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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.92k|      : quantization_bits_(-1),
   54|  2.92k|        max_quantized_value_(-1),
   55|  2.92k|        max_value_(-1),
   56|  2.92k|        dequantization_scale_(1.f),
   57|  2.92k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  2.61k|  bool SetQuantizationBits(int32_t q) {
   60|  2.61k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 749, False: 1.86k]
  |  Branch (60:18): [True: 172, False: 1.69k]
  ------------------
   61|    921|      return false;
   62|    921|    }
   63|  1.69k|    quantization_bits_ = q;
   64|  1.69k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.69k|    max_value_ = max_quantized_value_ - 1;
   66|  1.69k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.69k|    center_value_ = max_value_ / 2;
   68|  1.69k|    return true;
   69|  2.61k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.93M|                                           int32_t *out_t) const {
   77|  2.93M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 2.22k, False: 2.93M]
  |  Branch (77:20): [True: 0, False: 2.22k]
  |  Branch (77:32): [True: 2.22k, False: 2.93M]
  |  Branch (77:42): [True: 0, False: 2.22k]
  ------------------
   78|  2.93M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 2.27M, False: 661k]
  |  Branch (78:29): [True: 3.62k, False: 2.27M]
  ------------------
   79|  3.62k|      s = max_value_;
   80|  3.62k|      t = max_value_;
   81|  2.93M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 2.22k, False: 2.93M]
  |  Branch (81:26): [True: 619, False: 1.60k]
  ------------------
   82|    619|      t = center_value_ - (t - center_value_);
   83|  2.93M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 2.27M, False: 661k]
  |  Branch (83:35): [True: 3.63k, False: 2.26M]
  ------------------
   84|  3.63k|      t = center_value_ + (center_value_ - t);
   85|  2.92M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 2.26M, False: 659k]
  |  Branch (85:35): [True: 198, False: 2.26M]
  ------------------
   86|    198|      s = center_value_ + (center_value_ - s);
   87|  2.92M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 3.48k, False: 2.92M]
  |  Branch (87:26): [True: 1.49k, False: 1.99k]
  ------------------
   88|  1.49k|      s = center_value_ - (s - center_value_);
   89|  1.49k|    }
   90|       |
   91|  2.93M|    *out_s = s;
   92|  2.93M|    *out_t = t;
   93|  2.93M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.93M|                                                       int32_t *out_t) const {
  100|  2.93M|    DRACO_DCHECK_EQ(
  101|  2.93M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.93M|        center_value_);
  103|  2.93M|    int32_t s, t;
  104|  2.93M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.08M, False: 1.85M]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.08M|      s = (int_vec[1] + center_value_);
  107|  1.08M|      t = (int_vec[2] + center_value_);
  108|  1.85M|    } else {
  109|       |      // Left hemisphere.
  110|  1.85M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 31.4k, False: 1.82M]
  ------------------
  111|  31.4k|        s = std::abs(int_vec[2]);
  112|  1.82M|      } else {
  113|  1.82M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.82M|      }
  115|  1.85M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 35.1k, False: 1.81M]
  ------------------
  116|  35.1k|        t = std::abs(int_vec[1]);
  117|  1.81M|      } else {
  118|  1.81M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.81M|      }
  120|  1.85M|    }
  121|  2.93M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.93M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   518k|                                                    float *out_vector) const {
  199|   518k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   518k|                                 in_t * dequantization_scale_ - 1.f,
  201|   518k|                                 out_vector);
  202|   518k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  2.78M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  2.78M|    DRACO_DCHECK_LE(s, center_value_);
  208|  2.78M|    DRACO_DCHECK_LE(t, center_value_);
  209|  2.78M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  2.78M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  2.78M|    const uint32_t st =
  212|  2.78M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  2.78M|    return st <= center_value_;
  214|  2.78M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  3.92M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  3.92M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  3.92M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  3.92M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  3.92M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  3.92M|    int32_t sign_s = 0;
  223|  3.92M|    int32_t sign_t = 0;
  224|  3.92M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 3.62M, False: 306k]
  |  Branch (224:20): [True: 3.50M, False: 112k]
  ------------------
  225|  3.50M|      sign_s = 1;
  226|  3.50M|      sign_t = 1;
  227|  3.50M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 344k, False: 73.7k]
  |  Branch (227:27): [True: 299k, False: 44.9k]
  ------------------
  228|   299k|      sign_s = -1;
  229|   299k|      sign_t = -1;
  230|   299k|    } else {
  231|   118k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 73.7k, False: 44.9k]
  ------------------
  232|   118k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 44.9k, False: 73.7k]
  ------------------
  233|   118k|    }
  234|       |
  235|       |    // Perform the addition and subtraction using unsigned integers to avoid
  236|       |    // signed integer overflows for bad data. Note that the result will be
  237|       |    // unchanged for non-overflowing cases.
  238|  3.92M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  3.92M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  3.92M|    uint32_t us = *s;
  241|  3.92M|    uint32_t ut = *t;
  242|  3.92M|    us = us + us - corner_point_s;
  243|  3.92M|    ut = ut + ut - corner_point_t;
  244|  3.92M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 3.80M, False: 118k]
  ------------------
  245|  3.80M|      uint32_t temp = us;
  246|  3.80M|      us = -ut;
  247|  3.80M|      ut = -temp;
  248|  3.80M|    } else {
  249|   118k|      std::swap(us, ut);
  250|   118k|    }
  251|  3.92M|    us = us + corner_point_s;
  252|  3.92M|    ut = ut + corner_point_t;
  253|       |
  254|  3.92M|    *s = us;
  255|  3.92M|    *t = ut;
  256|  3.92M|    *s /= 2;
  257|  3.92M|    *t /= 2;
  258|  3.92M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  5.57M|  int32_t ModMax(int32_t x) const {
  273|  5.57M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 4.63k, False: 5.56M]
  ------------------
  274|  4.63k|      return x - this->max_quantized_value();
  275|  4.63k|    }
  276|  5.56M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 2.47k, False: 5.56M]
  ------------------
  277|  2.47k|      return x + this->max_quantized_value();
  278|  2.47k|    }
  279|  5.56M|    return x;
  280|  5.56M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.61k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  7.10k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  16.7M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   518k|                                           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|   518k|    float y = in_s_scaled;
  329|   518k|    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|   518k|    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|   518k|    float x_offset = -x;
  342|   518k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 14.6k, False: 503k]
  ------------------
  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|   518k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 145k, False: 373k]
  ------------------
  348|   518k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 145k, False: 373k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   518k|    const float norm_squared = x * x + y * y + z * z;
  352|   518k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 518k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   518k|    } else {
  357|   518k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   518k|      out_vector[0] = x * d;
  359|   518k|      out_vector[1] = y * d;
  360|   518k|      out_vector[2] = z * d;
  361|   518k|    }
  362|   518k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.93M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  2.93M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.93M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.93M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.93M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.93M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.93M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 2.76M, False: 169k]
  ------------------
  181|  2.76M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  2.76M|    } else {
  183|   169k|      vec[0] =
  184|   169k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   169k|          abs_sum;
  186|   169k|      vec[1] =
  187|   169k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   169k|          abs_sum;
  189|   169k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 91.8k, False: 77.4k]
  ------------------
  190|  91.8k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|  91.8k|      } else {
  192|  77.4k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|  77.4k|      }
  194|   169k|    }
  195|  2.93M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    373|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    373|            attribute, transform, mesh_data),
   52|    373|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    357|                                                                *buffer) {
  194|    357|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    357|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    357|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 15, False: 342]
  ------------------
  196|       |    // Decode prediction mode.
  197|     15|    uint8_t mode;
  198|     15|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 1, False: 14]
  ------------------
  199|      1|      return false;
  200|      1|    }
  201|       |
  202|     14|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 11, False: 3]
  ------------------
  203|       |      // Unsupported mode.
  204|     11|      return false;
  205|     11|    }
  206|     14|  }
  207|    345|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.50k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.25k, False: 248]
  ------------------
  211|  1.25k|    uint32_t num_flags;
  212|  1.25k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 14, False: 1.24k]
  ------------------
  213|     14|      return false;
  214|     14|    }
  215|  1.24k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 51, False: 1.19k]
  ------------------
  216|     51|      return false;
  217|     51|    }
  218|  1.19k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 534, False: 657]
  ------------------
  219|    534|      is_crease_edge_[i].resize(num_flags);
  220|    534|      RAnsBitDecoder decoder;
  221|    534|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 32, False: 502]
  ------------------
  222|     32|        return false;
  223|     32|      }
  224|  1.30M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.30M, False: 502]
  ------------------
  225|  1.30M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.30M|      }
  227|    502|      decoder.EndDecoding();
  228|    502|    }
  229|  1.19k|  }
  230|    248|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    248|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    345|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    228|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    228|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    228|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.14k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 912, False: 228]
  ------------------
   93|    912|    pred_vals[i].resize(num_components, 0);
   94|    912|  }
   95|    228|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    228|                                         out_data);
   97|       |
   98|    228|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    228|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    228|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    228|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    228|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    228|  const int corner_map_size =
  109|    228|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  1.09M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 1.09M, False: 140]
  ------------------
  111|  1.09M|    const CornerIndex start_corner_id =
  112|  1.09M|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  1.09M|    CornerIndex corner_id(start_corner_id);
  115|  1.09M|    int num_parallelograms = 0;
  116|  1.09M|    bool first_pass = true;
  117|  2.32M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 1.25M, False: 1.07M]
  ------------------
  118|  1.25M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 57.8k, False: 1.19M]
  ------------------
  119|  1.25M|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  1.25M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  57.8k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  57.8k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 431, False: 57.4k]
  ------------------
  127|    431|          break;
  128|    431|        }
  129|  57.8k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|  1.25M|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 1.23M, False: 23.2k]
  ------------------
  134|  1.23M|        corner_id = table->SwingLeft(corner_id);
  135|  1.23M|      } else {
  136|  23.2k|        corner_id = table->SwingRight(corner_id);
  137|  23.2k|      }
  138|  1.25M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 22.4k, False: 1.23M]
  ------------------
  139|  22.4k|        break;
  140|  22.4k|      }
  141|  1.23M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 1.08M, False: 147k]
  |  Branch (141:47): [True: 1.07M, False: 12.0k]
  ------------------
  142|  1.07M|        first_pass = false;
  143|  1.07M|        corner_id = table->SwingRight(start_corner_id);
  144|  1.07M|      }
  145|  1.23M|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  1.09M|    int num_used_parallelograms = 0;
  150|  1.09M|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 35.8k, False: 1.05M]
  ------------------
  151|  6.42M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 6.38M, False: 35.8k]
  ------------------
  152|  6.38M|        multi_pred_vals[i] = 0;
  153|  6.38M|      }
  154|       |      // Check which parallelograms are actually used.
  155|  93.5k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 57.8k, False: 35.7k]
  ------------------
  156|  57.8k|        const int context = num_parallelograms - 1;
  157|  57.8k|        const int pos = is_crease_edge_pos[context]++;
  158|  57.8k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 88, False: 57.7k]
  ------------------
  159|     88|          return false;
  160|     88|        }
  161|  57.7k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  57.7k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 8.69k, False: 49.0k]
  ------------------
  163|  8.69k|          ++num_used_parallelograms;
  164|  1.27M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.26M, False: 8.69k]
  ------------------
  165|  1.26M|            multi_pred_vals[j] =
  166|  1.26M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.26M|          }
  168|  8.69k|        }
  169|  57.7k|      }
  170|  35.8k|    }
  171|  1.09M|    const int dst_offset = p * num_components;
  172|  1.09M|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 1.09M, False: 3.97k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  1.09M|      const int src_offset = (p - 1) * num_components;
  176|  1.09M|      this->transform().ComputeOriginalValue(
  177|  1.09M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  1.09M|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   564k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 560k, False: 3.97k]
  ------------------
  181|   560k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   560k|      }
  183|  3.97k|      this->transform().ComputeOriginalValue(
  184|  3.97k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  3.97k|    }
  186|  1.09M|  }
  187|    140|  return true;
  188|    228|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    436|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    436|            attribute, transform, mesh_data),
   52|    436|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    422|                                                                *buffer) {
  194|    422|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    422|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    422|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 3, False: 419]
  ------------------
  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|    420|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.82k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.51k, False: 309]
  ------------------
  211|  1.51k|    uint32_t num_flags;
  212|  1.51k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 15, False: 1.49k]
  ------------------
  213|     15|      return false;
  214|     15|    }
  215|  1.49k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 59, False: 1.43k]
  ------------------
  216|     59|      return false;
  217|     59|    }
  218|  1.43k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 604, False: 833]
  ------------------
  219|    604|      is_crease_edge_[i].resize(num_flags);
  220|    604|      RAnsBitDecoder decoder;
  221|    604|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 37, False: 567]
  ------------------
  222|     37|        return false;
  223|     37|      }
  224|  1.13M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.13M, False: 567]
  ------------------
  225|  1.13M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.13M|      }
  227|    567|      decoder.EndDecoding();
  228|    567|    }
  229|  1.43k|  }
  230|    309|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    309|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    420|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    274|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    274|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    274|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.37k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.09k, False: 274]
  ------------------
   93|  1.09k|    pred_vals[i].resize(num_components, 0);
   94|  1.09k|  }
   95|    274|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    274|                                         out_data);
   97|       |
   98|    274|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    274|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    274|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    274|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    274|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    274|  const int corner_map_size =
  109|    274|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   155k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 155k, False: 142]
  ------------------
  111|   155k|    const CornerIndex start_corner_id =
  112|   155k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   155k|    CornerIndex corner_id(start_corner_id);
  115|   155k|    int num_parallelograms = 0;
  116|   155k|    bool first_pass = true;
  117|   985k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 965k, False: 20.2k]
  ------------------
  118|   965k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 285k, False: 679k]
  ------------------
  119|   965k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   965k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   285k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   285k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 490, False: 285k]
  ------------------
  127|    490|          break;
  128|    490|        }
  129|   285k|      }
  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|   965k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 896k, False: 68.3k]
  ------------------
  134|   896k|        corner_id = table->SwingLeft(corner_id);
  135|   896k|      } else {
  136|  68.3k|        corner_id = table->SwingRight(corner_id);
  137|  68.3k|      }
  138|   965k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 134k, False: 830k]
  ------------------
  139|   134k|        break;
  140|   134k|      }
  141|   830k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 36.5k, False: 793k]
  |  Branch (141:47): [True: 20.2k, False: 16.2k]
  ------------------
  142|  20.2k|        first_pass = false;
  143|  20.2k|        corner_id = table->SwingRight(start_corner_id);
  144|  20.2k|      }
  145|   830k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   155k|    int num_used_parallelograms = 0;
  150|   155k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 153k, False: 1.93k]
  ------------------
  151|  16.4M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 16.3M, False: 153k]
  ------------------
  152|  16.3M|        multi_pred_vals[i] = 0;
  153|  16.3M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   438k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 285k, False: 153k]
  ------------------
  156|   285k|        const int context = num_parallelograms - 1;
  157|   285k|        const int pos = is_crease_edge_pos[context]++;
  158|   285k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 132, False: 285k]
  ------------------
  159|    132|          return false;
  160|    132|        }
  161|   285k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   285k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 9.86k, False: 275k]
  ------------------
  163|  9.86k|          ++num_used_parallelograms;
  164|   982k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 972k, False: 9.86k]
  ------------------
  165|   972k|            multi_pred_vals[j] =
  166|   972k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   972k|          }
  168|  9.86k|        }
  169|   285k|      }
  170|   153k|    }
  171|   155k|    const int dst_offset = p * num_components;
  172|   155k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 149k, False: 5.10k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   149k|      const int src_offset = (p - 1) * num_components;
  176|   149k|      this->transform().ComputeOriginalValue(
  177|   149k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   149k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   464k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 459k, False: 5.10k]
  ------------------
  181|   459k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   459k|      }
  183|  5.10k|      this->transform().ComputeOriginalValue(
  184|  5.10k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  5.10k|    }
  186|   155k|  }
  187|    142|  return true;
  188|    274|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.59k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.59k|    mesh_ = mesh;
   39|  2.59k|    corner_table_ = table;
   40|  2.59k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.59k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.59k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  13.9M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  10.3M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  10.3M|    return vertex_to_data_map_;
   48|  10.3M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  6.70M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  6.70M|    return data_to_corner_map_;
   51|  6.70M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.46k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.46k|    mesh_ = mesh;
   39|  2.46k|    corner_table_ = table;
   40|  2.46k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.46k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.46k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  10.2M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  8.97M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  8.97M|    return vertex_to_data_map_;
   48|  8.97M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  2.18M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  2.18M|    return data_to_corner_map_;
   51|  2.18M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  2.59k|      : mesh_(nullptr),
   31|  2.59k|        corner_table_(nullptr),
   32|  2.59k|        vertex_to_data_map_(nullptr),
   33|  2.59k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  2.46k|      : mesh_(nullptr),
   31|  2.46k|        corner_table_(nullptr),
   32|  2.46k|        vertex_to_data_map_(nullptr),
   33|  2.46k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   737k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   271k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  1.00M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   188k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.16k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.16k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  6.77M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.16k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.16k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  2.64M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    207|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    207|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    155|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    155|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    208|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    208|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    133|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    133|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    410|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    207|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    207|    DRACO_DCHECK_EQ(i, 0);
   70|    207|    (void)i;
   71|    207|    return GeometryAttribute::POSITION;
   72|    207|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    206|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    206|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 206]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    206|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 203]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    203|    predictor_.SetPositionAttribute(*att);
   82|    203|    return true;
   83|    206|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    203|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    203|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 11, False: 192]
  ------------------
  145|     11|    return false;
  146|     11|  }
  147|       |
  148|    192|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    192|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    192|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 50, False: 142]
  ------------------
  150|     50|    uint8_t prediction_mode;
  151|     50|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 49]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     49|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 3, False: 46]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      3|      return false;
  157|      3|    }
  158|       |
  159|     46|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 46]
  ------------------
  160|     46|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     46|  }
  164|    188|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    188|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 4, False: 184]
  ------------------
  168|      4|    return false;
  169|      4|  }
  170|       |
  171|    184|  return true;
  172|    188|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    184|                                      const PointIndex *entry_to_point_id_map) {
  103|    184|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    184|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    184|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    184|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    184|  const int corner_map_size =
  111|    184|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    184|  VectorD<int32_t, 3> pred_normal_3d;
  114|    184|  int32_t pred_normal_oct[2];
  115|       |
  116|   737k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 737k, False: 184]
  ------------------
  117|   737k|    const CornerIndex corner_id =
  118|   737k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   737k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   737k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   737k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   737k|                    octahedron_tool_box_.center_value());
  125|   737k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 534k, False: 202k]
  ------------------
  126|   534k|      pred_normal_3d = -pred_normal_3d;
  127|   534k|    }
  128|   737k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   737k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   737k|    const int data_offset = data_id * 2;
  132|   737k|    this->transform().ComputeOriginalValue(
  133|   737k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   737k|  }
  135|    184|  flip_normal_bit_decoder_.EndDecoding();
  136|    184|  return true;
  137|    184|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    184|  void SetQuantizationBits(int q) {
   85|    184|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    184|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    307|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    155|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    155|    DRACO_DCHECK_EQ(i, 0);
   70|    155|    (void)i;
   71|    155|    return GeometryAttribute::POSITION;
   72|    155|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    153|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    153|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 153]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    153|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 152]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    152|    predictor_.SetPositionAttribute(*att);
   82|    152|    return true;
   83|    153|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    151|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    151|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 146]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    146|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    146|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    146|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 32, False: 114]
  ------------------
  150|     32|    uint8_t prediction_mode;
  151|     32|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 31]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     31|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 30]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     30|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 30]
  ------------------
  160|     30|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     30|  }
  164|    144|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    144|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 7, False: 137]
  ------------------
  168|      7|    return false;
  169|      7|  }
  170|       |
  171|    137|  return true;
  172|    144|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    137|                                      const PointIndex *entry_to_point_id_map) {
  103|    137|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    137|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    137|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    137|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    137|  const int corner_map_size =
  111|    137|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    137|  VectorD<int32_t, 3> pred_normal_3d;
  114|    137|  int32_t pred_normal_oct[2];
  115|       |
  116|   271k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 271k, False: 137]
  ------------------
  117|   271k|    const CornerIndex corner_id =
  118|   271k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   271k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   271k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   271k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   271k|                    octahedron_tool_box_.center_value());
  125|   271k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 222k, False: 48.8k]
  ------------------
  126|   222k|      pred_normal_3d = -pred_normal_3d;
  127|   222k|    }
  128|   271k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   271k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   271k|    const int data_offset = data_id * 2;
  132|   271k|    this->transform().ComputeOriginalValue(
  133|   271k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   271k|  }
  135|    137|  flip_normal_bit_decoder_.EndDecoding();
  136|    137|  return true;
  137|    137|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    137|  void SetQuantizationBits(int q) {
   85|    137|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    137|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    414|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    208|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    208|    DRACO_DCHECK_EQ(i, 0);
   70|    208|    (void)i;
   71|    208|    return GeometryAttribute::POSITION;
   72|    208|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    207|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    207|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 207]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    207|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 206]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    206|    predictor_.SetPositionAttribute(*att);
   82|    206|    return true;
   83|    207|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    206|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    206|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 7, False: 199]
  ------------------
  145|      7|    return false;
  146|      7|  }
  147|       |
  148|    199|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    199|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    199|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 57, False: 142]
  ------------------
  150|     57|    uint8_t prediction_mode;
  151|     57|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 56]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     56|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 10, False: 46]
  ------------------
  155|       |      // Invalid prediction mode.
  156|     10|      return false;
  157|     10|    }
  158|       |
  159|     46|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 46]
  ------------------
  160|     46|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     46|  }
  164|    188|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    188|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 183]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    183|  return true;
  172|    188|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    183|                                      const PointIndex *entry_to_point_id_map) {
  103|    183|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    183|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    183|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    183|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    183|  const int corner_map_size =
  111|    183|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    183|  VectorD<int32_t, 3> pred_normal_3d;
  114|    183|  int32_t pred_normal_oct[2];
  115|       |
  116|  1.00M|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 1.00M, False: 183]
  ------------------
  117|  1.00M|    const CornerIndex corner_id =
  118|  1.00M|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|  1.00M|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|  1.00M|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|  1.00M|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|  1.00M|                    octahedron_tool_box_.center_value());
  125|  1.00M|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 763k, False: 239k]
  ------------------
  126|   763k|      pred_normal_3d = -pred_normal_3d;
  127|   763k|    }
  128|  1.00M|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|  1.00M|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|  1.00M|    const int data_offset = data_id * 2;
  132|  1.00M|    this->transform().ComputeOriginalValue(
  133|  1.00M|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|  1.00M|  }
  135|    183|  flip_normal_bit_decoder_.EndDecoding();
  136|    183|  return true;
  137|    183|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    183|  void SetQuantizationBits(int q) {
   85|    183|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    183|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    262|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    133|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    133|    DRACO_DCHECK_EQ(i, 0);
   70|    133|    (void)i;
   71|    133|    return GeometryAttribute::POSITION;
   72|    133|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    133|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    133|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 133]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    133|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 4, False: 129]
  ------------------
   79|      4|      return false;  // Currently works only for 3 component positions.
   80|      4|    }
   81|    129|    predictor_.SetPositionAttribute(*att);
   82|    129|    return true;
   83|    133|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    128|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    128|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 8, False: 120]
  ------------------
  145|      8|    return false;
  146|      8|  }
  147|       |
  148|    120|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    120|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    120|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 16, False: 104]
  ------------------
  150|     16|    uint8_t prediction_mode;
  151|     16|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 16]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     16|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 15]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     15|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 15]
  ------------------
  160|     15|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     15|  }
  164|    119|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    119|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 114]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    114|  return true;
  172|    119|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    114|                                      const PointIndex *entry_to_point_id_map) {
  103|    114|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    114|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    114|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    114|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    114|  const int corner_map_size =
  111|    114|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    114|  VectorD<int32_t, 3> pred_normal_3d;
  114|    114|  int32_t pred_normal_oct[2];
  115|       |
  116|   188k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 188k, False: 114]
  ------------------
  117|   188k|    const CornerIndex corner_id =
  118|   188k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   188k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   188k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   188k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   188k|                    octahedron_tool_box_.center_value());
  125|   188k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 174k, False: 14.3k]
  ------------------
  126|   174k|      pred_normal_3d = -pred_normal_3d;
  127|   174k|    }
  128|   188k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   188k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   188k|    const int data_offset = data_id * 2;
  132|   188k|    this->transform().ComputeOriginalValue(
  133|   188k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   188k|  }
  135|    114|  flip_normal_bit_decoder_.EndDecoding();
  136|    114|  return true;
  137|    114|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    114|  void SetQuantizationBits(int q) {
   85|    114|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    114|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    381|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    381|            attribute, transform, mesh_data),
   37|    381|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    759|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    381|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    381|    DRACO_DCHECK_EQ(i, 0);
   70|    381|    (void)i;
   71|    381|    return GeometryAttribute::POSITION;
   72|    381|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    380|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    380|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 380]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    380|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 378]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    378|    predictor_.SetPositionAttribute(*att);
   82|    378|    return true;
   83|    380|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    378|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    378|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 33, False: 345]
  ------------------
  145|     33|    return false;
  146|     33|  }
  147|       |
  148|    345|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    345|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    345|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 180, False: 165]
  ------------------
  150|    180|    uint8_t prediction_mode;
  151|    180|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 179]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    179|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 177]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|    177|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 177]
  ------------------
  160|    177|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    177|  }
  164|    342|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    342|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 16, False: 326]
  ------------------
  168|     16|    return false;
  169|     16|  }
  170|       |
  171|    326|  return true;
  172|    342|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    326|                                      const PointIndex *entry_to_point_id_map) {
  103|    326|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    326|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    326|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    326|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    326|  const int corner_map_size =
  111|    326|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    326|  VectorD<int32_t, 3> pred_normal_3d;
  114|    326|  int32_t pred_normal_oct[2];
  115|       |
  116|   547k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 547k, False: 326]
  ------------------
  117|   547k|    const CornerIndex corner_id =
  118|   547k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   547k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   547k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   547k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   547k|                    octahedron_tool_box_.center_value());
  125|   547k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 385k, False: 161k]
  ------------------
  126|   385k|      pred_normal_3d = -pred_normal_3d;
  127|   385k|    }
  128|   547k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   547k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   547k|    const int data_offset = data_id * 2;
  132|   547k|    this->transform().ComputeOriginalValue(
  133|   547k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   547k|  }
  135|    326|  flip_normal_bit_decoder_.EndDecoding();
  136|    326|  return true;
  137|    326|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    326|  void SetQuantizationBits(int q) {
   85|    326|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    326|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    373|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    373|            attribute, transform, mesh_data),
   37|    373|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    743|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    373|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    373|    DRACO_DCHECK_EQ(i, 0);
   70|    373|    (void)i;
   71|    373|    return GeometryAttribute::POSITION;
   72|    373|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    372|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    372|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 372]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    372|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 370]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    370|    predictor_.SetPositionAttribute(*att);
   82|    370|    return true;
   83|    372|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    368|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    368|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 35, False: 333]
  ------------------
  145|     35|    return false;
  146|     35|  }
  147|       |
  148|    333|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    333|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    333|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 134, False: 199]
  ------------------
  150|    134|    uint8_t prediction_mode;
  151|    134|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 133]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    133|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 132]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|    132|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 132]
  ------------------
  160|    132|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    132|  }
  164|    331|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    331|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 23, False: 308]
  ------------------
  168|     23|    return false;
  169|     23|  }
  170|       |
  171|    308|  return true;
  172|    331|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    308|                                      const PointIndex *entry_to_point_id_map) {
  103|    308|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    308|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    308|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    308|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    308|  const int corner_map_size =
  111|    308|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    308|  VectorD<int32_t, 3> pred_normal_3d;
  114|    308|  int32_t pred_normal_oct[2];
  115|       |
  116|   189k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 188k, False: 308]
  ------------------
  117|   188k|    const CornerIndex corner_id =
  118|   188k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   188k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   188k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   188k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   188k|                    octahedron_tool_box_.center_value());
  125|   188k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 106k, False: 82.3k]
  ------------------
  126|   106k|      pred_normal_3d = -pred_normal_3d;
  127|   106k|    }
  128|   188k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   188k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   188k|    const int data_offset = data_id * 2;
  132|   188k|    this->transform().ComputeOriginalValue(
  133|   188k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   188k|  }
  135|    308|  flip_normal_bit_decoder_.EndDecoding();
  136|    308|  return true;
  137|    308|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    308|  void SetQuantizationBits(int q) {
   85|    308|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    308|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    207|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    207|            attribute, transform, mesh_data),
   37|    207|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    155|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    155|            attribute, transform, mesh_data),
   37|    155|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    208|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    208|            attribute, transform, mesh_data),
   37|    208|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    133|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    133|            attribute, transform, mesh_data),
   37|    133|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    253|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    253|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 43, False: 210]
  ------------------
  105|     43|      this->normal_prediction_mode_ = mode;
  106|     43|      return true;
  107|    210|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 210, False: 0]
  ------------------
  108|    210|      this->normal_prediction_mode_ = mode;
  109|    210|      return true;
  110|    210|    }
  111|      0|    return false;
  112|    253|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   737k|                             DataTypeT *prediction) override {
   42|   737k|    DRACO_DCHECK(this->IsInitialized());
   43|   737k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   737k|    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|   737k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   737k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   737k|    VectorD<int64_t, 3> normal;
   53|   737k|    CornerIndex c_next, c_prev;
   54|  1.61M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 882k, False: 737k]
  ------------------
   55|       |      // Getting corners.
   56|   882k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 246, False: 882k]
  ------------------
   57|    246|        c_next = corner_table->Next(corner_id);
   58|    246|        c_prev = corner_table->Previous(corner_id);
   59|   882k|      } else {
   60|   882k|        c_next = corner_table->Next(cit.Corner());
   61|   882k|        c_prev = corner_table->Previous(cit.Corner());
   62|   882k|      }
   63|   882k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   882k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   882k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   882k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   882k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   882k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   882k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   882k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   882k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   882k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   882k|      cit.Next();
   81|   882k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   737k|    constexpr int64_t upper_bound = 1 << 29;
   85|   737k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 164, False: 737k]
  ------------------
   86|    164|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    164|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 52, False: 112]
  ------------------
   88|     52|        const int64_t quotient = abs_sum / upper_bound;
   89|     52|        normal = normal / quotient;
   90|     52|      }
   91|   737k|    } else {
   92|   737k|      const int64_t abs_sum = normal.AbsSum();
   93|   737k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.04k, False: 734k]
  ------------------
   94|  3.04k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.04k|        normal = normal / quotient;
   96|  3.04k|      }
   97|   737k|    }
   98|   737k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   737k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   737k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   737k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   737k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    185|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    185|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 27, False: 158]
  ------------------
  105|     27|      this->normal_prediction_mode_ = mode;
  106|     27|      return true;
  107|    158|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 158, False: 0]
  ------------------
  108|    158|      this->normal_prediction_mode_ = mode;
  109|    158|      return true;
  110|    158|    }
  111|      0|    return false;
  112|    185|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   271k|                             DataTypeT *prediction) override {
   42|   271k|    DRACO_DCHECK(this->IsInitialized());
   43|   271k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   271k|    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|   271k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   271k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   271k|    VectorD<int64_t, 3> normal;
   53|   271k|    CornerIndex c_next, c_prev;
   54|  1.88M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.61M, False: 271k]
  ------------------
   55|       |      // Getting corners.
   56|  1.61M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 156, False: 1.61M]
  ------------------
   57|    156|        c_next = corner_table->Next(corner_id);
   58|    156|        c_prev = corner_table->Previous(corner_id);
   59|  1.61M|      } else {
   60|  1.61M|        c_next = corner_table->Next(cit.Corner());
   61|  1.61M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.61M|      }
   63|  1.61M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.61M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.61M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.61M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.61M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.61M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.61M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.61M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.61M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.61M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.61M|      cit.Next();
   81|  1.61M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   271k|    constexpr int64_t upper_bound = 1 << 29;
   85|   271k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 104, False: 271k]
  ------------------
   86|    104|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    104|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 31, False: 73]
  ------------------
   88|     31|        const int64_t quotient = abs_sum / upper_bound;
   89|     31|        normal = normal / quotient;
   90|     31|      }
   91|   271k|    } else {
   92|   271k|      const int64_t abs_sum = normal.AbsSum();
   93|   271k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 88.1k, False: 182k]
  ------------------
   94|  88.1k|        const int64_t quotient = abs_sum / upper_bound;
   95|  88.1k|        normal = normal / quotient;
   96|  88.1k|      }
   97|   271k|    }
   98|   271k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   271k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   271k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   271k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   271k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    254|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    254|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 45, False: 209]
  ------------------
  105|     45|      this->normal_prediction_mode_ = mode;
  106|     45|      return true;
  107|    209|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 209, False: 0]
  ------------------
  108|    209|      this->normal_prediction_mode_ = mode;
  109|    209|      return true;
  110|    209|    }
  111|      0|    return false;
  112|    254|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  1.00M|                             DataTypeT *prediction) override {
   42|  1.00M|    DRACO_DCHECK(this->IsInitialized());
   43|  1.00M|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  1.00M|    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|  1.00M|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  1.00M|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  1.00M|    VectorD<int64_t, 3> normal;
   53|  1.00M|    CornerIndex c_next, c_prev;
   54|  2.04M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.04M, False: 1.00M]
  ------------------
   55|       |      // Getting corners.
   56|  1.04M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 252, False: 1.04M]
  ------------------
   57|    252|        c_next = corner_table->Next(corner_id);
   58|    252|        c_prev = corner_table->Previous(corner_id);
   59|  1.04M|      } else {
   60|  1.04M|        c_next = corner_table->Next(cit.Corner());
   61|  1.04M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.04M|      }
   63|  1.04M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.04M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.04M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.04M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.04M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.04M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.04M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.04M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.04M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.04M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.04M|      cit.Next();
   81|  1.04M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  1.00M|    constexpr int64_t upper_bound = 1 << 29;
   85|  1.00M|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 168, False: 1.00M]
  ------------------
   86|    168|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    168|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 38, False: 130]
  ------------------
   88|     38|        const int64_t quotient = abs_sum / upper_bound;
   89|     38|        normal = normal / quotient;
   90|     38|      }
   91|  1.00M|    } else {
   92|  1.00M|      const int64_t abs_sum = normal.AbsSum();
   93|  1.00M|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.21k, False: 1.00M]
  ------------------
   94|  2.21k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.21k|        normal = normal / quotient;
   96|  2.21k|      }
   97|  1.00M|    }
   98|  1.00M|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  1.00M|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  1.00M|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  1.00M|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  1.00M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    148|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    148|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 14, False: 134]
  ------------------
  105|     14|      this->normal_prediction_mode_ = mode;
  106|     14|      return true;
  107|    134|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 134, False: 0]
  ------------------
  108|    134|      this->normal_prediction_mode_ = mode;
  109|    134|      return true;
  110|    134|    }
  111|      0|    return false;
  112|    148|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   188k|                             DataTypeT *prediction) override {
   42|   188k|    DRACO_DCHECK(this->IsInitialized());
   43|   188k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   188k|    const CornerTable *const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   188k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   188k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   188k|    VectorD<int64_t, 3> normal;
   53|   188k|    CornerIndex c_next, c_prev;
   54|  1.31M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.12M, False: 188k]
  ------------------
   55|       |      // Getting corners.
   56|  1.12M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 78, False: 1.12M]
  ------------------
   57|     78|        c_next = corner_table->Next(corner_id);
   58|     78|        c_prev = corner_table->Previous(corner_id);
   59|  1.12M|      } else {
   60|  1.12M|        c_next = corner_table->Next(cit.Corner());
   61|  1.12M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.12M|      }
   63|  1.12M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.12M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.12M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.12M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.12M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.12M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.12M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.12M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.12M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.12M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.12M|      cit.Next();
   81|  1.12M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   188k|    constexpr int64_t upper_bound = 1 << 29;
   85|   188k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 52, False: 188k]
  ------------------
   86|     52|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     52|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 13, False: 39]
  ------------------
   88|     13|        const int64_t quotient = abs_sum / upper_bound;
   89|     13|        normal = normal / quotient;
   90|     13|      }
   91|   188k|    } else {
   92|   188k|      const int64_t abs_sum = normal.AbsSum();
   93|   188k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 56.0k, False: 132k]
  ------------------
   94|  56.0k|        const int64_t quotient = abs_sum / upper_bound;
   95|  56.0k|        normal = normal / quotient;
   96|  56.0k|      }
   97|   188k|    }
   98|   188k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   188k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   188k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   188k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   188k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    381|      : Base(md) {
   35|    381|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    381|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    558|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    558|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 158, False: 400]
  ------------------
  105|    158|      this->normal_prediction_mode_ = mode;
  106|    158|      return true;
  107|    400|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 400, False: 0]
  ------------------
  108|    400|      this->normal_prediction_mode_ = mode;
  109|    400|      return true;
  110|    400|    }
  111|      0|    return false;
  112|    558|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   547k|                             DataTypeT *prediction) override {
   42|   547k|    DRACO_DCHECK(this->IsInitialized());
   43|   547k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   547k|    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|   547k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   547k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   547k|    VectorD<int64_t, 3> normal;
   53|   547k|    CornerIndex c_next, c_prev;
   54|  1.97M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.42M, False: 547k]
  ------------------
   55|       |      // Getting corners.
   56|  1.42M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 371k, False: 1.05M]
  ------------------
   57|   371k|        c_next = corner_table->Next(corner_id);
   58|   371k|        c_prev = corner_table->Previous(corner_id);
   59|  1.05M|      } else {
   60|  1.05M|        c_next = corner_table->Next(cit.Corner());
   61|  1.05M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.05M|      }
   63|  1.42M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.42M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.42M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.42M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.42M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.42M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.42M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.42M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.42M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.42M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.42M|      cit.Next();
   81|  1.42M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   547k|    constexpr int64_t upper_bound = 1 << 29;
   85|   547k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 62.8k, False: 484k]
  ------------------
   86|  62.8k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  62.8k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 296, False: 62.5k]
  ------------------
   88|    296|        const int64_t quotient = abs_sum / upper_bound;
   89|    296|        normal = normal / quotient;
   90|    296|      }
   91|   484k|    } else {
   92|   484k|      const int64_t abs_sum = normal.AbsSum();
   93|   484k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.47k, False: 483k]
  ------------------
   94|  1.47k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.47k|        normal = normal / quotient;
   96|  1.47k|      }
   97|   484k|    }
   98|   547k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   547k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   547k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   547k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   547k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    373|      : Base(md) {
   35|    373|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    373|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    505|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    505|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 120, False: 385]
  ------------------
  105|    120|      this->normal_prediction_mode_ = mode;
  106|    120|      return true;
  107|    385|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 385, False: 0]
  ------------------
  108|    385|      this->normal_prediction_mode_ = mode;
  109|    385|      return true;
  110|    385|    }
  111|      0|    return false;
  112|    505|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   188k|                             DataTypeT *prediction) override {
   42|   188k|    DRACO_DCHECK(this->IsInitialized());
   43|   188k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   188k|    const CornerTable *const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   188k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   188k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   188k|    VectorD<int64_t, 3> normal;
   53|   188k|    CornerIndex c_next, c_prev;
   54|  1.29M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.10M, False: 188k]
  ------------------
   55|       |      // Getting corners.
   56|  1.10M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 372k, False: 731k]
  ------------------
   57|   372k|        c_next = corner_table->Next(corner_id);
   58|   372k|        c_prev = corner_table->Previous(corner_id);
   59|   731k|      } else {
   60|   731k|        c_next = corner_table->Next(cit.Corner());
   61|   731k|        c_prev = corner_table->Previous(cit.Corner());
   62|   731k|      }
   63|  1.10M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.10M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.10M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.10M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.10M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.10M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.10M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.10M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.10M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.10M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.10M|      cit.Next();
   81|  1.10M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   188k|    constexpr int64_t upper_bound = 1 << 29;
   85|   188k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 63.0k, False: 125k]
  ------------------
   86|  63.0k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  63.0k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 194, False: 62.8k]
  ------------------
   88|    194|        const int64_t quotient = abs_sum / upper_bound;
   89|    194|        normal = normal / quotient;
   90|    194|      }
   91|   125k|    } else {
   92|   125k|      const int64_t abs_sum = normal.AbsSum();
   93|   125k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.66k, False: 123k]
  ------------------
   94|  2.66k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.66k|        normal = normal / quotient;
   96|  2.66k|      }
   97|   125k|    }
   98|   188k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   188k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   188k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   188k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   188k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    207|      : Base(md) {
   35|    207|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    207|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    155|      : Base(md) {
   35|    155|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    155|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    208|      : Base(md) {
   35|    208|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    208|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    133|      : Base(md) {
   35|    133|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    133|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.50M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.50M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.50M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.50M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.50M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.50M|    return GetPositionForDataId(data_id);
   77|  2.50M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.50M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.50M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.50M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.50M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.50M|    VectorD<int64_t, 3> pos;
   68|  2.50M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.50M|    return pos;
   70|  2.50M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    203|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    203|    pos_attribute_ = &position_attribute;
   43|    203|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    184|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    184|    entry_to_point_id_map_ = map;
   46|    184|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.50M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.50M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.50M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.50M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.50M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.50M|    return GetPositionForDataId(data_id);
   77|  3.50M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.50M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.50M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.50M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.50M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.50M|    VectorD<int64_t, 3> pos;
   68|  3.50M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.50M|    return pos;
   70|  3.50M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    152|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    152|    pos_attribute_ = &position_attribute;
   43|    152|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    137|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    137|    entry_to_point_id_map_ = map;
   46|    137|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.09M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.09M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.09M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.09M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.09M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.09M|    return GetPositionForDataId(data_id);
   77|  3.09M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  3.09M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.09M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.09M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.09M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.09M|    VectorD<int64_t, 3> pos;
   68|  3.09M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.09M|    return pos;
   70|  3.09M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    206|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    206|    pos_attribute_ = &position_attribute;
   43|    206|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    183|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    183|    entry_to_point_id_map_ = map;
   46|    183|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.43M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.43M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.43M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.43M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.43M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.43M|    return GetPositionForDataId(data_id);
   77|  2.43M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.43M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.43M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.43M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.43M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.43M|    VectorD<int64_t, 3> pos;
   68|  2.43M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.43M|    return pos;
   70|  2.43M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    129|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    129|    pos_attribute_ = &position_attribute;
   43|    129|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    114|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    114|    entry_to_point_id_map_ = map;
   46|    114|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    381|      : pos_attribute_(nullptr),
   36|    381|        entry_to_point_id_map_(nullptr),
   37|    381|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    381|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.39M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.39M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.39M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.39M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.39M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.39M|    return GetPositionForDataId(data_id);
   77|  3.39M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  3.39M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.39M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.39M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.39M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.39M|    VectorD<int64_t, 3> pos;
   68|  3.39M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.39M|    return pos;
   70|  3.39M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    378|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    378|    pos_attribute_ = &position_attribute;
   43|    378|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    326|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    326|    entry_to_point_id_map_ = map;
   46|    326|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    373|      : pos_attribute_(nullptr),
   36|    373|        entry_to_point_id_map_(nullptr),
   37|    373|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    373|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.39M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.39M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.39M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.39M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.39M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.39M|    return GetPositionForDataId(data_id);
   77|  2.39M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.39M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.39M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.39M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.39M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.39M|    VectorD<int64_t, 3> pos;
   68|  2.39M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.39M|    return pos;
   70|  2.39M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    370|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    370|    pos_attribute_ = &position_attribute;
   43|    370|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    308|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    308|    entry_to_point_id_map_ = map;
   46|    308|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    207|      : pos_attribute_(nullptr),
   36|    207|        entry_to_point_id_map_(nullptr),
   37|    207|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    207|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    155|      : pos_attribute_(nullptr),
   36|    155|        entry_to_point_id_map_(nullptr),
   37|    155|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    155|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    208|      : pos_attribute_(nullptr),
   36|    208|        entry_to_point_id_map_(nullptr),
   37|    208|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    208|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    133|      : pos_attribute_(nullptr),
   36|    133|        entry_to_point_id_map_(nullptr),
   37|    133|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    133|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    271|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    271|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    256|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    256|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    256|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    256|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    256|      new DataTypeT[num_components]());
   70|       |
   71|    256|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    256|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    256|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    256|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    256|  const int corner_map_size =
   78|    256|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  1.24M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 1.24M, False: 256]
  ------------------
   80|  1.24M|    const CornerIndex start_corner_id =
   81|  1.24M|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  1.24M|    CornerIndex corner_id(start_corner_id);
   84|  1.24M|    int num_parallelograms = 0;
   85|  39.6M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 38.3M, False: 1.24M]
  ------------------
   86|  38.3M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  38.3M|    }
   88|  3.31M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 2.06M, False: 1.24M]
  ------------------
   89|  2.06M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 319k, False: 1.74M]
  ------------------
   90|  2.06M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  2.06M|              num_components, parallelogram_pred_vals.get())) {
   92|  16.8M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 16.5M, False: 319k]
  ------------------
   93|  16.5M|          pred_vals[c] =
   94|  16.5M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  16.5M|        }
   96|   319k|        ++num_parallelograms;
   97|   319k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  2.06M|      corner_id = table->SwingRight(corner_id);
  101|  2.06M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 159k, False: 1.90M]
  ------------------
  102|   159k|        corner_id = kInvalidCornerIndex;
  103|   159k|      }
  104|  2.06M|    }
  105|       |
  106|  1.24M|    const int dst_offset = p * num_components;
  107|  1.24M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.07M, False: 172k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.07M|      const int src_offset = (p - 1) * num_components;
  111|  1.07M|      this->transform().ComputeOriginalValue(
  112|  1.07M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  1.07M|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  8.63M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 8.46M, False: 172k]
  ------------------
  116|  8.46M|        pred_vals[c] /= num_parallelograms;
  117|  8.46M|      }
  118|   172k|      this->transform().ComputeOriginalValue(
  119|   172k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   172k|    }
  121|  1.24M|  }
  122|    256|  return true;
  123|    256|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    450|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    450|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    423|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    423|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    423|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    423|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    423|      new DataTypeT[num_components]());
   70|       |
   71|    423|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    423|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    423|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    423|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    423|  const int corner_map_size =
   78|    423|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   815k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 814k, False: 423]
  ------------------
   80|   814k|    const CornerIndex start_corner_id =
   81|   814k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   814k|    CornerIndex corner_id(start_corner_id);
   84|   814k|    int num_parallelograms = 0;
   85|  24.9M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 24.1M, False: 814k]
  ------------------
   86|  24.1M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  24.1M|    }
   88|  5.61M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 4.80M, False: 814k]
  ------------------
   89|  4.80M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.58M, False: 3.21M]
  ------------------
   90|  4.80M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  4.80M|              num_components, parallelogram_pred_vals.get())) {
   92|  48.2M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 46.6M, False: 1.58M]
  ------------------
   93|  46.6M|          pred_vals[c] =
   94|  46.6M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  46.6M|        }
   96|  1.58M|        ++num_parallelograms;
   97|  1.58M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  4.80M|      corner_id = table->SwingRight(corner_id);
  101|  4.80M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 794k, False: 4.00M]
  ------------------
  102|   794k|        corner_id = kInvalidCornerIndex;
  103|   794k|      }
  104|  4.80M|    }
  105|       |
  106|   814k|    const int dst_offset = p * num_components;
  107|   814k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 2.78k, False: 812k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  2.78k|      const int src_offset = (p - 1) * num_components;
  111|  2.78k|      this->transform().ComputeOriginalValue(
  112|  2.78k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   812k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  24.8M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 24.0M, False: 812k]
  ------------------
  116|  24.0M|        pred_vals[c] /= num_parallelograms;
  117|  24.0M|      }
  118|   812k|      this->transform().ComputeOriginalValue(
  119|   812k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   812k|    }
  121|   814k|  }
  122|    423|  return true;
  123|    423|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  4.72M|    int num_components, DataTypeT *out_prediction) {
   49|  4.72M|  const CornerIndex oci = table->Opposite(ci);
   50|  4.72M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 3.37M, False: 1.35M]
  ------------------
   51|  3.37M|    return false;
   52|  3.37M|  }
   53|  1.35M|  int vert_opp, vert_next, vert_prev;
   54|  1.35M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  1.35M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  1.35M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 764k, False: 591k]
  |  Branch (56:35): [True: 604k, False: 159k]
  ------------------
   57|   604k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 574k, False: 30.4k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   574k|    const int v_opp_off = vert_opp * num_components;
   60|   574k|    const int v_next_off = vert_next * num_components;
   61|   574k|    const int v_prev_off = vert_prev * num_components;
   62|  34.1M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 33.5M, False: 574k]
  ------------------
   63|  33.5M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  33.5M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  33.5M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  33.5M|      const int64_t result =
   67|  33.5M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  33.5M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  33.5M|    }
   71|   574k|    return true;
   72|   574k|  }
   73|   781k|  return false;  // Not all data is available for prediction
   74|  1.35M|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  1.35M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  1.35M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  1.35M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  1.35M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  1.35M|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  6.01M|    int num_components, DataTypeT *out_prediction) {
   49|  6.01M|  const CornerIndex oci = table->Opposite(ci);
   50|  6.01M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 38.6k, False: 5.97M]
  ------------------
   51|  38.6k|    return false;
   52|  38.6k|  }
   53|  5.97M|  int vert_opp, vert_next, vert_prev;
   54|  5.97M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  5.97M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  5.97M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 3.06M, False: 2.91M]
  |  Branch (56:35): [True: 2.37M, False: 685k]
  ------------------
   57|  2.37M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 2.11M, False: 263k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  2.11M|    const int v_opp_off = vert_opp * num_components;
   60|  2.11M|    const int v_next_off = vert_next * num_components;
   61|  2.11M|    const int v_prev_off = vert_prev * num_components;
   62|   102M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 100M, False: 2.11M]
  ------------------
   63|   100M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|   100M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|   100M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|   100M|      const int64_t result =
   67|   100M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|   100M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|   100M|    }
   71|  2.11M|    return true;
   72|  2.11M|  }
   73|  3.86M|  return false;  // Not all data is available for prediction
   74|  5.97M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  5.97M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  5.97M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  5.97M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  5.97M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  5.97M|}

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

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    238|      : pos_attribute_(nullptr),
   39|    238|        entry_to_point_id_map_(nullptr),
   40|    238|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    235|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    235|    pos_attribute_ = &position_attribute;
   43|    235|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    223|  void ResizeOrientations(int num_orientations) {
   74|    223|    orientations_.resize(num_orientations);
   75|    223|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  2.23G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    178|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    178|    entry_to_point_id_map_ = map;
   46|    178|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   364k|                                                 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|   364k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   364k|  const CornerIndex prev_corner_id =
   99|   364k|      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|   364k|  int next_data_id, prev_data_id;
  103|       |
  104|   364k|  int next_vert_id, prev_vert_id;
  105|   364k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   364k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   364k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   364k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   364k|  typedef VectorD<int64_t, 2> Vec2;
  112|   364k|  typedef VectorD<int64_t, 3> Vec3;
  113|   364k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   364k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 249k, False: 115k]
  |  Branch (115:33): [True: 133k, False: 115k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   133k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   133k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   133k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 120k, False: 12.6k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   120k|      predicted_value_[0] = p_uv[0];
  122|   120k|      predicted_value_[1] = p_uv[1];
  123|   120k|      return true;
  124|   120k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  12.6k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  12.6k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  12.6k|    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|  12.6k|    const Vec3 pn = prev_pos - next_pos;
  146|  12.6k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  12.6k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 777, False: 11.8k]
  ------------------
  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|    777|      const Vec3 cn = tip_pos - next_pos;
  153|    777|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    777|      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|    777|      const int64_t n_uv_absmax_element =
  164|    777|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    777|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 35, False: 742]
  ------------------
  166|    777|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     35|        return false;
  169|     35|      }
  170|    742|      const int64_t pn_uv_absmax_element =
  171|    742|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    742|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 29, False: 713]
  ------------------
  173|    742|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     29|        return false;
  176|     29|      }
  177|    713|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|    713|      const int64_t pn_absmax_element =
  179|    713|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|    713|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 14, False: 699]
  ------------------
  181|    713|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|     14|        return false;
  184|     14|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|    699|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|    699|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  189|       |
  190|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  191|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  192|       |      //
  193|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  194|       |      //
  195|       |      // To preserve precision, we perform all operations in scaled space as
  196|       |      // explained above, so we want the final vector to be:
  197|       |      //
  198|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  199|       |      //
  200|       |      // We can then rewrite the formula as:
  201|       |      //
  202|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  203|       |      //
  204|    699|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|    699|      const uint64_t norm_squared =
  207|    699|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|    699|      cx_uv = cx_uv * norm_squared;
  210|       |
  211|       |      // Predicted uv coordinate is then computed by either adding or
  212|       |      // subtracting CX_UV to/from X_UV.
  213|    699|      Vec2 predicted_uv;
  214|    699|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 699]
  ------------------
  215|       |        // When encoding, compute both possible vectors and determine which one
  216|       |        // results in a better prediction.
  217|       |        // Both vectors need to be transformed back from the scaled space to
  218|       |        // the real UV coordinate space.
  219|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  220|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  221|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  222|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  224|      0|          predicted_uv = predicted_uv_0;
  225|      0|          orientations_.push_back(true);
  226|      0|        } else {
  227|      0|          predicted_uv = predicted_uv_1;
  228|      0|          orientations_.push_back(false);
  229|      0|        }
  230|    699|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|    699|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 5, False: 694]
  ------------------
  233|      5|          return false;
  234|      5|        }
  235|    694|        const bool orientation = orientations_.back();
  236|    694|        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|    694|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 423, False: 271]
  ------------------
  240|    423|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    423|        } else {
  242|    271|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    271|        }
  244|    694|      }
  245|    694|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|    694|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|    694|      return true;
  248|    699|    }
  249|  12.6k|  }
  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|   242k|  int data_offset = 0;
  254|   242k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 127k, False: 115k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|   127k|    data_offset = prev_data_id * kNumComponents;
  257|   127k|  }
  258|   242k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 11.8k, False: 230k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  11.8k|    data_offset = next_data_id * kNumComponents;
  261|   230k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   230k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 230k, False: 178]
  ------------------
  265|   230k|      data_offset = (data_id - 1) * kNumComponents;
  266|   230k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    534|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 356, False: 178]
  ------------------
  269|    356|        predicted_value_[i] = 0;
  270|    356|      }
  271|    178|      return true;
  272|    178|    }
  273|   230k|  }
  274|   727k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 484k, False: 242k]
  ------------------
  275|   484k|    predicted_value_[i] = data[data_offset + i];
  276|   484k|  }
  277|   242k|  return true;
  278|   242k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   267k|                                            const DataTypeT *data) const {
   59|   267k|    const int data_offset = entry_id * kNumComponents;
   60|   267k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   267k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  37.9k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  37.9k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  37.9k|    VectorD<int64_t, 3> pos;
   52|  37.9k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  37.9k|                                 &pos[0]);
   54|  37.9k|    return pos;
   55|  37.9k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   364k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    227|      : pos_attribute_(nullptr),
   39|    227|        entry_to_point_id_map_(nullptr),
   40|    227|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    225|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    225|    pos_attribute_ = &position_attribute;
   43|    225|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    221|  void ResizeOrientations(int num_orientations) {
   74|    221|    orientations_.resize(num_orientations);
   75|    221|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  8.78G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    174|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    174|    entry_to_point_id_map_ = map;
   46|    174|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   164k|                                                 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|   164k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   164k|  const CornerIndex prev_corner_id =
   99|   164k|      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|   164k|  int next_data_id, prev_data_id;
  103|       |
  104|   164k|  int next_vert_id, prev_vert_id;
  105|   164k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   164k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   164k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   164k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   164k|  typedef VectorD<int64_t, 2> Vec2;
  112|   164k|  typedef VectorD<int64_t, 3> Vec3;
  113|   164k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   164k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 164k, False: 245]
  |  Branch (115:33): [True: 164k, False: 259]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   164k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   164k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   164k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 157k, False: 6.96k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   157k|      predicted_value_[0] = p_uv[0];
  122|   157k|      predicted_value_[1] = p_uv[1];
  123|   157k|      return true;
  124|   157k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  6.96k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  6.96k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  6.96k|    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.96k|    const Vec3 pn = prev_pos - next_pos;
  146|  6.96k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  6.96k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.35k, False: 5.61k]
  ------------------
  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.35k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.35k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.35k|      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.35k|      const int64_t n_uv_absmax_element =
  164|  1.35k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.35k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 24, False: 1.33k]
  ------------------
  166|  1.35k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     24|        return false;
  169|     24|      }
  170|  1.33k|      const int64_t pn_uv_absmax_element =
  171|  1.33k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.33k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 22, False: 1.30k]
  ------------------
  173|  1.33k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     22|        return false;
  176|     22|      }
  177|  1.30k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.30k|      const int64_t pn_absmax_element =
  179|  1.30k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.30k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 7, False: 1.30k]
  ------------------
  181|  1.30k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      7|        return false;
  184|      7|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.30k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.30k|      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.30k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.30k|      const uint64_t norm_squared =
  207|  1.30k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.30k|      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.30k|      Vec2 predicted_uv;
  214|  1.30k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.30k]
  ------------------
  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.30k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.30k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 3, False: 1.29k]
  ------------------
  233|      3|          return false;
  234|      3|        }
  235|  1.29k|        const bool orientation = orientations_.back();
  236|  1.29k|        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.29k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 497, False: 802]
  ------------------
  240|    497|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    802|        } else {
  242|    802|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    802|        }
  244|  1.29k|      }
  245|  1.29k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.29k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.29k|      return true;
  248|  1.30k|    }
  249|  6.96k|  }
  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.11k|  int data_offset = 0;
  254|  6.11k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 5.87k, False: 245]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  5.87k|    data_offset = prev_data_id * kNumComponents;
  257|  5.87k|  }
  258|  6.11k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 5.62k, False: 494]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  5.62k|    data_offset = next_data_id * kNumComponents;
  261|  5.62k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    494|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 320, False: 174]
  ------------------
  265|    320|      data_offset = (data_id - 1) * kNumComponents;
  266|    320|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    522|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 348, False: 174]
  ------------------
  269|    348|        predicted_value_[i] = 0;
  270|    348|      }
  271|    174|      return true;
  272|    174|    }
  273|    494|  }
  274|  17.8k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 11.8k, False: 5.94k]
  ------------------
  275|  11.8k|    predicted_value_[i] = data[data_offset + i];
  276|  11.8k|  }
  277|  5.94k|  return true;
  278|  6.11k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   328k|                                            const DataTypeT *data) const {
   59|   328k|    const int data_offset = entry_id * kNumComponents;
   60|   328k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   328k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  20.9k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  20.9k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  20.9k|    VectorD<int64_t, 3> pos;
   52|  20.9k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  20.9k|                                 &pos[0]);
   54|  20.9k|    return pos;
   55|  20.9k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   164k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    157|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    490|  bool AreCorrectionsPositive() override {
   71|    490|    return transform_.AreCorrectionsPositive();
   72|    490|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    136|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    136|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 26, False: 110]
  ------------------
   50|     26|      return false;
   51|     26|    }
   52|    110|    return true;
   53|    136|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  1.09M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    226|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    542|  bool AreCorrectionsPositive() override {
   71|    542|    return transform_.AreCorrectionsPositive();
   72|    542|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    208|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    208|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 30, False: 178]
  ------------------
   50|     30|      return false;
   51|     30|    }
   52|    178|    return true;
   53|    208|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  1.69M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  4.74k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  3.18k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  4.52k|  bool AreCorrectionsPositive() override {
   71|  4.52k|    return transform_.AreCorrectionsPositive();
   72|  4.52k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  3.47k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  3.47k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 222, False: 3.25k]
  ------------------
   50|    222|      return false;
   51|    222|    }
   52|  3.25k|    return true;
   53|  3.47k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  7.25M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    519|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    567|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    519|                                 const PointCloudDecoder *decoder) {
  188|    519|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    519|      method, att_id, decoder, TransformT());
  190|    519|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    519|                                 const TransformT &transform) {
  156|    519|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 519]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    519|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    519|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 519, 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|    519|    const MeshDecoder *const mesh_decoder =
  167|    519|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    519|    auto ret = CreateMeshPredictionScheme<
  170|    519|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    519|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    519|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    519|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 362, False: 157]
  ------------------
  174|    362|      return ret;
  175|    362|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    519|  }
  178|       |  // Create delta decoder.
  179|    157|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    157|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    519|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    221|      uint16_t bitstream_version) {
  143|    221|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    221|        method, attribute, transform, mesh_data, bitstream_version);
  145|    221|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    221|        uint16_t bitstream_version) {
  127|    221|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 207, False: 14]
  ------------------
  128|    207|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    207|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    207|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    207|                                                  mesh_data));
  132|    207|      }
  133|     14|      return nullptr;
  134|    221|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    158|      uint16_t bitstream_version) {
  143|    158|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    158|        method, attribute, transform, mesh_data, bitstream_version);
  145|    158|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    158|        uint16_t bitstream_version) {
  127|    158|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 155, False: 3]
  ------------------
  128|    155|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    155|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    155|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    155|                                                  mesh_data));
  132|    155|      }
  133|      3|      return nullptr;
  134|    158|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    567|                                 const PointCloudDecoder *decoder) {
  188|    567|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    567|      method, att_id, decoder, TransformT());
  190|    567|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    567|                                 const TransformT &transform) {
  156|    567|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 567]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    567|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    567|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 567, 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|    567|    const MeshDecoder *const mesh_decoder =
  167|    567|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    567|    auto ret = CreateMeshPredictionScheme<
  170|    567|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    567|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    567|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    567|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 341, False: 226]
  ------------------
  174|    341|      return ret;
  175|    341|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    567|  }
  178|       |  // Create delta decoder.
  179|    226|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    226|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    567|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    209|      uint16_t bitstream_version) {
  143|    209|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    209|        method, attribute, transform, mesh_data, bitstream_version);
  145|    209|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    209|        uint16_t bitstream_version) {
  111|    209|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 208, False: 1]
  ------------------
  112|    208|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    208|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    208|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    208|                                                  mesh_data));
  116|    208|      }
  117|      1|      return nullptr;
  118|    209|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__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_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    135|        uint16_t bitstream_version) {
  111|    135|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 133, False: 2]
  ------------------
  112|    133|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    133|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    133|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    133|                                                  mesh_data));
  116|    133|      }
  117|      2|      return nullptr;
  118|    135|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  4.74k|                                 const PointCloudDecoder *decoder) {
  188|  4.74k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  4.74k|      method, att_id, decoder, TransformT());
  190|  4.74k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  4.74k|                                 const TransformT &transform) {
  156|  4.74k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 4.74k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  4.74k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  4.74k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 4.74k, False: 0]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|  4.74k|    const MeshDecoder *const mesh_decoder =
  167|  4.74k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  4.74k|    auto ret = CreateMeshPredictionScheme<
  170|  4.74k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  4.74k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  4.74k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  4.74k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 4.33k, False: 406]
  ------------------
  174|  4.33k|      return ret;
  175|  4.33k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  4.74k|  }
  178|       |  // Create delta decoder.
  179|    406|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    406|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  4.74k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.16k|      uint16_t bitstream_version) {
  143|  2.16k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.16k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.16k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.16k|        uint16_t bitstream_version) {
   53|  2.16k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 732, False: 1.43k]
  ------------------
   54|    732|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    732|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    732|                                                         MeshDataT>(
   57|    732|                attribute, transform, mesh_data));
   58|    732|      }
   59|  1.43k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.43k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 271, False: 1.16k]
  ------------------
   61|    271|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    271|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    271|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    271|                                                  mesh_data));
   65|    271|      }
   66|  1.16k|#endif
   67|  1.16k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 373, False: 791]
  ------------------
   68|    373|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    373|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    373|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    373|                                                  mesh_data));
   72|    373|      }
   73|    791|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    791|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 172, False: 619]
  ------------------
   75|    172|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    172|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    172|                                                     MeshDataT>(
   78|    172|                attribute, transform, mesh_data, bitstream_version));
   79|    172|      }
   80|    619|#endif
   81|    619|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 238, False: 381]
  ------------------
   82|    238|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    238|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    238|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    238|                                                  mesh_data));
   86|    238|      }
   87|    381|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    381|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 381, False: 0]
  ------------------
   89|    381|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    381|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    381|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    381|                                                  mesh_data));
   93|    381|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.16k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.16k|      uint16_t bitstream_version) {
  143|  2.16k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.16k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.16k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.16k|        uint16_t bitstream_version) {
   53|  2.16k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 521, False: 1.64k]
  ------------------
   54|    521|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    521|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    521|                                                         MeshDataT>(
   57|    521|                attribute, transform, mesh_data));
   58|    521|      }
   59|  1.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.64k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 450, False: 1.19k]
  ------------------
   61|    450|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    450|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    450|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    450|                                                  mesh_data));
   65|    450|      }
   66|  1.19k|#endif
   67|  1.19k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 436, False: 761]
  ------------------
   68|    436|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    436|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    436|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    436|                                                  mesh_data));
   72|    436|      }
   73|    761|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    761|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 161, False: 600]
  ------------------
   75|    161|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    161|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    161|                                                     MeshDataT>(
   78|    161|                attribute, transform, mesh_data, bitstream_version));
   79|    161|      }
   80|    600|#endif
   81|    600|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 227, False: 373]
  ------------------
   82|    227|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    227|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    227|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    227|                                                  mesh_data));
   86|    227|      }
   87|    373|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    373|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 373, False: 0]
  ------------------
   89|    373|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    373|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    373|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    373|                                                  mesh_data));
   93|    373|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.16k|    }

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    519|    uint16_t bitstream_version) {
   38|    519|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    519|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 519, False: 0]
  ------------------
   40|    519|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 72, False: 447]
  ------------------
   41|    447|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 6, False: 441]
  ------------------
   42|    441|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 3, False: 438]
  ------------------
   43|    438|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 438]
  ------------------
   44|    438|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 387, False: 51]
  ------------------
   45|    471|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 3, False: 48]
  ------------------
   46|    471|    const CornerTable *const ct = source->GetCornerTable();
   47|    471|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    471|        source->GetAttributeEncodingData(att_id);
   49|    471|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 92, False: 379]
  |  Branch (49:26): [True: 0, False: 379]
  ------------------
   50|       |      // No connectivity data found.
   51|     92|      return nullptr;
   52|     92|    }
   53|       |    // Connectivity data exists.
   54|    379|    const MeshAttributeCornerTable *const att_ct =
   55|    379|        source->GetAttributeCornerTable(att_id);
   56|    379|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 221, False: 158]
  ------------------
   57|    221|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    221|      MeshData md;
   59|    221|      md.Set(source->mesh(), att_ct,
   60|    221|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    221|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    221|      MeshPredictionSchemeFactoryT factory;
   63|    221|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    221|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 207, False: 14]
  ------------------
   65|    207|        return ret;
   66|    207|      }
   67|    221|    } else {
   68|    158|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    158|      MeshData md;
   70|    158|      md.Set(source->mesh(), ct,
   71|    158|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    158|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    158|      MeshPredictionSchemeFactoryT factory;
   74|    158|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    158|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 155, False: 3]
  ------------------
   76|    155|        return ret;
   77|    155|      }
   78|    158|    }
   79|    379|  }
   80|     65|  return nullptr;
   81|    519|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    567|    uint16_t bitstream_version) {
   38|    567|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    567|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 567, False: 0]
  ------------------
   40|    567|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 14, False: 553]
  ------------------
   41|    553|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 24, False: 529]
  ------------------
   42|    529|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 2, False: 527]
  ------------------
   43|    527|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 15, False: 512]
  ------------------
   44|    512|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 409, False: 103]
  ------------------
   45|    503|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 39, False: 64]
  ------------------
   46|    503|    const CornerTable *const ct = source->GetCornerTable();
   47|    503|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    503|        source->GetAttributeEncodingData(att_id);
   49|    503|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 159, False: 344]
  |  Branch (49:26): [True: 0, False: 344]
  ------------------
   50|       |      // No connectivity data found.
   51|    159|      return nullptr;
   52|    159|    }
   53|       |    // Connectivity data exists.
   54|    344|    const MeshAttributeCornerTable *const att_ct =
   55|    344|        source->GetAttributeCornerTable(att_id);
   56|    344|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 209, False: 135]
  ------------------
   57|    209|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    209|      MeshData md;
   59|    209|      md.Set(source->mesh(), att_ct,
   60|    209|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    209|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    209|      MeshPredictionSchemeFactoryT factory;
   63|    209|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    209|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 208, False: 1]
  ------------------
   65|    208|        return ret;
   66|    208|      }
   67|    209|    } else {
   68|    135|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    135|      MeshData md;
   70|    135|      md.Set(source->mesh(), ct,
   71|    135|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    135|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    135|      MeshPredictionSchemeFactoryT factory;
   74|    135|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    135|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 133, False: 2]
  ------------------
   76|    133|        return ret;
   77|    133|      }
   78|    135|    }
   79|    344|  }
   80|     67|  return nullptr;
   81|    567|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  4.74k|    uint16_t bitstream_version) {
   38|  4.74k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  4.74k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 4.74k, False: 0]
  ------------------
   40|  4.74k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.36k, False: 3.37k]
  ------------------
   41|  3.37k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 776, False: 2.60k]
  ------------------
   42|  2.60k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 826, False: 1.77k]
  ------------------
   43|  1.77k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 469, False: 1.30k]
  ------------------
   44|  1.30k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 763, False: 542]
  ------------------
   45|  4.53k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 335, False: 207]
  ------------------
   46|  4.53k|    const CornerTable *const ct = source->GetCornerTable();
   47|  4.53k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  4.53k|        source->GetAttributeEncodingData(att_id);
   49|  4.53k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 199, False: 4.33k]
  |  Branch (49:26): [True: 0, False: 4.33k]
  ------------------
   50|       |      // No connectivity data found.
   51|    199|      return nullptr;
   52|    199|    }
   53|       |    // Connectivity data exists.
   54|  4.33k|    const MeshAttributeCornerTable *const att_ct =
   55|  4.33k|        source->GetAttributeCornerTable(att_id);
   56|  4.33k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 2.16k, False: 2.16k]
  ------------------
   57|  2.16k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  2.16k|      MeshData md;
   59|  2.16k|      md.Set(source->mesh(), att_ct,
   60|  2.16k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  2.16k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  2.16k|      MeshPredictionSchemeFactoryT factory;
   63|  2.16k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  2.16k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 2.16k, False: 0]
  ------------------
   65|  2.16k|        return ret;
   66|  2.16k|      }
   67|  2.16k|    } else {
   68|  2.16k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.16k|      MeshData md;
   70|  2.16k|      md.Set(source->mesh(), ct,
   71|  2.16k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.16k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.16k|      MeshPredictionSchemeFactoryT factory;
   74|  2.16k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.16k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.16k, False: 0]
  ------------------
   76|  2.16k|        return ret;
   77|  2.16k|      }
   78|  2.16k|    }
   79|  4.33k|  }
   80|    207|  return nullptr;
   81|  4.74k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  1.69M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  1.69M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 1.40M, False: 290k]
  |  Branch (93:22): [True: 1.26M, False: 134k]
  ------------------
   94|  1.26M|      return true;
   95|  1.26M|    }
   96|   424k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 156k, False: 268k]
  |  Branch (96:25): [True: 124k, False: 31.5k]
  ------------------
   97|  1.69M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  1.69M|  int32_t GetRotationCount(Point2 pred) const {
   51|  1.69M|    const DataType sign_x = pred[0];
   52|  1.69M|    const DataType sign_y = pred[1];
   53|       |
   54|  1.69M|    int32_t rotation_count = 0;
   55|  1.69M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 1.40M, False: 290k]
  ------------------
   56|  1.40M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 1.26M, False: 134k]
  ------------------
   57|  1.26M|        rotation_count = 0;
   58|  1.26M|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 95.9k, False: 38.6k]
  ------------------
   59|  95.9k|        rotation_count = 3;
   60|  95.9k|      } else {
   61|  38.6k|        rotation_count = 1;
   62|  38.6k|      }
   63|  1.40M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 134k, False: 156k]
  ------------------
   64|   134k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 103k, False: 31.0k]
  ------------------
   65|   103k|        rotation_count = 2;
   66|   103k|      } else {
   67|  31.0k|        rotation_count = 1;
   68|  31.0k|      }
   69|   156k|    } else {
   70|   156k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 124k, False: 31.5k]
  ------------------
   71|   124k|        rotation_count = 0;
   72|   124k|      } else {
   73|  31.5k|        rotation_count = 3;
   74|  31.5k|      }
   75|   156k|    }
   76|  1.69M|    return rotation_count;
   77|  1.69M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   600k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   600k|    switch (rotation_count) {
   81|   197k|      case 1:
  ------------------
  |  Branch (81:7): [True: 197k, False: 403k]
  ------------------
   82|   197k|        return Point2(p[1], -p[0]);
   83|   206k|      case 2:
  ------------------
  |  Branch (83:7): [True: 206k, False: 394k]
  ------------------
   84|   206k|        return Point2(-p[0], -p[1]);
   85|   197k|      case 3:
  ------------------
  |  Branch (85:7): [True: 197k, False: 403k]
  ------------------
   86|   197k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 600k]
  ------------------
   88|      0|        return p;
   89|   600k|    }
   90|   600k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    567|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  4.52k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  3.95k|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  3.95k|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  3.95k|  bool InitCorrectionBounds() {
   84|  3.95k|    const int64_t dif =
   85|  3.95k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  3.95k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 3.95k]
  |  Branch (86:20): [True: 25, False: 3.93k]
  ------------------
   87|     25|      return false;
   88|     25|    }
   89|  3.93k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  3.93k|    max_correction_ = max_dif_ / 2;
   91|  3.93k|    min_correction_ = -max_correction_;
   92|  3.93k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 1.74k, False: 2.18k]
  ------------------
   93|  1.74k|      max_correction_ -= 1;
   94|  1.74k|    }
   95|  3.93k|    return true;
   96|  3.95k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  3.23k|  void Init(int num_components) {
   56|  3.23k|    num_components_ = num_components;
   57|  3.23k|    clamped_value_.resize(num_components);
   58|  3.23k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  7.25M|      const DataTypeT *predicted_val) const {
   64|   205M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 198M, False: 7.25M]
  ------------------
   65|   198M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 247k, False: 197M]
  ------------------
   66|   247k|        clamped_value_[i] = max_value_;
   67|   197M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 11.7M, False: 186M]
  ------------------
   68|  11.7M|        clamped_value_[i] = min_value_;
   69|   186M|      } else {
   70|   186M|        clamped_value_[i] = predicted_val[i];
   71|   186M|      }
   72|   198M|    }
   73|  7.25M|    return clamped_value_.data();
   74|  7.25M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|   410M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|   198M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|   437k|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|   198M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    634|  int quantization_bits() const {
   78|    634|    DRACO_DCHECK(false);
   79|    634|    return -1;
   80|    634|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  4.74k|      : num_components_(0),
   45|  4.74k|        min_value_(0),
   46|  4.74k|        max_value_(0),
   47|  4.74k|        max_dif_(0),
   48|  4.74k|        max_correction_(0),
   49|  4.74k|        min_correction_(0) {}

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

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

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  30.9k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  9.16k|    DecoderBuffer *buffer) {
   30|  9.16k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 210, False: 8.95k]
  ------------------
   31|    210|    return false;
   32|    210|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  8.95k|  const int32_t num_attributes = GetNumAttributes();
   35|  8.95k|  sequential_decoders_.resize(num_attributes);
   36|  34.1k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 25.2k, False: 8.91k]
  ------------------
   37|  25.2k|    uint8_t decoder_type;
   38|  25.2k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 13, False: 25.2k]
  ------------------
   39|     13|      return false;
   40|     13|    }
   41|       |    // Create the decoder from the id.
   42|  25.2k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  25.2k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 19, False: 25.1k]
  ------------------
   44|     19|      return false;
   45|     19|    }
   46|  25.1k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 7, False: 25.1k]
  ------------------
   47|      7|      return false;
   48|      7|    }
   49|  25.1k|  }
   50|  8.91k|  return true;
   51|  8.95k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  5.28k|    DecoderBuffer *buffer) {
   55|  5.28k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 5.28k]
  |  Branch (55:22): [True: 9, False: 5.27k]
  ------------------
   56|      9|    return false;
   57|      9|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  5.27k|  const int32_t num_attributes = GetNumAttributes();
   60|  20.1k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 14.8k, False: 5.27k]
  ------------------
   61|  14.8k|    PointAttribute *const pa =
   62|  14.8k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  14.8k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 3, False: 14.8k]
  ------------------
   64|      3|      return false;
   65|      3|    }
   66|  14.8k|  }
   67|  5.27k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  5.27k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  5.27k|    DecoderBuffer *in_buffer) {
   72|  5.27k|  const int32_t num_attributes = GetNumAttributes();
   73|  13.7k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 10.6k, False: 3.03k]
  ------------------
   74|  10.6k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 2.23k, False: 8.43k]
  ------------------
   75|  10.6k|                                                          in_buffer)) {
   76|  2.23k|      return false;
   77|  2.23k|    }
   78|  10.6k|  }
   79|  3.03k|  return true;
   80|  5.27k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  3.03k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  3.03k|  const int32_t num_attributes = GetNumAttributes();
   85|  7.54k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 5.23k, False: 2.31k]
  ------------------
   86|  5.23k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 722, False: 4.50k]
  ------------------
   87|  5.23k|            point_ids_, in_buffer)) {
   88|    722|      return false;
   89|    722|    }
   90|  5.23k|  }
   91|  2.31k|  return true;
   92|  3.03k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  2.31k|    TransformAttributesToOriginalFormat() {
   96|  2.31k|  const int32_t num_attributes = GetNumAttributes();
   97|  5.87k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 3.89k, False: 1.97k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  3.89k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 3.89k, False: 0]
  ------------------
  100|  3.89k|      const PointAttribute *const attribute =
  101|  3.89k|          sequential_decoders_[i]->attribute();
  102|  3.89k|      const PointAttribute *const portable_attribute =
  103|  3.89k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  3.89k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 3.63k, False: 264]
  |  Branch (104:11): [True: 685, False: 3.21k]
  ------------------
  105|  3.63k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 685, False: 2.94k]
  ------------------
  106|  3.63k|              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|    685|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|    685|        continue;
  114|    685|      }
  115|  3.89k|    }
  116|  3.21k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 337, False: 2.87k]
  ------------------
  117|  3.21k|            point_ids_)) {
  118|    337|      return false;
  119|    337|    }
  120|  3.21k|  }
  121|  1.97k|  return true;
  122|  2.31k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  25.2k|    uint8_t decoder_type) {
  127|  25.2k|  switch (decoder_type) {
  128|  1.65k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.65k, False: 23.5k]
  ------------------
  129|  1.65k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.65k|          new SequentialAttributeDecoder());
  131|  21.6k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 21.6k, False: 3.54k]
  ------------------
  132|  21.6k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  21.6k|          new SequentialIntegerAttributeDecoder());
  134|    531|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 531, False: 24.6k]
  ------------------
  135|    531|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    531|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.33k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.33k, False: 23.8k]
  ------------------
  139|  1.33k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.33k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     19|    default:
  ------------------
  |  Branch (142:5): [True: 19, False: 25.1k]
  ------------------
  143|     19|      break;
  144|  25.2k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     19|  return nullptr;
  147|  25.2k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  23.5k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  23.5k|                                             int attribute_id) {
   27|  23.5k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 23.5k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  23.5k|  return true;
   31|  23.5k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  2.94k|    const std::vector<PointIndex> &point_ids) {
   35|  2.94k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  2.94k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 2.94k, False: 0]
  ------------------
   37|  2.94k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.94k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 3, False: 2.94k]
  ------------------
   38|      3|    return true;  // Don't revert the transform here for older files.
   39|      3|  }
   40|  2.94k|#endif
   41|  2.94k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  2.94k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  10.1k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  10.1k|  int8_t prediction_scheme_method;
   48|  10.1k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 160, False: 10.0k]
  ------------------
   49|    160|    return false;
   50|    160|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  10.0k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 64, False: 9.94k]
  ------------------
   53|  9.94k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 132, False: 9.81k]
  ------------------
   54|    196|    return false;
   55|    196|  }
   56|  9.81k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 9.46k, False: 347]
  ------------------
   57|  9.46k|    int8_t prediction_transform_type;
   58|  9.46k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 53, False: 9.41k]
  ------------------
   59|     53|      return false;
   60|     53|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  9.41k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 27, False: 9.38k]
  ------------------
   63|  9.38k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 74, False: 9.31k]
  ------------------
   64|    101|      return false;
   65|    101|    }
   66|  9.31k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  9.31k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  9.31k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  9.31k|  }
   70|       |
   71|  9.65k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 5.82k, False: 3.83k]
  ------------------
   72|  5.82k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 32, False: 5.79k]
  ------------------
   73|     32|      return false;
   74|     32|    }
   75|  5.82k|  }
   76|       |
   77|  9.62k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 1.58k, False: 8.04k]
  ------------------
   78|  1.58k|    return false;
   79|  1.58k|  }
   80|       |
   81|  8.04k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  8.04k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  8.04k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 8.04k, False: 0]
  ------------------
   84|  8.04k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  8.04k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 32, False: 8.01k]
  ------------------
   85|       |    // For older files, revert the transform right after we decode the data.
   86|     32|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (86:9): [True: 1, False: 31]
  ------------------
   87|      1|      return false;
   88|      1|    }
   89|     32|  }
   90|  8.04k|#endif
   91|  8.04k|  return true;
   92|  8.04k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  8.17k|    PredictionSchemeTransformType transform_type) {
   98|  8.17k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 3.43k, False: 4.74k]
  ------------------
   99|  3.43k|    return nullptr;  // For now we support only wrap transform.
  100|  3.43k|  }
  101|  4.74k|  return CreatePredictionSchemeForDecoder<
  102|  4.74k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  4.74k|      method, attribute_id(), decoder());
  104|  8.17k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  9.61k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  9.61k|  const int num_components = GetNumValueComponents();
  109|  9.61k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 9.61k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  9.61k|  const size_t num_entries = point_ids.size();
  113|  9.61k|  const size_t num_values = num_entries * num_components;
  114|  9.61k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  9.61k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  9.61k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 12, False: 9.60k]
  ------------------
  117|     12|    return false;
  118|     12|  }
  119|  9.60k|  uint8_t compressed;
  120|  9.60k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 25, False: 9.57k]
  ------------------
  121|     25|    return false;
  122|     25|  }
  123|  9.57k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 700, False: 8.87k]
  ------------------
  124|       |    // Decode compressed values.
  125|    700|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 286, False: 414]
  ------------------
  126|    700|                       in_buffer,
  127|    700|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    286|      return false;
  129|    286|    }
  130|  8.87k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  8.87k|    uint8_t num_bytes;
  134|  8.87k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 12, False: 8.86k]
  ------------------
  135|     12|      return false;
  136|     12|    }
  137|  8.86k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 296, False: 8.56k]
  ------------------
  138|    296|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 296]
  ------------------
  139|    296|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    296|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 2, False: 294]
  ------------------
  143|    296|                             sizeof(int32_t) * num_values)) {
  144|      2|        return false;
  145|      2|      }
  146|  8.56k|    } else {
  147|  8.56k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 30, False: 8.53k]
  ------------------
  148|  8.56k|          num_bytes * num_values) {
  149|     30|        return false;
  150|     30|      }
  151|  8.53k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 14, False: 8.52k]
  ------------------
  152|  8.53k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     14|        return false;
  154|     14|      }
  155|  1.08G|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 1.08G, False: 8.52k]
  ------------------
  156|  1.08G|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 1.08G]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|  1.08G|      }
  160|  8.52k|    }
  161|  8.86k|  }
  162|       |
  163|  9.23k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 9.23k, False: 0]
  |  Branch (163:26): [True: 3.67k, False: 5.55k]
  ------------------
  164|  8.20k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 4.52k, False: 1.03k]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  8.20k|    ConvertSymbolsToSignedInts(
  167|  8.20k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  8.20k|        static_cast<int>(num_values), portable_attribute_data);
  169|  8.20k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  9.23k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 5.55k, False: 3.67k]
  ------------------
  173|  5.55k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 764, False: 4.79k]
  ------------------
  174|    764|      return false;
  175|    764|    }
  176|       |
  177|  4.79k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 4.79k, False: 0]
  ------------------
  178|  4.79k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 425, False: 4.36k]
  ------------------
  179|  4.79k|              portable_attribute_data, portable_attribute_data,
  180|  4.79k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    425|        return false;
  182|    425|      }
  183|  4.79k|    }
  184|  4.79k|  }
  185|  8.04k|  return true;
  186|  9.23k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  2.51k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  2.51k|  switch (attribute()->data_type()) {
  190|    151|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 151, False: 2.36k]
  ------------------
  191|    151|      StoreTypedValues<uint8_t>(num_values);
  192|    151|      break;
  193|  1.73k|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 1.73k, False: 778]
  ------------------
  194|  1.73k|      StoreTypedValues<int8_t>(num_values);
  195|  1.73k|      break;
  196|     85|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 85, False: 2.42k]
  ------------------
  197|     85|      StoreTypedValues<uint16_t>(num_values);
  198|     85|      break;
  199|    135|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 135, False: 2.37k]
  ------------------
  200|    135|      StoreTypedValues<int16_t>(num_values);
  201|    135|      break;
  202|    126|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 126, False: 2.38k]
  ------------------
  203|    126|      StoreTypedValues<uint32_t>(num_values);
  204|    126|      break;
  205|    191|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 191, False: 2.32k]
  ------------------
  206|    191|      StoreTypedValues<int32_t>(num_values);
  207|    191|      break;
  208|     90|    default:
  ------------------
  |  Branch (208:5): [True: 90, False: 2.42k]
  ------------------
  209|     90|      return false;
  210|  2.51k|  }
  211|  2.42k|  return true;
  212|  2.51k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  9.61k|    int num_entries, int num_components) {
  237|  9.61k|  GeometryAttribute ga;
  238|  9.61k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  9.61k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  9.61k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  9.61k|  port_att->SetIdentityMapping();
  242|  9.61k|  port_att->Reset(num_entries);
  243|  9.61k|  port_att->set_unique_id(attribute()->unique_id());
  244|  9.61k|  SetPortableAttribute(std::move(port_att));
  245|  9.61k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    151|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    151|  const int num_components = attribute()->num_components();
  217|    151|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    151|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    151|      new AttributeTypeT[num_components]);
  220|    151|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    151|  int val_id = 0;
  222|    151|  int out_byte_pos = 0;
  223|   929k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 929k, False: 151]
  ------------------
  224|  25.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 24.9M, False: 929k]
  ------------------
  225|  24.9M|      const AttributeTypeT value =
  226|  24.9M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  24.9M|      att_val[c] = value;
  228|  24.9M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   929k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   929k|    out_byte_pos += entry_size;
  232|   929k|  }
  233|    151|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|  1.73k|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|  1.73k|  const int num_components = attribute()->num_components();
  217|  1.73k|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|  1.73k|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|  1.73k|      new AttributeTypeT[num_components]);
  220|  1.73k|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|  1.73k|  int val_id = 0;
  222|  1.73k|  int out_byte_pos = 0;
  223|  4.77M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 4.77M, False: 1.73k]
  ------------------
  224|   323M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 318M, False: 4.77M]
  ------------------
  225|   318M|      const AttributeTypeT value =
  226|   318M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   318M|      att_val[c] = value;
  228|   318M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  4.77M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  4.77M|    out_byte_pos += entry_size;
  232|  4.77M|  }
  233|  1.73k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  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|   209k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 209k, False: 85]
  ------------------
  224|  12.1M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 11.9M, False: 209k]
  ------------------
  225|  11.9M|      const AttributeTypeT value =
  226|  11.9M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  11.9M|      att_val[c] = value;
  228|  11.9M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   209k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   209k|    out_byte_pos += entry_size;
  232|   209k|  }
  233|     85|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    135|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    135|  const int num_components = attribute()->num_components();
  217|    135|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    135|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    135|      new AttributeTypeT[num_components]);
  220|    135|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    135|  int val_id = 0;
  222|    135|  int out_byte_pos = 0;
  223|   294k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 293k, False: 135]
  ------------------
  224|  17.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 17.3M, False: 293k]
  ------------------
  225|  17.3M|      const AttributeTypeT value =
  226|  17.3M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  17.3M|      att_val[c] = value;
  228|  17.3M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   293k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   293k|    out_byte_pos += entry_size;
  232|   293k|  }
  233|    135|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    126|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    126|  const int num_components = attribute()->num_components();
  217|    126|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    126|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    126|      new AttributeTypeT[num_components]);
  220|    126|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    126|  int val_id = 0;
  222|    126|  int out_byte_pos = 0;
  223|   992k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 992k, False: 126]
  ------------------
  224|   201M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 200M, False: 992k]
  ------------------
  225|   200M|      const AttributeTypeT value =
  226|   200M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   200M|      att_val[c] = value;
  228|   200M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   992k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   992k|    out_byte_pos += entry_size;
  232|   992k|  }
  233|    126|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|    191|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    191|  const int num_components = attribute()->num_components();
  217|    191|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    191|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    191|      new AttributeTypeT[num_components]);
  220|    191|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    191|  int val_id = 0;
  222|    191|  int out_byte_pos = 0;
  223|  2.75M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 2.75M, False: 191]
  ------------------
  224|   240M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 238M, False: 2.75M]
  ------------------
  225|   238M|      const AttributeTypeT value =
  226|   238M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   238M|      att_val[c] = value;
  228|   238M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  2.75M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  2.75M|    out_byte_pos += entry_size;
  232|  2.75M|  }
  233|    191|}

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

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

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

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

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  29.7k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  18.5k|                                const uint8_t *const buf, int offset) {
  301|  18.5k|  unsigned x;
  302|  18.5k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 21, False: 18.5k]
  ------------------
  303|     21|    return 1;
  304|     21|  }
  305|  18.5k|  ans->buf = buf;
  306|  18.5k|  x = buf[offset - 1] >> 6;
  307|  18.5k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 16.2k, False: 2.28k]
  ------------------
  308|  16.2k|    ans->buf_offset = offset - 1;
  309|  16.2k|    ans->state = buf[offset - 1] & 0x3F;
  310|  16.2k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.01k, False: 279]
  ------------------
  311|  2.01k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 4, False: 2.00k]
  ------------------
  312|      4|      return 1;
  313|      4|    }
  314|  2.00k|    ans->buf_offset = offset - 2;
  315|  2.00k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.00k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 274, False: 5]
  ------------------
  317|    274|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 1, False: 273]
  ------------------
  318|      1|      return 1;
  319|      1|    }
  320|    273|    ans->buf_offset = offset - 3;
  321|    273|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    273|  } else {
  323|      5|    return 1;
  324|      5|  }
  325|  18.5k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  18.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  18.5k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  18.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  18.5k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 3, False: 18.5k]
  ------------------
  327|      3|    return 1;
  328|      3|  }
  329|  18.5k|  return 0;
  330|  18.5k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.00k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.00k|  uint32_t val;
   69|  2.00k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.00k|  val = mem[1] << 8;
   72|  2.00k|  val |= mem[0];
   73|  2.00k|  return val;
   74|  2.00k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    273|static uint32_t mem_get_le24(const void *vmem) {
   77|    273|  uint32_t val;
   78|    273|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    273|  val = mem[2] << 16;
   81|    273|  val |= mem[1] << 8;
   82|    273|  val |= mem[0];
   83|    273|  return val;
   84|    273|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  11.1G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  11.1G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  11.1G|  unsigned quot, rem, x, xn;
  172|  11.1G|#endif
  173|  11.1G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  11.1G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  11.1G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  22.2G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 10.3G, False: 818M]
  |  Branch (174:40): [True: 137k, False: 10.3G]
  ------------------
  175|   137k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   137k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   137k|  }
  177|       |#if DRACO_ANS_IMPL1
  178|       |  val = ans->state % DRACO_ANS_P8_PRECISION < p;
  179|       |  l_s = val ? p : p0;
  180|       |  ans->state = (ans->state / DRACO_ANS_P8_PRECISION) * l_s +
  181|       |               ans->state % DRACO_ANS_P8_PRECISION - (!val * p);
  182|       |#else
  183|  11.1G|  x = ans->state;
  184|  11.1G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  11.1G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  11.1G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  11.1G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  11.1G|  xn = quot * p;
  187|  11.1G|  val = rem < p;
  188|  11.1G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  22.2G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 10.3G, False: 793M]
  |  |  ------------------
  ------------------
  189|  10.3G|    ans->state = xn + rem;
  190|  10.3G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   793M|    ans->state = x - xn - p;
  193|   793M|  }
  194|  11.1G|#endif
  195|  11.1G|  return val;
  196|  11.1G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  40.5k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  40.5k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  40.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  40.5k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  4.31k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  2.39k|                                       uint32_t num_symbols) {
  482|  2.39k|    lut_table_.resize(rans_precision);
  483|  2.39k|    probability_table_.resize(num_symbols);
  484|  2.39k|    uint32_t cum_prob = 0;
  485|  2.39k|    uint32_t act_prob = 0;
  486|  22.3k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 20.1k, False: 2.21k]
  ------------------
  487|  20.1k|      probability_table_[i].prob = token_probs[i];
  488|  20.1k|      probability_table_[i].cum_prob = cum_prob;
  489|  20.1k|      cum_prob += token_probs[i];
  490|  20.1k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 178, False: 20.0k]
  ------------------
  491|    178|        return false;
  492|    178|      }
  493|  8.21M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 8.19M, False: 20.0k]
  ------------------
  494|  8.19M|        lut_table_[j] = i;
  495|  8.19M|      }
  496|  20.0k|      act_prob = cum_prob;
  497|  20.0k|    }
  498|  2.21k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 264, False: 1.94k]
  ------------------
  499|    264|      return false;
  500|    264|    }
  501|  1.94k|    return true;
  502|  2.21k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.69k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.69k|    unsigned x;
  423|  1.69k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 176, False: 1.51k]
  ------------------
  424|    176|      return 1;
  425|    176|    }
  426|  1.51k|    ans_.buf = buf;
  427|  1.51k|    x = buf[offset - 1] >> 6;
  428|  1.51k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 861, False: 654]
  ------------------
  429|    861|      ans_.buf_offset = offset - 1;
  430|    861|      ans_.state = buf[offset - 1] & 0x3F;
  431|    861|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 290, False: 364]
  ------------------
  432|    290|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 70, False: 220]
  ------------------
  433|     70|        return 1;
  434|     70|      }
  435|    220|      ans_.buf_offset = offset - 2;
  436|    220|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    364|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 250, False: 114]
  ------------------
  438|    250|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 79, False: 171]
  ------------------
  439|     79|        return 1;
  440|     79|      }
  441|    171|      ans_.buf_offset = offset - 3;
  442|    171|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    171|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 114, False: 0]
  ------------------
  444|    114|      ans_.buf_offset = offset - 4;
  445|    114|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    114|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.36k|    ans_.state += l_rans_base;
  450|  1.36k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.36k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 107, False: 1.25k]
  ------------------
  451|    107|      return 1;
  452|    107|    }
  453|  1.25k|    return 0;
  454|  1.36k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    354|static uint32_t mem_get_le16(const void *vmem) {
   68|    354|  uint32_t val;
   69|    354|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    354|  val = mem[1] << 8;
   72|    354|  val |= mem[0];
   73|    354|  return val;
   74|    354|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    272|static uint32_t mem_get_le24(const void *vmem) {
   77|    272|  uint32_t val;
   78|    272|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    272|  val = mem[2] << 16;
   81|    272|  val |= mem[1] << 8;
   82|    272|  val |= mem[0];
   83|    272|  return val;
   84|    272|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    386|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    386|  uint32_t val;
   88|    386|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    386|  val = mem[3] << 24;
   91|    386|  val |= mem[2] << 16;
   92|    386|  val |= mem[1] << 8;
   93|    386|  val |= mem[0];
   94|    386|  return val;
   95|    386|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  88.4M|  inline int rans_read() {
  463|  88.4M|    unsigned rem;
  464|  88.4M|    unsigned quo;
  465|  88.4M|    struct rans_dec_sym sym;
  466|  88.4M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 79.4M, False: 9.03M]
  |  Branch (466:40): [True: 23.6k, False: 79.3M]
  ------------------
  467|  23.6k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  23.6k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  23.6k|    }
  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|  88.4M|    quo = ans_.state / rans_precision;
  472|  88.4M|    rem = ans_.state % rans_precision;
  473|  88.4M|    fetch_sym(&sym, rem);
  474|  88.4M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  88.4M|    return sym.val;
  476|  88.4M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  88.4M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  88.4M|    uint32_t symbol = lut_table_[rem];
  507|  88.4M|    out->val = symbol;
  508|  88.4M|    out->prob = probability_table_[symbol].prob;
  509|  88.4M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  88.4M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|  1.19k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    456|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    335|                                       uint32_t num_symbols) {
  482|    335|    lut_table_.resize(rans_precision);
  483|    335|    probability_table_.resize(num_symbols);
  484|    335|    uint32_t cum_prob = 0;
  485|    335|    uint32_t act_prob = 0;
  486|  9.15k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 8.84k, False: 309]
  ------------------
  487|  8.84k|      probability_table_[i].prob = token_probs[i];
  488|  8.84k|      probability_table_[i].cum_prob = cum_prob;
  489|  8.84k|      cum_prob += token_probs[i];
  490|  8.84k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 26, False: 8.81k]
  ------------------
  491|     26|        return false;
  492|     26|      }
  493|  2.41M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 2.40M, False: 8.81k]
  ------------------
  494|  2.40M|        lut_table_[j] = i;
  495|  2.40M|      }
  496|  8.81k|      act_prob = cum_prob;
  497|  8.81k|    }
  498|    309|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 28, False: 281]
  ------------------
  499|     28|      return false;
  500|     28|    }
  501|    281|    return true;
  502|    309|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|    216|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    216|    unsigned x;
  423|    216|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 9, False: 207]
  ------------------
  424|      9|      return 1;
  425|      9|    }
  426|    207|    ans_.buf = buf;
  427|    207|    x = buf[offset - 1] >> 6;
  428|    207|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 120, False: 87]
  ------------------
  429|    120|      ans_.buf_offset = offset - 1;
  430|    120|      ans_.state = buf[offset - 1] & 0x3F;
  431|    120|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 39, False: 48]
  ------------------
  432|     39|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 14, False: 25]
  ------------------
  433|     14|        return 1;
  434|     14|      }
  435|     25|      ans_.buf_offset = offset - 2;
  436|     25|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     48|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 24, False: 24]
  ------------------
  438|     24|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 9, False: 15]
  ------------------
  439|      9|        return 1;
  440|      9|      }
  441|     15|      ans_.buf_offset = offset - 3;
  442|     15|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     24|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 24, False: 0]
  ------------------
  444|     24|      ans_.buf_offset = offset - 4;
  445|     24|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     24|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    184|    ans_.state += l_rans_base;
  450|    184|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    184|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 18, False: 166]
  ------------------
  451|     18|      return 1;
  452|     18|    }
  453|    166|    return 0;
  454|    184|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  9.42M|  inline int rans_read() {
  463|  9.42M|    unsigned rem;
  464|  9.42M|    unsigned quo;
  465|  9.42M|    struct rans_dec_sym sym;
  466|  9.42M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 9.41M, False: 10.6k]
  |  Branch (466:40): [True: 3.06k, False: 9.41M]
  ------------------
  467|  3.06k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  3.06k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  3.06k|    }
  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|  9.42M|    quo = ans_.state / rans_precision;
  472|  9.42M|    rem = ans_.state % rans_precision;
  473|  9.42M|    fetch_sym(&sym, rem);
  474|  9.42M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  9.42M|    return sym.val;
  476|  9.42M|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  9.42M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  9.42M|    uint32_t symbol = lut_table_[rem];
  507|  9.42M|    out->val = symbol;
  508|  9.42M|    out->prob = probability_table_[symbol].prob;
  509|  9.42M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  9.42M|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|    166|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    397|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    270|                                       uint32_t num_symbols) {
  482|    270|    lut_table_.resize(rans_precision);
  483|    270|    probability_table_.resize(num_symbols);
  484|    270|    uint32_t cum_prob = 0;
  485|    270|    uint32_t act_prob = 0;
  486|  9.32k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 9.08k, False: 238]
  ------------------
  487|  9.08k|      probability_table_[i].prob = token_probs[i];
  488|  9.08k|      probability_table_[i].cum_prob = cum_prob;
  489|  9.08k|      cum_prob += token_probs[i];
  490|  9.08k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 32, False: 9.05k]
  ------------------
  491|     32|        return false;
  492|     32|      }
  493|  7.00M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 6.99M, False: 9.05k]
  ------------------
  494|  6.99M|        lut_table_[j] = i;
  495|  6.99M|      }
  496|  9.05k|      act_prob = cum_prob;
  497|  9.05k|    }
  498|    238|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 39, False: 199]
  ------------------
  499|     39|      return false;
  500|     39|    }
  501|    199|    return true;
  502|    238|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|    130|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    130|    unsigned x;
  423|    130|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 11, False: 119]
  ------------------
  424|     11|      return 1;
  425|     11|    }
  426|    119|    ans_.buf = buf;
  427|    119|    x = buf[offset - 1] >> 6;
  428|    119|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 22, False: 97]
  ------------------
  429|     22|      ans_.buf_offset = offset - 1;
  430|     22|      ans_.state = buf[offset - 1] & 0x3F;
  431|     97|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 26, False: 71]
  ------------------
  432|     26|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 12, False: 14]
  ------------------
  433|     12|        return 1;
  434|     12|      }
  435|     14|      ans_.buf_offset = offset - 2;
  436|     14|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     71|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 24, False: 47]
  ------------------
  438|     24|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 12, False: 12]
  ------------------
  439|     12|        return 1;
  440|     12|      }
  441|     12|      ans_.buf_offset = offset - 3;
  442|     12|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     47|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 47, False: 0]
  ------------------
  444|     47|      ans_.buf_offset = offset - 4;
  445|     47|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     47|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     95|    ans_.state += l_rans_base;
  450|     95|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     95|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 29, False: 66]
  ------------------
  451|     29|      return 1;
  452|     29|    }
  453|     66|    return 0;
  454|     95|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   539k|  inline int rans_read() {
  463|   539k|    unsigned rem;
  464|   539k|    unsigned quo;
  465|   539k|    struct rans_dec_sym sym;
  466|   539k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 211k, False: 328k]
  |  Branch (466:40): [True: 292, False: 210k]
  ------------------
  467|    292|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    292|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    292|    }
  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|   539k|    quo = ans_.state / rans_precision;
  472|   539k|    rem = ans_.state % rans_precision;
  473|   539k|    fetch_sym(&sym, rem);
  474|   539k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   539k|    return sym.val;
  476|   539k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   539k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   539k|    uint32_t symbol = lut_table_[rem];
  507|   539k|    out->val = symbol;
  508|   539k|    out->prob = probability_table_[symbol].prob;
  509|   539k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   539k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     66|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    354|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    211|                                       uint32_t num_symbols) {
  482|    211|    lut_table_.resize(rans_precision);
  483|    211|    probability_table_.resize(num_symbols);
  484|    211|    uint32_t cum_prob = 0;
  485|    211|    uint32_t act_prob = 0;
  486|  22.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 22.6k, False: 187]
  ------------------
  487|  22.6k|      probability_table_[i].prob = token_probs[i];
  488|  22.6k|      probability_table_[i].cum_prob = cum_prob;
  489|  22.6k|      cum_prob += token_probs[i];
  490|  22.6k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 24, False: 22.6k]
  ------------------
  491|     24|        return false;
  492|     24|      }
  493|  10.3M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 10.3M, False: 22.6k]
  ------------------
  494|  10.3M|        lut_table_[j] = i;
  495|  10.3M|      }
  496|  22.6k|      act_prob = cum_prob;
  497|  22.6k|    }
  498|    187|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 54, False: 133]
  ------------------
  499|     54|      return false;
  500|     54|    }
  501|    133|    return true;
  502|    187|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     81|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     81|    unsigned x;
  423|     81|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 7, False: 74]
  ------------------
  424|      7|      return 1;
  425|      7|    }
  426|     74|    ans_.buf = buf;
  427|     74|    x = buf[offset - 1] >> 6;
  428|     74|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 35, False: 39]
  ------------------
  429|     35|      ans_.buf_offset = offset - 1;
  430|     35|      ans_.state = buf[offset - 1] & 0x3F;
  431|     39|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 12, False: 27]
  ------------------
  432|     12|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 2, False: 10]
  ------------------
  433|      2|        return 1;
  434|      2|      }
  435|     10|      ans_.buf_offset = offset - 2;
  436|     10|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     27|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 12, False: 15]
  ------------------
  438|     12|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 12]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|     12|      ans_.buf_offset = offset - 3;
  442|     12|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     15|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 15, False: 0]
  ------------------
  444|     15|      ans_.buf_offset = offset - 4;
  445|     15|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     15|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     72|    ans_.state += l_rans_base;
  450|     72|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     72|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 12, False: 60]
  ------------------
  451|     12|      return 1;
  452|     12|    }
  453|     60|    return 0;
  454|     72|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|   382k|  inline int rans_read() {
  463|   382k|    unsigned rem;
  464|   382k|    unsigned quo;
  465|   382k|    struct rans_dec_sym sym;
  466|   383k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 202k, False: 180k]
  |  Branch (466:40): [True: 1.10k, False: 201k]
  ------------------
  467|  1.10k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.10k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.10k|    }
  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|   382k|    quo = ans_.state / rans_precision;
  472|   382k|    rem = ans_.state % rans_precision;
  473|   382k|    fetch_sym(&sym, rem);
  474|   382k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   382k|    return sym.val;
  476|   382k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|   382k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   382k|    uint32_t symbol = lut_table_[rem];
  507|   382k|    out->val = symbol;
  508|   382k|    out->prob = probability_table_[symbol].prob;
  509|   382k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   382k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     60|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    366|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    221|                                       uint32_t num_symbols) {
  482|    221|    lut_table_.resize(rans_precision);
  483|    221|    probability_table_.resize(num_symbols);
  484|    221|    uint32_t cum_prob = 0;
  485|    221|    uint32_t act_prob = 0;
  486|  4.12k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.93k, False: 193]
  ------------------
  487|  3.93k|      probability_table_[i].prob = token_probs[i];
  488|  3.93k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.93k|      cum_prob += token_probs[i];
  490|  3.93k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 28, False: 3.90k]
  ------------------
  491|     28|        return false;
  492|     28|      }
  493|  45.4M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 45.4M, False: 3.90k]
  ------------------
  494|  45.4M|        lut_table_[j] = i;
  495|  45.4M|      }
  496|  3.90k|      act_prob = cum_prob;
  497|  3.90k|    }
  498|    193|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 35, False: 158]
  ------------------
  499|     35|      return false;
  500|     35|    }
  501|    158|    return true;
  502|    193|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     90|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     90|    unsigned x;
  423|     90|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 87]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|     87|    ans_.buf = buf;
  427|     87|    x = buf[offset - 1] >> 6;
  428|     87|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 33, False: 54]
  ------------------
  429|     33|      ans_.buf_offset = offset - 1;
  430|     33|      ans_.state = buf[offset - 1] & 0x3F;
  431|     54|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 23, False: 31]
  ------------------
  432|     23|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 11, False: 12]
  ------------------
  433|     11|        return 1;
  434|     11|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     31|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 13, False: 18]
  ------------------
  438|     13|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 11, False: 2]
  ------------------
  439|     11|        return 1;
  440|     11|      }
  441|      2|      ans_.buf_offset = offset - 3;
  442|      2|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     18|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 18, False: 0]
  ------------------
  444|     18|      ans_.buf_offset = offset - 4;
  445|     18|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     18|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     65|    ans_.state += l_rans_base;
  450|     65|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     65|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 7, False: 58]
  ------------------
  451|      7|      return 1;
  452|      7|    }
  453|     58|    return 0;
  454|     65|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  75.1k|  inline int rans_read() {
  463|  75.1k|    unsigned rem;
  464|  75.1k|    unsigned quo;
  465|  75.1k|    struct rans_dec_sym sym;
  466|  75.9k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 65.6k, False: 10.2k]
  |  Branch (466:40): [True: 837, False: 64.8k]
  ------------------
  467|    837|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    837|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    837|    }
  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|  75.1k|    quo = ans_.state / rans_precision;
  472|  75.1k|    rem = ans_.state % rans_precision;
  473|  75.1k|    fetch_sym(&sym, rem);
  474|  75.1k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  75.1k|    return sym.val;
  476|  75.1k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  75.1k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  75.1k|    uint32_t symbol = lut_table_[rem];
  507|  75.1k|    out->val = symbol;
  508|  75.1k|    out->prob = probability_table_[symbol].prob;
  509|  75.1k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  75.1k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     58|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    361|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    221|                                       uint32_t num_symbols) {
  482|    221|    lut_table_.resize(rans_precision);
  483|    221|    probability_table_.resize(num_symbols);
  484|    221|    uint32_t cum_prob = 0;
  485|    221|    uint32_t act_prob = 0;
  486|  7.86k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 7.66k, False: 202]
  ------------------
  487|  7.66k|      probability_table_[i].prob = token_probs[i];
  488|  7.66k|      probability_table_[i].cum_prob = cum_prob;
  489|  7.66k|      cum_prob += token_probs[i];
  490|  7.66k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 19, False: 7.64k]
  ------------------
  491|     19|        return false;
  492|     19|      }
  493|  85.3M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 85.3M, False: 7.64k]
  ------------------
  494|  85.3M|        lut_table_[j] = i;
  495|  85.3M|      }
  496|  7.64k|      act_prob = cum_prob;
  497|  7.64k|    }
  498|    202|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 54, False: 148]
  ------------------
  499|     54|      return false;
  500|     54|    }
  501|    148|    return true;
  502|    202|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     93|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     93|    unsigned x;
  423|     93|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 87]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     87|    ans_.buf = buf;
  427|     87|    x = buf[offset - 1] >> 6;
  428|     87|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 21, False: 66]
  ------------------
  429|     21|      ans_.buf_offset = offset - 1;
  430|     21|      ans_.state = buf[offset - 1] & 0x3F;
  431|     66|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 23, False: 43]
  ------------------
  432|     23|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 4, False: 19]
  ------------------
  433|      4|        return 1;
  434|      4|      }
  435|     19|      ans_.buf_offset = offset - 2;
  436|     19|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     43|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 8, False: 35]
  ------------------
  438|      8|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 5]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|      5|      ans_.buf_offset = offset - 3;
  442|      5|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     35|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 35, False: 0]
  ------------------
  444|     35|      ans_.buf_offset = offset - 4;
  445|     35|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     35|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     80|    ans_.state += l_rans_base;
  450|     80|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     80|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 7, False: 73]
  ------------------
  451|      7|      return 1;
  452|      7|    }
  453|     73|    return 0;
  454|     80|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|  73.9k|  inline int rans_read() {
  463|  73.9k|    unsigned rem;
  464|  73.9k|    unsigned quo;
  465|  73.9k|    struct rans_dec_sym sym;
  466|  74.7k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 63.5k, False: 11.2k]
  |  Branch (466:40): [True: 819, False: 62.7k]
  ------------------
  467|    819|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    819|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    819|    }
  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|  73.9k|    quo = ans_.state / rans_precision;
  472|  73.9k|    rem = ans_.state % rans_precision;
  473|  73.9k|    fetch_sym(&sym, rem);
  474|  73.9k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  73.9k|    return sym.val;
  476|  73.9k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|  73.9k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  73.9k|    uint32_t symbol = lut_table_[rem];
  507|  73.9k|    out->val = symbol;
  508|  73.9k|    out->prob = probability_table_[symbol].prob;
  509|  73.9k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  73.9k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     73|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.65k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    996|                                       uint32_t num_symbols) {
  482|    996|    lut_table_.resize(rans_precision);
  483|    996|    probability_table_.resize(num_symbols);
  484|    996|    uint32_t cum_prob = 0;
  485|    996|    uint32_t act_prob = 0;
  486|  53.4k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 52.5k, False: 938]
  ------------------
  487|  52.5k|      probability_table_[i].prob = token_probs[i];
  488|  52.5k|      probability_table_[i].cum_prob = cum_prob;
  489|  52.5k|      cum_prob += token_probs[i];
  490|  52.5k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 58, False: 52.4k]
  ------------------
  491|     58|        return false;
  492|     58|      }
  493|   899M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 899M, False: 52.4k]
  ------------------
  494|   899M|        lut_table_[j] = i;
  495|   899M|      }
  496|  52.4k|      act_prob = cum_prob;
  497|  52.4k|    }
  498|    938|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 121, False: 817]
  ------------------
  499|    121|      return false;
  500|    121|    }
  501|    817|    return true;
  502|    938|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    492|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    492|    unsigned x;
  423|    492|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 55, False: 437]
  ------------------
  424|     55|      return 1;
  425|     55|    }
  426|    437|    ans_.buf = buf;
  427|    437|    x = buf[offset - 1] >> 6;
  428|    437|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 130, False: 307]
  ------------------
  429|    130|      ans_.buf_offset = offset - 1;
  430|    130|      ans_.state = buf[offset - 1] & 0x3F;
  431|    307|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 86, False: 221]
  ------------------
  432|     86|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 32, False: 54]
  ------------------
  433|     32|        return 1;
  434|     32|      }
  435|     54|      ans_.buf_offset = offset - 2;
  436|     54|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    221|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 88, False: 133]
  ------------------
  438|     88|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 33, False: 55]
  ------------------
  439|     33|        return 1;
  440|     33|      }
  441|     55|      ans_.buf_offset = offset - 3;
  442|     55|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    133|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 133, False: 0]
  ------------------
  444|    133|      ans_.buf_offset = offset - 4;
  445|    133|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    133|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    372|    ans_.state += l_rans_base;
  450|    372|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    372|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 59, False: 313]
  ------------------
  451|     59|      return 1;
  452|     59|    }
  453|    313|    return 0;
  454|    372|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|   871k|  inline int rans_read() {
  463|   871k|    unsigned rem;
  464|   871k|    unsigned quo;
  465|   871k|    struct rans_dec_sym sym;
  466|   876k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 633k, False: 243k]
  |  Branch (466:40): [True: 4.56k, False: 628k]
  ------------------
  467|  4.56k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.56k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  4.56k|    }
  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|   871k|    quo = ans_.state / rans_precision;
  472|   871k|    rem = ans_.state % rans_precision;
  473|   871k|    fetch_sym(&sym, rem);
  474|   871k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   871k|    return sym.val;
  476|   871k|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|   871k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   871k|    uint32_t symbol = lut_table_[rem];
  507|   871k|    out->val = symbol;
  508|   871k|    out->prob = probability_table_[symbol].prob;
  509|   871k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   871k|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    313|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.24k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.24k|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.24k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.24k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.24k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.24k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.24k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 134, False: 1.11k]
  ------------------
   67|    134|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 9, False: 125]
  ------------------
   68|      9|      return false;
   69|      9|    }
   70|       |
   71|    134|  } else
   72|  1.11k|#endif
   73|  1.11k|  {
   74|  1.11k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 43, False: 1.06k]
  ------------------
   75|     43|      return false;
   76|     43|    }
   77|  1.11k|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|  1.19k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 109, False: 1.08k]
  ------------------
   83|    109|    return false;
   84|    109|  }
   85|  1.08k|  probability_table_.resize(num_symbols_);
   86|  1.08k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 336, False: 747]
  ------------------
   87|    336|    return true;
   88|    336|  }
   89|       |  // Decode the table.
   90|   517k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 516k, False: 459]
  ------------------
   91|   516k|    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|   516k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 76, False: 516k]
  ------------------
   95|     76|      return false;
   96|     76|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   516k|    const int token = prob_data & 3;
  102|   516k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.94k, False: 509k]
  ------------------
  103|  6.94k|      const uint32_t offset = prob_data >> 2;
  104|  6.94k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 190, False: 6.75k]
  ------------------
  105|    190|        return false;
  106|    190|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   265k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 258k, False: 6.75k]
  ------------------
  109|   258k|        probability_table_[i + j] = 0;
  110|   258k|      }
  111|  6.75k|      i += offset;
  112|   509k|    } else {
  113|   509k|      const int extra_bytes = token;
  114|   509k|      uint32_t prob = prob_data >> 2;
  115|   521k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 11.8k, False: 509k]
  ------------------
  116|  11.8k|        uint8_t eb;
  117|  11.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 11.7k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  11.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  11.7k|      }
  124|   509k|      probability_table_[i] = prob;
  125|   509k|    }
  126|   516k|  }
  127|    459|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 128, False: 331]
  ------------------
  128|    128|    return false;
  129|    128|  }
  130|    331|  return true;
  131|    459|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    623|    DecoderBuffer *buffer) {
  136|    623|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    623|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    623|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    623|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 55, False: 568]
  ------------------
  140|     55|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 5, False: 50]
  ------------------
  141|      5|      return false;
  142|      5|    }
  143|       |
  144|     55|  } else
  145|    568|#endif
  146|    568|  {
  147|    568|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 15, False: 553]
  ------------------
  148|     15|      return false;
  149|     15|    }
  150|    568|  }
  151|    603|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 84, False: 519]
  ------------------
  152|     84|    return false;
  153|     84|  }
  154|    519|  const uint8_t *const data_head =
  155|    519|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    519|  buffer->Advance(bytes_encoded);
  158|    519|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 149, False: 370]
  ------------------
  159|    149|    return false;
  160|    149|  }
  161|    370|  return true;
  162|    519|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    423|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  13.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    304|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    304|  ans_.read_end();
  167|    304|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    590|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    590|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    590|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 590]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    590|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    590|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    590|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 62, False: 528]
  ------------------
   67|     62|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 7, False: 55]
  ------------------
   68|      7|      return false;
   69|      7|    }
   70|       |
   71|     62|  } else
   72|    528|#endif
   73|    528|  {
   74|    528|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 12, False: 516]
  ------------------
   75|     12|      return false;
   76|     12|    }
   77|    528|  }
   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|    571|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 51, False: 520]
  ------------------
   83|     51|    return false;
   84|     51|  }
   85|    520|  probability_table_.resize(num_symbols_);
   86|    520|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 36, False: 484]
  ------------------
   87|     36|    return true;
   88|     36|  }
   89|       |  // Decode the table.
   90|  1.28M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.28M, False: 318]
  ------------------
   91|  1.28M|    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.28M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 57, False: 1.28M]
  ------------------
   95|     57|      return false;
   96|     57|    }
   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.28M|    const int token = prob_data & 3;
  102|  1.28M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 867k, False: 417k]
  ------------------
  103|   867k|      const uint32_t offset = prob_data >> 2;
  104|   867k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 78, False: 867k]
  ------------------
  105|     78|        return false;
  106|     78|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  45.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 45.0M, False: 867k]
  ------------------
  109|  45.0M|        probability_table_[i + j] = 0;
  110|  45.0M|      }
  111|   867k|      i += offset;
  112|   867k|    } else {
  113|   417k|      const int extra_bytes = token;
  114|   417k|      uint32_t prob = prob_data >> 2;
  115|   718k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 301k, False: 417k]
  ------------------
  116|   301k|        uint8_t eb;
  117|   301k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 31, False: 301k]
  ------------------
  118|     31|          return false;
  119|     31|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   301k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   301k|      }
  124|   417k|      probability_table_[i] = prob;
  125|   417k|    }
  126|  1.28M|  }
  127|    318|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 150, False: 168]
  ------------------
  128|    150|    return false;
  129|    150|  }
  130|    168|  return true;
  131|    318|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    204|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    168|    DecoderBuffer *buffer) {
  136|    168|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    168|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    168|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    168|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 164]
  ------------------
  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|    164|#endif
  146|    164|  {
  147|    164|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 11, False: 153]
  ------------------
  148|     11|      return false;
  149|     11|    }
  150|    164|  }
  151|    157|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 24, False: 133]
  ------------------
  152|     24|    return false;
  153|     24|  }
  154|    133|  const uint8_t *const data_head =
  155|    133|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    133|  buffer->Advance(bytes_encoded);
  158|    133|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 30, False: 103]
  ------------------
  159|     30|    return false;
  160|     30|  }
  161|    103|  return true;
  162|    133|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  13.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    103|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    103|  ans_.read_end();
  167|    103|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    495|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    495|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    495|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 495]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    495|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    495|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    495|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 48, False: 447]
  ------------------
   67|     48|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 48]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     48|  } else
   72|    447|#endif
   73|    447|  {
   74|    447|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 12, False: 435]
  ------------------
   75|     12|      return false;
   76|     12|    }
   77|    447|  }
   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|    483|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 37, False: 446]
  ------------------
   83|     37|    return false;
   84|     37|  }
   85|    446|  probability_table_.resize(num_symbols_);
   86|    446|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 436]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|   960k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 959k, False: 297]
  ------------------
   91|   959k|    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|   959k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 39, False: 959k]
  ------------------
   95|     39|      return false;
   96|     39|    }
   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|   959k|    const int token = prob_data & 3;
  102|   959k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 732k, False: 227k]
  ------------------
  103|   732k|      const uint32_t offset = prob_data >> 2;
  104|   732k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 62, False: 732k]
  ------------------
  105|     62|        return false;
  106|     62|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  19.6M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 18.9M, False: 732k]
  ------------------
  109|  18.9M|        probability_table_[i + j] = 0;
  110|  18.9M|      }
  111|   732k|      i += offset;
  112|   732k|    } else {
  113|   227k|      const int extra_bytes = token;
  114|   227k|      uint32_t prob = prob_data >> 2;
  115|   399k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 172k, False: 227k]
  ------------------
  116|   172k|        uint8_t eb;
  117|   172k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 38, False: 172k]
  ------------------
  118|     38|          return false;
  119|     38|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   172k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   172k|      }
  124|   227k|      probability_table_[i] = prob;
  125|   227k|    }
  126|   959k|  }
  127|    297|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 42, False: 255]
  ------------------
  128|     42|    return false;
  129|     42|  }
  130|    255|  return true;
  131|    297|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    265|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    255|    DecoderBuffer *buffer) {
  136|    255|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    255|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    255|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    255|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 15, False: 240]
  ------------------
  140|     15|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 15]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     15|  } else
  145|    240|#endif
  146|    240|  {
  147|    240|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 237]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    240|  }
  151|    252|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 47, False: 205]
  ------------------
  152|     47|    return false;
  153|     47|  }
  154|    205|  const uint8_t *const data_head =
  155|    205|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    205|  buffer->Advance(bytes_encoded);
  158|    205|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 36, False: 169]
  ------------------
  159|     36|    return false;
  160|     36|  }
  161|    169|  return true;
  162|    205|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  2.66M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    169|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    169|  ans_.read_end();
  167|    169|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    515|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    515|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    515|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 515]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    515|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    515|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    515|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 93, False: 422]
  ------------------
   67|     93|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 92]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     93|  } else
   72|    422|#endif
   73|    422|  {
   74|    422|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 416]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    422|  }
   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|    508|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 22, False: 486]
  ------------------
   83|     22|    return false;
   84|     22|  }
   85|    486|  probability_table_.resize(num_symbols_);
   86|    486|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 473]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|  73.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 73.3k, False: 361]
  ------------------
   91|  73.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  73.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 51, False: 73.2k]
  ------------------
   95|     51|      return false;
   96|     51|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  73.2k|    const int token = prob_data & 3;
  102|  73.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 20.2k, False: 53.0k]
  ------------------
  103|  20.2k|      const uint32_t offset = prob_data >> 2;
  104|  20.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 41, False: 20.1k]
  ------------------
  105|     41|        return false;
  106|     41|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   795k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 775k, False: 20.1k]
  ------------------
  109|   775k|        probability_table_[i + j] = 0;
  110|   775k|      }
  111|  20.1k|      i += offset;
  112|  53.0k|    } else {
  113|  53.0k|      const int extra_bytes = token;
  114|  53.0k|      uint32_t prob = prob_data >> 2;
  115|  98.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 45.5k, False: 53.0k]
  ------------------
  116|  45.5k|        uint8_t eb;
  117|  45.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 45.5k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  45.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  45.5k|      }
  124|  53.0k|      probability_table_[i] = prob;
  125|  53.0k|    }
  126|  73.2k|  }
  127|    361|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 39, False: 322]
  ------------------
  128|     39|    return false;
  129|     39|  }
  130|    322|  return true;
  131|    361|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    335|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    322|    DecoderBuffer *buffer) {
  136|    322|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    322|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    322|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    322|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 68, False: 254]
  ------------------
  140|     68|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 68]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     68|  } else
  145|    254|#endif
  146|    254|  {
  147|    254|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 15, False: 239]
  ------------------
  148|     15|      return false;
  149|     15|    }
  150|    254|  }
  151|    307|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 112, False: 195]
  ------------------
  152|    112|    return false;
  153|    112|  }
  154|    195|  const uint8_t *const data_head =
  155|    195|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    195|  buffer->Advance(bytes_encoded);
  158|    195|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 61, False: 134]
  ------------------
  159|     61|    return false;
  160|     61|  }
  161|    134|  return true;
  162|    195|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  7.44M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    134|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    134|  ans_.read_end();
  167|    134|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    368|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    368|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    368|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 368]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    368|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    368|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    368|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 8, False: 360]
  ------------------
   67|      8|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 8]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      8|  } else
   72|    360|#endif
   73|    360|  {
   74|    360|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 353]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    360|  }
   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|    361|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 17, False: 344]
  ------------------
   83|     17|    return false;
   84|     17|  }
   85|    344|  probability_table_.resize(num_symbols_);
   86|    344|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 331]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|   378k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 378k, False: 243]
  ------------------
   91|   378k|    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|   378k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 45, False: 377k]
  ------------------
   95|     45|      return false;
   96|     45|    }
   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|   377k|    const int token = prob_data & 3;
  102|   377k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 369k, False: 8.63k]
  ------------------
  103|   369k|      const uint32_t offset = prob_data >> 2;
  104|   369k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 369k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  21.3M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 20.9M, False: 369k]
  ------------------
  109|  20.9M|        probability_table_[i + j] = 0;
  110|  20.9M|      }
  111|   369k|      i += offset;
  112|   369k|    } else {
  113|  8.63k|      const int extra_bytes = token;
  114|  8.63k|      uint32_t prob = prob_data >> 2;
  115|  14.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.40k, False: 8.61k]
  ------------------
  116|  5.40k|        uint8_t eb;
  117|  5.40k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 5.38k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.38k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.38k|      }
  124|  8.61k|      probability_table_[i] = prob;
  125|  8.61k|    }
  126|   377k|  }
  127|    243|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 220]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    220|  return true;
  131|    243|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    233|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    220|    DecoderBuffer *buffer) {
  136|    220|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    220|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    220|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    220|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 218]
  ------------------
  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|    218|#endif
  146|    218|  {
  147|    218|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 213]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    218|  }
  151|    215|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 12, False: 203]
  ------------------
  152|     12|    return false;
  153|     12|  }
  154|    203|  const uint8_t *const data_head =
  155|    203|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    203|  buffer->Advance(bytes_encoded);
  158|    203|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 44, False: 159]
  ------------------
  159|     44|    return false;
  160|     44|  }
  161|    159|  return true;
  162|    203|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  8.84M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    159|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    159|  ans_.read_end();
  167|    159|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    358|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    358|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    358|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 358]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    358|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    358|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    358|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 74, False: 284]
  ------------------
   67|     74|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 74]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     74|  } else
   72|    284|#endif
   73|    284|  {
   74|    284|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 279]
  ------------------
   75|      5|      return false;
   76|      5|    }
   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|    353|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 27, False: 326]
  ------------------
   83|     27|    return false;
   84|     27|  }
   85|    326|  probability_table_.resize(num_symbols_);
   86|    326|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 319]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  12.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 12.6k, False: 239]
  ------------------
   91|  12.6k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  12.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 34, False: 12.6k]
  ------------------
   95|     34|      return false;
   96|     34|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  12.6k|    const int token = prob_data & 3;
  102|  12.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.01k, False: 7.62k]
  ------------------
  103|  5.01k|      const uint32_t offset = prob_data >> 2;
  104|  5.01k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 23, False: 4.99k]
  ------------------
  105|     23|        return false;
  106|     23|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   210k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 205k, False: 4.99k]
  ------------------
  109|   205k|        probability_table_[i + j] = 0;
  110|   205k|      }
  111|  4.99k|      i += offset;
  112|  7.62k|    } else {
  113|  7.62k|      const int extra_bytes = token;
  114|  7.62k|      uint32_t prob = prob_data >> 2;
  115|  12.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.95k, False: 7.60k]
  ------------------
  116|  4.95k|        uint8_t eb;
  117|  4.95k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 4.92k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.92k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.92k|      }
  124|  7.60k|      probability_table_[i] = prob;
  125|  7.60k|    }
  126|  12.6k|  }
  127|    239|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 18, False: 221]
  ------------------
  128|     18|    return false;
  129|     18|  }
  130|    221|  return true;
  131|    239|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    228|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    221|    DecoderBuffer *buffer) {
  136|    221|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    221|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    221|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    221|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 54, False: 167]
  ------------------
  140|     54|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 52]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     54|  } else
  145|    167|#endif
  146|    167|  {
  147|    167|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 164]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    167|  }
  151|    216|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 72, False: 144]
  ------------------
  152|     72|    return false;
  153|     72|  }
  154|    144|  const uint8_t *const data_head =
  155|    144|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    144|  buffer->Advance(bytes_encoded);
  158|    144|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 111]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|    111|  return true;
  162|    144|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  4.04M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    111|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    111|  ans_.read_end();
  167|    111|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    357|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    357|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    357|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 357]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    357|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    357|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    357|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 54, False: 303]
  ------------------
   67|     54|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 54]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     54|  } else
   72|    303|#endif
   73|    303|  {
   74|    303|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 299]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    303|  }
   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|    353|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 344]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    344|  probability_table_.resize(num_symbols_);
   86|    344|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 339]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|  1.38M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.38M, False: 231]
  ------------------
   91|  1.38M|    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.38M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 47, False: 1.38M]
  ------------------
   95|     47|      return false;
   96|     47|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.38M|    const int token = prob_data & 3;
  102|  1.38M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 425k, False: 962k]
  ------------------
  103|   425k|      const uint32_t offset = prob_data >> 2;
  104|   425k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 425k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  18.6M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 18.2M, False: 425k]
  ------------------
  109|  18.2M|        probability_table_[i + j] = 0;
  110|  18.2M|      }
  111|   425k|      i += offset;
  112|   962k|    } else {
  113|   962k|      const int extra_bytes = token;
  114|   962k|      uint32_t prob = prob_data >> 2;
  115|  1.55M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 595k, False: 962k]
  ------------------
  116|   595k|        uint8_t eb;
  117|   595k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 594k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   594k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   594k|      }
  124|   962k|      probability_table_[i] = prob;
  125|   962k|    }
  126|  1.38M|  }
  127|    231|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 211]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|    211|  return true;
  131|    231|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    216|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    211|    DecoderBuffer *buffer) {
  136|    211|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    211|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    211|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    211|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 38, False: 173]
  ------------------
  140|     38|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 35]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     38|  } else
  145|    173|#endif
  146|    173|  {
  147|    173|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 164]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    173|  }
  151|    199|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 54, False: 145]
  ------------------
  152|     54|    return false;
  153|     54|  }
  154|    145|  const uint8_t *const data_head =
  155|    145|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    145|  buffer->Advance(bytes_encoded);
  158|    145|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 39, False: 106]
  ------------------
  159|     39|    return false;
  160|     39|  }
  161|    106|  return true;
  162|    145|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  18.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    106|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    106|  ans_.read_end();
  167|    106|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    386|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    386|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    386|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 386]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    386|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    386|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    386|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 73, False: 313]
  ------------------
   67|     73|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 71]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     73|  } else
   72|    313|#endif
   73|    313|  {
   74|    313|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 303]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    313|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    374|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 23, False: 351]
  ------------------
   83|     23|    return false;
   84|     23|  }
   85|    351|  probability_table_.resize(num_symbols_);
   86|    351|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 339]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|   697k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 697k, False: 242]
  ------------------
   91|   697k|    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|   697k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 42, False: 697k]
  ------------------
   95|     42|      return false;
   96|     42|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   697k|    const int token = prob_data & 3;
  102|   697k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 177k, False: 519k]
  ------------------
  103|   177k|      const uint32_t offset = prob_data >> 2;
  104|   177k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 177k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  9.02M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.84M, False: 177k]
  ------------------
  109|  8.84M|        probability_table_[i + j] = 0;
  110|  8.84M|      }
  111|   177k|      i += offset;
  112|   519k|    } else {
  113|   519k|      const int extra_bytes = token;
  114|   519k|      uint32_t prob = prob_data >> 2;
  115|   694k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 175k, False: 519k]
  ------------------
  116|   175k|        uint8_t eb;
  117|   175k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 175k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   175k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   175k|      }
  124|   519k|      probability_table_[i] = prob;
  125|   519k|    }
  126|   697k|  }
  127|    242|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 22, False: 220]
  ------------------
  128|     22|    return false;
  129|     22|  }
  130|    220|  return true;
  131|    242|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    232|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    220|    DecoderBuffer *buffer) {
  136|    220|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    220|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    220|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    220|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 36, False: 184]
  ------------------
  140|     36|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 36]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     36|  } else
  145|    184|#endif
  146|    184|  {
  147|    184|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 184]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    184|  }
  151|    220|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 73, False: 147]
  ------------------
  152|     73|    return false;
  153|     73|  }
  154|    147|  const uint8_t *const data_head =
  155|    147|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    147|  buffer->Advance(bytes_encoded);
  158|    147|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 40, False: 107]
  ------------------
  159|     40|    return false;
  160|     40|  }
  161|    107|  return true;
  162|    147|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  20.0M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|    107|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    107|  ans_.read_end();
  167|    107|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    456|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    456|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    456|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 456]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    456|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    456|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    456|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 33, False: 423]
  ------------------
   67|     33|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 33]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     33|  } else
   72|    423|#endif
   73|    423|  {
   74|    423|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 414]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    423|  }
   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|    447|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 426]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    426|  probability_table_.resize(num_symbols_);
   86|    426|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 413]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|  60.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 59.9k, False: 335]
  ------------------
   91|  59.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|  59.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 27, False: 59.8k]
  ------------------
   95|     27|      return false;
   96|     27|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  59.8k|    const int token = prob_data & 3;
  102|  59.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 12.8k, False: 47.0k]
  ------------------
  103|  12.8k|      const uint32_t offset = prob_data >> 2;
  104|  12.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 12.8k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   442k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 430k, False: 12.8k]
  ------------------
  109|   430k|        probability_table_[i + j] = 0;
  110|   430k|      }
  111|  12.8k|      i += offset;
  112|  47.0k|    } else {
  113|  47.0k|      const int extra_bytes = token;
  114|  47.0k|      uint32_t prob = prob_data >> 2;
  115|  81.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 34.7k, False: 47.0k]
  ------------------
  116|  34.7k|        uint8_t eb;
  117|  34.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 34.7k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  34.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  34.7k|      }
  124|  47.0k|      probability_table_[i] = prob;
  125|  47.0k|    }
  126|  59.8k|  }
  127|    335|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 54, False: 281]
  ------------------
  128|     54|    return false;
  129|     54|  }
  130|    281|  return true;
  131|    335|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    294|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    281|    DecoderBuffer *buffer) {
  136|    281|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    281|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    281|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    281|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 272]
  ------------------
  140|      9|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 8]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      9|  } else
  145|    272|#endif
  146|    272|  {
  147|    272|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 270]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    272|  }
  151|    278|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 62, False: 216]
  ------------------
  152|     62|    return false;
  153|     62|  }
  154|    216|  const uint8_t *const data_head =
  155|    216|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    216|  buffer->Advance(bytes_encoded);
  158|    216|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 50, False: 166]
  ------------------
  159|     50|    return false;
  160|     50|  }
  161|    166|  return true;
  162|    216|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  9.42M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|    166|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    166|  ans_.read_end();
  167|    166|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    397|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    397|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    397|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 397]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    397|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    397|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    397|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 39, False: 358]
  ------------------
   67|     39|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 38]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     39|  } else
   72|    358|#endif
   73|    358|  {
   74|    358|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 348]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    358|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    386|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 374]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    374|  probability_table_.resize(num_symbols_);
   86|    374|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 370]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  92.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 92.2k, False: 270]
  ------------------
   91|  92.2k|    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|  92.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 48, False: 92.2k]
  ------------------
   95|     48|      return false;
   96|     48|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  92.2k|    const int token = prob_data & 3;
  102|  92.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 13.4k, False: 78.7k]
  ------------------
  103|  13.4k|      const uint32_t offset = prob_data >> 2;
  104|  13.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 35, False: 13.4k]
  ------------------
  105|     35|        return false;
  106|     35|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   393k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 379k, False: 13.4k]
  ------------------
  109|   379k|        probability_table_[i + j] = 0;
  110|   379k|      }
  111|  13.4k|      i += offset;
  112|  78.7k|    } else {
  113|  78.7k|      const int extra_bytes = token;
  114|  78.7k|      uint32_t prob = prob_data >> 2;
  115|   158k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 80.1k, False: 78.7k]
  ------------------
  116|  80.1k|        uint8_t eb;
  117|  80.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 80.1k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  80.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  80.1k|      }
  124|  78.7k|      probability_table_[i] = prob;
  125|  78.7k|    }
  126|  92.2k|  }
  127|    270|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 71, False: 199]
  ------------------
  128|     71|    return false;
  129|     71|  }
  130|    199|  return true;
  131|    270|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    203|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    199|    DecoderBuffer *buffer) {
  136|    199|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    199|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    199|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    199|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 23, False: 176]
  ------------------
  140|     23|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 22]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     23|  } else
  145|    176|#endif
  146|    176|  {
  147|    176|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 173]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    176|  }
  151|    195|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 65, False: 130]
  ------------------
  152|     65|    return false;
  153|     65|  }
  154|    130|  const uint8_t *const data_head =
  155|    130|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    130|  buffer->Advance(bytes_encoded);
  158|    130|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 64, False: 66]
  ------------------
  159|     64|    return false;
  160|     64|  }
  161|     66|  return true;
  162|    130|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   539k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     66|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     66|  ans_.read_end();
  167|     66|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    354|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    354|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    354|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 354]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    354|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    354|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    354|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 30, False: 324]
  ------------------
   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|    324|#endif
   73|    324|  {
   74|    324|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 12, False: 312]
  ------------------
   75|     12|      return false;
   76|     12|    }
   77|    324|  }
   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|    342|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 26, False: 316]
  ------------------
   83|     26|    return false;
   84|     26|  }
   85|    316|  probability_table_.resize(num_symbols_);
   86|    316|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 305]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|   108k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 108k, False: 211]
  ------------------
   91|   108k|    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|   108k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 43, False: 108k]
  ------------------
   95|     43|      return false;
   96|     43|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   108k|    const int token = prob_data & 3;
  102|   108k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 32.8k, False: 75.6k]
  ------------------
  103|  32.8k|      const uint32_t offset = prob_data >> 2;
  104|  32.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 39, False: 32.8k]
  ------------------
  105|     39|        return false;
  106|     39|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.57M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.54M, False: 32.8k]
  ------------------
  109|  1.54M|        probability_table_[i + j] = 0;
  110|  1.54M|      }
  111|  32.8k|      i += offset;
  112|  75.6k|    } else {
  113|  75.6k|      const int extra_bytes = token;
  114|  75.6k|      uint32_t prob = prob_data >> 2;
  115|   132k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 56.7k, False: 75.6k]
  ------------------
  116|  56.7k|        uint8_t eb;
  117|  56.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 56.6k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  56.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  56.6k|      }
  124|  75.6k|      probability_table_[i] = prob;
  125|  75.6k|    }
  126|   108k|  }
  127|    211|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 78, False: 133]
  ------------------
  128|     78|    return false;
  129|     78|  }
  130|    133|  return true;
  131|    211|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    144|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    133|    DecoderBuffer *buffer) {
  136|    133|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    133|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    133|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    133|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 133]
  ------------------
  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|    133|#endif
  146|    133|  {
  147|    133|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 123]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    133|  }
  151|    123|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 42, False: 81]
  ------------------
  152|     42|    return false;
  153|     42|  }
  154|     81|  const uint8_t *const data_head =
  155|     81|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     81|  buffer->Advance(bytes_encoded);
  158|     81|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 21, False: 60]
  ------------------
  159|     21|    return false;
  160|     21|  }
  161|     60|  return true;
  162|     81|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   382k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     60|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     60|  ans_.read_end();
  167|     60|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    366|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    366|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    366|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 366]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    366|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    366|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    366|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 48, False: 318]
  ------------------
   67|     48|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 48]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     48|  } else
   72|    318|#endif
   73|    318|  {
   74|    318|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 309]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    318|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    357|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 346]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    346|  probability_table_.resize(num_symbols_);
   86|    346|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 340]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|   315k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 314k, False: 221]
  ------------------
   91|   314k|    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|   314k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 48, False: 314k]
  ------------------
   95|     48|      return false;
   96|     48|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   314k|    const int token = prob_data & 3;
  102|   314k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 40.9k, False: 273k]
  ------------------
  103|  40.9k|      const uint32_t offset = prob_data >> 2;
  104|  40.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 44, False: 40.8k]
  ------------------
  105|     44|        return false;
  106|     44|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.36M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.32M, False: 40.8k]
  ------------------
  109|  1.32M|        probability_table_[i + j] = 0;
  110|  1.32M|      }
  111|  40.8k|      i += offset;
  112|   273k|    } else {
  113|   273k|      const int extra_bytes = token;
  114|   273k|      uint32_t prob = prob_data >> 2;
  115|   512k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 238k, False: 273k]
  ------------------
  116|   238k|        uint8_t eb;
  117|   238k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 238k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  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|   273k|      probability_table_[i] = prob;
  125|   273k|    }
  126|   314k|  }
  127|    221|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 63, False: 158]
  ------------------
  128|     63|    return false;
  129|     63|  }
  130|    158|  return true;
  131|    221|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    164|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    158|    DecoderBuffer *buffer) {
  136|    158|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    158|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    158|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    158|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 29, False: 129]
  ------------------
  140|     29|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 27]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     29|  } else
  145|    129|#endif
  146|    129|  {
  147|    129|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 127]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    129|  }
  151|    154|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 64, False: 90]
  ------------------
  152|     64|    return false;
  153|     64|  }
  154|     90|  const uint8_t *const data_head =
  155|     90|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     90|  buffer->Advance(bytes_encoded);
  158|     90|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 32, False: 58]
  ------------------
  159|     32|    return false;
  160|     32|  }
  161|     58|  return true;
  162|     90|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  75.1k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    361|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    361|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    361|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 361]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    361|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    361|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    361|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 23, False: 338]
  ------------------
   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|    338|#endif
   73|    338|  {
   74|    338|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 332]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    338|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    355|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 340]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    340|  probability_table_.resize(num_symbols_);
   86|    340|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 330]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|   730k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 730k, False: 221]
  ------------------
   91|   730k|    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|   730k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 49, False: 730k]
  ------------------
   95|     49|      return false;
   96|     49|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   730k|    const int token = prob_data & 3;
  102|   730k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 408k, False: 321k]
  ------------------
  103|   408k|      const uint32_t offset = prob_data >> 2;
  104|   408k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 44, False: 408k]
  ------------------
  105|     44|        return false;
  106|     44|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  23.2M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 22.8M, False: 408k]
  ------------------
  109|  22.8M|        probability_table_[i + j] = 0;
  110|  22.8M|      }
  111|   408k|      i += offset;
  112|   408k|    } else {
  113|   321k|      const int extra_bytes = token;
  114|   321k|      uint32_t prob = prob_data >> 2;
  115|   418k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 96.3k, False: 321k]
  ------------------
  116|  96.3k|        uint8_t eb;
  117|  96.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 96.2k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  96.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  96.2k|      }
  124|   321k|      probability_table_[i] = prob;
  125|   321k|    }
  126|   730k|  }
  127|    221|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 73, False: 148]
  ------------------
  128|     73|    return false;
  129|     73|  }
  130|    148|  return true;
  131|    221|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    158|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    148|    DecoderBuffer *buffer) {
  136|    148|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    148|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    148|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    148|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 148]
  ------------------
  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|    148|#endif
  146|    148|  {
  147|    148|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 148]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    148|  }
  151|    148|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 55, False: 93]
  ------------------
  152|     55|    return false;
  153|     55|  }
  154|     93|  const uint8_t *const data_head =
  155|     93|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     93|  buffer->Advance(bytes_encoded);
  158|     93|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 20, False: 73]
  ------------------
  159|     20|    return false;
  160|     20|  }
  161|     73|  return true;
  162|     93|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|  73.9k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     73|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     73|  ans_.read_end();
  167|     73|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    327|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    327|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    327|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 327]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    327|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    327|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    327|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 30, False: 297]
  ------------------
   67|     30|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 29]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     30|  } else
   72|    297|#endif
   73|    297|  {
   74|    297|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 292]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    297|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    321|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 313]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|    313|  probability_table_.resize(num_symbols_);
   86|    313|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 302]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|   537k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 537k, False: 202]
  ------------------
   91|   537k|    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|   537k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 41, False: 536k]
  ------------------
   95|     41|      return false;
   96|     41|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   536k|    const int token = prob_data & 3;
  102|   536k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 416k, False: 120k]
  ------------------
  103|   416k|      const uint32_t offset = prob_data >> 2;
  104|   416k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 416k]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  17.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 17.2M, False: 416k]
  ------------------
  109|  17.2M|        probability_table_[i + j] = 0;
  110|  17.2M|      }
  111|   416k|      i += offset;
  112|   416k|    } else {
  113|   120k|      const int extra_bytes = token;
  114|   120k|      uint32_t prob = prob_data >> 2;
  115|   202k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 82.7k, False: 120k]
  ------------------
  116|  82.7k|        uint8_t eb;
  117|  82.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 82.7k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  82.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  82.7k|      }
  124|   120k|      probability_table_[i] = prob;
  125|   120k|    }
  126|   536k|  }
  127|    202|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 33, False: 169]
  ------------------
  128|     33|    return false;
  129|     33|  }
  130|    169|  return true;
  131|    202|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    180|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    169|    DecoderBuffer *buffer) {
  136|    169|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    169|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    169|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    169|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 14, False: 155]
  ------------------
  140|     14|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 13]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     14|  } else
  145|    155|#endif
  146|    155|  {
  147|    155|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 11, False: 144]
  ------------------
  148|     11|      return false;
  149|     11|    }
  150|    155|  }
  151|    157|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 56, False: 101]
  ------------------
  152|     56|    return false;
  153|     56|  }
  154|    101|  const uint8_t *const data_head =
  155|    101|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    101|  buffer->Advance(bytes_encoded);
  158|    101|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 63]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|     63|  return true;
  162|    101|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  73.5k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     63|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     63|  ans_.read_end();
  167|     63|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    368|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    368|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    368|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 368]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    368|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    368|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    368|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 85, False: 283]
  ------------------
   67|     85|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 5, False: 80]
  ------------------
   68|      5|      return false;
   69|      5|    }
   70|       |
   71|     85|  } else
   72|    283|#endif
   73|    283|  {
   74|    283|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 279]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    283|  }
   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|    359|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 27, False: 332]
  ------------------
   83|     27|    return false;
   84|     27|  }
   85|    332|  probability_table_.resize(num_symbols_);
   86|    332|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 325]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  2.78M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.78M, False: 225]
  ------------------
   91|  2.78M|    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.78M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 53, False: 2.78M]
  ------------------
   95|     53|      return false;
   96|     53|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  2.78M|    const int token = prob_data & 3;
  102|  2.78M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.51M, False: 270k]
  ------------------
  103|  2.51M|      const uint32_t offset = prob_data >> 2;
  104|  2.51M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 2.51M]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   147M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 145M, False: 2.51M]
  ------------------
  109|   145M|        probability_table_[i + j] = 0;
  110|   145M|      }
  111|  2.51M|      i += offset;
  112|  2.51M|    } else {
  113|   270k|      const int extra_bytes = token;
  114|   270k|      uint32_t prob = prob_data >> 2;
  115|   461k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 190k, False: 270k]
  ------------------
  116|   190k|        uint8_t eb;
  117|   190k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 190k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   190k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   190k|      }
  124|   270k|      probability_table_[i] = prob;
  125|   270k|    }
  126|  2.78M|  }
  127|    225|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 35, False: 190]
  ------------------
  128|     35|    return false;
  129|     35|  }
  130|    190|  return true;
  131|    225|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    197|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    190|    DecoderBuffer *buffer) {
  136|    190|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    190|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    190|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    190|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 44, False: 146]
  ------------------
  140|     44|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 42]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     44|  } else
  145|    146|#endif
  146|    146|  {
  147|    146|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 141]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    146|  }
  151|    183|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 67, False: 116]
  ------------------
  152|     67|    return false;
  153|     67|  }
  154|    116|  const uint8_t *const data_head =
  155|    116|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    116|  buffer->Advance(bytes_encoded);
  158|    116|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 44, False: 72]
  ------------------
  159|     44|    return false;
  160|     44|  }
  161|     72|  return true;
  162|    116|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|   265k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     72|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     72|  ans_.read_end();
  167|     72|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    326|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    326|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    326|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 326]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    326|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    326|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    326|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 27, False: 299]
  ------------------
   67|     27|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 26]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     27|  } else
   72|    299|#endif
   73|    299|  {
   74|    299|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 12, False: 287]
  ------------------
   75|     12|      return false;
   76|     12|    }
   77|    299|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    313|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 300]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    300|  probability_table_.resize(num_symbols_);
   86|    300|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 16, False: 284]
  ------------------
   87|     16|    return true;
   88|     16|  }
   89|       |  // Decode the table.
   90|   442k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 442k, False: 190]
  ------------------
   91|   442k|    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|   442k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 46, False: 442k]
  ------------------
   95|     46|      return false;
   96|     46|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   442k|    const int token = prob_data & 3;
  102|   442k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 70.1k, False: 372k]
  ------------------
  103|  70.1k|      const uint32_t offset = prob_data >> 2;
  104|  70.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 70.1k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.33M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.26M, False: 70.1k]
  ------------------
  109|  2.26M|        probability_table_[i + j] = 0;
  110|  2.26M|      }
  111|  70.1k|      i += offset;
  112|   372k|    } else {
  113|   372k|      const int extra_bytes = token;
  114|   372k|      uint32_t prob = prob_data >> 2;
  115|   689k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 317k, False: 371k]
  ------------------
  116|   317k|        uint8_t eb;
  117|   317k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 24, False: 317k]
  ------------------
  118|     24|          return false;
  119|     24|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   317k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   317k|      }
  124|   371k|      probability_table_[i] = prob;
  125|   371k|    }
  126|   442k|  }
  127|    190|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 38, False: 152]
  ------------------
  128|     38|    return false;
  129|     38|  }
  130|    152|  return true;
  131|    190|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    168|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    152|    DecoderBuffer *buffer) {
  136|    152|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    152|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    152|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    152|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 145]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 6]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      7|  } else
  145|    145|#endif
  146|    145|  {
  147|    145|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 145]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    145|  }
  151|    151|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 51, False: 100]
  ------------------
  152|     51|    return false;
  153|     51|  }
  154|    100|  const uint8_t *const data_head =
  155|    100|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    100|  buffer->Advance(bytes_encoded);
  158|    100|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 39, False: 61]
  ------------------
  159|     39|    return false;
  160|     39|  }
  161|     61|  return true;
  162|    100|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|   192k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     61|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     61|  ans_.read_end();
  167|     61|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    310|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    310|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    310|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 310]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    310|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    310|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    310|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 46, False: 264]
  ------------------
   67|     46|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 43]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     46|  } else
   72|    264|#endif
   73|    264|  {
   74|    264|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 255]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    264|  }
   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|    298|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 24, False: 274]
  ------------------
   83|     24|    return false;
   84|     24|  }
   85|    274|  probability_table_.resize(num_symbols_);
   86|    274|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 264]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  19.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 19.4k, False: 188]
  ------------------
   91|  19.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|  19.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 44, False: 19.4k]
  ------------------
   95|     44|      return false;
   96|     44|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  19.4k|    const int token = prob_data & 3;
  102|  19.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 8.65k, False: 10.7k]
  ------------------
  103|  8.65k|      const uint32_t offset = prob_data >> 2;
  104|  8.65k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 8.63k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   317k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 309k, False: 8.63k]
  ------------------
  109|   309k|        probability_table_[i + j] = 0;
  110|   309k|      }
  111|  8.63k|      i += offset;
  112|  10.7k|    } else {
  113|  10.7k|      const int extra_bytes = token;
  114|  10.7k|      uint32_t prob = prob_data >> 2;
  115|  18.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 7.24k, False: 10.7k]
  ------------------
  116|  7.24k|        uint8_t eb;
  117|  7.24k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 7.23k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  7.23k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  7.23k|      }
  124|  10.7k|      probability_table_[i] = prob;
  125|  10.7k|    }
  126|  19.4k|  }
  127|    188|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 32, False: 156]
  ------------------
  128|     32|    return false;
  129|     32|  }
  130|    156|  return true;
  131|    188|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    166|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    156|    DecoderBuffer *buffer) {
  136|    156|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    156|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    156|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    156|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 21, False: 135]
  ------------------
  140|     21|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 20]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     21|  } else
  145|    135|#endif
  146|    135|  {
  147|    135|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 135]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    135|  }
  151|    155|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 66, False: 89]
  ------------------
  152|     66|    return false;
  153|     66|  }
  154|     89|  const uint8_t *const data_head =
  155|     89|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     89|  buffer->Advance(bytes_encoded);
  158|     89|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 64]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     64|  return true;
  162|     89|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|   263k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     64|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     64|  ans_.read_end();
  167|     64|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    323|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    323|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    323|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 323]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    323|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    323|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    323|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 76, False: 247]
  ------------------
   67|     76|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 75]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     76|  } else
   72|    247|#endif
   73|    247|  {
   74|    247|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 244]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    247|  }
   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|    319|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 24, False: 295]
  ------------------
   83|     24|    return false;
   84|     24|  }
   85|    295|  probability_table_.resize(num_symbols_);
   86|    295|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 285]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|   335k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 335k, False: 191]
  ------------------
   91|   335k|    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|   335k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 33, False: 335k]
  ------------------
   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|   335k|    const int token = prob_data & 3;
  102|   335k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 75.4k, False: 260k]
  ------------------
  103|  75.4k|      const uint32_t offset = prob_data >> 2;
  104|  75.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 75.4k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.28M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.20M, False: 75.4k]
  ------------------
  109|  3.20M|        probability_table_[i + j] = 0;
  110|  3.20M|      }
  111|  75.4k|      i += offset;
  112|   260k|    } else {
  113|   260k|      const int extra_bytes = token;
  114|   260k|      uint32_t prob = prob_data >> 2;
  115|   502k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 242k, False: 260k]
  ------------------
  116|   242k|        uint8_t eb;
  117|   242k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 242k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   242k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   242k|      }
  124|   260k|      probability_table_[i] = prob;
  125|   260k|    }
  126|   335k|  }
  127|    191|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 41, False: 150]
  ------------------
  128|     41|    return false;
  129|     41|  }
  130|    150|  return true;
  131|    191|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    160|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    150|    DecoderBuffer *buffer) {
  136|    150|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    150|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    150|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    150|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 36, False: 114]
  ------------------
  140|     36|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 34]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     36|  } else
  145|    114|#endif
  146|    114|  {
  147|    114|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 114]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    114|  }
  151|    148|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 62, False: 86]
  ------------------
  152|     62|    return false;
  153|     62|  }
  154|     86|  const uint8_t *const data_head =
  155|     86|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     86|  buffer->Advance(bytes_encoded);
  158|     86|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 53]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     53|  return true;
  162|     86|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  77.2k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     53|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     53|  ans_.read_end();
  167|     53|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  11.6k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  11.6k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 61, False: 11.5k]
  ------------------
   35|     61|    return true;
   36|     61|  }
   37|       |  // Decode which scheme to use.
   38|  11.5k|  uint8_t scheme;
   39|  11.5k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 150, False: 11.4k]
  ------------------
   40|    150|    return false;
   41|    150|  }
   42|  11.4k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.06k, False: 10.3k]
  ------------------
   43|  1.06k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.06k|                                                  src_buffer, out_values);
   45|  10.3k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 7.36k, False: 2.98k]
  ------------------
   46|  7.36k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  7.36k|                                               out_values);
   48|  7.36k|  }
   49|  2.98k|  return false;
   50|  11.4k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.06k|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|  1.06k|  SymbolDecoderT<5> tag_decoder;
   57|  1.06k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 540, False: 528]
  ------------------
   58|    540|    return false;
   59|    540|  }
   60|       |
   61|    528|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 244, False: 284]
  ------------------
   62|    244|    return false;
   63|    244|  }
   64|       |
   65|    284|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 284, False: 0]
  |  Branch (65:25): [True: 51, False: 233]
  ------------------
   66|     51|    return false;  // Wrong number of symbols.
   67|     51|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    233|  src_buffer->StartBitDecoding(false, nullptr);
   72|    233|  int value_id = 0;
   73|  5.01M|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 5.01M, False: 218]
  ------------------
   74|       |    // Decode the tag.
   75|  5.01M|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  12.3M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 7.36M, False: 5.01M]
  ------------------
   78|  7.36M|      uint32_t val;
   79|  7.36M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 15, False: 7.36M]
  ------------------
   80|     15|        return false;
   81|     15|      }
   82|  7.36M|      out_values[value_id++] = val;
   83|  7.36M|    }
   84|  5.01M|  }
   85|    218|  tag_decoder.EndDecoding();
   86|    218|  src_buffer->EndBitDecoding();
   87|    218|  return true;
   88|    233|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  7.36k|                      uint32_t *out_values) {
  117|  7.36k|  uint8_t max_bit_length;
  118|  7.36k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 57, False: 7.30k]
  ------------------
  119|     57|    return false;
  120|     57|  }
  121|  7.30k|  switch (max_bit_length) {
  122|    590|    case 1:
  ------------------
  |  Branch (122:5): [True: 590, False: 6.71k]
  ------------------
  123|    590|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    590|                                                         out_values);
  125|    495|    case 2:
  ------------------
  |  Branch (125:5): [True: 495, False: 6.80k]
  ------------------
  126|    495|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    495|                                                         out_values);
  128|    515|    case 3:
  ------------------
  |  Branch (128:5): [True: 515, False: 6.78k]
  ------------------
  129|    515|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    515|                                                         out_values);
  131|    368|    case 4:
  ------------------
  |  Branch (131:5): [True: 368, False: 6.93k]
  ------------------
  132|    368|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    368|                                                         out_values);
  134|    176|    case 5:
  ------------------
  |  Branch (134:5): [True: 176, False: 7.12k]
  ------------------
  135|    176|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    176|                                                         out_values);
  137|    358|    case 6:
  ------------------
  |  Branch (137:5): [True: 358, False: 6.94k]
  ------------------
  138|    358|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    358|                                                         out_values);
  140|    357|    case 7:
  ------------------
  |  Branch (140:5): [True: 357, False: 6.94k]
  ------------------
  141|    357|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    357|                                                         out_values);
  143|    386|    case 8:
  ------------------
  |  Branch (143:5): [True: 386, False: 6.91k]
  ------------------
  144|    386|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    386|                                                         out_values);
  146|    456|    case 9:
  ------------------
  |  Branch (146:5): [True: 456, False: 6.84k]
  ------------------
  147|    456|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    456|                                                         out_values);
  149|    397|    case 10:
  ------------------
  |  Branch (149:5): [True: 397, False: 6.90k]
  ------------------
  150|    397|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    397|          num_values, src_buffer, out_values);
  152|    354|    case 11:
  ------------------
  |  Branch (152:5): [True: 354, False: 6.94k]
  ------------------
  153|    354|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    354|          num_values, src_buffer, out_values);
  155|    366|    case 12:
  ------------------
  |  Branch (155:5): [True: 366, False: 6.93k]
  ------------------
  156|    366|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    366|          num_values, src_buffer, out_values);
  158|    361|    case 13:
  ------------------
  |  Branch (158:5): [True: 361, False: 6.94k]
  ------------------
  159|    361|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    361|          num_values, src_buffer, out_values);
  161|    327|    case 14:
  ------------------
  |  Branch (161:5): [True: 327, False: 6.97k]
  ------------------
  162|    327|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    327|          num_values, src_buffer, out_values);
  164|    368|    case 15:
  ------------------
  |  Branch (164:5): [True: 368, False: 6.93k]
  ------------------
  165|    368|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    368|          num_values, src_buffer, out_values);
  167|    326|    case 16:
  ------------------
  |  Branch (167:5): [True: 326, False: 6.97k]
  ------------------
  168|    326|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    326|          num_values, src_buffer, out_values);
  170|    310|    case 17:
  ------------------
  |  Branch (170:5): [True: 310, False: 6.99k]
  ------------------
  171|    310|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    310|          num_values, src_buffer, out_values);
  173|    323|    case 18:
  ------------------
  |  Branch (173:5): [True: 323, False: 6.98k]
  ------------------
  174|    323|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    323|          num_values, src_buffer, out_values);
  176|    470|    default:
  ------------------
  |  Branch (176:5): [True: 470, False: 6.83k]
  ------------------
  177|    470|      return false;
  178|  7.30k|  }
  179|  7.30k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    590|                              uint32_t *out_values) {
   93|    590|  SymbolDecoderT decoder;
   94|    590|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 386, False: 204]
  ------------------
   95|    386|    return false;
   96|    386|  }
   97|       |
   98|    204|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 204, False: 0]
  |  Branch (98:25): [True: 36, False: 168]
  ------------------
   99|     36|    return false;  // Wrong number of symbols.
  100|     36|  }
  101|       |
  102|    168|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 65, False: 103]
  ------------------
  103|     65|    return false;
  104|     65|  }
  105|  13.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 13.5M, False: 103]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  13.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  13.5M|    out_values[i] = value;
  109|  13.5M|  }
  110|    103|  decoder.EndDecoding();
  111|    103|  return true;
  112|    168|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    495|                              uint32_t *out_values) {
   93|    495|  SymbolDecoderT decoder;
   94|    495|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 230, False: 265]
  ------------------
   95|    230|    return false;
   96|    230|  }
   97|       |
   98|    265|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 265, False: 0]
  |  Branch (98:25): [True: 10, False: 255]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    255|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 86, False: 169]
  ------------------
  103|     86|    return false;
  104|     86|  }
  105|  2.66M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.66M, False: 169]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.66M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.66M|    out_values[i] = value;
  109|  2.66M|  }
  110|    169|  decoder.EndDecoding();
  111|    169|  return true;
  112|    255|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    515|                              uint32_t *out_values) {
   93|    515|  SymbolDecoderT decoder;
   94|    515|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 180, False: 335]
  ------------------
   95|    180|    return false;
   96|    180|  }
   97|       |
   98|    335|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 335, False: 0]
  |  Branch (98:25): [True: 13, False: 322]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    322|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 188, False: 134]
  ------------------
  103|    188|    return false;
  104|    188|  }
  105|  7.44M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.44M, False: 134]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.44M|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.44M|    out_values[i] = value;
  109|  7.44M|  }
  110|    134|  decoder.EndDecoding();
  111|    134|  return true;
  112|    322|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    368|                              uint32_t *out_values) {
   93|    368|  SymbolDecoderT decoder;
   94|    368|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 135, False: 233]
  ------------------
   95|    135|    return false;
   96|    135|  }
   97|       |
   98|    233|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 233, False: 0]
  |  Branch (98:25): [True: 13, False: 220]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    220|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 61, False: 159]
  ------------------
  103|     61|    return false;
  104|     61|  }
  105|  8.84M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.84M, False: 159]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.84M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.84M|    out_values[i] = value;
  109|  8.84M|  }
  110|    159|  decoder.EndDecoding();
  111|    159|  return true;
  112|    220|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    176|                              uint32_t *out_values) {
   93|    176|  SymbolDecoderT decoder;
   94|    176|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 37, False: 139]
  ------------------
   95|     37|    return false;
   96|     37|  }
   97|       |
   98|    139|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 139, False: 0]
  |  Branch (98:25): [True: 44, False: 95]
  ------------------
   99|     44|    return false;  // Wrong number of symbols.
  100|     44|  }
  101|       |
  102|     95|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 9, False: 86]
  ------------------
  103|      9|    return false;
  104|      9|  }
  105|  8.18M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.18M, False: 86]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.18M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.18M|    out_values[i] = value;
  109|  8.18M|  }
  110|     86|  decoder.EndDecoding();
  111|     86|  return true;
  112|     95|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    358|                              uint32_t *out_values) {
   93|    358|  SymbolDecoderT decoder;
   94|    358|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 130, False: 228]
  ------------------
   95|    130|    return false;
   96|    130|  }
   97|       |
   98|    228|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 228, False: 0]
  |  Branch (98:25): [True: 7, False: 221]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    221|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 110, False: 111]
  ------------------
  103|    110|    return false;
  104|    110|  }
  105|  4.04M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.04M, False: 111]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.04M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.04M|    out_values[i] = value;
  109|  4.04M|  }
  110|    111|  decoder.EndDecoding();
  111|    111|  return true;
  112|    221|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    357|                              uint32_t *out_values) {
   93|    357|  SymbolDecoderT decoder;
   94|    357|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 141, False: 216]
  ------------------
   95|    141|    return false;
   96|    141|  }
   97|       |
   98|    216|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 216, False: 0]
  |  Branch (98:25): [True: 5, False: 211]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    211|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 105, False: 106]
  ------------------
  103|    105|    return false;
  104|    105|  }
  105|  18.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 18.7M, False: 106]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  18.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  18.7M|    out_values[i] = value;
  109|  18.7M|  }
  110|    106|  decoder.EndDecoding();
  111|    106|  return true;
  112|    211|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    386|                              uint32_t *out_values) {
   93|    386|  SymbolDecoderT decoder;
   94|    386|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 154, False: 232]
  ------------------
   95|    154|    return false;
   96|    154|  }
   97|       |
   98|    232|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 232, False: 0]
  |  Branch (98:25): [True: 12, False: 220]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    220|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 113, False: 107]
  ------------------
  103|    113|    return false;
  104|    113|  }
  105|  20.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 20.0M, False: 107]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  20.0M|    const uint32_t value = decoder.DecodeSymbol();
  108|  20.0M|    out_values[i] = value;
  109|  20.0M|  }
  110|    107|  decoder.EndDecoding();
  111|    107|  return true;
  112|    220|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    456|                              uint32_t *out_values) {
   93|    456|  SymbolDecoderT decoder;
   94|    456|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 162, False: 294]
  ------------------
   95|    162|    return false;
   96|    162|  }
   97|       |
   98|    294|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 294, False: 0]
  |  Branch (98:25): [True: 13, False: 281]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    281|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 115, False: 166]
  ------------------
  103|    115|    return false;
  104|    115|  }
  105|  9.42M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.42M, False: 166]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.42M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.42M|    out_values[i] = value;
  109|  9.42M|  }
  110|    166|  decoder.EndDecoding();
  111|    166|  return true;
  112|    281|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    397|                              uint32_t *out_values) {
   93|    397|  SymbolDecoderT decoder;
   94|    397|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 194, False: 203]
  ------------------
   95|    194|    return false;
   96|    194|  }
   97|       |
   98|    203|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 203, False: 0]
  |  Branch (98:25): [True: 4, False: 199]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    199|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 133, False: 66]
  ------------------
  103|    133|    return false;
  104|    133|  }
  105|   539k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 539k, False: 66]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   539k|    const uint32_t value = decoder.DecodeSymbol();
  108|   539k|    out_values[i] = value;
  109|   539k|  }
  110|     66|  decoder.EndDecoding();
  111|     66|  return true;
  112|    199|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    354|                              uint32_t *out_values) {
   93|    354|  SymbolDecoderT decoder;
   94|    354|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 210, False: 144]
  ------------------
   95|    210|    return false;
   96|    210|  }
   97|       |
   98|    144|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 144, False: 0]
  |  Branch (98:25): [True: 11, False: 133]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    133|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 73, False: 60]
  ------------------
  103|     73|    return false;
  104|     73|  }
  105|   382k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 382k, False: 60]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   382k|    const uint32_t value = decoder.DecodeSymbol();
  108|   382k|    out_values[i] = value;
  109|   382k|  }
  110|     60|  decoder.EndDecoding();
  111|     60|  return true;
  112|    133|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    366|                              uint32_t *out_values) {
   93|    366|  SymbolDecoderT decoder;
   94|    366|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 202, False: 164]
  ------------------
   95|    202|    return false;
   96|    202|  }
   97|       |
   98|    164|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 164, False: 0]
  |  Branch (98:25): [True: 6, False: 158]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    158|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 100, False: 58]
  ------------------
  103|    100|    return false;
  104|    100|  }
  105|  75.1k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 75.1k, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  75.1k|    const uint32_t value = decoder.DecodeSymbol();
  108|  75.1k|    out_values[i] = value;
  109|  75.1k|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|    158|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    361|                              uint32_t *out_values) {
   93|    361|  SymbolDecoderT decoder;
   94|    361|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 203, False: 158]
  ------------------
   95|    203|    return false;
   96|    203|  }
   97|       |
   98|    158|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 158, False: 0]
  |  Branch (98:25): [True: 10, False: 148]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    148|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 75, False: 73]
  ------------------
  103|     75|    return false;
  104|     75|  }
  105|  74.0k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 73.9k, False: 73]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  73.9k|    const uint32_t value = decoder.DecodeSymbol();
  108|  73.9k|    out_values[i] = value;
  109|  73.9k|  }
  110|     73|  decoder.EndDecoding();
  111|     73|  return true;
  112|    148|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    327|                              uint32_t *out_values) {
   93|    327|  SymbolDecoderT decoder;
   94|    327|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 147, False: 180]
  ------------------
   95|    147|    return false;
   96|    147|  }
   97|       |
   98|    180|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 180, False: 0]
  |  Branch (98:25): [True: 11, False: 169]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    169|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 106, False: 63]
  ------------------
  103|    106|    return false;
  104|    106|  }
  105|  73.5k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 73.5k, False: 63]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  73.5k|    const uint32_t value = decoder.DecodeSymbol();
  108|  73.5k|    out_values[i] = value;
  109|  73.5k|  }
  110|     63|  decoder.EndDecoding();
  111|     63|  return true;
  112|    169|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    368|                              uint32_t *out_values) {
   93|    368|  SymbolDecoderT decoder;
   94|    368|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 171, False: 197]
  ------------------
   95|    171|    return false;
   96|    171|  }
   97|       |
   98|    197|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 197, False: 0]
  |  Branch (98:25): [True: 7, False: 190]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    190|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 118, False: 72]
  ------------------
  103|    118|    return false;
  104|    118|  }
  105|   265k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 265k, False: 72]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   265k|    const uint32_t value = decoder.DecodeSymbol();
  108|   265k|    out_values[i] = value;
  109|   265k|  }
  110|     72|  decoder.EndDecoding();
  111|     72|  return true;
  112|    190|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    326|                              uint32_t *out_values) {
   93|    326|  SymbolDecoderT decoder;
   94|    326|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 158, False: 168]
  ------------------
   95|    158|    return false;
   96|    158|  }
   97|       |
   98|    168|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 168, False: 0]
  |  Branch (98:25): [True: 16, False: 152]
  ------------------
   99|     16|    return false;  // Wrong number of symbols.
  100|     16|  }
  101|       |
  102|    152|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 91, False: 61]
  ------------------
  103|     91|    return false;
  104|     91|  }
  105|   192k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 192k, False: 61]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   192k|    const uint32_t value = decoder.DecodeSymbol();
  108|   192k|    out_values[i] = value;
  109|   192k|  }
  110|     61|  decoder.EndDecoding();
  111|     61|  return true;
  112|    152|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    310|                              uint32_t *out_values) {
   93|    310|  SymbolDecoderT decoder;
   94|    310|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 144, False: 166]
  ------------------
   95|    144|    return false;
   96|    144|  }
   97|       |
   98|    166|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 166, False: 0]
  |  Branch (98:25): [True: 10, False: 156]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    156|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 92, False: 64]
  ------------------
  103|     92|    return false;
  104|     92|  }
  105|   263k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 263k, False: 64]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   263k|    const uint32_t value = decoder.DecodeSymbol();
  108|   263k|    out_values[i] = value;
  109|   263k|  }
  110|     64|  decoder.EndDecoding();
  111|     64|  return true;
  112|    156|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    323|                              uint32_t *out_values) {
   93|    323|  SymbolDecoderT decoder;
   94|    323|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 163, False: 160]
  ------------------
   95|    163|    return false;
   96|    163|  }
   97|       |
   98|    160|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 160, False: 0]
  |  Branch (98:25): [True: 10, False: 150]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    150|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 97, False: 53]
  ------------------
  103|     97|    return false;
  104|     97|  }
  105|  77.2k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 77.2k, False: 53]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  77.2k|    const uint32_t value = decoder.DecodeSymbol();
  108|  77.2k|    out_values[i] = value;
  109|  77.2k|  }
  110|     53|  decoder.EndDecoding();
  111|     53|  return true;
  112|    150|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  8.58k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  3.17k|  const CornerTable *GetCornerTable() const override {
   67|  3.17k|    return corner_table_.get();
   68|  3.17k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  8.90M|                       int *out_encoder_split_symbol_id) {
   87|  8.90M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 1.12M, False: 7.78M]
  ------------------
   88|  1.12M|      return false;
   89|  1.12M|    }
   90|  7.78M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 23, False: 7.78M]
  ------------------
   91|  7.78M|        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|     23|      *out_encoder_split_symbol_id = -1;
   98|     23|      return true;
   99|     23|    }
  100|  7.78M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 7.77M, False: 1.77k]
  ------------------
  101|  7.77M|      return false;
  102|  7.77M|    }
  103|  1.77k|    *out_face_edge =
  104|  1.77k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.77k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.77k|    topology_split_data_.pop_back();
  108|  1.77k|    return true;
  109|  7.78M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  29.8M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  29.8M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  29.8M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  29.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  9.72k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  5.16k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  3.37k|  const CornerTable *GetCornerTable() const override {
   67|  3.37k|    return corner_table_.get();
   68|  3.37k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  35.4M|                       int *out_encoder_split_symbol_id) {
   87|  35.4M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 34.9M, False: 499k]
  ------------------
   88|  34.9M|      return false;
   89|  34.9M|    }
   90|   499k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 43, False: 499k]
  ------------------
   91|   499k|        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|     43|      *out_encoder_split_symbol_id = -1;
   98|     43|      return true;
   99|     43|    }
  100|   499k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 497k, False: 1.61k]
  ------------------
  101|   497k|      return false;
  102|   497k|    }
  103|  1.61k|    *out_face_edge =
  104|  1.61k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.61k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.61k|    topology_split_data_.pop_back();
  108|  1.61k|    return true;
  109|   499k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|   103M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|   103M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|   103M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|   103M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  10.5k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  13.5k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.68k|  const CornerTable *GetCornerTable() const override {
   67|  2.68k|    return corner_table_.get();
   68|  2.68k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  51.7M|                       int *out_encoder_split_symbol_id) {
   87|  51.7M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 51.3M, False: 304k]
  ------------------
   88|  51.3M|      return false;
   89|  51.3M|    }
   90|   304k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 59, False: 304k]
  ------------------
   91|   304k|        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|     59|      *out_encoder_split_symbol_id = -1;
   98|     59|      return true;
   99|     59|    }
  100|   304k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 302k, False: 1.54k]
  ------------------
  101|   302k|      return false;
  102|   302k|    }
  103|  1.54k|    *out_face_edge =
  104|  1.54k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.54k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.54k|    topology_split_data_.pop_back();
  108|  1.54k|    return true;
  109|   304k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  63.6M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  63.6M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  63.6M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  63.6M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  7.38k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  7.70k|      : attribute_connectivity_decoders_(nullptr),
   34|  7.70k|        num_attribute_data_(0),
   35|  7.70k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  7.03k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  7.03k|    decoder_impl_ = decoder;
   38|  7.03k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  7.03k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  7.03k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  7.03k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  6.16k|  uint16_t BitstreamVersion() const {
   45|  6.16k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  6.16k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  2.86k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  7.03k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  4.58k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  4.58k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 72, False: 4.51k]
  ------------------
   63|     72|      return false;
   64|     72|    }
   65|       |
   66|  4.51k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 97, False: 4.41k]
  ------------------
   67|     97|      return false;
   68|     97|    }
   69|       |
   70|  4.41k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 12, False: 4.40k]
  ------------------
   71|     12|      return false;
   72|     12|    }
   73|  4.40k|    *out_buffer = buffer_;
   74|  4.40k|    return true;
   75|  4.41k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  4.97M|  inline bool DecodeStartFaceConfiguration() {
   79|  4.97M|    uint32_t face_configuration;
   80|  4.97M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  4.97M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.97M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 1.29k, False: 4.96M]
  ------------------
   82|  1.29k|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|  1.29k|    } else
   85|  4.96M|#endif
   86|  4.96M|    {
   87|  4.96M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  4.96M|    }
   89|  4.97M|    return face_configuration;
   90|  4.97M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  20.7M|  inline uint32_t DecodeSymbol() {
   94|  20.7M|    uint32_t symbol;
   95|  20.7M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  20.7M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 9.34M, False: 11.4M]
  ------------------
   97|  9.34M|      return symbol;
   98|  9.34M|    }
   99|       |    // Else decode two additional bits.
  100|  11.4M|    uint32_t symbol_suffix;
  101|  11.4M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  11.4M|    symbol |= (symbol_suffix << 1);
  103|  11.4M|    return symbol;
  104|  20.7M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  20.5M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  2.41M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  19.2M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  19.2M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  19.2M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  4.23k|  void Done() {
  123|  4.23k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 3.94k, False: 287]
  ------------------
  124|  3.94k|      symbol_buffer_.EndBitDecoding();
  125|  3.94k|    }
  126|  4.23k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  4.23k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.23k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 458, False: 3.77k]
  ------------------
  128|    458|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    458|    } else
  131|  3.77k|#endif
  132|  3.77k|    {
  133|  3.77k|      start_face_decoder_.EndDecoding();
  134|  3.77k|    }
  135|  4.23k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  2.29k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  4.92k|  bool DecodeTraversalSymbols() {
  141|  4.92k|    uint64_t traversal_size;
  142|  4.92k|    symbol_buffer_ = buffer_;
  143|  4.92k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 21, False: 4.90k]
  ------------------
  144|     21|      return false;
  145|     21|    }
  146|  4.90k|    buffer_ = symbol_buffer_;
  147|  4.90k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 106, False: 4.80k]
  ------------------
  148|    106|      return false;
  149|    106|    }
  150|  4.80k|    buffer_.Advance(traversal_size);
  151|  4.80k|    return true;
  152|  4.90k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  6.91k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  6.91k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  6.91k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  6.91k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 877, False: 6.03k]
  ------------------
  158|    877|      start_face_buffer_ = buffer_;
  159|    877|      uint64_t traversal_size;
  160|    877|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 3, False: 874]
  ------------------
  161|      3|        return false;
  162|      3|      }
  163|    874|      buffer_ = start_face_buffer_;
  164|    874|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 167, False: 707]
  ------------------
  165|    167|        return false;
  166|    167|      }
  167|    707|      buffer_.Advance(traversal_size);
  168|    707|      return true;
  169|    874|    }
  170|  6.03k|#endif
  171|  6.03k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  6.91k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  6.72k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  6.72k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 4.29k, False: 2.42k]
  ------------------
  177|  4.29k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  4.29k|          new BinaryDecoder[num_attribute_data_]);
  179|  12.2k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 7.93k, False: 4.27k]
  ------------------
  180|  7.93k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 26, False: 7.90k]
  ------------------
  181|     26|          return false;
  182|     26|        }
  183|  7.93k|      }
  184|  4.29k|    }
  185|  6.69k|    return true;
  186|  6.72k|  }

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.35k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.51M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.51M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.48M, False: 31.7k]
  ------------------
   61|  1.48M|      return true;  // Already traversed.
   62|  1.48M|    }
   63|       |
   64|  31.7k|    corner_traversal_stack_.clear();
   65|  31.7k|    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|  31.7k|    const VertexIndex next_vert =
   69|  31.7k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  31.7k|    const VertexIndex prev_vert =
   71|  31.7k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  31.7k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 31.7k]
  |  Branch (72:45): [True: 0, False: 31.7k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  31.7k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 31.1k, False: 656]
  ------------------
   76|  31.1k|      this->MarkVertexVisited(next_vert);
   77|  31.1k|      this->traversal_observer().OnNewVertexVisited(
   78|  31.1k|          next_vert, this->corner_table()->Next(corner_id));
   79|  31.1k|    }
   80|  31.7k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.33k, False: 28.4k]
  ------------------
   81|  3.33k|      this->MarkVertexVisited(prev_vert);
   82|  3.33k|      this->traversal_observer().OnNewVertexVisited(
   83|  3.33k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.33k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  73.9k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 42.1k, False: 31.7k]
  ------------------
   88|       |      // Currently processed corner.
   89|  42.1k|      corner_id = corner_traversal_stack_.back();
   90|  42.1k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  42.1k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 42.1k]
  |  Branch (92:47): [True: 613, False: 41.5k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    613|        corner_traversal_stack_.pop_back();
   95|    613|        continue;
   96|    613|      }
   97|  1.51M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.51M, Folded]
  ------------------
   98|  1.51M|        this->MarkFaceVisited(face_id);
   99|  1.51M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.51M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.51M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.51M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.51M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 749k, False: 762k]
  ------------------
  105|   749k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   749k|          this->MarkVertexVisited(vert_id);
  107|   749k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   749k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 731k, False: 18.4k]
  ------------------
  109|   731k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   731k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   731k|            continue;
  112|   731k|          }
  113|   749k|        }
  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|   780k|        const CornerIndex right_corner_id =
  118|   780k|            this->corner_table()->GetRightCorner(corner_id);
  119|   780k|        const CornerIndex left_corner_id =
  120|   780k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   780k|        const FaceIndex right_face_id(
  122|   780k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 13.4k, False: 767k]
  ------------------
  123|   780k|                 ? kInvalidFaceIndex
  124|   780k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   780k|        const FaceIndex left_face_id(
  126|   780k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 35.7k, False: 744k]
  ------------------
  127|   780k|                 ? kInvalidFaceIndex
  128|   780k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   780k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 747k, False: 32.6k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   747k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 36.3k, False: 711k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  36.3k|            corner_traversal_stack_.pop_back();
  134|  36.3k|            break;  // Break from the while (true) loop.
  135|   711k|          } else {
  136|       |            // Go to the left face.
  137|   711k|            corner_id = left_corner_id;
  138|   711k|            face_id = left_face_id;
  139|   711k|          }
  140|   747k|        } else {
  141|       |          // Right face was not visited.
  142|  32.6k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 27.4k, False: 5.19k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  27.4k|            corner_id = right_corner_id;
  145|  27.4k|            face_id = right_face_id;
  146|  27.4k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  5.19k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  5.19k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  5.19k|            break;
  159|  5.19k|          }
  160|  32.6k|        }
  161|   780k|      }
  162|  41.5k|    }
  163|  31.7k|    return true;
  164|  31.7k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.35k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.92k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.85k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  4.20M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  4.20M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.41M, False: 2.78M]
  ------------------
   61|  1.41M|      return true;  // Already traversed.
   62|  1.41M|    }
   63|       |
   64|  2.78M|    corner_traversal_stack_.clear();
   65|  2.78M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  2.78M|    const VertexIndex next_vert =
   69|  2.78M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.78M|    const VertexIndex prev_vert =
   71|  2.78M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.78M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.78M]
  |  Branch (72:45): [True: 0, False: 2.78M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.78M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.78M, False: 1.49k]
  ------------------
   76|  2.78M|      this->MarkVertexVisited(next_vert);
   77|  2.78M|      this->traversal_observer().OnNewVertexVisited(
   78|  2.78M|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.78M|    }
   80|  2.78M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.75M, False: 35.0k]
  ------------------
   81|  2.75M|      this->MarkVertexVisited(prev_vert);
   82|  2.75M|      this->traversal_observer().OnNewVertexVisited(
   83|  2.75M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.75M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  5.61M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.83M, False: 2.78M]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.83M|      corner_id = corner_traversal_stack_.back();
   90|  2.83M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.83M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.83M]
  |  Branch (92:47): [True: 4.58k, False: 2.82M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  4.58k|        corner_traversal_stack_.pop_back();
   95|  4.58k|        continue;
   96|  4.58k|      }
   97|  4.20M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 4.20M, Folded]
  ------------------
   98|  4.20M|        this->MarkFaceVisited(face_id);
   99|  4.20M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  4.20M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  4.20M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 4.20M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  4.20M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 3.47M, False: 723k]
  ------------------
  105|  3.47M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  3.47M|          this->MarkVertexVisited(vert_id);
  107|  3.47M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  3.47M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 676k, False: 2.80M]
  ------------------
  109|   676k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   676k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   676k|            continue;
  112|   676k|          }
  113|  3.47M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  3.52M|        const CornerIndex right_corner_id =
  118|  3.52M|            this->corner_table()->GetRightCorner(corner_id);
  119|  3.52M|        const CornerIndex left_corner_id =
  120|  3.52M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  3.52M|        const FaceIndex right_face_id(
  122|  3.52M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 2.78M, False: 745k]
  ------------------
  123|  3.52M|                 ? kInvalidFaceIndex
  124|  3.52M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  3.52M|        const FaceIndex left_face_id(
  126|  3.52M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.80M, False: 719k]
  ------------------
  127|  3.52M|                 ? kInvalidFaceIndex
  128|  3.52M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  3.52M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 3.45M, False: 70.8k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  3.45M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.80M, False: 651k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.80M|            corner_traversal_stack_.pop_back();
  134|  2.80M|            break;  // Break from the while (true) loop.
  135|  2.80M|          } else {
  136|       |            // Go to the left face.
  137|   651k|            corner_id = left_corner_id;
  138|   651k|            face_id = left_face_id;
  139|   651k|          }
  140|  3.45M|        } else {
  141|       |          // Right face was not visited.
  142|  70.8k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 47.4k, False: 23.4k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  47.4k|            corner_id = right_corner_id;
  145|  47.4k|            face_id = right_face_id;
  146|  47.4k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  23.4k|            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|  23.4k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  23.4k|            break;
  159|  23.4k|          }
  160|  70.8k|        }
  161|  3.52M|      }
  162|  2.82M|    }
  163|  2.78M|    return true;
  164|  2.78M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.85k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.87k|  DepthFirstTraverser() {}

_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   58|    427|  void OnTraversalStart() {
   59|    427|    prediction_degree_.resize(this->corner_table()->num_vertices(), 0);
   60|    427|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  2.81M|  bool TraverseFromCorner(CornerIndex corner_id) {
   66|  2.81M|    if (prediction_degree_.size() == 0) {
  ------------------
  |  Branch (66:9): [True: 0, False: 2.81M]
  ------------------
   67|      0|      return true;
   68|      0|    }
   69|       |
   70|       |    // Traversal starts from the |corner_id|. It's going to follow either the
   71|       |    // right or the left neighboring faces to |corner_id| based on their
   72|       |    // prediction degree.
   73|  2.81M|    traversal_stacks_[0].push_back(corner_id);
   74|  2.81M|    best_priority_ = 0;
   75|       |    // For the first face, check the remaining corners as they may not be
   76|       |    // processed yet.
   77|  2.81M|    const VertexIndex next_vert =
   78|  2.81M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   79|  2.81M|    const VertexIndex prev_vert =
   80|  2.81M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   81|  2.81M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (81:9): [True: 11.8k, False: 2.79M]
  ------------------
   82|  11.8k|      this->MarkVertexVisited(next_vert);
   83|  11.8k|      this->traversal_observer().OnNewVertexVisited(
   84|  11.8k|          next_vert, this->corner_table()->Next(corner_id));
   85|  11.8k|    }
   86|  2.81M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (86:9): [True: 2.92k, False: 2.80M]
  ------------------
   87|  2.92k|      this->MarkVertexVisited(prev_vert);
   88|  2.92k|      this->traversal_observer().OnNewVertexVisited(
   89|  2.92k|          prev_vert, this->corner_table()->Previous(corner_id));
   90|  2.92k|    }
   91|  2.81M|    const VertexIndex tip_vertex = this->corner_table()->Vertex(corner_id);
   92|  2.81M|    if (!this->IsVertexVisited(tip_vertex)) {
  ------------------
  |  Branch (92:9): [True: 2.77k, False: 2.80M]
  ------------------
   93|  2.77k|      this->MarkVertexVisited(tip_vertex);
   94|  2.77k|      this->traversal_observer().OnNewVertexVisited(tip_vertex, corner_id);
   95|  2.77k|    }
   96|       |    // Start the actual traversal.
   97|  8.24M|    while ((corner_id = PopNextCornerToTraverse()) != kInvalidCornerIndex) {
  ------------------
  |  Branch (97:12): [True: 5.42M, False: 2.81M]
  ------------------
   98|  5.42M|      FaceIndex face_id(corner_id.value() / 3);
   99|       |      // Make sure the face hasn't been visited yet.
  100|  5.42M|      if (this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (100:11): [True: 4.17M, False: 1.25M]
  ------------------
  101|       |        // This face has been already traversed.
  102|  4.17M|        continue;
  103|  4.17M|      }
  104|       |
  105|  2.81M|      while (true) {
  ------------------
  |  Branch (105:14): [True: 2.81M, Folded]
  ------------------
  106|  2.81M|        face_id = FaceIndex(corner_id.value() / 3);
  107|  2.81M|        this->MarkFaceVisited(face_id);
  108|  2.81M|        this->traversal_observer().OnNewFaceVisited(face_id);
  109|       |
  110|       |        // If the newly reached vertex hasn't been visited, mark it and notify
  111|       |        // the observer.
  112|  2.81M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  113|  2.81M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (113:13): [True: 1.41M, False: 1.39M]
  ------------------
  114|  1.41M|          this->MarkVertexVisited(vert_id);
  115|  1.41M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  116|  1.41M|        }
  117|       |
  118|       |        // Check whether we can traverse to the right and left neighboring
  119|       |        // faces.
  120|  2.81M|        const CornerIndex right_corner_id =
  121|  2.81M|            this->corner_table()->GetRightCorner(corner_id);
  122|  2.81M|        const CornerIndex left_corner_id =
  123|  2.81M|            this->corner_table()->GetLeftCorner(corner_id);
  124|  2.81M|        const FaceIndex right_face_id(
  125|  2.81M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (125:14): [True: 21.0k, False: 2.78M]
  ------------------
  126|  2.81M|                 ? kInvalidFaceIndex
  127|  2.81M|                 : FaceIndex(right_corner_id.value() / 3)));
  128|  2.81M|        const FaceIndex left_face_id(
  129|  2.81M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (129:14): [True: 31.3k, False: 2.77M]
  ------------------
  130|  2.81M|                 ? kInvalidFaceIndex
  131|  2.81M|                 : FaceIndex(left_corner_id.value() / 3)));
  132|  2.81M|        const bool is_right_face_visited = this->IsFaceVisited(right_face_id);
  133|  2.81M|        const bool is_left_face_visited = this->IsFaceVisited(left_face_id);
  134|       |
  135|  2.81M|        if (!is_left_face_visited) {
  ------------------
  |  Branch (135:13): [True: 2.15M, False: 651k]
  ------------------
  136|       |          // We can go to the left face.
  137|  2.15M|          const int priority = ComputePriority(left_corner_id);
  138|  2.15M|          if (is_right_face_visited && priority <= best_priority_) {
  ------------------
  |  Branch (138:15): [True: 774k, False: 1.38M]
  |  Branch (138:40): [True: 734k, False: 39.9k]
  ------------------
  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|   734k|            corner_id = left_corner_id;
  144|   734k|            continue;
  145|  1.42M|          } else {
  146|  1.42M|            AddCornerToTraversalStack(left_corner_id, priority);
  147|  1.42M|          }
  148|  2.15M|        }
  149|  2.07M|        if (!is_right_face_visited) {
  ------------------
  |  Branch (149:13): [True: 2.01M, False: 57.2k]
  ------------------
  150|       |          // Go to the right face.
  151|  2.01M|          const int priority = ComputePriority(right_corner_id);
  152|  2.01M|          if (priority <= best_priority_) {
  ------------------
  |  Branch (152:15): [True: 826k, False: 1.19M]
  ------------------
  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|   826k|            corner_id = right_corner_id;
  156|   826k|            continue;
  157|  1.19M|          } else {
  158|  1.19M|            AddCornerToTraversalStack(right_corner_id, priority);
  159|  1.19M|          }
  160|  2.01M|        }
  161|       |
  162|       |        // Couldn't proceed directly to the next corner
  163|  1.25M|        break;
  164|  2.07M|      }
  165|  1.25M|    }
  166|  2.81M|    return true;
  167|  2.81M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE23PopNextCornerToTraverseEv:
  173|  8.24M|  CornerIndex PopNextCornerToTraverse() {
  174|  17.3M|    for (int i = best_priority_; i < kMaxPriority; ++i) {
  ------------------
  |  Branch (174:34): [True: 14.5M, False: 2.81M]
  ------------------
  175|  14.5M|      if (!traversal_stacks_[i].empty()) {
  ------------------
  |  Branch (175:11): [True: 5.42M, False: 9.09M]
  ------------------
  176|  5.42M|        const CornerIndex ret = traversal_stacks_[i].back();
  177|  5.42M|        traversal_stacks_[i].pop_back();
  178|  5.42M|        best_priority_ = i;
  179|  5.42M|        return ret;
  180|  5.42M|      }
  181|  14.5M|    }
  182|  2.81M|    return kInvalidCornerIndex;
  183|  8.24M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15ComputePriorityENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  194|  4.17M|  inline int ComputePriority(CornerIndex corner_id) {
  195|  4.17M|    const VertexIndex v_tip = this->corner_table()->Vertex(corner_id);
  196|       |    // Priority 0 when traversing to already visited vertices.
  197|  4.17M|    int priority = 0;
  198|  4.17M|    if (!this->IsVertexVisited(v_tip)) {
  ------------------
  |  Branch (198:9): [True: 2.76M, False: 1.40M]
  ------------------
  199|  2.76M|      const int degree = ++prediction_degree_[v_tip];
  200|       |      // Priority 1 when prediction degree > 1, otherwise 2.
  201|  2.76M|      priority = (degree > 1 ? 1 : 2);
  ------------------
  |  Branch (201:19): [True: 1.35M, False: 1.41M]
  ------------------
  202|  2.76M|    }
  203|       |    // Clamp the priority to the maximum number of buckets.
  204|  4.17M|    if (priority >= kMaxPriority) {
  ------------------
  |  Branch (204:9): [True: 0, False: 4.17M]
  ------------------
  205|      0|      priority = kMaxPriority - 1;
  206|      0|    }
  207|  4.17M|    return priority;
  208|  4.17M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE25AddCornerToTraversalStackENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEi:
  185|  2.61M|  inline void AddCornerToTraversalStack(CornerIndex ci, int priority) {
  186|  2.61M|    traversal_stacks_[priority].push_back(ci);
  187|       |    // Make sure that the best available priority is up to date.
  188|  2.61M|    if (priority < best_priority_) {
  ------------------
  |  Branch (188:9): [True: 631k, False: 1.98M]
  ------------------
  189|   631k|      best_priority_ = priority;
  190|   631k|    }
  191|  2.61M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   63|    427|  void OnTraversalEnd() {}
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   55|    934|  MaxPredictionDegreeTraverser() {}

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    467|      : 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|  4.53M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.53M, False: 1.62k]
  ------------------
   54|  4.53M|      const auto &face = mesh_->face(f);
   55|  18.1M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 13.6M, False: 4.53M]
  ------------------
   56|  13.6M|        const PointIndex point_id = face[p];
   57|  13.6M|        const VertexIndex vert_id =
   58|  13.6M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  13.6M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 13.6M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  13.6M|        const AttributeValueIndex att_entry_id(
   63|  13.6M|            encoding_data_
   64|  13.6M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  13.6M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 13.6M]
  |  Branch (65:13): [True: 0, False: 13.6M]
  |  Branch (65:39): [True: 0, False: 13.6M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  13.6M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  13.6M|      }
   71|  4.53M|    }
   72|  1.62k|    return true;
   73|  1.62k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    427|  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|    427|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    427|    traverser_.OnTraversalStart();
   82|    427|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 427]
  ------------------
   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|    427|    } else {
   89|    427|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.81M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.81M, False: 427]
  ------------------
   91|  2.81M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.81M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.81M|      }
   95|    427|    }
   96|    427|    traverser_.OnTraversalEnd();
   97|    427|    return true;
   98|    427|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.81M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.81M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.81M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    467|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.46k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  4.86k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  4.86k|    const auto *corner_table = traverser_.corner_table();
   50|  4.86k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  4.86k|    const size_t num_faces = mesh_->num_faces();
   52|  4.86k|    const size_t num_points = mesh_->num_points();
   53|  2.87M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 2.86M, False: 4.86k]
  ------------------
   54|  2.86M|      const auto &face = mesh_->face(f);
   55|  11.4M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 8.60M, False: 2.86M]
  ------------------
   56|  8.60M|        const PointIndex point_id = face[p];
   57|  8.60M|        const VertexIndex vert_id =
   58|  8.60M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  8.60M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 8.60M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  8.60M|        const AttributeValueIndex att_entry_id(
   63|  8.60M|            encoding_data_
   64|  8.60M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  8.60M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 8.60M]
  |  Branch (65:13): [True: 0, False: 8.60M]
  |  Branch (65:39): [True: 0, False: 8.60M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  8.60M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  8.60M|      }
   71|  2.86M|    }
   72|  4.86k|    return true;
   73|  4.86k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.35k|  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.35k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.35k|    traverser_.OnTraversalStart();
   82|  1.35k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.35k]
  ------------------
   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.35k|    } else {
   89|  1.35k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  1.51M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 1.51M, False: 1.35k]
  ------------------
   91|  1.51M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 1.51M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  1.51M|      }
   95|  1.35k|    }
   96|  1.35k|    traverser_.OnTraversalEnd();
   97|  1.35k|    return true;
   98|  1.35k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.51M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  1.51M|    return traverser_.TraverseFromCorner(corner_id);
  103|  1.51M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.46k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.93k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.85k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  5.85k|    const auto *corner_table = traverser_.corner_table();
   50|  5.85k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.85k|    const size_t num_faces = mesh_->num_faces();
   52|  5.85k|    const size_t num_points = mesh_->num_points();
   53|  7.12M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 7.12M, False: 5.85k]
  ------------------
   54|  7.12M|      const auto &face = mesh_->face(f);
   55|  28.4M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 21.3M, False: 7.12M]
  ------------------
   56|  21.3M|        const PointIndex point_id = face[p];
   57|  21.3M|        const VertexIndex vert_id =
   58|  21.3M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  21.3M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 21.3M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  21.3M|        const AttributeValueIndex att_entry_id(
   63|  21.3M|            encoding_data_
   64|  21.3M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  21.3M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 21.3M]
  |  Branch (65:13): [True: 3, False: 21.3M]
  |  Branch (65:39): [True: 3, False: 21.3M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      3|          return false;
   68|      3|        }
   69|  21.3M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  21.3M|      }
   71|  7.12M|    }
   72|  5.85k|    return true;
   73|  5.85k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.85k|  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.85k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.85k|    traverser_.OnTraversalStart();
   82|  1.85k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.85k]
  ------------------
   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.85k|    } else {
   89|  1.85k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  4.20M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 4.20M, False: 1.85k]
  ------------------
   91|  4.20M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 4.20M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  4.20M|      }
   95|  1.85k|    }
   96|  1.85k|    traverser_.OnTraversalEnd();
   97|  1.85k|    return true;
   98|  1.85k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  4.20M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  4.20M|    return traverser_.TraverseFromCorner(corner_id);
  103|  4.20M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.93k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.87k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  31.4M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  16.9M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  16.9M|    return is_vertex_visited_[vert_id.value()];
   65|  16.9M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.21M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.21M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.21M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  6.54M|  inline TraversalObserverT &traversal_observer() {
   75|  6.54M|    return traversal_observer_;
   76|  6.54M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  12.6M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  12.6M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 101k, False: 12.5M]
  ------------------
   47|   101k|      return true;  // Invalid faces are always considered as visited.
   48|   101k|    }
   49|  12.5M|    return is_face_visited_[face_id.value()];
   50|  12.6M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  4.32M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  4.32M|    is_face_visited_[face_id.value()] = true;
   62|  4.32M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.85k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.85k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.92k|                    TraversalObserver traversal_observer) {
   37|  1.92k|    corner_table_ = corner_table;
   38|  1.92k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.92k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.92k|    traversal_observer_ = traversal_observer;
   41|  1.92k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.51M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.51M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.51M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.51M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.51M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  32.0M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  4.20M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  4.20M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 4.20M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  4.20M|    return is_face_visited_[corner_id.value() / 3];
   58|  4.20M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  9.77M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  9.77M|    return is_vertex_visited_[vert_id.value()];
   65|  9.77M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  9.01M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  9.01M|    is_vertex_visited_[vert_id.value()] = true;
   68|  9.01M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  13.2M|  inline TraversalObserverT &traversal_observer() {
   75|  13.2M|    return traversal_observer_;
   76|  13.2M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  9.88M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  9.88M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 5.58M, False: 4.29M]
  ------------------
   47|  5.58M|      return true;  // Invalid faces are always considered as visited.
   48|  5.58M|    }
   49|  4.29M|    return is_face_visited_[face_id.value()];
   50|  9.88M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  4.20M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  4.20M|    is_face_visited_[face_id.value()] = true;
   62|  4.20M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.87k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.93k|                    TraversalObserver traversal_observer) {
   37|  1.93k|    corner_table_ = corner_table;
   38|  1.93k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.93k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.93k|    traversal_observer_ = traversal_observer;
   41|  1.93k|  }

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  39.5M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  39.5M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 39.5M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  39.5M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  39.5M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  1.09G|  bool Decode(void *out_data, size_t size_to_decode) {
   77|  1.09G|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 455, False: 1.09G]
  ------------------
   78|    455|      return false;  // Buffer overflow.
   79|    455|    }
   80|  1.09G|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  1.09G|    pos_ += size_to_decode;
   82|  1.09G|    return true;
   83|  1.09G|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  27.2k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  11.2k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  42.4k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   231k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  7.03k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  39.5M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  5.03M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  8.46k|    inline void reset(const void *b, size_t s) {
  131|  8.46k|      bit_offset_ = 0;
  132|  8.46k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  8.46k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  8.46k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  7.07k|    inline uint64_t BitsDecoded() const {
  138|  7.07k|      return static_cast<uint64_t>(bit_offset_);
  139|  7.07k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  39.5M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  39.5M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 15, False: 39.5M]
  ------------------
  162|     15|        return false;
  163|     15|      }
  164|  39.5M|      uint32_t value = 0;
  165|  85.7M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 46.1M, False: 39.5M]
  ------------------
  166|  46.1M|        value |= GetBit() << bit;
  167|  46.1M|      }
  168|  39.5M|      *x = value;
  169|  39.5M|      return true;
  170|  39.5M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  46.1M|    inline int GetBit() {
  176|  46.1M|      const size_t off = bit_offset_;
  177|  46.1M|      const size_t byte_offset = off >> 3;
  178|  46.1M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  46.1M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 40.6M, False: 5.44M]
  ------------------
  180|  40.6M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  40.6M|        bit_offset_ = off + 1;
  182|  40.6M|        return bit;
  183|  40.6M|      }
  184|  5.44M|      return 0;
  185|  46.1M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  15.5M|  bool Decode(T *out_val) {
   69|  15.5M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 3.49k, False: 15.5M]
  ------------------
   70|  3.49k|      return false;
   71|  3.49k|    }
   72|  15.5M|    pos_ += sizeof(T);
   73|  15.5M|    return true;
   74|  15.5M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  15.5M|  bool Peek(T *out_val) {
   88|  15.5M|    const size_t size_to_decode = sizeof(T);
   89|  15.5M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 3.49k, False: 15.5M]
  ------------------
   90|  3.49k|      return false;  // Buffer overflow.
   91|  3.49k|    }
   92|  15.5M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  15.5M|    return true;
   94|  15.5M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  12.1k|  bool Decode(T *out_val) {
   69|  12.1k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 127, False: 12.0k]
  ------------------
   70|    127|      return false;
   71|    127|    }
   72|  12.0k|    pos_ += sizeof(T);
   73|  12.0k|    return true;
   74|  12.1k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  12.1k|  bool Peek(T *out_val) {
   88|  12.1k|    const size_t size_to_decode = sizeof(T);
   89|  12.1k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 127, False: 12.0k]
  ------------------
   90|    127|      return false;  // Buffer overflow.
   91|    127|    }
   92|  12.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  12.0k|    return true;
   94|  12.1k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   768k|  bool Decode(T *out_val) {
   69|   768k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 181, False: 768k]
  ------------------
   70|    181|      return false;
   71|    181|    }
   72|   768k|    pos_ += sizeof(T);
   73|   768k|    return true;
   74|   768k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   768k|  bool Peek(T *out_val) {
   88|   768k|    const size_t size_to_decode = sizeof(T);
   89|   768k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 181, False: 768k]
  ------------------
   90|    181|      return false;  // Buffer overflow.
   91|    181|    }
   92|   768k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   768k|    return true;
   94|   768k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  24.0k|  bool Decode(T *out_val) {
   69|  24.0k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 269, False: 23.8k]
  ------------------
   70|    269|      return false;
   71|    269|    }
   72|  23.8k|    pos_ += sizeof(T);
   73|  23.8k|    return true;
   74|  24.0k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  24.0k|  bool Peek(T *out_val) {
   88|  24.0k|    const size_t size_to_decode = sizeof(T);
   89|  24.0k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 269, False: 23.8k]
  ------------------
   90|    269|      return false;  // Buffer overflow.
   91|    269|    }
   92|  23.8k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  23.8k|    return true;
   94|  24.0k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|  1.19M|  bool Decode(T *out_val) {
   69|  1.19M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 149, False: 1.19M]
  ------------------
   70|    149|      return false;
   71|    149|    }
   72|  1.19M|    pos_ += sizeof(T);
   73|  1.19M|    return true;
   74|  1.19M|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|  1.19M|  bool Peek(T *out_val) {
   88|  1.19M|    const size_t size_to_decode = sizeof(T);
   89|  1.19M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 149, False: 1.19M]
  ------------------
   90|    149|      return false;  // Buffer overflow.
   91|    149|    }
   92|  1.19M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.19M|    return true;
   94|  1.19M|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|   249k|  bool Decode(T *out_val) {
   69|   249k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 21, False: 249k]
  ------------------
   70|     21|      return false;
   71|     21|    }
   72|   249k|    pos_ += sizeof(T);
   73|   249k|    return true;
   74|   249k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|   249k|  bool Peek(T *out_val) {
   88|   249k|    const size_t size_to_decode = sizeof(T);
   89|   249k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 21, False: 249k]
  ------------------
   90|     21|      return false;  // Buffer overflow.
   91|     21|    }
   92|   249k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   249k|    return true;
   94|   249k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  2.29k|  bool Decode(T *out_val) {
   69|  2.29k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 24, False: 2.27k]
  ------------------
   70|     24|      return false;
   71|     24|    }
   72|  2.27k|    pos_ += sizeof(T);
   73|  2.27k|    return true;
   74|  2.29k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  2.29k|  bool Peek(T *out_val) {
   88|  2.29k|    const size_t size_to_decode = sizeof(T);
   89|  2.29k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 24, False: 2.27k]
  ------------------
   90|     24|      return false;  // Buffer overflow.
   91|     24|    }
   92|  2.27k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.27k|    return true;
   94|  2.29k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    180|  bool Decode(T *out_val) {
   69|    180|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 17, False: 163]
  ------------------
   70|     17|      return false;
   71|     17|    }
   72|    163|    pos_ += sizeof(T);
   73|    163|    return true;
   74|    180|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    180|  bool Peek(T *out_val) {
   88|    180|    const size_t size_to_decode = sizeof(T);
   89|    180|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 17, False: 163]
  ------------------
   90|     17|      return false;  // Buffer overflow.
   91|     17|    }
   92|    163|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    163|    return true;
   94|    180|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|  99.3M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   105M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  11.7M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  11.7M|    return value_ >= val;
  100|  11.7M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   286M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  3.62G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  26.2M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  95.5M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  95.5M|    value_ = i.value_;
  153|  95.5M|    return *this;
  154|  95.5M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   301M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   301M|    value_ = i.value_;
  153|   301M|    return *this;
  154|   301M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  26.2M|  inline ThisIndexType &operator++() {
  103|  26.2M|    ++value_;
  104|  26.2M|    return *this;
  105|  26.2M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  2.66G|  constexpr bool operator==(const IndexType &i) const {
   76|  2.66G|    return value_ == i.value_;
   77|  2.66G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|  1.06G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  10.3k|  constexpr bool operator<(const IndexType &i) const {
   88|  10.3k|    return value_ < i.value_;
   89|  10.3k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   149M|  constexpr bool operator==(const IndexType &i) const {
   76|   149M|    return value_ == i.value_;
   77|   149M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   187M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   187M|    return ThisIndexType(value_ - val);
  133|   187M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   847M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   847M|    return ThisIndexType(value_ + val);
  127|   847M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  22.5M|  constexpr bool operator==(const IndexType &i) const {
   76|  22.5M|    return value_ == i.value_;
   77|  22.5M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   282M|  constexpr bool operator!=(const IndexType &i) const {
   82|   282M|    return value_ != i.value_;
   83|   282M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   386M|  constexpr bool operator!=(const IndexType &i) const {
   82|   386M|    return value_ != i.value_;
   83|   386M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   588M|  inline ThisIndexType &operator++() {
  103|   588M|    ++value_;
  104|   588M|    return *this;
  105|   588M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   492M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   492M|    value_ = i.value_;
  153|   492M|    return *this;
  154|   492M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|  1.21G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  1.21G|    value_ = i.value_;
  153|  1.21G|    return *this;
  154|  1.21G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  43.5M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  43.5M|    return value_ >= val;
  100|  43.5M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  9.74M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.25G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  26.9G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   218M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  21.3G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   275M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  16.8M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  16.8M|    return ThisIndexType(value_ + val);
  127|  16.8M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   173M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  27.5M|  constexpr bool operator<(const IndexType &i) const {
   88|  27.5M|    return value_ < i.value_;
   89|  27.5M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   237M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   302M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  71.5M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|  75.2M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   295M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  5.65M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  5.65M|    value_ = i.value_;
  153|  5.65M|    return *this;
  154|  5.65M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  9.74M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  9.74M|    value_ += val;
  141|  9.74M|    return *this;
  142|  9.74M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  35.8M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  35.8M|    value_ = val;
  157|  35.8M|    return *this;
  158|  35.8M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   266M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  6.90M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  6.89M|  inline ThisIndexType &operator++() {
  103|  6.89M|    ++value_;
  104|  6.89M|    return *this;
  105|  6.89M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  22.4M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  22.4M|  inline ThisIndexType &operator++() {
  103|  22.4M|    ++value_;
  104|  22.4M|    return *this;
  105|  22.4M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  39.9M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  39.9M|    return vector_[index.value()];
   75|  39.9M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  22.4M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  12.1k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  16.2k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  66.0M|  inline reference operator[](const IndexTypeT &index) {
   71|  66.0M|    return vector_[index.value()];
   72|  66.0M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|   184k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  23.5M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  4.23k|  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|  11.7M|  inline reference operator[](const IndexTypeT &index) {
   71|  11.7M|    return vector_[index.value()];
   72|  11.7M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  25.7M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  25.7M|    return vector_[index.value()];
   75|  25.7M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   221M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  12.8M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   351M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   351M|    return vector_[index.value()];
   75|   351M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   948M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   948M|    return vector_[index.value()];
   75|   948M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   454M|  inline reference operator[](const IndexTypeT &index) {
   71|   454M|    return vector_[index.value()];
   72|   454M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  68.8M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  68.8M|    return vector_[index.value()];
   75|  68.8M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   393M|  inline reference operator[](const IndexTypeT &index) {
   71|   393M|    return vector_[index.value()];
   72|   393M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   112M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   255M|  inline reference operator[](const IndexTypeT &index) {
   71|   255M|    return vector_[index.value()];
   72|   255M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.70k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   222M|  inline reference operator[](const IndexTypeT &index) {
   71|   222M|    return vector_[index.value()];
   72|   222M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  53.3k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.81M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  49.7k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  7.56k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  7.56k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  7.56k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  7.56k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  14.4k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  14.4k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  14.4k|    vector_.swap(arg.vector_);
   57|  14.4k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  14.4k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  14.4k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  14.4k|    vector_.swap(arg.vector_);
   57|  14.4k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  7.56k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  7.56k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  7.56k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  11.2k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  47.3k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  76.5k|int32_t DataTypeLength(DataType dt) {
   20|  76.5k|  switch (dt) {
   21|  37.1k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 37.1k, False: 39.3k]
  ------------------
   22|  39.2k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 2.01k, False: 74.5k]
  ------------------
   23|  39.2k|      return 1;
   24|  1.87k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 1.87k, False: 74.6k]
  ------------------
   25|  2.17k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 295, False: 76.2k]
  ------------------
   26|  2.17k|      return 2;
   27|  28.9k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 28.9k, False: 47.6k]
  ------------------
   28|  29.8k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 863, False: 75.6k]
  ------------------
   29|  29.8k|      return 4;
   30|    428|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 428, False: 76.1k]
  ------------------
   31|    804|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 376, False: 76.1k]
  ------------------
   32|    804|      return 8;
   33|  4.02k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 4.02k, False: 72.5k]
  ------------------
   34|  4.02k|      return 4;
   35|    165|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 165, False: 76.3k]
  ------------------
   36|    165|      return 8;
   37|    362|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 362, False: 76.1k]
  ------------------
   38|    362|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 76.5k]
  ------------------
   40|      0|      return -1;
   41|  76.5k|  }
   42|  76.5k|}

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

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

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

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

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

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

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

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   951k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   951k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 951k, Folded]
  ------------------
   65|   951k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.33k, False: 950k]
  ------------------
   66|  1.33k|      return false;
   67|  1.33k|    }
   68|   951k|  } 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|   950k|  return true;
   77|   951k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   691k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   691k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   691k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 114, False: 691k]
  ------------------
   33|    114|    return false;
   34|    114|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   691k|  uint8_t in;
   39|   691k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 847, False: 690k]
  ------------------
   40|    847|    return false;
   41|    847|  }
   42|   690k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 18.6k, False: 671k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  18.6k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 642, False: 17.9k]
  ------------------
   45|    642|      return false;
   46|    642|    }
   47|       |    // Append decoded info from this byte.
   48|  17.9k|    *out_val <<= 7;
   49|  17.9k|    *out_val |= in & ((1 << 7) - 1);
   50|   671k|  } else {
   51|       |    // Last byte reached
   52|   671k|    *out_val = in;
   53|   671k|  }
   54|   689k|  return true;
   55|   690k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  7.36k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  7.36k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.36k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 7.36k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.36k|  uint8_t in;
   39|  7.36k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 8, False: 7.36k]
  ------------------
   40|      8|    return false;
   41|      8|  }
   42|  7.36k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 553, False: 6.80k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    553|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 5, False: 548]
  ------------------
   45|      5|      return false;
   46|      5|    }
   47|       |    // Append decoded info from this byte.
   48|    548|    *out_val <<= 7;
   49|    548|    *out_val |= in & ((1 << 7) - 1);
   50|  6.80k|  } else {
   51|       |    // Last byte reached
   52|  6.80k|    *out_val = in;
   53|  6.80k|  }
   54|  7.35k|  return true;
   55|  7.36k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  7.48k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  7.48k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 7.48k, Folded]
  ------------------
   65|  7.48k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 115, False: 7.37k]
  ------------------
   66|    115|      return false;
   67|    115|    }
   68|  7.48k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  7.37k|  return true;
   77|  7.48k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.05k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.05k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.05k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 4.05k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.05k|  uint8_t in;
   39|  4.05k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 21, False: 4.03k]
  ------------------
   40|     21|    return false;
   41|     21|  }
   42|  4.03k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 91, False: 3.94k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     91|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 91]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     91|    *out_val <<= 7;
   49|     91|    *out_val |= in & ((1 << 7) - 1);
   50|  3.94k|  } else {
   51|       |    // Last byte reached
   52|  3.94k|    *out_val = in;
   53|  3.94k|  }
   54|  4.03k|  return true;
   55|  4.03k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   199k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   199k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   199k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 15, False: 199k]
  ------------------
   33|     15|    return false;
   34|     15|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   199k|  uint8_t in;
   39|   199k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 66, False: 199k]
  ------------------
   40|     66|    return false;
   41|     66|  }
   42|   199k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.36k, False: 197k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.36k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 85, False: 1.28k]
  ------------------
   45|     85|      return false;
   46|     85|    }
   47|       |    // Append decoded info from this byte.
   48|  1.28k|    *out_val <<= 7;
   49|  1.28k|    *out_val |= in & ((1 << 7) - 1);
   50|   197k|  } else {
   51|       |    // Last byte reached
   52|   197k|    *out_val = in;
   53|   197k|  }
   54|   199k|  return true;
   55|   199k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.71k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.71k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.71k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 3.71k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.71k|  uint8_t in;
   39|  3.71k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 29, False: 3.68k]
  ------------------
   40|     29|    return false;
   41|     29|  }
   42|  3.68k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 677, False: 3.00k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    677|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 35, False: 642]
  ------------------
   45|     35|      return false;
   46|     35|    }
   47|       |    // Append decoded info from this byte.
   48|    642|    *out_val <<= 7;
   49|    642|    *out_val |= in & ((1 << 7) - 1);
   50|  3.00k|  } else {
   51|       |    // Last byte reached
   52|  3.00k|    *out_val = in;
   53|  3.00k|  }
   54|  3.65k|  return true;
   55|  3.68k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  17.7k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  17.7k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  17.7k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 7, False: 17.7k]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  17.7k|  uint8_t in;
   39|  17.7k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 23, False: 17.7k]
  ------------------
   40|     23|    return false;
   41|     23|  }
   42|  17.7k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 283, False: 17.4k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    283|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 37, False: 246]
  ------------------
   45|     37|      return false;
   46|     37|    }
   47|       |    // Append decoded info from this byte.
   48|    246|    *out_val <<= 7;
   49|    246|    *out_val |= in & ((1 << 7) - 1);
   50|  17.4k|  } else {
   51|       |    // Last byte reached
   52|  17.4k|    *out_val = in;
   53|  17.4k|  }
   54|  17.6k|  return true;
   55|  17.7k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  9.36k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  9.36k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  9.36k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 100, False: 9.26k]
  ------------------
   33|    100|    return false;
   34|    100|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  9.26k|  uint8_t in;
   39|  9.26k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 78, False: 9.18k]
  ------------------
   40|     78|    return false;
   41|     78|  }
   42|  9.18k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.44k, False: 6.74k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.44k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 532, False: 1.91k]
  ------------------
   45|    532|      return false;
   46|    532|    }
   47|       |    // Append decoded info from this byte.
   48|  1.91k|    *out_val <<= 7;
   49|  1.91k|    *out_val |= in & ((1 << 7) - 1);
   50|  6.74k|  } else {
   51|       |    // Last byte reached
   52|  6.74k|    *out_val = in;
   53|  6.74k|  }
   54|  8.65k|  return true;
   55|  9.18k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  6.94k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  6.94k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.94k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 51, False: 6.89k]
  ------------------
   33|     51|    return false;
   34|     51|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.89k|  uint8_t in;
   39|  6.89k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 43, False: 6.85k]
  ------------------
   40|     43|    return false;
   41|     43|  }
   42|  6.85k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.42k, False: 3.42k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.42k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 602, False: 2.82k]
  ------------------
   45|    602|      return false;
   46|    602|    }
   47|       |    // Append decoded info from this byte.
   48|  2.82k|    *out_val <<= 7;
   49|  2.82k|    *out_val |= in & ((1 << 7) - 1);
   50|  3.42k|  } else {
   51|       |    // Last byte reached
   52|  3.42k|    *out_val = in;
   53|  3.42k|  }
   54|  6.25k|  return true;
   55|  6.85k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  48.1k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  48.1k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  48.1k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 9, False: 48.1k]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  48.1k|  uint8_t in;
   39|  48.1k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 36, False: 48.1k]
  ------------------
   40|     36|    return false;
   41|     36|  }
   42|  48.1k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.47k, False: 46.6k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.47k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 63, False: 1.41k]
  ------------------
   45|     63|      return false;
   46|     63|    }
   47|       |    // Append decoded info from this byte.
   48|  1.41k|    *out_val <<= 7;
   49|  1.41k|    *out_val |= in & ((1 << 7) - 1);
   50|  46.6k|  } else {
   51|       |    // Last byte reached
   52|  46.6k|    *out_val = in;
   53|  46.6k|  }
   54|  48.0k|  return true;
   55|  48.1k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   155k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   199k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  16.6k|  Self operator-(const Self &o) const {
  138|  16.6k|    Self ret;
  139|  66.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 49.8k, False: 16.6k]
  ------------------
  140|  49.8k|      ret[i] = (*this)[i] - o[i];
  141|  49.8k|    }
  142|  16.6k|    return ret;
  143|  16.6k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  41.2k|  VectorD() {
   41|   165k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 123k, False: 41.2k]
  ------------------
   42|   123k|      (*this)[i] = Scalar(0);
   43|   123k|    }
   44|  41.2k|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   173M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  14.4M|  Self operator-(const Self &o) const {
  138|  14.4M|    Self ret;
  139|  57.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 43.2M, False: 14.4M]
  ------------------
  140|  43.2M|      ret[i] = (*this)[i] - o[i];
  141|  43.2M|    }
  142|  14.4M|    return ret;
  143|  14.4M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  7.19M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  7.19M|  static_assert(std::is_signed<ScalarT>::value,
  321|  7.19M|                "ScalarT must be a signed type. ");
  322|  7.19M|  VectorD<ScalarT, 3> r;
  323|  7.19M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  7.19M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  7.19M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  7.19M|  return r;
  327|  7.19M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  7.19M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  7.19M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  2.93M|  Scalar AbsSum() const {
  238|  2.93M|    Scalar result(0);
  239|  11.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 8.80M, False: 2.92M]
  ------------------
  240|  8.80M|      Scalar next_value = std::abs(v_[i]);
  241|  8.80M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 7.94k, False: 8.80M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  7.94k|        return std::numeric_limits<Scalar>::max();
  244|  7.94k|      }
  245|  8.80M|      result += next_value;
  246|  8.80M|    }
  247|  2.92M|    return result;
  248|  2.93M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   156k|  Self operator/(const Scalar &o) const {
  183|   156k|    Self ret;
  184|   624k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 468k, False: 156k]
  ------------------
  185|   468k|      ret[i] = (*this)[i] / o;
  186|   468k|    }
  187|   156k|    return ret;
  188|   156k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   217M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  13.1M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  8.81M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  2.18M|  Self operator-() const {
  121|  2.18M|    Self ret;
  122|  8.74M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 6.56M, False: 2.18M]
  ------------------
  123|  6.56M|      ret[i] = -(*this)[i];
  124|  6.56M|    }
  125|  2.18M|    return ret;
  126|  2.18M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  6.56M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  1.09M|  Self operator-(const Self &o) const {
  138|  1.09M|    Self ret;
  139|  3.27M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.18M, False: 1.09M]
  ------------------
  140|  2.18M|      ret[i] = (*this)[i] - o[i];
  141|  2.18M|    }
  142|  1.09M|    return ret;
  143|  1.09M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  13.0M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  19.6M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  56.2M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  2.18M|  Self operator+(const Self &o) const {
  130|  2.18M|    Self ret;
  131|  6.54M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 4.36M, False: 2.18M]
  ------------------
  132|  4.36M|      ret[i] = (*this)[i] + o[i];
  133|  4.36M|    }
  134|  2.18M|    return ret;
  135|  2.18M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  49.4M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  1.69M|  Self operator-(const Self &o) const {
  138|  1.69M|    Self ret;
  139|  5.08M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.38M, False: 1.69M]
  ------------------
  140|  3.38M|      ret[i] = (*this)[i] - o[i];
  141|  3.38M|    }
  142|  1.69M|    return ret;
  143|  1.69M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  1.69M|  Self operator+(const Self &o) const {
  130|  1.69M|    Self ret;
  131|  5.08M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 3.38M, False: 1.69M]
  ------------------
  132|  3.38M|      ret[i] = (*this)[i] + o[i];
  133|  3.38M|    }
  134|  1.69M|    return ret;
  135|  1.69M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   288k|  bool operator==(const Self &o) const {
  207|   849k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 569k, False: 280k]
  ------------------
  208|   569k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 8.05k, False: 560k]
  ------------------
  209|  8.05k|        return false;
  210|  8.05k|      }
  211|   569k|    }
  212|   280k|    return true;
  213|   288k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  3.31M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  8.56k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  9.08k|  Scalar Dot(const Self &o) const {
  251|  9.08k|    Scalar ret(0);
  252|  36.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 27.2k, False: 9.08k]
  ------------------
  253|  27.2k|      ret += (*this)[i] * o[i];
  254|  27.2k|    }
  255|  9.08k|    return ret;
  256|  9.08k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    516|  Self operator*(const Scalar &o) const {
  175|    516|    Self ret;
  176|  2.06k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.54k, False: 516]
  ------------------
  177|  1.54k|      ret[i] = (*this)[i] * o;
  178|  1.54k|    }
  179|    516|    return ret;
  180|    516|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  8.05k|  Self operator-(const Self &o) const {
  138|  8.05k|    Self ret;
  139|  24.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 16.1k, False: 8.05k]
  ------------------
  140|  16.1k|      ret[i] = (*this)[i] - o[i];
  141|  16.1k|    }
  142|  8.05k|    return ret;
  143|  8.05k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  16.1k|  VectorD() {
   41|  48.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 32.2k, False: 16.1k]
  ------------------
   42|  32.2k|      (*this)[i] = Scalar(0);
   43|  32.2k|    }
   44|  16.1k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   584k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   584k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   584k|    v_[0] = c0;
   55|   584k|    v_[1] = c1;
   56|   584k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  64.3k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   298k|  bool operator==(const Self &o) const {
  207|   856k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 577k, False: 278k]
  ------------------
  208|   577k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 19.6k, False: 558k]
  ------------------
  209|  19.6k|        return false;
  210|  19.6k|      }
  211|   577k|    }
  212|   278k|    return true;
  213|   298k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.76M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  42.0M|  VectorD() {
   41|   168M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 126M, False: 42.0M]
  ------------------
   42|   126M|      (*this)[i] = Scalar(0);
   43|   126M|    }
   44|  42.0M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  21.6k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  23.7k|  Scalar Dot(const Self &o) const {
  251|  23.7k|    Scalar ret(0);
  252|  94.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 71.2k, False: 23.7k]
  ------------------
  253|  71.2k|      ret += (*this)[i] * o[i];
  254|  71.2k|    }
  255|  23.7k|    return ret;
  256|  23.7k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  2.13k|  Self operator-(const Self &o) const {
  138|  2.13k|    Self ret;
  139|  6.39k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.26k, False: 2.13k]
  ------------------
  140|  4.26k|      ret[i] = (*this)[i] - o[i];
  141|  4.26k|    }
  142|  2.13k|    return ret;
  143|  2.13k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  6.04k|  Self operator*(const Scalar &o) const {
  175|  6.04k|    Self ret;
  176|  18.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 12.0k, False: 6.04k]
  ------------------
  177|  12.0k|      ret[i] = (*this)[i] * o;
  178|  12.0k|    }
  179|  6.04k|    return ret;
  180|  6.04k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  2.02k|  Self operator+(const Self &o) const {
  130|  2.02k|    Self ret;
  131|  6.06k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 4.04k, False: 2.02k]
  ------------------
  132|  4.04k|      ret[i] = (*this)[i] + o[i];
  133|  4.04k|    }
  134|  2.02k|    return ret;
  135|  2.02k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.02k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.02k|  return v * o;
  294|  2.02k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  2.00k|  Self operator+(const Self &o) const {
  130|  2.00k|    Self ret;
  131|  8.00k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 6.00k, False: 2.00k]
  ------------------
  132|  6.00k|      ret[i] = (*this)[i] + o[i];
  133|  6.00k|    }
  134|  2.00k|    return ret;
  135|  2.00k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.00k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.00k|  return v * o;
  294|  2.00k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  2.00k|  Self operator*(const Scalar &o) const {
  175|  2.00k|    Self ret;
  176|  8.00k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 6.00k, False: 2.00k]
  ------------------
  177|  6.00k|      ret[i] = (*this)[i] * o;
  178|  6.00k|    }
  179|  2.00k|    return ret;
  180|  2.00k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   598k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   598k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   598k|    v_[0] = c0;
   55|   598k|    v_[1] = c1;
   56|   598k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  14.1k|  VectorD() {
   41|  42.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 28.3k, False: 14.1k]
  ------------------
   42|  28.3k|      (*this)[i] = Scalar(0);
   43|  28.3k|    }
   44|  14.1k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  3.98k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  11.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 7.97k, False: 3.98k]
  ------------------
  104|  7.97k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 7.97k, False: 0]
  ------------------
  105|  7.97k|        v_[i] = Scalar(src_vector[i]);
  106|  7.97k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  7.97k|    }
  110|  3.98k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|    920|  Self operator+(const Self &o) const {
  130|    920|    Self ret;
  131|  2.76k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.84k, False: 920]
  ------------------
  132|  1.84k|      ret[i] = (*this)[i] + o[i];
  133|  1.84k|    }
  134|    920|    return ret;
  135|    920|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  1.99k|  VectorD() {
   41|  5.97k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.98k, False: 1.99k]
  ------------------
   42|  3.98k|      (*this)[i] = Scalar(0);
   43|  3.98k|    }
   44|  1.99k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  11.9k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  7.97k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  1.99k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  5.97k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 3.98k, False: 1.99k]
  ------------------
  104|  3.98k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 3.98k, False: 0]
  ------------------
  105|  3.98k|        v_[i] = Scalar(src_vector[i]);
  106|  3.98k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  3.98k|    }
  110|  1.99k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  1.99k|  Self operator/(const Scalar &o) const {
  183|  1.99k|    Self ret;
  184|  5.97k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 3.98k, False: 1.99k]
  ------------------
  185|  3.98k|      ret[i] = (*this)[i] / o;
  186|  3.98k|    }
  187|  1.99k|    return ret;
  188|  1.99k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.07k|  Self operator-(const Self &o) const {
  138|  1.07k|    Self ret;
  139|  3.21k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.14k, False: 1.07k]
  ------------------
  140|  2.14k|      ret[i] = (*this)[i] - o[i];
  141|  2.14k|    }
  142|  1.07k|    return ret;
  143|  1.07k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  56.7k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  2.18M|  VectorD() {
   41|  8.75M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.56M, False: 2.18M]
  ------------------
   42|  6.56M|      (*this)[i] = Scalar(0);
   43|  6.56M|    }
   44|  2.18M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  10.6M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  10.6M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  10.6M|    v_[0] = c0;
   55|  10.6M|    v_[1] = c1;
   56|  10.6M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  6.54M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  19.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 13.0M, False: 6.54M]
  ------------------
  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.54M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  3.27M|  VectorD() {
   41|  9.81M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.54M, False: 3.27M]
  ------------------
   42|  6.54M|      (*this)[i] = Scalar(0);
   43|  6.54M|    }
   44|  3.27M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  3.27M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  9.81M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 6.54M, False: 3.27M]
  ------------------
  104|  6.54M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 6.54M, False: 0]
  ------------------
  105|  6.54M|        v_[i] = Scalar(src_vector[i]);
  106|  6.54M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  6.54M|    }
  110|  3.27M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  6.77M|  VectorD(const Self &o) {
   89|  20.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 13.5M, False: 6.77M]
  ------------------
   90|  13.5M|      (*this)[i] = o[i];
   91|  13.5M|    }
   92|  6.77M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  3.38M|  VectorD() {
   41|  10.1M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.77M, False: 3.38M]
  ------------------
   42|  6.77M|      (*this)[i] = Scalar(0);
   43|  6.77M|    }
   44|  3.38M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|   108M|  inline int num_vertices() const {
   74|   108M|    return static_cast<int>(vertex_corners_.size());
   75|   108M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  9.76M|  inline int num_corners() const {
   77|  9.76M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  9.76M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  3.13M|  inline int num_faces() const {
   80|  3.13M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  3.13M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   351M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   351M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 351M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   351M|    return opposite_corners_[corner];
   88|   351M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   602M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   602M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 14.1M, False: 588M]
  ------------------
   91|  14.1M|      return corner;
   92|  14.1M|    }
   93|   588M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 534M, False: 53.6M]
  ------------------
   94|   602M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   500M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   500M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 5.70M, False: 495M]
  ------------------
   97|  5.70M|      return corner;
   98|  5.70M|    }
   99|   495M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 133M, False: 361M]
  ------------------
  100|   500M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   948M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   948M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 948M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   948M|    return ConfidentVertex(corner);
  106|   948M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   948M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   948M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   948M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   948M|    return corner_to_vertex_map_[corner];
  111|   948M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  36.9M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  36.9M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 36.9M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  36.9M|    return FaceIndex(corner.value() / 3);
  117|  36.9M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|  1.08G|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  68.8M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  68.8M|    return vertex_corners_[v];
  152|  68.8M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|   749k|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|   749k|    const CornerIndex corner = LeftMostCorner(vert);
  187|   749k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 18.4k, False: 731k]
  ------------------
  188|  18.4k|      return true;
  189|  18.4k|    }
  190|   731k|    return false;
  191|   749k|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  76.6M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  76.6M|    return Previous(Opposite(Previous(corner)));
  202|  76.6M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  12.7M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  12.7M|    return Next(Opposite(Next(corner)));
  207|  12.7M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  3.59M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  3.59M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 3.59M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  3.59M|    return Opposite(Previous(corner_id));
  222|  3.59M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  4.32M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  4.32M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 4.32M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  4.32M|    return Opposite(Next(corner_id));
  228|  4.32M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   393M|                                CornerIndex opp_corner_id) {
  249|   393M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   393M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   393M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   454M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   454M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   454M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   454M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|   112M|  VertexIndex AddNewVertex() {
  271|   112M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|   112M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|   112M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|   112M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   252M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   252M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   252M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 252M, False: 0]
  ------------------
  295|   252M|      vertex_corners_[vert] = corner;
  296|   252M|    }
  297|   252M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  2.46M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  2.46M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  2.46M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  2.46M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  8.71k|      : corner_table_(table),
  229|  8.71k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  8.71k|        corner_(start_corner_),
  231|  8.71k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  4.56M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  66.3k|  VertexCornersIterator &operator++() {
  268|  66.3k|    Next();
  269|  66.3k|    return *this;
  270|  66.3k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.90M|  void Next() {
  248|  3.90M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.85M, False: 57.7k]
  ------------------
  249|  3.85M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.85M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 19.3k, False: 3.83M]
  ------------------
  251|       |        // Open boundary reached.
  252|  19.3k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  19.3k|        left_traversal_ = false;
  254|  3.83M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 637k, False: 3.19M]
  ------------------
  255|       |        // End reached.
  256|   637k|        corner_ = kInvalidCornerIndex;
  257|   637k|      }
  258|  3.85M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  57.7k|      corner_ = corner_table_->SwingRight(corner_);
  262|  57.7k|    }
  263|  3.90M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  7.00M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  5.64M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  5.96M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  3.35M|  void Next() {
  248|  3.35M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.32M, False: 30.2k]
  ------------------
  249|  3.32M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.32M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 2.08M, False: 1.23M]
  ------------------
  251|       |        // Open boundary reached.
  252|  2.08M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  2.08M|        left_traversal_ = false;
  254|  2.08M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 202k, False: 1.03M]
  ------------------
  255|       |        // End reached.
  256|   202k|        corner_ = kInvalidCornerIndex;
  257|   202k|      }
  258|  3.32M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  30.2k|      corner_ = corner_table_->SwingRight(corner_);
  262|  30.2k|    }
  263|  3.35M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  2.28M|      : corner_table_(table),
  236|  2.28M|        start_corner_(corner_id),
  237|  2.28M|        corner_(start_corner_),
  238|  2.28M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   648k|      : corner_table_(table),
  236|   648k|        start_corner_(corner_id),
  237|   648k|        corner_(start_corner_),
  238|   648k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  63.0M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  63.0M|    return is_edge_on_seam_[corner.value()];
   47|  63.0M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  31.5M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  31.5M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 31.5M]
  |  Branch (50:42): [True: 24.8M, False: 6.68M]
  ------------------
   51|  24.8M|      return kInvalidCornerIndex;
   52|  24.8M|    }
   53|  6.68M|    return corner_table_->Opposite(corner);
   54|  31.5M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  42.7M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  42.7M|    return corner_table_->Next(corner);
   58|  42.7M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  24.9M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  24.9M|    return corner_table_->Previous(corner);
   62|  24.9M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  4.75M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  4.75M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  4.75M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.52M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  3.52M|    return Opposite(Previous(corner));
   73|  3.52M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  4.20M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  4.20M|    return Opposite(Next(corner));
   76|  4.20M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  5.27M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  5.27M|    return Previous(Opposite(Previous(corner)));
   81|  5.27M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  13.8M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  13.8M|    return Next(Opposite(Next(corner)));
   86|  13.8M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  10.6k|  int num_vertices() const {
   89|  10.6k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  10.6k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  3.79k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.39k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|   104M|  VertexIndex Vertex(CornerIndex corner) const {
   95|   104M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|   104M|    return ConfidentVertex(corner);
   97|   104M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|   104M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|   104M|    return corner_to_vertex_map_[corner.value()];
  100|   104M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  3.47M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  3.47M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  3.47M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  3.47M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  3.47M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  3.47M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 3.47M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  3.47M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 2.80M, False: 676k]
  ------------------
  128|  2.80M|      return true;
  129|  2.80M|    }
  130|   676k|    return false;
  131|  3.47M|  }

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

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

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

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

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

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

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

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

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

