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

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

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

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

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

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

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

_ZN5draco17GeometryAttributeC2Ev:
   20|  77.8k|    : buffer_(nullptr),
   21|  77.8k|      num_components_(1),
   22|  77.8k|      data_type_(DT_FLOAT32),
   23|  77.8k|      byte_stride_(0),
   24|  77.8k|      byte_offset_(0),
   25|  77.8k|      attribute_type_(INVALID),
   26|  77.8k|      unique_id_(0) {}
_ZN5draco17GeometryAttribute4InitENS0_4TypeEPNS_10DataBufferEhNS_8DataTypeEbll:
   31|  77.8k|                             int64_t byte_stride, int64_t byte_offset) {
   32|  77.8k|  buffer_ = buffer;
   33|  77.8k|  if (buffer) {
  ------------------
  |  Branch (33:7): [True: 0, False: 77.8k]
  ------------------
   34|      0|    buffer_descriptor_.buffer_id = buffer->buffer_id();
   35|      0|    buffer_descriptor_.buffer_update_count = buffer->update_count();
   36|      0|  }
   37|  77.8k|  num_components_ = num_components;
   38|  77.8k|  data_type_ = data_type;
   39|  77.8k|  normalized_ = normalized;
   40|  77.8k|  byte_stride_ = byte_stride;
   41|  77.8k|  byte_offset_ = byte_offset;
   42|  77.8k|  attribute_type_ = attribute_type;
   43|  77.8k|}
_ZN5draco17GeometryAttribute11ResetBufferEPNS_10DataBufferEll:
  102|  27.0k|                                    int64_t byte_offset) {
  103|  27.0k|  buffer_ = buffer;
  104|  27.0k|  buffer_descriptor_.buffer_id = buffer->buffer_id();
  105|  27.0k|  buffer_descriptor_.buffer_update_count = buffer->update_count();
  106|  27.0k|  byte_stride_ = byte_stride;
  107|  27.0k|  byte_offset_ = byte_offset;
  108|  27.0k|}

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

_ZN5draco14PointAttributeC2ERKNS_17GeometryAttributeE:
   32|  77.8k|    : GeometryAttribute(att),
   33|  77.8k|      num_unique_entries_(0),
   34|  77.8k|      identity_mapping_(false) {}
_ZN5draco14PointAttribute5ResetEm:
   67|  27.0k|bool PointAttribute::Reset(size_t num_attribute_values) {
   68|  27.0k|  if (attribute_buffer_ == nullptr) {
  ------------------
  |  Branch (68:7): [True: 27.0k, False: 0]
  ------------------
   69|  27.0k|    attribute_buffer_ = std::unique_ptr<DataBuffer>(new DataBuffer());
   70|  27.0k|  }
   71|  27.0k|  const int64_t entry_size = DataTypeLength(data_type()) * num_components();
   72|  27.0k|  if (!attribute_buffer_->Update(nullptr, num_attribute_values * entry_size)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 27.0k]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|       |  // Assign the new buffer to the parent attribute.
   76|  27.0k|  ResetBuffer(attribute_buffer_.get(), entry_size, 0);
   77|  27.0k|  num_unique_entries_ = static_cast<uint32_t>(num_attribute_values);
   78|  27.0k|  return true;
   79|  27.0k|}

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  3.30k|      : quantization_bits_(-1),
   54|  3.30k|        max_quantized_value_(-1),
   55|  3.30k|        max_value_(-1),
   56|  3.30k|        dequantization_scale_(1.f),
   57|  3.30k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  3.00k|  bool SetQuantizationBits(int32_t q) {
   60|  3.00k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 1.05k, False: 1.95k]
  |  Branch (60:18): [True: 126, False: 1.82k]
  ------------------
   61|  1.17k|      return false;
   62|  1.17k|    }
   63|  1.82k|    quantization_bits_ = q;
   64|  1.82k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.82k|    max_value_ = max_quantized_value_ - 1;
   66|  1.82k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.82k|    center_value_ = max_value_ / 2;
   68|  1.82k|    return true;
   69|  3.00k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  3.93M|                                           int32_t* out_t) const {
   77|  3.93M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 3.66k, False: 3.93M]
  |  Branch (77:20): [True: 0, False: 3.66k]
  |  Branch (77:32): [True: 3.66k, False: 3.93M]
  |  Branch (77:42): [True: 0, False: 3.66k]
  ------------------
   78|  3.93M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 3.16M, False: 775k]
  |  Branch (78:29): [True: 4.65k, False: 3.15M]
  ------------------
   79|  4.65k|      s = max_value_;
   80|  4.65k|      t = max_value_;
   81|  3.93M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 3.66k, False: 3.93M]
  |  Branch (81:26): [True: 1.02k, False: 2.63k]
  ------------------
   82|  1.02k|      t = center_value_ - (t - center_value_);
   83|  3.93M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 3.15M, False: 774k]
  |  Branch (83:35): [True: 5.01k, False: 3.15M]
  ------------------
   84|  5.01k|      t = center_value_ + (center_value_ - t);
   85|  3.92M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 3.15M, False: 772k]
  |  Branch (85:35): [True: 387, False: 3.15M]
  ------------------
   86|    387|      s = center_value_ + (center_value_ - s);
   87|  3.92M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 4.89k, False: 3.92M]
  |  Branch (87:26): [True: 1.69k, False: 3.20k]
  ------------------
   88|  1.69k|      s = center_value_ - (s - center_value_);
   89|  1.69k|    }
   90|       |
   91|  3.93M|    *out_s = s;
   92|  3.93M|    *out_t = t;
   93|  3.93M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  3.93M|                                                       int32_t* out_t) const {
  100|  3.93M|    DRACO_DCHECK_EQ(
  101|  3.93M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  3.93M|        center_value_);
  103|  3.93M|    int32_t s, t;
  104|  3.93M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.58M, False: 2.35M]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.58M|      s = (int_vec[1] + center_value_);
  107|  1.58M|      t = (int_vec[2] + center_value_);
  108|  2.35M|    } else {
  109|       |      // Left hemisphere.
  110|  2.35M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 35.2k, False: 2.32M]
  ------------------
  111|  35.2k|        s = std::abs(int_vec[2]);
  112|  2.32M|      } else {
  113|  2.32M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  2.32M|      }
  115|  2.35M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 38.1k, False: 2.31M]
  ------------------
  116|  38.1k|        t = std::abs(int_vec[1]);
  117|  2.31M|      } else {
  118|  2.31M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  2.31M|      }
  120|  2.35M|    }
  121|  3.93M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  3.93M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  15.3M|                                                    float* out_vector) const {
  199|  15.3M|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  15.3M|                                 in_t * dequantization_scale_ - 1.f,
  201|  15.3M|                                 out_vector);
  202|  15.3M|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  5.32M|  inline bool IsInDiamond(const int32_t& s, const int32_t& t) const {
  206|       |    // Expect center already at origin.
  207|  5.32M|    DRACO_DCHECK_LE(s, center_value_);
  208|  5.32M|    DRACO_DCHECK_LE(t, center_value_);
  209|  5.32M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  5.32M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  5.32M|    const uint32_t st =
  212|  5.32M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  5.32M|    return st <= center_value_;
  214|  5.32M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  9.27M|  void InvertDiamond(int32_t* s, int32_t* t) const {
  217|       |    // Expect center already at origin.
  218|  9.27M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  9.27M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  9.27M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  9.27M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  9.27M|    int32_t sign_s = 0;
  223|  9.27M|    int32_t sign_t = 0;
  224|  9.27M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 9.19M, False: 79.1k]
  |  Branch (224:20): [True: 9.14M, False: 49.5k]
  ------------------
  225|  9.14M|      sign_s = 1;
  226|  9.14M|      sign_t = 1;
  227|  9.14M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 81.3k, False: 47.3k]
  |  Branch (227:27): [True: 37.6k, False: 43.7k]
  ------------------
  228|  37.6k|      sign_s = -1;
  229|  37.6k|      sign_t = -1;
  230|  91.0k|    } else {
  231|  91.0k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 47.3k, False: 43.7k]
  ------------------
  232|  91.0k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 43.7k, False: 47.3k]
  ------------------
  233|  91.0k|    }
  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|  9.27M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  9.27M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  9.27M|    uint32_t us = *s;
  241|  9.27M|    uint32_t ut = *t;
  242|  9.27M|    us = us + us - corner_point_s;
  243|  9.27M|    ut = ut + ut - corner_point_t;
  244|  9.27M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 9.18M, False: 91.0k]
  ------------------
  245|  9.18M|      uint32_t temp = us;
  246|  9.18M|      us = -ut;
  247|  9.18M|      ut = -temp;
  248|  9.18M|    } else {
  249|  91.0k|      std::swap(us, ut);
  250|  91.0k|    }
  251|  9.27M|    us = us + corner_point_s;
  252|  9.27M|    ut = ut + corner_point_t;
  253|       |
  254|  9.27M|    *s = us;
  255|  9.27M|    *t = ut;
  256|  9.27M|    *s /= 2;
  257|  9.27M|    *t /= 2;
  258|  9.27M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  10.6M|  int32_t ModMax(int32_t x) const {
  273|  10.6M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 4.55k, False: 10.6M]
  ------------------
  274|  4.55k|      return x - this->max_quantized_value();
  275|  4.55k|    }
  276|  10.6M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 2.92k, False: 10.6M]
  ------------------
  277|  2.92k|      return x + this->max_quantized_value();
  278|  2.92k|    }
  279|  10.6M|    return x;
  280|  10.6M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.76k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  7.47k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  31.9M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  15.3M|                                           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|  15.3M|    float y = in_s_scaled;
  329|  15.3M|    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|  15.3M|    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|  15.3M|    float x_offset = -x;
  342|  15.3M|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 25, False: 15.3M]
  ------------------
  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|  15.3M|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 15.0M, False: 276k]
  ------------------
  348|  15.3M|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 15.0M, False: 276k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  15.3M|    const float norm_squared = x * x + y * y + z * z;
  352|  15.3M|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 15.3M]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  15.3M|    } else {
  357|  15.3M|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  15.3M|      out_vector[0] = x * d;
  359|  15.3M|      out_vector[1] = y * d;
  360|  15.3M|      out_vector[2] = z * d;
  361|  15.3M|    }
  362|  15.3M|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  3.93M|  void CanonicalizeIntegerVector(T* vec) const {
  174|  3.93M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  3.93M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  3.93M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  3.93M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  3.93M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  3.93M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 3.73M, False: 202k]
  ------------------
  181|  3.73M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  3.73M|    } else {
  183|   202k|      vec[0] =
  184|   202k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   202k|          abs_sum;
  186|   202k|      vec[1] =
  187|   202k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   202k|          abs_sum;
  189|   202k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 110k, False: 91.6k]
  ------------------
  190|   110k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   110k|      } else {
  192|  91.6k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|  91.6k|      }
  194|   202k|    }
  195|  3.93M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    706|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    706|            attribute, transform, mesh_data),
   52|    706|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    700|                                                                buffer) {
  197|    700|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    700|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    700|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 17, False: 683]
  ------------------
  199|       |    // Decode prediction mode.
  200|     17|    uint8_t mode;
  201|     17|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 1, False: 16]
  ------------------
  202|      1|      return false;
  203|      1|    }
  204|       |
  205|     16|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 5, False: 11]
  ------------------
  206|       |      // Unsupported mode.
  207|      5|      return false;
  208|      5|    }
  209|     16|  }
  210|    694|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  3.25k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 2.65k, False: 598]
  ------------------
  214|  2.65k|    uint32_t num_flags;
  215|  2.65k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 20, False: 2.63k]
  ------------------
  216|     20|      return false;
  217|     20|    }
  218|  2.63k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 51, False: 2.58k]
  ------------------
  219|     51|      return false;
  220|     51|    }
  221|  2.58k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 643, False: 1.93k]
  ------------------
  222|    643|      is_crease_edge_[i].resize(num_flags);
  223|    643|      RAnsBitDecoder decoder;
  224|    643|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 25, False: 618]
  ------------------
  225|     25|        return false;
  226|     25|      }
  227|  1.08M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 1.08M, False: 618]
  ------------------
  228|  1.08M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  1.08M|      }
  230|    618|      decoder.EndDecoding();
  231|    618|    }
  232|  2.58k|  }
  233|    598|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    598|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    694|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    576|                          const PointIndex* /* entry_to_point_id_map */) {
   87|    576|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    576|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  2.88k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 2.30k, False: 576]
  ------------------
   93|  2.30k|    pred_vals[i].resize(num_components, 0);
   94|  2.30k|  }
   95|    576|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    576|                                         out_data);
   97|       |
   98|    576|  const CornerTable* const table = this->mesh_data().corner_table();
   99|    576|  const std::vector<int32_t>* const vertex_to_data_map =
  100|    576|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    576|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    576|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    576|  const int corner_map_size =
  109|    576|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    576|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 576]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   697k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 696k, False: 431]
  ------------------
  114|   696k|    const CornerIndex start_corner_id =
  115|   696k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   696k|    CornerIndex corner_id(start_corner_id);
  118|   696k|    int num_parallelograms = 0;
  119|   696k|    bool first_pass = true;
  120|  1.52M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 862k, False: 666k]
  ------------------
  121|   862k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 64.6k, False: 798k]
  ------------------
  122|   862k|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|   862k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|  64.6k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|  64.6k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 493, False: 64.1k]
  ------------------
  130|    493|          break;
  131|    493|        }
  132|  64.6k|      }
  133|       |
  134|       |      // Proceed to the next corner attached to the vertex. First swing left
  135|       |      // and if we reach a boundary, swing right from the start corner.
  136|   862k|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 853k, False: 9.38k]
  ------------------
  137|   853k|        corner_id = table->SwingLeft(corner_id);
  138|   853k|      } else {
  139|  9.38k|        corner_id = table->SwingRight(corner_id);
  140|  9.38k|      }
  141|   862k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 29.7k, False: 832k]
  ------------------
  142|  29.7k|        break;
  143|  29.7k|      }
  144|   832k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 670k, False: 162k]
  |  Branch (144:47): [True: 666k, False: 3.97k]
  ------------------
  145|   666k|        first_pass = false;
  146|   666k|        corner_id = table->SwingRight(start_corner_id);
  147|   666k|      }
  148|   832k|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   696k|    int num_used_parallelograms = 0;
  153|   696k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 35.8k, False: 660k]
  ------------------
  154|  1.18M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 1.15M, False: 35.8k]
  ------------------
  155|  1.15M|        multi_pred_vals[i] = 0;
  156|  1.15M|      }
  157|       |      // Check which parallelograms are actually used.
  158|   100k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 64.5k, False: 35.7k]
  ------------------
  159|  64.5k|        const int context = num_parallelograms - 1;
  160|  64.5k|        const int pos = is_crease_edge_pos[context]++;
  161|  64.5k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 145, False: 64.4k]
  ------------------
  162|    145|          return false;
  163|    145|        }
  164|  64.4k|        const bool is_crease = is_crease_edge_[context][pos];
  165|  64.4k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 31.4k, False: 32.9k]
  ------------------
  166|  31.4k|          ++num_used_parallelograms;
  167|  1.26M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 1.23M, False: 31.4k]
  ------------------
  168|  1.23M|            multi_pred_vals[j] =
  169|  1.23M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|  1.23M|          }
  171|  31.4k|        }
  172|  64.4k|      }
  173|  35.8k|    }
  174|   696k|    const int dst_offset = p * num_components;
  175|   696k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 680k, False: 16.2k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|   680k|      const int src_offset = (p - 1) * num_components;
  179|   680k|      this->transform().ComputeOriginalValue(
  180|   680k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|   680k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|   666k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 650k, False: 16.2k]
  ------------------
  184|   650k|        multi_pred_vals[c] /= num_used_parallelograms;
  185|   650k|      }
  186|  16.2k|      this->transform().ComputeOriginalValue(
  187|  16.2k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  16.2k|    }
  189|   696k|  }
  190|    431|  return true;
  191|    576|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    657|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    657|            attribute, transform, mesh_data),
   52|    657|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    649|                                                                buffer) {
  197|    649|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    649|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    649|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 14, False: 635]
  ------------------
  199|       |    // Decode prediction mode.
  200|     14|    uint8_t mode;
  201|     14|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 1, False: 13]
  ------------------
  202|      1|      return false;
  203|      1|    }
  204|       |
  205|     13|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 6, False: 7]
  ------------------
  206|       |      // Unsupported mode.
  207|      6|      return false;
  208|      6|    }
  209|     13|  }
  210|    642|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  2.88k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 2.38k, False: 504]
  ------------------
  214|  2.38k|    uint32_t num_flags;
  215|  2.38k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 14, False: 2.36k]
  ------------------
  216|     14|      return false;
  217|     14|    }
  218|  2.36k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 88, False: 2.27k]
  ------------------
  219|     88|      return false;
  220|     88|    }
  221|  2.27k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 948, False: 1.33k]
  ------------------
  222|    948|      is_crease_edge_[i].resize(num_flags);
  223|    948|      RAnsBitDecoder decoder;
  224|    948|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 36, False: 912]
  ------------------
  225|     36|        return false;
  226|     36|      }
  227|  1.12M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 1.12M, False: 912]
  ------------------
  228|  1.12M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  1.12M|      }
  230|    912|      decoder.EndDecoding();
  231|    912|    }
  232|  2.27k|  }
  233|    504|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    504|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    642|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    460|                          const PointIndex* /* entry_to_point_id_map */) {
   87|    460|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    460|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  2.30k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.84k, False: 460]
  ------------------
   93|  1.84k|    pred_vals[i].resize(num_components, 0);
   94|  1.84k|  }
   95|    460|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    460|                                         out_data);
   97|       |
   98|    460|  const CornerTable* const table = this->mesh_data().corner_table();
   99|    460|  const std::vector<int32_t>* const vertex_to_data_map =
  100|    460|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    460|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    460|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    460|  const int corner_map_size =
  109|    460|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    460|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 460]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   111k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 111k, False: 212]
  ------------------
  114|   111k|    const CornerIndex start_corner_id =
  115|   111k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   111k|    CornerIndex corner_id(start_corner_id);
  118|   111k|    int num_parallelograms = 0;
  119|   111k|    bool first_pass = true;
  120|   639k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 631k, False: 8.07k]
  ------------------
  121|   631k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 202k, False: 429k]
  ------------------
  122|   631k|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|   631k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|   202k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|   202k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 277, False: 202k]
  ------------------
  130|    277|          break;
  131|    277|        }
  132|   202k|      }
  133|       |
  134|       |      // Proceed to the next corner attached to the vertex. First swing left
  135|       |      // and if we reach a boundary, swing right from the start corner.
  136|   631k|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 624k, False: 6.75k]
  ------------------
  137|   624k|        corner_id = table->SwingLeft(corner_id);
  138|   624k|      } else {
  139|  6.75k|        corner_id = table->SwingRight(corner_id);
  140|  6.75k|      }
  141|   631k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 102k, False: 528k]
  ------------------
  142|   102k|        break;
  143|   102k|      }
  144|   528k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 11.5k, False: 516k]
  |  Branch (144:47): [True: 8.07k, False: 3.48k]
  ------------------
  145|  8.07k|        first_pass = false;
  146|  8.07k|        corner_id = table->SwingRight(start_corner_id);
  147|  8.07k|      }
  148|   528k|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   111k|    int num_used_parallelograms = 0;
  153|   111k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 104k, False: 6.76k]
  ------------------
  154|  8.88M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 8.78M, False: 104k]
  ------------------
  155|  8.78M|        multi_pred_vals[i] = 0;
  156|  8.78M|      }
  157|       |      // Check which parallelograms are actually used.
  158|   306k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 202k, False: 104k]
  ------------------
  159|   202k|        const int context = num_parallelograms - 1;
  160|   202k|        const int pos = is_crease_edge_pos[context]++;
  161|   202k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 248, False: 201k]
  ------------------
  162|    248|          return false;
  163|    248|        }
  164|   201k|        const bool is_crease = is_crease_edge_[context][pos];
  165|   201k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 153k, False: 48.4k]
  ------------------
  166|   153k|          ++num_used_parallelograms;
  167|  15.9M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 15.7M, False: 153k]
  ------------------
  168|  15.7M|            multi_pred_vals[j] =
  169|  15.7M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|  15.7M|          }
  171|   153k|        }
  172|   201k|      }
  173|   104k|    }
  174|   111k|    const int dst_offset = p * num_components;
  175|   111k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 33.5k, False: 77.5k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|  33.5k|      const int src_offset = (p - 1) * num_components;
  179|  33.5k|      this->transform().ComputeOriginalValue(
  180|  33.5k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|  77.5k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|  7.99M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 7.92M, False: 77.5k]
  ------------------
  184|  7.92M|        multi_pred_vals[c] /= num_used_parallelograms;
  185|  7.92M|      }
  186|  77.5k|      this->transform().ComputeOriginalValue(
  187|  77.5k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  77.5k|    }
  189|   111k|  }
  190|    212|  return true;
  191|    460|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  3.77k|           const std::vector<int32_t>* vertex_to_data_map) {
   38|  3.77k|    mesh_ = mesh;
   39|  3.77k|    corner_table_ = table;
   40|  3.77k|    data_to_corner_map_ = data_to_corner_map;
   41|  3.77k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  3.77k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  16.1M|  const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  11.7M|  const std::vector<int32_t>* vertex_to_data_map() const {
   47|  11.7M|    return vertex_to_data_map_;
   48|  11.7M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  11.7M|  const std::vector<CornerIndex>* data_to_corner_map() const {
   50|  11.7M|    return data_to_corner_map_;
   51|  11.7M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  3.78k|           const std::vector<int32_t>* vertex_to_data_map) {
   38|  3.78k|    mesh_ = mesh;
   39|  3.78k|    corner_table_ = table;
   40|  3.78k|    data_to_corner_map_ = data_to_corner_map;
   41|  3.78k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  3.78k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  9.65M|  const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  8.25M|  const std::vector<int32_t>* vertex_to_data_map() const {
   47|  8.25M|    return vertex_to_data_map_;
   48|  8.25M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  2.78M|  const std::vector<CornerIndex>* data_to_corner_map() const {
   50|  2.78M|    return data_to_corner_map_;
   51|  2.78M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  3.77k|      : mesh_(nullptr),
   31|  3.77k|        corner_table_(nullptr),
   32|  3.77k|        vertex_to_data_map_(nullptr),
   33|  3.77k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  3.78k|      : mesh_(nullptr),
   31|  3.78k|        corner_table_(nullptr),
   32|  3.78k|        vertex_to_data_map_(nullptr),
   33|  3.78k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  1.34M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   248k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  1.12M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   190k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  3.39k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  3.39k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  10.8M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  3.33k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  3.33k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  3.59M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    159|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    159|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    219|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    219|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    189|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    189|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    223|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    223|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    316|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    159|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    159|    DRACO_DCHECK_EQ(i, 0);
   70|    159|    (void)i;
   71|    159|    return GeometryAttribute::POSITION;
   72|    159|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    158|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    158|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 158]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    158|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 157]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    157|    predictor_.SetPositionAttribute(*att);
   82|    157|    return true;
   83|    158|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    157|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    157|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 8, False: 149]
  ------------------
  148|      8|    return false;
  149|      8|  }
  150|       |
  151|    149|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    149|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    149|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 45, False: 104]
  ------------------
  153|     45|    uint8_t prediction_mode;
  154|     45|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 44]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     44|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 43]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     43|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 43]
  ------------------
  163|     43|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     43|  }
  167|    147|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    147|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 16, False: 131]
  ------------------
  171|     16|    return false;
  172|     16|  }
  173|       |
  174|    131|  return true;
  175|    147|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    131|                                      const PointIndex* entry_to_point_id_map) {
  103|    131|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    131|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    131|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    131|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    131|  const int corner_map_size =
  111|    131|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    131|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 131]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    131|  VectorD<int32_t, 3> pred_normal_3d;
  117|    131|  int32_t pred_normal_oct[2];
  118|       |
  119|  1.34M|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 1.34M, False: 131]
  ------------------
  120|  1.34M|    const CornerIndex corner_id =
  121|  1.34M|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|  1.34M|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|  1.34M|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|  1.34M|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|  1.34M|                    octahedron_tool_box_.center_value());
  128|  1.34M|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 1.29M, False: 49.6k]
  ------------------
  129|  1.29M|      pred_normal_3d = -pred_normal_3d;
  130|  1.29M|    }
  131|  1.34M|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|  1.34M|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|  1.34M|    const int data_offset = data_id * 2;
  135|  1.34M|    this->transform().ComputeOriginalValue(
  136|  1.34M|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|  1.34M|  }
  138|    131|  flip_normal_bit_decoder_.EndDecoding();
  139|    131|  return true;
  140|    131|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    131|  void SetQuantizationBits(int q) {
   85|    131|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    131|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    434|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    219|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    219|    DRACO_DCHECK_EQ(i, 0);
   70|    219|    (void)i;
   71|    219|    return GeometryAttribute::POSITION;
   72|    219|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    218|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    218|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 218]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    218|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 215]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    215|    predictor_.SetPositionAttribute(*att);
   82|    215|    return true;
   83|    218|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    215|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    215|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 7, False: 208]
  ------------------
  148|      7|    return false;
  149|      7|  }
  150|       |
  151|    208|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    208|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    208|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 42, False: 166]
  ------------------
  153|     42|    uint8_t prediction_mode;
  154|     42|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 41]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     41|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 39]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     39|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 39]
  ------------------
  163|     39|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     39|  }
  167|    205|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    205|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 5, False: 200]
  ------------------
  171|      5|    return false;
  172|      5|  }
  173|       |
  174|    200|  return true;
  175|    205|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    200|                                      const PointIndex* entry_to_point_id_map) {
  103|    200|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    200|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    200|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    200|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    200|  const int corner_map_size =
  111|    200|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    200|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 200]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    200|  VectorD<int32_t, 3> pred_normal_3d;
  117|    200|  int32_t pred_normal_oct[2];
  118|       |
  119|   248k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 248k, False: 200]
  ------------------
  120|   248k|    const CornerIndex corner_id =
  121|   248k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   248k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   248k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   248k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   248k|                    octahedron_tool_box_.center_value());
  128|   248k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 187k, False: 60.4k]
  ------------------
  129|   187k|      pred_normal_3d = -pred_normal_3d;
  130|   187k|    }
  131|   248k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   248k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   248k|    const int data_offset = data_id * 2;
  135|   248k|    this->transform().ComputeOriginalValue(
  136|   248k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   248k|  }
  138|    200|  flip_normal_bit_decoder_.EndDecoding();
  139|    200|  return true;
  140|    200|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    200|  void SetQuantizationBits(int q) {
   85|    200|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    200|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    375|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    189|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    189|    DRACO_DCHECK_EQ(i, 0);
   70|    189|    (void)i;
   71|    189|    return GeometryAttribute::POSITION;
   72|    189|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    189|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    189|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 189]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    189|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 186]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    186|    predictor_.SetPositionAttribute(*att);
   82|    186|    return true;
   83|    189|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    186|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    186|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 6, False: 180]
  ------------------
  148|      6|    return false;
  149|      6|  }
  150|       |
  151|    180|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    180|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    180|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 56, False: 124]
  ------------------
  153|     56|    uint8_t prediction_mode;
  154|     56|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 55]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     55|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 53]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     53|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 53]
  ------------------
  163|     53|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     53|  }
  167|    177|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    177|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 22, False: 155]
  ------------------
  171|     22|    return false;
  172|     22|  }
  173|       |
  174|    155|  return true;
  175|    177|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    155|                                      const PointIndex* entry_to_point_id_map) {
  103|    155|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    155|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    155|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    155|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    155|  const int corner_map_size =
  111|    155|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    155|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 155]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    155|  VectorD<int32_t, 3> pred_normal_3d;
  117|    155|  int32_t pred_normal_oct[2];
  118|       |
  119|  1.12M|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 1.12M, False: 155]
  ------------------
  120|  1.12M|    const CornerIndex corner_id =
  121|  1.12M|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|  1.12M|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|  1.12M|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|  1.12M|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|  1.12M|                    octahedron_tool_box_.center_value());
  128|  1.12M|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 705k, False: 417k]
  ------------------
  129|   705k|      pred_normal_3d = -pred_normal_3d;
  130|   705k|    }
  131|  1.12M|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|  1.12M|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|  1.12M|    const int data_offset = data_id * 2;
  135|  1.12M|    this->transform().ComputeOriginalValue(
  136|  1.12M|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|  1.12M|  }
  138|    155|  flip_normal_bit_decoder_.EndDecoding();
  139|    155|  return true;
  140|    155|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    155|  void SetQuantizationBits(int q) {
   85|    155|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    155|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    444|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    223|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    223|    DRACO_DCHECK_EQ(i, 0);
   70|    223|    (void)i;
   71|    223|    return GeometryAttribute::POSITION;
   72|    223|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    223|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    223|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 223]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    223|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 221]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    221|    predictor_.SetPositionAttribute(*att);
   82|    221|    return true;
   83|    223|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    221|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    221|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 6, False: 215]
  ------------------
  148|      6|    return false;
  149|      6|  }
  150|       |
  151|    215|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    215|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    215|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 56, False: 159]
  ------------------
  153|     56|    uint8_t prediction_mode;
  154|     56|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 55]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     55|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 5, False: 50]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      5|      return false;
  160|      5|    }
  161|       |
  162|     50|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 50]
  ------------------
  163|     50|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     50|  }
  167|    209|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    209|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 7, False: 202]
  ------------------
  171|      7|    return false;
  172|      7|  }
  173|       |
  174|    202|  return true;
  175|    209|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    202|                                      const PointIndex* entry_to_point_id_map) {
  103|    202|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    202|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    202|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    202|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    202|  const int corner_map_size =
  111|    202|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    202|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 202]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    202|  VectorD<int32_t, 3> pred_normal_3d;
  117|    202|  int32_t pred_normal_oct[2];
  118|       |
  119|   190k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 190k, False: 202]
  ------------------
  120|   190k|    const CornerIndex corner_id =
  121|   190k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   190k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   190k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   190k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   190k|                    octahedron_tool_box_.center_value());
  128|   190k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 122k, False: 67.2k]
  ------------------
  129|   122k|      pred_normal_3d = -pred_normal_3d;
  130|   122k|    }
  131|   190k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   190k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   190k|    const int data_offset = data_id * 2;
  135|   190k|    this->transform().ComputeOriginalValue(
  136|   190k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   190k|  }
  138|    202|  flip_normal_bit_decoder_.EndDecoding();
  139|    202|  return true;
  140|    202|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    202|  void SetQuantizationBits(int q) {
   85|    202|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    202|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    436|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    436|            attribute, transform, mesh_data),
   37|    436|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    868|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    436|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    436|    DRACO_DCHECK_EQ(i, 0);
   70|    436|    (void)i;
   71|    436|    return GeometryAttribute::POSITION;
   72|    436|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    435|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    435|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 435]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    435|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 432]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    432|    predictor_.SetPositionAttribute(*att);
   82|    432|    return true;
   83|    435|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    431|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    431|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 27, False: 404]
  ------------------
  148|     27|    return false;
  149|     27|  }
  150|       |
  151|    404|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    404|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    404|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 231, False: 173]
  ------------------
  153|    231|    uint8_t prediction_mode;
  154|    231|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 230]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|    230|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 5, False: 225]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      5|      return false;
  160|      5|    }
  161|       |
  162|    225|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 225]
  ------------------
  163|    225|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|    225|  }
  167|    398|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    398|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 15, False: 383]
  ------------------
  171|     15|    return false;
  172|     15|  }
  173|       |
  174|    383|  return true;
  175|    398|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    383|                                      const PointIndex* entry_to_point_id_map) {
  103|    383|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    383|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    383|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    383|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    383|  const int corner_map_size =
  111|    383|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    383|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 383]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    383|  VectorD<int32_t, 3> pred_normal_3d;
  117|    383|  int32_t pred_normal_oct[2];
  118|       |
  119|   877k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 877k, False: 383]
  ------------------
  120|   877k|    const CornerIndex corner_id =
  121|   877k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   877k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   877k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   877k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   877k|                    octahedron_tool_box_.center_value());
  128|   877k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 790k, False: 86.6k]
  ------------------
  129|   790k|      pred_normal_3d = -pred_normal_3d;
  130|   790k|    }
  131|   877k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   877k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   877k|    const int data_offset = data_id * 2;
  135|   877k|    this->transform().ComputeOriginalValue(
  136|   877k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   877k|  }
  138|    383|  flip_normal_bit_decoder_.EndDecoding();
  139|    383|  return true;
  140|    383|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    383|  void SetQuantizationBits(int q) {
   85|    383|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    383|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    563|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    563|            attribute, transform, mesh_data),
   37|    563|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|  1.12k|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    563|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    563|    DRACO_DCHECK_EQ(i, 0);
   70|    563|    (void)i;
   71|    563|    return GeometryAttribute::POSITION;
   72|    563|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    563|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    563|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 563]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    563|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 561]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    561|    predictor_.SetPositionAttribute(*att);
   82|    561|    return true;
   83|    563|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    552|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    552|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 39, False: 513]
  ------------------
  148|     39|    return false;
  149|     39|  }
  150|       |
  151|    513|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    513|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    513|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 184, False: 329]
  ------------------
  153|    184|    uint8_t prediction_mode;
  154|    184|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 183]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|    183|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 181]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|    181|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 181]
  ------------------
  163|    181|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|    181|  }
  167|    510|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    510|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 34, False: 476]
  ------------------
  171|     34|    return false;
  172|     34|  }
  173|       |
  174|    476|  return true;
  175|    510|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    476|                                      const PointIndex* entry_to_point_id_map) {
  103|    476|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    476|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    476|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    476|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    476|  const int corner_map_size =
  111|    476|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    476|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 476]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    476|  VectorD<int32_t, 3> pred_normal_3d;
  117|    476|  int32_t pred_normal_oct[2];
  118|       |
  119|   153k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 153k, False: 476]
  ------------------
  120|   153k|    const CornerIndex corner_id =
  121|   153k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   153k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   153k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   153k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   153k|                    octahedron_tool_box_.center_value());
  128|   153k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 94.9k, False: 58.3k]
  ------------------
  129|  94.9k|      pred_normal_3d = -pred_normal_3d;
  130|  94.9k|    }
  131|   153k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   153k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   153k|    const int data_offset = data_id * 2;
  135|   153k|    this->transform().ComputeOriginalValue(
  136|   153k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   153k|  }
  138|    476|  flip_normal_bit_decoder_.EndDecoding();
  139|    476|  return true;
  140|    476|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    476|  void SetQuantizationBits(int q) {
   85|    476|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    476|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    159|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    159|            attribute, transform, mesh_data),
   37|    159|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    219|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    219|            attribute, transform, mesh_data),
   37|    219|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    189|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    189|            attribute, transform, mesh_data),
   37|    189|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    223|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    223|            attribute, transform, mesh_data),
   37|    223|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    202|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    202|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 41, False: 161]
  ------------------
  105|     41|      this->normal_prediction_mode_ = mode;
  106|     41|      return true;
  107|    161|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 161, False: 0]
  ------------------
  108|    161|      this->normal_prediction_mode_ = mode;
  109|    161|      return true;
  110|    161|    }
  111|      0|    return false;
  112|    202|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  1.34M|                             DataTypeT* prediction) override {
   42|  1.34M|    DRACO_DCHECK(this->IsInitialized());
   43|  1.34M|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  1.34M|    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.34M|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  1.34M|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  1.34M|    VectorD<int64_t, 3> normal;
   53|  1.34M|    CornerIndex c_next, c_prev;
   54|  2.71M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.36M, False: 1.34M]
  ------------------
   55|       |      // Getting corners.
   56|  1.36M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 162, False: 1.36M]
  ------------------
   57|    162|        c_next = corner_table->Next(corner_id);
   58|    162|        c_prev = corner_table->Previous(corner_id);
   59|  1.36M|      } else {
   60|  1.36M|        c_next = corner_table->Next(cit.Corner());
   61|  1.36M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.36M|      }
   63|  1.36M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.36M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.36M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.36M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.36M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.36M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.36M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.36M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.36M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.36M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.36M|      cit.Next();
   81|  1.36M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  1.34M|    constexpr int64_t upper_bound = 1 << 29;
   85|  1.34M|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 110, False: 1.34M]
  ------------------
   86|    110|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    110|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 36, False: 74]
  ------------------
   88|     36|        const int64_t quotient = abs_sum / upper_bound;
   89|     36|        normal = normal / quotient;
   90|     36|      }
   91|  1.34M|    } else {
   92|  1.34M|      const int64_t abs_sum = normal.AbsSum();
   93|  1.34M|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.99k, False: 1.34M]
  ------------------
   94|  1.99k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.99k|        normal = normal / quotient;
   96|  1.99k|      }
   97|  1.34M|    }
   98|  1.34M|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  1.34M|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  1.34M|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  1.34M|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  1.34M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    258|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    258|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 37, False: 221]
  ------------------
  105|     37|      this->normal_prediction_mode_ = mode;
  106|     37|      return true;
  107|    221|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 221, False: 0]
  ------------------
  108|    221|      this->normal_prediction_mode_ = mode;
  109|    221|      return true;
  110|    221|    }
  111|      0|    return false;
  112|    258|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   248k|                             DataTypeT* prediction) override {
   42|   248k|    DRACO_DCHECK(this->IsInitialized());
   43|   248k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   248k|    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|   248k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   248k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   248k|    VectorD<int64_t, 3> normal;
   53|   248k|    CornerIndex c_next, c_prev;
   54|  1.72M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.47M, False: 248k]
  ------------------
   55|       |      // Getting corners.
   56|  1.47M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 222, False: 1.47M]
  ------------------
   57|    222|        c_next = corner_table->Next(corner_id);
   58|    222|        c_prev = corner_table->Previous(corner_id);
   59|  1.47M|      } else {
   60|  1.47M|        c_next = corner_table->Next(cit.Corner());
   61|  1.47M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.47M|      }
   63|  1.47M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.47M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.47M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.47M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.47M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.47M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.47M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.47M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.47M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.47M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.47M|      cit.Next();
   81|  1.47M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   248k|    constexpr int64_t upper_bound = 1 << 29;
   85|   248k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 148, False: 247k]
  ------------------
   86|    148|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    148|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 27, False: 121]
  ------------------
   88|     27|        const int64_t quotient = abs_sum / upper_bound;
   89|     27|        normal = normal / quotient;
   90|     27|      }
   91|   247k|    } else {
   92|   247k|      const int64_t abs_sum = normal.AbsSum();
   93|   247k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 112k, False: 135k]
  ------------------
   94|   112k|        const int64_t quotient = abs_sum / upper_bound;
   95|   112k|        normal = normal / quotient;
   96|   112k|      }
   97|   247k|    }
   98|   248k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   248k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   248k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   248k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   248k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    242|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    242|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 51, False: 191]
  ------------------
  105|     51|      this->normal_prediction_mode_ = mode;
  106|     51|      return true;
  107|    191|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 191, False: 0]
  ------------------
  108|    191|      this->normal_prediction_mode_ = mode;
  109|    191|      return true;
  110|    191|    }
  111|      0|    return false;
  112|    242|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  1.12M|                             DataTypeT* prediction) override {
   42|  1.12M|    DRACO_DCHECK(this->IsInitialized());
   43|  1.12M|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  1.12M|    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.12M|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  1.12M|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  1.12M|    VectorD<int64_t, 3> normal;
   53|  1.12M|    CornerIndex c_next, c_prev;
   54|  2.50M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.37M, False: 1.12M]
  ------------------
   55|       |      // Getting corners.
   56|  1.37M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 210, False: 1.37M]
  ------------------
   57|    210|        c_next = corner_table->Next(corner_id);
   58|    210|        c_prev = corner_table->Previous(corner_id);
   59|  1.37M|      } else {
   60|  1.37M|        c_next = corner_table->Next(cit.Corner());
   61|  1.37M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.37M|      }
   63|  1.37M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.37M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.37M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.37M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.37M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.37M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.37M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.37M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.37M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.37M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.37M|      cit.Next();
   81|  1.37M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  1.12M|    constexpr int64_t upper_bound = 1 << 29;
   85|  1.12M|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 140, False: 1.12M]
  ------------------
   86|    140|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    140|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 41, False: 99]
  ------------------
   88|     41|        const int64_t quotient = abs_sum / upper_bound;
   89|     41|        normal = normal / quotient;
   90|     41|      }
   91|  1.12M|    } else {
   92|  1.12M|      const int64_t abs_sum = normal.AbsSum();
   93|  1.12M|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.68k, False: 1.12M]
  ------------------
   94|  1.68k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.68k|        normal = normal / quotient;
   96|  1.68k|      }
   97|  1.12M|    }
   98|  1.12M|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  1.12M|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  1.12M|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  1.12M|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  1.12M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    273|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    273|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 49, False: 224]
  ------------------
  105|     49|      this->normal_prediction_mode_ = mode;
  106|     49|      return true;
  107|    224|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 224, False: 0]
  ------------------
  108|    224|      this->normal_prediction_mode_ = mode;
  109|    224|      return true;
  110|    224|    }
  111|      0|    return false;
  112|    273|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   190k|                             DataTypeT* prediction) override {
   42|   190k|    DRACO_DCHECK(this->IsInitialized());
   43|   190k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   190k|    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|   190k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   190k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   190k|    VectorD<int64_t, 3> normal;
   53|   190k|    CornerIndex c_next, c_prev;
   54|  1.32M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.13M, False: 190k]
  ------------------
   55|       |      // Getting corners.
   56|  1.13M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 288, False: 1.13M]
  ------------------
   57|    288|        c_next = corner_table->Next(corner_id);
   58|    288|        c_prev = corner_table->Previous(corner_id);
   59|  1.13M|      } else {
   60|  1.13M|        c_next = corner_table->Next(cit.Corner());
   61|  1.13M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.13M|      }
   63|  1.13M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.13M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.13M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.13M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.13M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.13M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.13M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.13M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.13M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.13M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.13M|      cit.Next();
   81|  1.13M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   190k|    constexpr int64_t upper_bound = 1 << 29;
   85|   190k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 192, False: 189k]
  ------------------
   86|    192|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    192|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 57, False: 135]
  ------------------
   88|     57|        const int64_t quotient = abs_sum / upper_bound;
   89|     57|        normal = normal / quotient;
   90|     57|      }
   91|   189k|    } else {
   92|   189k|      const int64_t abs_sum = normal.AbsSum();
   93|   189k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 52.6k, False: 137k]
  ------------------
   94|  52.6k|        const int64_t quotient = abs_sum / upper_bound;
   95|  52.6k|        normal = normal / quotient;
   96|  52.6k|      }
   97|   189k|    }
   98|   190k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   190k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   190k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   190k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   190k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    436|      : Base(md) {
   35|    436|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    436|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    661|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    661|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 207, False: 454]
  ------------------
  105|    207|      this->normal_prediction_mode_ = mode;
  106|    207|      return true;
  107|    454|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 454, False: 0]
  ------------------
  108|    454|      this->normal_prediction_mode_ = mode;
  109|    454|      return true;
  110|    454|    }
  111|      0|    return false;
  112|    661|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   877k|                             DataTypeT* prediction) override {
   42|   877k|    DRACO_DCHECK(this->IsInitialized());
   43|   877k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   877k|    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|   877k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   877k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   877k|    VectorD<int64_t, 3> normal;
   53|   877k|    CornerIndex c_next, c_prev;
   54|  1.77M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 897k, False: 877k]
  ------------------
   55|       |      // Getting corners.
   56|   897k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 1.22k, False: 896k]
  ------------------
   57|  1.22k|        c_next = corner_table->Next(corner_id);
   58|  1.22k|        c_prev = corner_table->Previous(corner_id);
   59|   896k|      } else {
   60|   896k|        c_next = corner_table->Next(cit.Corner());
   61|   896k|        c_prev = corner_table->Previous(cit.Corner());
   62|   896k|      }
   63|   897k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   897k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   897k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   897k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   897k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   897k|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|   897k|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|   897k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   897k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   897k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   897k|      cit.Next();
   81|   897k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   877k|    constexpr int64_t upper_bound = 1 << 29;
   85|   877k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 816, False: 876k]
  ------------------
   86|    816|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    816|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 191, False: 625]
  ------------------
   88|    191|        const int64_t quotient = abs_sum / upper_bound;
   89|    191|        normal = normal / quotient;
   90|    191|      }
   91|   876k|    } else {
   92|   876k|      const int64_t abs_sum = normal.AbsSum();
   93|   876k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.44k, False: 874k]
  ------------------
   94|  2.44k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.44k|        normal = normal / quotient;
   96|  2.44k|      }
   97|   876k|    }
   98|   877k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   877k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   877k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   877k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   877k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    563|      : Base(md) {
   35|    563|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    563|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    744|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    744|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 171, False: 573]
  ------------------
  105|    171|      this->normal_prediction_mode_ = mode;
  106|    171|      return true;
  107|    573|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 573, False: 0]
  ------------------
  108|    573|      this->normal_prediction_mode_ = mode;
  109|    573|      return true;
  110|    573|    }
  111|      0|    return false;
  112|    744|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   153k|                             DataTypeT* prediction) override {
   42|   153k|    DRACO_DCHECK(this->IsInitialized());
   43|   153k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   153k|    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|   153k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   153k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   153k|    VectorD<int64_t, 3> normal;
   53|   153k|    CornerIndex c_next, c_prev;
   54|   973k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 820k, False: 153k]
  ------------------
   55|       |      // Getting corners.
   56|   820k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 996, False: 819k]
  ------------------
   57|    996|        c_next = corner_table->Next(corner_id);
   58|    996|        c_prev = corner_table->Previous(corner_id);
   59|   819k|      } else {
   60|   819k|        c_next = corner_table->Next(cit.Corner());
   61|   819k|        c_prev = corner_table->Previous(cit.Corner());
   62|   819k|      }
   63|   820k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   820k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   820k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   820k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   820k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   820k|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|   820k|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|   820k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   820k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   820k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   820k|      cit.Next();
   81|   820k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   153k|    constexpr int64_t upper_bound = 1 << 29;
   85|   153k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 663, False: 152k]
  ------------------
   86|    663|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    663|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 182, False: 481]
  ------------------
   88|    182|        const int64_t quotient = abs_sum / upper_bound;
   89|    182|        normal = normal / quotient;
   90|    182|      }
   91|   152k|    } else {
   92|   152k|      const int64_t abs_sum = normal.AbsSum();
   93|   152k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.10k, False: 150k]
  ------------------
   94|  2.10k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.10k|        normal = normal / quotient;
   96|  2.10k|      }
   97|   152k|    }
   98|   153k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   153k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   153k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   153k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   153k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    159|      : Base(md) {
   35|    159|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    159|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    219|      : Base(md) {
   35|    219|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    219|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    189|      : Base(md) {
   35|    189|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    189|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    223|      : Base(md) {
   35|    223|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    223|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  4.07M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  4.07M|    DRACO_DCHECK(this->IsInitialized());
   73|  4.07M|    const auto corner_table = mesh_data_.corner_table();
   74|  4.07M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  4.07M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  4.07M|    return GetPositionForDataId(data_id);
   77|  4.07M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  4.07M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  4.07M|    DRACO_DCHECK(this->IsInitialized());
   65|  4.07M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  4.07M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  4.07M|    VectorD<int64_t, 3> pos;
   68|  4.07M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  4.07M|    return pos;
   70|  4.07M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    157|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    157|    pos_attribute_ = &position_attribute;
   43|    157|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    131|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    131|    entry_to_point_id_map_ = map;
   46|    131|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.20M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.20M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.20M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.20M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.20M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.20M|    return GetPositionForDataId(data_id);
   77|  3.20M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.20M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.20M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.20M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.20M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.20M|    VectorD<int64_t, 3> pos;
   68|  3.20M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.20M|    return pos;
   70|  3.20M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    215|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    215|    pos_attribute_ = &position_attribute;
   43|    215|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    200|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    200|    entry_to_point_id_map_ = map;
   46|    200|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.88M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.88M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.88M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.88M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.88M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.88M|    return GetPositionForDataId(data_id);
   77|  3.88M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  3.88M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.88M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.88M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.88M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.88M|    VectorD<int64_t, 3> pos;
   68|  3.88M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.88M|    return pos;
   70|  3.88M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    186|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    186|    pos_attribute_ = &position_attribute;
   43|    186|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    155|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    155|    entry_to_point_id_map_ = map;
   46|    155|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.45M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.45M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.45M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.45M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.45M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.45M|    return GetPositionForDataId(data_id);
   77|  2.45M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.45M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.45M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.45M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.45M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.45M|    VectorD<int64_t, 3> pos;
   68|  2.45M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.45M|    return pos;
   70|  2.45M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    221|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    221|    pos_attribute_ = &position_attribute;
   43|    221|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    202|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    202|    entry_to_point_id_map_ = map;
   46|    202|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    436|      : pos_attribute_(nullptr),
   36|    436|        entry_to_point_id_map_(nullptr),
   37|    436|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    436|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.67M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.67M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.67M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.67M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.67M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.67M|    return GetPositionForDataId(data_id);
   77|  2.67M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.67M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.67M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.67M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.67M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.67M|    VectorD<int64_t, 3> pos;
   68|  2.67M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.67M|    return pos;
   70|  2.67M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    432|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    432|    pos_attribute_ = &position_attribute;
   43|    432|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    383|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    383|    entry_to_point_id_map_ = map;
   46|    383|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    563|      : pos_attribute_(nullptr),
   36|    563|        entry_to_point_id_map_(nullptr),
   37|    563|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    563|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.79M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.79M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.79M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.79M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.79M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.79M|    return GetPositionForDataId(data_id);
   77|  1.79M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.79M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.79M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.79M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.79M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.79M|    VectorD<int64_t, 3> pos;
   68|  1.79M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.79M|    return pos;
   70|  1.79M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    561|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    561|    pos_attribute_ = &position_attribute;
   43|    561|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    476|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    476|    entry_to_point_id_map_ = map;
   46|    476|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    159|      : pos_attribute_(nullptr),
   36|    159|        entry_to_point_id_map_(nullptr),
   37|    159|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    159|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    219|      : pos_attribute_(nullptr),
   36|    219|        entry_to_point_id_map_(nullptr),
   37|    219|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    219|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    189|      : pos_attribute_(nullptr),
   36|    189|        entry_to_point_id_map_(nullptr),
   37|    189|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    189|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    223|      : pos_attribute_(nullptr),
   36|    223|        entry_to_point_id_map_(nullptr),
   37|    223|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    223|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    447|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    447|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    433|                          const PointIndex* /* entry_to_point_id_map */) {
   64|    433|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    433|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    433|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    433|      new DataTypeT[num_components]());
   70|       |
   71|    433|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    433|  const CornerTable* const table = this->mesh_data().corner_table();
   74|    433|  const std::vector<int32_t>* const vertex_to_data_map =
   75|    433|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    433|  const int corner_map_size =
   78|    433|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    433|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 433]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|  2.80M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 2.80M, False: 433]
  ------------------
   83|  2.80M|    const CornerIndex start_corner_id =
   84|  2.80M|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|  2.80M|    CornerIndex corner_id(start_corner_id);
   87|  2.80M|    int num_parallelograms = 0;
   88|  89.6M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 86.8M, False: 2.80M]
  ------------------
   89|  86.8M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  86.8M|    }
   91|  6.22M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 3.41M, False: 2.80M]
  ------------------
   92|  3.41M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 251k, False: 3.16M]
  ------------------
   93|  3.41M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  3.41M|              num_components, parallelogram_pred_vals.get())) {
   95|  18.3M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 18.1M, False: 251k]
  ------------------
   96|  18.1M|          pred_vals[c] =
   97|  18.1M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  18.1M|        }
   99|   251k|        ++num_parallelograms;
  100|   251k|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  3.41M|      corner_id = table->SwingRight(corner_id);
  104|  3.41M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 117k, False: 3.30M]
  ------------------
  105|   117k|        corner_id = kInvalidCornerIndex;
  106|   117k|      }
  107|  3.41M|    }
  108|       |
  109|  2.80M|    const int dst_offset = p * num_components;
  110|  2.80M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 2.66M, False: 136k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  2.66M|      const int src_offset = (p - 1) * num_components;
  114|  2.66M|      this->transform().ComputeOriginalValue(
  115|  2.66M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|  2.66M|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  9.68M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 9.54M, False: 136k]
  ------------------
  119|  9.54M|        pred_vals[c] /= num_parallelograms;
  120|  9.54M|      }
  121|   136k|      this->transform().ComputeOriginalValue(
  122|   136k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|   136k|    }
  124|  2.80M|  }
  125|    433|  return true;
  126|    433|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    549|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    549|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    519|                          const PointIndex* /* entry_to_point_id_map */) {
   64|    519|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    519|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    519|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    519|      new DataTypeT[num_components]());
   70|       |
   71|    519|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    519|  const CornerTable* const table = this->mesh_data().corner_table();
   74|    519|  const std::vector<int32_t>* const vertex_to_data_map =
   75|    519|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    519|  const int corner_map_size =
   78|    519|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    519|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 519]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|  1.25M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 1.25M, False: 519]
  ------------------
   83|  1.25M|    const CornerIndex start_corner_id =
   84|  1.25M|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|  1.25M|    CornerIndex corner_id(start_corner_id);
   87|  1.25M|    int num_parallelograms = 0;
   88|  76.5M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 75.3M, False: 1.25M]
  ------------------
   89|  75.3M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  75.3M|    }
   91|  8.61M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 7.36M, False: 1.25M]
  ------------------
   92|  7.36M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 2.42M, False: 4.93M]
  ------------------
   93|  7.36M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  7.36M|              num_components, parallelogram_pred_vals.get())) {
   95|   142M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 140M, False: 2.42M]
  ------------------
   96|   140M|          pred_vals[c] =
   97|   140M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|   140M|        }
   99|  2.42M|        ++num_parallelograms;
  100|  2.42M|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  7.36M|      corner_id = table->SwingRight(corner_id);
  104|  7.36M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 1.22M, False: 6.13M]
  ------------------
  105|  1.22M|        corner_id = kInvalidCornerIndex;
  106|  1.22M|      }
  107|  7.36M|    }
  108|       |
  109|  1.25M|    const int dst_offset = p * num_components;
  110|  1.25M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 18.8k, False: 1.23M]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  18.8k|      const int src_offset = (p - 1) * num_components;
  114|  18.8k|      this->transform().ComputeOriginalValue(
  115|  18.8k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|  1.23M|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  73.2M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 71.9M, False: 1.23M]
  ------------------
  119|  71.9M|        pred_vals[c] /= num_parallelograms;
  120|  71.9M|      }
  121|  1.23M|      this->transform().ComputeOriginalValue(
  122|  1.23M|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|  1.23M|    }
  124|  1.25M|  }
  125|    519|  return true;
  126|    519|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  8.67M|    int num_components, DataTypeT* out_prediction) {
   49|  8.67M|  const CornerIndex oci = table->Opposite(ci);
   50|  8.67M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 7.62M, False: 1.04M]
  ------------------
   51|  7.62M|    return false;
   52|  7.62M|  }
   53|  1.04M|  int vert_opp, vert_next, vert_prev;
   54|  1.04M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  1.04M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  1.04M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 553k, False: 487k]
  |  Branch (56:35): [True: 441k, False: 112k]
  ------------------
   57|   441k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 418k, False: 22.8k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   418k|    const int v_opp_off = vert_opp * num_components;
   60|   418k|    const int v_next_off = vert_next * num_components;
   61|   418k|    const int v_prev_off = vert_prev * num_components;
   62|  26.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 26.2M, False: 418k]
  ------------------
   63|  26.2M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  26.2M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  26.2M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  26.2M|      const int64_t result =
   67|  26.2M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  26.2M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  26.2M|    }
   71|   418k|    return true;
   72|   418k|  }
   73|   623k|  return false;  // Not all data is available for prediction
   74|  1.04M|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  1.04M|    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.04M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  1.04M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  1.04M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  1.04M|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  8.41M|    int num_components, DataTypeT* out_prediction) {
   49|  8.41M|  const CornerIndex oci = table->Opposite(ci);
   50|  8.41M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 46.4k, False: 8.36M]
  ------------------
   51|  46.4k|    return false;
   52|  46.4k|  }
   53|  8.36M|  int vert_opp, vert_next, vert_prev;
   54|  8.36M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  8.36M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  8.36M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 4.35M, False: 4.00M]
  |  Branch (56:35): [True: 3.36M, False: 992k]
  ------------------
   57|  3.36M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 3.04M, False: 324k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  3.04M|    const int v_opp_off = vert_opp * num_components;
   60|  3.04M|    const int v_next_off = vert_next * num_components;
   61|  3.04M|    const int v_prev_off = vert_prev * num_components;
   62|   201M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 198M, False: 3.04M]
  ------------------
   63|   198M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|   198M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|   198M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|   198M|      const int64_t result =
   67|   198M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|   198M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|   198M|    }
   71|  3.04M|    return true;
   72|  3.04M|  }
   73|  5.32M|  return false;  // Not all data is available for prediction
   74|  8.36M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  8.36M|    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|  8.36M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  8.36M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  8.36M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  8.36M|}

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

_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   38|    412|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   39|    412|            attribute, transform, mesh_data),
   40|    412|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   62|    822|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   64|    412|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   65|    412|    DRACO_DCHECK_EQ(i, 0);
   66|    412|    (void)i;
   67|    412|    return GeometryAttribute::POSITION;
   68|    412|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   70|    411|  bool SetParentAttribute(const PointAttribute* att) override {
   71|    411|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (71:9): [True: 0, False: 411]
  |  Branch (71:17): [True: 0, False: 411]
  ------------------
   72|      0|      return false;  // Invalid attribute type.
   73|      0|    }
   74|    411|    if (att->num_components() != 3) {
  ------------------
  |  Branch (74:9): [True: 1, False: 410]
  ------------------
   75|      1|      return false;  // Currently works only for 3 component positions.
   76|      1|    }
   77|    410|    predictor_.SetPositionAttribute(*att);
   78|    410|    return true;
   79|    411|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  128|    407|                                                                buffer) {
  129|       |  // Decode the delta coded orientations.
  130|    407|  int32_t num_orientations = 0;
  131|    407|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (131:7): [True: 3, False: 404]
  |  Branch (131:45): [True: 13, False: 391]
  ------------------
  132|     16|    return false;
  133|     16|  }
  134|       |
  135|       |  // Check that the decoded number of orientations is not unreasonably high.
  136|    391|  const int32_t max_num_orientations = max_num_predicted_values_;
  137|    391|  if (max_num_orientations != -1 && num_orientations > max_num_orientations) {
  ------------------
  |  Branch (137:7): [True: 391, False: 0]
  |  Branch (137:37): [True: 35, False: 356]
  ------------------
  138|     35|    return false;
  139|     35|  }
  140|       |
  141|    356|  predictor_.ResizeOrientations(num_orientations);
  142|    356|  bool last_orientation = true;
  143|    356|  RAnsBitDecoder decoder;
  144|    356|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 351]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|   289k|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (147:19): [True: 288k, False: 351]
  ------------------
  148|   288k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (148:9): [True: 15.2k, False: 273k]
  ------------------
  149|  15.2k|      last_orientation = !last_orientation;
  150|  15.2k|    }
  151|   288k|    predictor_.set_orientation(i, last_orientation);
  152|   288k|  }
  153|    351|  decoder.EndDecoding();
  154|    351|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  155|    351|                                     MeshDataT>::DecodePredictionData(buffer);
  156|    356|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE24SetMaxNumPredictedValuesEi:
   81|    407|  virtual void SetMaxNumPredictedValues(int32_t num) {
   82|    407|    max_num_predicted_values_ = num;
   83|    407|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   97|    310|                                      const PointIndex* entry_to_point_id_map) {
   98|    310|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (98:7): [True: 10, False: 300]
  ------------------
   99|    310|                            DataTypeT, MeshDataT>::kNumComponents) {
  100|     10|    return false;
  101|     10|  }
  102|    300|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  103|    300|  this->transform().Init(num_components);
  104|       |
  105|    300|  const int corner_map_size =
  106|    300|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  107|    300|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (107:7): [True: 0, False: 300]
  ------------------
  108|      0|    return false;
  109|      0|  }
  110|   287k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 287k, False: 83]
  ------------------
  111|   287k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  112|   287k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (112:9): [True: 217, False: 286k]
  ------------------
  113|   287k|                                                          p)) {
  114|    217|      return false;
  115|    217|    }
  116|       |
  117|   286k|    const int dst_offset = p * num_components;
  118|   286k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  119|   286k|                                           in_corr + dst_offset,
  120|   286k|                                           out_data + dst_offset);
  121|   286k|  }
  122|     83|  return true;
  123|    300|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   38|    358|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   39|    358|            attribute, transform, mesh_data),
   40|    358|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   62|    714|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   64|    358|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   65|    358|    DRACO_DCHECK_EQ(i, 0);
   66|    358|    (void)i;
   67|    358|    return GeometryAttribute::POSITION;
   68|    358|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   70|    357|  bool SetParentAttribute(const PointAttribute* att) override {
   71|    357|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (71:9): [True: 0, False: 357]
  |  Branch (71:17): [True: 0, False: 357]
  ------------------
   72|      0|      return false;  // Invalid attribute type.
   73|      0|    }
   74|    357|    if (att->num_components() != 3) {
  ------------------
  |  Branch (74:9): [True: 1, False: 356]
  ------------------
   75|      1|      return false;  // Currently works only for 3 component positions.
   76|      1|    }
   77|    356|    predictor_.SetPositionAttribute(*att);
   78|    356|    return true;
   79|    357|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  128|    352|                                                                buffer) {
  129|       |  // Decode the delta coded orientations.
  130|    352|  int32_t num_orientations = 0;
  131|    352|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (131:7): [True: 1, False: 351]
  |  Branch (131:45): [True: 21, False: 330]
  ------------------
  132|     22|    return false;
  133|     22|  }
  134|       |
  135|       |  // Check that the decoded number of orientations is not unreasonably high.
  136|    330|  const int32_t max_num_orientations = max_num_predicted_values_;
  137|    330|  if (max_num_orientations != -1 && num_orientations > max_num_orientations) {
  ------------------
  |  Branch (137:7): [True: 330, False: 0]
  |  Branch (137:37): [True: 59, False: 271]
  ------------------
  138|     59|    return false;
  139|     59|  }
  140|       |
  141|    271|  predictor_.ResizeOrientations(num_orientations);
  142|    271|  bool last_orientation = true;
  143|    271|  RAnsBitDecoder decoder;
  144|    271|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (144:7): [True: 1, False: 270]
  ------------------
  145|      1|    return false;
  146|      1|  }
  147|  32.8k|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (147:19): [True: 32.6k, False: 270]
  ------------------
  148|  32.6k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (148:9): [True: 8.02k, False: 24.5k]
  ------------------
  149|  8.02k|      last_orientation = !last_orientation;
  150|  8.02k|    }
  151|  32.6k|    predictor_.set_orientation(i, last_orientation);
  152|  32.6k|  }
  153|    270|  decoder.EndDecoding();
  154|    270|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  155|    270|                                     MeshDataT>::DecodePredictionData(buffer);
  156|    271|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE24SetMaxNumPredictedValuesEi:
   81|    352|  virtual void SetMaxNumPredictedValues(int32_t num) {
   82|    352|    max_num_predicted_values_ = num;
   83|    352|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   97|    240|                                      const PointIndex* entry_to_point_id_map) {
   98|    240|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (98:7): [True: 3, False: 237]
  ------------------
   99|    240|                            DataTypeT, MeshDataT>::kNumComponents) {
  100|      3|    return false;
  101|      3|  }
  102|    237|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  103|    237|  this->transform().Init(num_components);
  104|       |
  105|    237|  const int corner_map_size =
  106|    237|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  107|    237|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (107:7): [True: 0, False: 237]
  ------------------
  108|      0|    return false;
  109|      0|  }
  110|   196k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 196k, False: 122]
  ------------------
  111|   196k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  112|   196k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (112:9): [True: 115, False: 196k]
  ------------------
  113|   196k|                                                          p)) {
  114|    115|      return false;
  115|    115|    }
  116|       |
  117|   196k|    const int dst_offset = p * num_components;
  118|   196k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  119|   196k|                                           in_corr + dst_offset,
  120|   196k|                                           out_data + dst_offset);
  121|   196k|  }
  122|    122|  return true;
  123|    237|}

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    412|      : pos_attribute_(nullptr),
   39|    412|        entry_to_point_id_map_(nullptr),
   40|    412|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    410|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    410|    pos_attribute_ = &position_attribute;
   43|    410|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    356|  void ResizeOrientations(int num_orientations) {
   74|    356|    orientations_.resize(num_orientations);
   75|    356|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|   288k|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    300|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    300|    entry_to_point_id_map_ = map;
   46|    300|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   287k|                                                 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|   287k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   287k|  const CornerIndex prev_corner_id =
   99|   287k|      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|   287k|  int next_data_id, prev_data_id;
  103|       |
  104|   287k|  int next_vert_id, prev_vert_id;
  105|   287k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   287k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   287k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   287k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   287k|  typedef VectorD<int64_t, 2> Vec2;
  112|   287k|  typedef VectorD<int64_t, 3> Vec3;
  113|   287k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   287k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 192k, False: 94.7k]
  |  Branch (115:33): [True: 97.5k, False: 94.7k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|  97.5k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|  97.5k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|  97.5k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 94.4k, False: 3.08k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|  94.4k|      predicted_value_[0] = p_uv[0];
  122|  94.4k|      predicted_value_[1] = p_uv[1];
  123|  94.4k|      return true;
  124|  94.4k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  3.08k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  3.08k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  3.08k|    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|  3.08k|    const Vec3 pn = prev_pos - next_pos;
  146|  3.08k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  3.08k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 834, False: 2.25k]
  ------------------
  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|    834|      const Vec3 cn = tip_pos - next_pos;
  153|    834|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    834|      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|    834|      const int64_t n_uv_absmax_element =
  164|    834|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    834|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 86, False: 748]
  ------------------
  166|    834|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     86|        return false;
  169|     86|      }
  170|    748|      const int64_t pn_uv_absmax_element =
  171|    748|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    748|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 37, False: 711]
  ------------------
  173|    748|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     37|        return false;
  176|     37|      }
  177|       |      // Keep the scaled prediction arithmetic in the unsigned domain.
  178|    711|      const Vec2 x_uv = Vec2(Vec2u(n_uv) * pn_norm2_squared +
  179|    711|                             Vec2u(pn_uv) * static_cast<uint64_t>(cn_dot_pn));
  180|    711|      const int64_t pn_absmax_element =
  181|    711|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  182|    711|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (182:11): [True: 16, False: 695]
  ------------------
  183|    711|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  184|       |        // Return false if squared length calculation would overflow.
  185|     16|        return false;
  186|     16|      }
  187|       |
  188|       |      // Compute squared length of vector CX in position coordinate system:
  189|    695|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  190|    695|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  191|       |
  192|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  193|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  194|       |      //
  195|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  196|       |      //
  197|       |      // To preserve precision, we perform all operations in scaled space as
  198|       |      // explained above, so we want the final vector to be:
  199|       |      //
  200|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  201|       |      //
  202|       |      // We can then rewrite the formula as:
  203|       |      //
  204|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  205|       |      //
  206|    695|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  207|       |      // Compute CX.Norm2() * PN.Norm2()
  208|    695|      const uint64_t norm_squared =
  209|    695|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  210|       |      // Final cx_uv in the scaled coordinate space.
  211|    695|      cx_uv = cx_uv * norm_squared;
  212|       |
  213|       |      // Predicted uv coordinate is then computed by either adding or
  214|       |      // subtracting CX_UV to/from X_UV.
  215|    695|      Vec2 predicted_uv;
  216|    695|      if (is_encoder_t) {
  ------------------
  |  Branch (216:11): [Folded, False: 695]
  ------------------
  217|       |        // When encoding, compute both possible vectors and determine which one
  218|       |        // results in a better prediction.
  219|       |        // Both vectors need to be transformed back from the scaled space to
  220|       |        // the real UV coordinate space.
  221|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  222|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  223|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  224|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (224:13): [True: 0, False: 0]
  ------------------
  225|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  226|      0|          predicted_uv = predicted_uv_0;
  227|      0|          orientations_.push_back(true);
  228|      0|        } else {
  229|      0|          predicted_uv = predicted_uv_1;
  230|      0|          orientations_.push_back(false);
  231|      0|        }
  232|    695|      } else {
  233|       |        // When decoding the data, we already know which orientation to use.
  234|    695|        if (orientations_.empty()) {
  ------------------
  |  Branch (234:13): [True: 78, False: 617]
  ------------------
  235|     78|          return false;
  236|     78|        }
  237|    617|        const bool orientation = orientations_.back();
  238|    617|        orientations_.pop_back();
  239|       |        // Perform operations in unsigned type to avoid signed integer overflow.
  240|       |        // Note that the result will be the same (for non-overflowing values).
  241|    617|        if (orientation) {
  ------------------
  |  Branch (241:13): [True: 386, False: 231]
  ------------------
  242|    386|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  243|    386|        } else {
  244|    231|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  245|    231|        }
  246|    617|      }
  247|    617|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  248|    617|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  249|    617|      return true;
  250|    695|    }
  251|  3.08k|  }
  252|       |  // Else we don't have available textures on both corners or the position data
  253|       |  // is invalid. For such cases we can't use positions for predicting the uv
  254|       |  // value and we resort to delta coding.
  255|   191k|  int data_offset = 0;
  256|   191k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (256:7): [True: 97.0k, False: 94.7k]
  ------------------
  257|       |    // Use the value on the previous corner as the prediction.
  258|  97.0k|    data_offset = prev_data_id * kNumComponents;
  259|  97.0k|  }
  260|   191k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (260:7): [True: 2.25k, False: 189k]
  ------------------
  261|       |    // Use the value on the next corner as the prediction.
  262|  2.25k|    data_offset = next_data_id * kNumComponents;
  263|   189k|  } else {
  264|       |    // None of the other corners have a valid value. Use the last encoded value
  265|       |    // as the prediction if possible.
  266|   189k|    if (data_id > 0) {
  ------------------
  |  Branch (266:9): [True: 189k, False: 300]
  ------------------
  267|   189k|      data_offset = (data_id - 1) * kNumComponents;
  268|   189k|    } else {
  269|       |      // We are encoding the first value. Predict 0.
  270|    900|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (270:23): [True: 600, False: 300]
  ------------------
  271|    600|        predicted_value_[i] = 0;
  272|    600|      }
  273|    300|      return true;
  274|    300|    }
  275|   189k|  }
  276|   574k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (276:19): [True: 383k, False: 191k]
  ------------------
  277|   383k|    predicted_value_[i] = data[data_offset + i];
  278|   383k|  }
  279|   191k|  return true;
  280|   191k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   195k|                                            const DataTypeT* data) const {
   59|   195k|    const int data_offset = entry_id * kNumComponents;
   60|   195k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   195k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  9.26k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  9.26k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  9.26k|    VectorD<int64_t, 3> pos;
   52|  9.26k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  9.26k|                                 &pos[0]);
   54|  9.26k|    return pos;
   55|  9.26k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   286k|  const DataTypeT* predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    358|      : pos_attribute_(nullptr),
   39|    358|        entry_to_point_id_map_(nullptr),
   40|    358|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    356|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    356|    pos_attribute_ = &position_attribute;
   43|    356|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    271|  void ResizeOrientations(int num_orientations) {
   74|    271|    orientations_.resize(num_orientations);
   75|    271|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  32.6k|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    237|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    237|    entry_to_point_id_map_ = map;
   46|    237|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   196k|                                                 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|   196k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   196k|  const CornerIndex prev_corner_id =
   99|   196k|      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|   196k|  int next_data_id, prev_data_id;
  103|       |
  104|   196k|  int next_vert_id, prev_vert_id;
  105|   196k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   196k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   196k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   196k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   196k|  typedef VectorD<int64_t, 2> Vec2;
  112|   196k|  typedef VectorD<int64_t, 3> Vec3;
  113|   196k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   196k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 196k, False: 352]
  |  Branch (115:33): [True: 195k, False: 414]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   195k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   195k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   195k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 194k, False: 1.07k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   194k|      predicted_value_[0] = p_uv[0];
  122|   194k|      predicted_value_[1] = p_uv[1];
  123|   194k|      return true;
  124|   194k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  1.07k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  1.07k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  1.07k|    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|  1.07k|    const Vec3 pn = prev_pos - next_pos;
  146|  1.07k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  1.07k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 538, False: 534]
  ------------------
  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|    538|      const Vec3 cn = tip_pos - next_pos;
  153|    538|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    538|      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|    538|      const int64_t n_uv_absmax_element =
  164|    538|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    538|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 17, False: 521]
  ------------------
  166|    538|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     17|        return false;
  169|     17|      }
  170|    521|      const int64_t pn_uv_absmax_element =
  171|    521|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    521|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 20, False: 501]
  ------------------
  173|    521|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     20|        return false;
  176|     20|      }
  177|       |      // Keep the scaled prediction arithmetic in the unsigned domain.
  178|    501|      const Vec2 x_uv = Vec2(Vec2u(n_uv) * pn_norm2_squared +
  179|    501|                             Vec2u(pn_uv) * static_cast<uint64_t>(cn_dot_pn));
  180|    501|      const int64_t pn_absmax_element =
  181|    501|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  182|    501|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (182:11): [True: 23, False: 478]
  ------------------
  183|    501|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  184|       |        // Return false if squared length calculation would overflow.
  185|     23|        return false;
  186|     23|      }
  187|       |
  188|       |      // Compute squared length of vector CX in position coordinate system:
  189|    478|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  190|    478|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  191|       |
  192|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  193|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  194|       |      //
  195|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  196|       |      //
  197|       |      // To preserve precision, we perform all operations in scaled space as
  198|       |      // explained above, so we want the final vector to be:
  199|       |      //
  200|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  201|       |      //
  202|       |      // We can then rewrite the formula as:
  203|       |      //
  204|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  205|       |      //
  206|    478|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  207|       |      // Compute CX.Norm2() * PN.Norm2()
  208|    478|      const uint64_t norm_squared =
  209|    478|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  210|       |      // Final cx_uv in the scaled coordinate space.
  211|    478|      cx_uv = cx_uv * norm_squared;
  212|       |
  213|       |      // Predicted uv coordinate is then computed by either adding or
  214|       |      // subtracting CX_UV to/from X_UV.
  215|    478|      Vec2 predicted_uv;
  216|    478|      if (is_encoder_t) {
  ------------------
  |  Branch (216:11): [Folded, False: 478]
  ------------------
  217|       |        // When encoding, compute both possible vectors and determine which one
  218|       |        // results in a better prediction.
  219|       |        // Both vectors need to be transformed back from the scaled space to
  220|       |        // the real UV coordinate space.
  221|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  222|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  223|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  224|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (224:13): [True: 0, False: 0]
  ------------------
  225|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  226|      0|          predicted_uv = predicted_uv_0;
  227|      0|          orientations_.push_back(true);
  228|      0|        } else {
  229|      0|          predicted_uv = predicted_uv_1;
  230|      0|          orientations_.push_back(false);
  231|      0|        }
  232|    478|      } else {
  233|       |        // When decoding the data, we already know which orientation to use.
  234|    478|        if (orientations_.empty()) {
  ------------------
  |  Branch (234:13): [True: 55, False: 423]
  ------------------
  235|     55|          return false;
  236|     55|        }
  237|    423|        const bool orientation = orientations_.back();
  238|    423|        orientations_.pop_back();
  239|       |        // Perform operations in unsigned type to avoid signed integer overflow.
  240|       |        // Note that the result will be the same (for non-overflowing values).
  241|    423|        if (orientation) {
  ------------------
  |  Branch (241:13): [True: 183, False: 240]
  ------------------
  242|    183|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  243|    240|        } else {
  244|    240|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  245|    240|        }
  246|    423|      }
  247|    423|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  248|    423|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  249|    423|      return true;
  250|    478|    }
  251|  1.07k|  }
  252|       |  // Else we don't have available textures on both corners or the position data
  253|       |  // is invalid. For such cases we can't use positions for predicting the uv
  254|       |  // value and we resort to delta coding.
  255|  1.30k|  int data_offset = 0;
  256|  1.30k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (256:7): [True: 948, False: 352]
  ------------------
  257|       |    // Use the value on the previous corner as the prediction.
  258|    948|    data_offset = prev_data_id * kNumComponents;
  259|    948|  }
  260|  1.30k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (260:7): [True: 546, False: 754]
  ------------------
  261|       |    // Use the value on the next corner as the prediction.
  262|    546|    data_offset = next_data_id * kNumComponents;
  263|    754|  } else {
  264|       |    // None of the other corners have a valid value. Use the last encoded value
  265|       |    // as the prediction if possible.
  266|    754|    if (data_id > 0) {
  ------------------
  |  Branch (266:9): [True: 517, False: 237]
  ------------------
  267|    517|      data_offset = (data_id - 1) * kNumComponents;
  268|    517|    } else {
  269|       |      // We are encoding the first value. Predict 0.
  270|    711|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (270:23): [True: 474, False: 237]
  ------------------
  271|    474|        predicted_value_[i] = 0;
  272|    474|      }
  273|    237|      return true;
  274|    237|    }
  275|    754|  }
  276|  3.18k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (276:19): [True: 2.12k, False: 1.06k]
  ------------------
  277|  2.12k|    predicted_value_[i] = data[data_offset + i];
  278|  2.12k|  }
  279|  1.06k|  return true;
  280|  1.30k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   391k|                                            const DataTypeT* data) const {
   59|   391k|    const int data_offset = entry_id * kNumComponents;
   60|   391k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   391k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  3.21k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  3.21k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  3.21k|    VectorD<int64_t, 3> pos;
   52|  3.21k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  3.21k|                                 &pos[0]);
   54|  3.21k|    return pos;
   55|  3.21k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   196k|  const DataTypeT* predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    144|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    505|  bool AreCorrectionsPositive() override {
   71|    505|    return transform_.AreCorrectionsPositive();
   72|    505|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    133|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|    133|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 10, False: 123]
  ------------------
   50|     10|      return false;
   51|     10|    }
   52|    123|    return true;
   53|    133|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  1.61M|  inline Transform& transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    162|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    567|  bool AreCorrectionsPositive() override {
   71|    567|    return transform_.AreCorrectionsPositive();
   72|    567|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    160|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|    160|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 17, False: 143]
  ------------------
   50|     17|      return false;
   51|     17|    }
   52|    143|    return true;
   53|    160|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  3.71M|  inline Transform& transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  7.10k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  4.81k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  6.91k|  bool AreCorrectionsPositive() override {
   71|  6.91k|    return transform_.AreCorrectionsPositive();
   72|  6.91k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  5.45k|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|  5.45k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 301, False: 5.15k]
  ------------------
   50|    301|      return false;
   51|    301|    }
   52|  5.15k|    return true;
   53|  5.45k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  33.8M|  inline Transform& transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    522|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    574|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    522|                                 const PointCloudDecoder* decoder) {
  188|    522|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    522|      method, att_id, decoder, TransformT());
  190|    522|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    522|                                 const TransformT& transform) {
  156|    522|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 522]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    522|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|    522|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 522, 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|    522|    const MeshDecoder* const mesh_decoder =
  167|    522|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|    522|    auto ret = CreateMeshPredictionScheme<
  170|    522|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    522|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    522|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    522|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 378, False: 144]
  ------------------
  174|    378|      return ret;
  175|    378|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    522|  }
  178|       |  // Create delta decoder.
  179|    144|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    144|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    522|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    176|      uint16_t bitstream_version) {
  143|    176|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    176|        method, attribute, transform, mesh_data, bitstream_version);
  145|    176|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    176|        uint16_t bitstream_version) {
  127|    176|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 159, False: 17]
  ------------------
  128|    159|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    159|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    159|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    159|                                                  mesh_data));
  132|    159|      }
  133|     17|      return nullptr;
  134|    176|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    223|      uint16_t bitstream_version) {
  143|    223|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    223|        method, attribute, transform, mesh_data, bitstream_version);
  145|    223|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    223|        uint16_t bitstream_version) {
  127|    223|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 219, False: 4]
  ------------------
  128|    219|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    219|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    219|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    219|                                                  mesh_data));
  132|    219|      }
  133|      4|      return nullptr;
  134|    223|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    574|                                 const PointCloudDecoder* decoder) {
  188|    574|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    574|      method, att_id, decoder, TransformT());
  190|    574|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    574|                                 const TransformT& transform) {
  156|    574|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 574]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    574|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|    574|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 574, 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|    574|    const MeshDecoder* const mesh_decoder =
  167|    574|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|    574|    auto ret = CreateMeshPredictionScheme<
  170|    574|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    574|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    574|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    574|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 412, False: 162]
  ------------------
  174|    412|      return ret;
  175|    412|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    574|  }
  178|       |  // Create delta decoder.
  179|    162|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    162|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    574|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    203|      uint16_t bitstream_version) {
  143|    203|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    203|        method, attribute, transform, mesh_data, bitstream_version);
  145|    203|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    203|        uint16_t bitstream_version) {
  111|    203|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 189, False: 14]
  ------------------
  112|    189|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    189|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    189|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    189|                                                  mesh_data));
  116|    189|      }
  117|     14|      return nullptr;
  118|    203|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    224|      uint16_t bitstream_version) {
  143|    224|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    224|        method, attribute, transform, mesh_data, bitstream_version);
  145|    224|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    224|        uint16_t bitstream_version) {
  111|    224|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 223, False: 1]
  ------------------
  112|    223|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    223|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    223|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    223|                                                  mesh_data));
  116|    223|      }
  117|      1|      return nullptr;
  118|    224|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  7.10k|                                 const PointCloudDecoder* decoder) {
  188|  7.10k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  7.10k|      method, att_id, decoder, TransformT());
  190|  7.10k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  7.10k|                                 const TransformT& transform) {
  156|  7.10k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 7.10k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  7.10k|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|  7.10k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 7.10k, 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|  7.10k|    const MeshDecoder* const mesh_decoder =
  167|  7.10k|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|  7.10k|    auto ret = CreateMeshPredictionScheme<
  170|  7.10k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  7.10k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  7.10k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  7.10k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 6.72k, False: 382]
  ------------------
  174|  6.72k|      return ret;
  175|  6.72k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  7.10k|  }
  178|       |  // Create delta decoder.
  179|    382|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    382|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  7.10k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  3.39k|      uint16_t bitstream_version) {
  143|  3.39k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  3.39k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  3.39k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  3.39k|        uint16_t bitstream_version) {
   53|  3.39k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 1.15k, False: 2.23k]
  ------------------
   54|  1.15k|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|  1.15k|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|  1.15k|                                                         MeshDataT>(
   57|  1.15k|                attribute, transform, mesh_data));
   58|  1.15k|      }
   59|  2.23k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  2.23k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 447, False: 1.79k]
  ------------------
   61|    447|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    447|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    447|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    447|                                                  mesh_data));
   65|    447|      }
   66|  1.79k|#endif
   67|  1.79k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 706, False: 1.08k]
  ------------------
   68|    706|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    706|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    706|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    706|                                                  mesh_data));
   72|    706|      }
   73|  1.08k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|  1.08k|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 236, False: 848]
  ------------------
   75|    236|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    236|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    236|                                                     MeshDataT>(
   78|    236|                attribute, transform, mesh_data, bitstream_version));
   79|    236|      }
   80|    848|#endif
   81|    848|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 412, False: 436]
  ------------------
   82|    412|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    412|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    412|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    412|                                                  mesh_data));
   86|    412|      }
   87|    436|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    436|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 436, False: 0]
  ------------------
   89|    436|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    436|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    436|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    436|                                                  mesh_data));
   93|    436|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  3.39k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  3.33k|      uint16_t bitstream_version) {
  143|  3.33k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  3.33k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  3.33k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  3.33k|        uint16_t bitstream_version) {
   53|  3.33k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 917, False: 2.41k]
  ------------------
   54|    917|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    917|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    917|                                                         MeshDataT>(
   57|    917|                attribute, transform, mesh_data));
   58|    917|      }
   59|  2.41k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  2.41k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 549, False: 1.86k]
  ------------------
   61|    549|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    549|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    549|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    549|                                                  mesh_data));
   65|    549|      }
   66|  1.86k|#endif
   67|  1.86k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 657, False: 1.21k]
  ------------------
   68|    657|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    657|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    657|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    657|                                                  mesh_data));
   72|    657|      }
   73|  1.21k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|  1.21k|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 289, False: 921]
  ------------------
   75|    289|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    289|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    289|                                                     MeshDataT>(
   78|    289|                attribute, transform, mesh_data, bitstream_version));
   79|    289|      }
   80|    921|#endif
   81|    921|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 358, False: 563]
  ------------------
   82|    358|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    358|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    358|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    358|                                                  mesh_data));
   86|    358|      }
   87|    563|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    563|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 563, False: 0]
  ------------------
   89|    563|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    563|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    563|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    563|                                                  mesh_data));
   93|    563|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  3.33k|    }

_ZN5draco32PredictionSchemeDecoderInterface24SetMaxNumPredictedValuesEi:
   38|  7.22k|  virtual void SetMaxNumPredictedValues(int32_t num) {};

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    123|    const PointIndex*) {
   50|    123|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    123|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    123|  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|  20.9k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 20.8k, False: 123]
  ------------------
   57|  20.8k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  20.8k|                                           in_corr + i, out_data + i);
   59|  20.8k|  }
   60|    123|  return true;
   61|    123|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    143|    const PointIndex*) {
   50|    143|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    143|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    143|  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|  2.40M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 2.40M, False: 143]
  ------------------
   57|  2.40M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  2.40M|                                           in_corr + i, out_data + i);
   59|  2.40M|  }
   60|    143|  return true;
   61|    143|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    382|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    291|    const PointIndex*) {
   50|    291|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    291|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    291|  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|  22.1M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 22.1M, False: 291]
  ------------------
   57|  22.1M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  22.1M|                                           in_corr + i, out_data + i);
   59|  22.1M|  }
   60|    291|  return true;
   61|    291|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    144|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    162|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    522|    uint16_t bitstream_version) {
   38|    522|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|    522|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 522, False: 0]
  ------------------
   40|    522|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 16, False: 506]
  ------------------
   41|    506|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 19, False: 487]
  ------------------
   42|    487|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 67, False: 420]
  ------------------
   43|    420|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 420]
  ------------------
   44|    420|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 378, False: 42]
  ------------------
   45|    497|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 17, False: 25]
  ------------------
   46|    497|    const CornerTable* const ct = source->GetCornerTable();
   47|    497|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|    497|        source->GetAttributeEncodingData(att_id);
   49|    497|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 98, False: 399]
  |  Branch (49:26): [True: 0, False: 399]
  ------------------
   50|       |      // No connectivity data found.
   51|     98|      return nullptr;
   52|     98|    }
   53|       |    // Connectivity data exists.
   54|    399|    const MeshAttributeCornerTable* const att_ct =
   55|    399|        source->GetAttributeCornerTable(att_id);
   56|    399|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 176, False: 223]
  ------------------
   57|    176|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    176|      MeshData md;
   59|    176|      md.Set(source->mesh(), att_ct,
   60|    176|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    176|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    176|      MeshPredictionSchemeFactoryT factory;
   63|    176|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    176|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 159, False: 17]
  ------------------
   65|    159|        return ret;
   66|    159|      }
   67|    223|    } else {
   68|    223|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    223|      MeshData md;
   70|    223|      md.Set(source->mesh(), ct,
   71|    223|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    223|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    223|      MeshPredictionSchemeFactoryT factory;
   74|    223|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    223|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 219, False: 4]
  ------------------
   76|    219|        return ret;
   77|    219|      }
   78|    223|    }
   79|    399|  }
   80|     46|  return nullptr;
   81|    522|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    574|    uint16_t bitstream_version) {
   38|    574|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|    574|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 574, False: 0]
  ------------------
   40|    574|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 2, False: 572]
  ------------------
   41|    572|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1, False: 571]
  ------------------
   42|    571|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 133, False: 438]
  ------------------
   43|    438|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 2, False: 436]
  ------------------
   44|    436|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 412, False: 24]
  ------------------
   45|    555|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 5, False: 19]
  ------------------
   46|    555|    const CornerTable* const ct = source->GetCornerTable();
   47|    555|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|    555|        source->GetAttributeEncodingData(att_id);
   49|    555|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 128, False: 427]
  |  Branch (49:26): [True: 0, False: 427]
  ------------------
   50|       |      // No connectivity data found.
   51|    128|      return nullptr;
   52|    128|    }
   53|       |    // Connectivity data exists.
   54|    427|    const MeshAttributeCornerTable* const att_ct =
   55|    427|        source->GetAttributeCornerTable(att_id);
   56|    427|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 203, False: 224]
  ------------------
   57|    203|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    203|      MeshData md;
   59|    203|      md.Set(source->mesh(), att_ct,
   60|    203|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    203|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    203|      MeshPredictionSchemeFactoryT factory;
   63|    203|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    203|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 189, False: 14]
  ------------------
   65|    189|        return ret;
   66|    189|      }
   67|    224|    } else {
   68|    224|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    224|      MeshData md;
   70|    224|      md.Set(source->mesh(), ct,
   71|    224|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    224|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    224|      MeshPredictionSchemeFactoryT factory;
   74|    224|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    224|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 223, False: 1]
  ------------------
   76|    223|        return ret;
   77|    223|      }
   78|    224|    }
   79|    427|  }
   80|     34|  return nullptr;
   81|    574|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  7.10k|    uint16_t bitstream_version) {
   38|  7.10k|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|  7.10k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 7.10k, False: 0]
  ------------------
   40|  7.10k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 2.14k, False: 4.96k]
  ------------------
   41|  4.96k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 999, False: 3.97k]
  ------------------
   42|  3.97k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 1.40k, False: 2.56k]
  ------------------
   43|  2.56k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 770, False: 1.79k]
  ------------------
   44|  1.79k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 999, False: 797]
  ------------------
   45|  6.83k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 525, False: 272]
  ------------------
   46|  6.83k|    const CornerTable* const ct = source->GetCornerTable();
   47|  6.83k|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|  6.83k|        source->GetAttributeEncodingData(att_id);
   49|  6.83k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 110, False: 6.72k]
  |  Branch (49:26): [True: 0, False: 6.72k]
  ------------------
   50|       |      // No connectivity data found.
   51|    110|      return nullptr;
   52|    110|    }
   53|       |    // Connectivity data exists.
   54|  6.72k|    const MeshAttributeCornerTable* const att_ct =
   55|  6.72k|        source->GetAttributeCornerTable(att_id);
   56|  6.72k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 3.39k, False: 3.33k]
  ------------------
   57|  3.39k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  3.39k|      MeshData md;
   59|  3.39k|      md.Set(source->mesh(), att_ct,
   60|  3.39k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  3.39k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  3.39k|      MeshPredictionSchemeFactoryT factory;
   63|  3.39k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  3.39k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 3.39k, False: 0]
  ------------------
   65|  3.39k|        return ret;
   66|  3.39k|      }
   67|  3.39k|    } else {
   68|  3.33k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  3.33k|      MeshData md;
   70|  3.33k|      md.Set(source->mesh(), ct,
   71|  3.33k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  3.33k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  3.33k|      MeshPredictionSchemeFactoryT factory;
   74|  3.33k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  3.33k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 3.33k, False: 0]
  ------------------
   76|  3.33k|        return ret;
   77|  3.33k|      }
   78|  3.33k|    }
   79|  6.72k|  }
   80|    272|  return nullptr;
   81|  7.10k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  3.71M|  bool IsInBottomLeft(const Point2& p) const {
   93|  3.71M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 3.64M, False: 66.5k]
  |  Branch (93:22): [True: 3.64M, False: 6.83k]
  ------------------
   94|  3.64M|      return true;
   95|  3.64M|    }
   96|  73.4k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 32.7k, False: 40.6k]
  |  Branch (96:25): [True: 15.5k, False: 17.2k]
  ------------------
   97|  3.71M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  3.71M|  int32_t GetRotationCount(Point2 pred) const {
   51|  3.71M|    const DataType sign_x = pred[0];
   52|  3.71M|    const DataType sign_y = pred[1];
   53|       |
   54|  3.71M|    int32_t rotation_count = 0;
   55|  3.71M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 3.64M, False: 66.5k]
  ------------------
   56|  3.64M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 3.64M, False: 6.83k]
  ------------------
   57|  3.64M|        rotation_count = 0;
   58|  3.64M|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 3.45k, False: 3.37k]
  ------------------
   59|  3.45k|        rotation_count = 3;
   60|  3.45k|      } else {
   61|  3.37k|        rotation_count = 1;
   62|  3.37k|      }
   63|  3.64M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 33.8k, False: 32.7k]
  ------------------
   64|  33.8k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 15.5k, False: 18.2k]
  ------------------
   65|  15.5k|        rotation_count = 2;
   66|  18.2k|      } else {
   67|  18.2k|        rotation_count = 1;
   68|  18.2k|      }
   69|  33.8k|    } else {
   70|  32.7k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 15.5k, False: 17.2k]
  ------------------
   71|  15.5k|        rotation_count = 0;
   72|  17.2k|      } else {
   73|  17.2k|        rotation_count = 3;
   74|  17.2k|      }
   75|  32.7k|    }
   76|  3.71M|    return rotation_count;
   77|  3.71M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   115k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   115k|    switch (rotation_count) {
   81|  42.2k|      case 1:
  ------------------
  |  Branch (81:7): [True: 42.2k, False: 73.4k]
  ------------------
   82|  42.2k|        return Point2(p[1], -p[0]);
   83|  31.1k|      case 2:
  ------------------
  |  Branch (83:7): [True: 31.1k, False: 84.5k]
  ------------------
   84|  31.1k|        return Point2(-p[0], -p[1]);
   85|  42.2k|      case 3:
  ------------------
  |  Branch (85:7): [True: 42.2k, False: 73.4k]
  ------------------
   86|  42.2k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 115k]
  ------------------
   88|      0|        return p;
   89|   115k|    }
   90|   115k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    574|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

_ZN5draco37PredictionSchemeWrapDecodingTransformIiiE19DecodeTransformDataEPNS_13DecoderBufferE:
   65|  6.43k|  bool DecodeTransformData(DecoderBuffer* buffer) {
   66|  6.43k|    DataTypeT min_value, max_value;
   67|  6.43k|    if (!buffer->Decode(&min_value)) {
  ------------------
  |  Branch (67:9): [True: 64, False: 6.37k]
  ------------------
   68|     64|      return false;
   69|     64|    }
   70|  6.37k|    if (!buffer->Decode(&max_value)) {
  ------------------
  |  Branch (70:9): [True: 52, False: 6.32k]
  ------------------
   71|     52|      return false;
   72|     52|    }
   73|  6.32k|    if (min_value > max_value) {
  ------------------
  |  Branch (73:9): [True: 226, False: 6.09k]
  ------------------
   74|    226|      return false;
   75|    226|    }
   76|  6.09k|    this->set_min_value(min_value);
   77|  6.09k|    this->set_max_value(max_value);
   78|  6.09k|    if (!this->InitCorrectionBounds()) {
  ------------------
  |  Branch (78:9): [True: 25, False: 6.07k]
  ------------------
   79|     25|      return false;
   80|     25|    }
   81|  6.07k|    return true;
   82|  6.09k|  }
_ZNK5draco37PredictionSchemeWrapDecodingTransformIiiE20ComputeOriginalValueEPKiS3_Pi:
   38|  33.8M|                                   DataTypeT* out_original_vals) const {
   39|       |    // For now we assume both |DataTypeT| and |CorrTypeT| are equal.
   40|  33.8M|    static_assert(std::is_same<DataTypeT, CorrTypeT>::value,
   41|  33.8M|                  "Predictions and corrections must have the same type.");
   42|       |
   43|       |    // The only valid implementation right now is for int32_t.
   44|  33.8M|    static_assert(std::is_same<DataTypeT, int32_t>::value,
   45|  33.8M|                  "Only int32_t is supported for predicted values.");
   46|       |
   47|  33.8M|    predicted_vals = this->ClampPredictedValue(predicted_vals);
   48|       |
   49|       |    // The sum is computed in int64_t, where it is exact. The encoder keeps each
   50|       |    // correction within half of the span, so the sum lies at most one span
   51|       |    // outside [min, max] and a single wrap gives the original value. Malformed
   52|       |    // corrections cannot overflow int64_t either.
   53|   629M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (53:21): [True: 595M, False: 33.8M]
  ------------------
   54|   595M|      int64_t value = static_cast<int64_t>(predicted_vals[i]) +
   55|   595M|                      static_cast<int64_t>(corr_vals[i]);
   56|   595M|      if (value > this->max_value()) {
  ------------------
  |  Branch (56:11): [True: 34.3M, False: 561M]
  ------------------
   57|  34.3M|        value -= this->max_dif();
   58|   561M|      } else if (value < this->min_value()) {
  ------------------
  |  Branch (58:18): [True: 1.24M, False: 560M]
  ------------------
   59|  1.24M|        value += this->max_dif();
   60|  1.24M|      }
   61|   595M|      out_original_vals[i] = static_cast<DataTypeT>(value);
   62|   595M|    }
   63|  33.8M|  }
_ZN5draco37PredictionSchemeWrapDecodingTransformIiiEC2Ev:
   32|  7.10k|  PredictionSchemeWrapDecodingTransform() {}

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  6.91k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  6.09k|  inline void set_min_value(const DataTypeT& v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  6.09k|  inline void set_max_value(const DataTypeT& v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  6.09k|  bool InitCorrectionBounds() {
   84|  6.09k|    const int64_t dif =
   85|  6.09k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  6.09k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 6.09k]
  |  Branch (86:20): [True: 25, False: 6.07k]
  ------------------
   87|     25|      return false;
   88|     25|    }
   89|  6.07k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  6.07k|    max_correction_ = max_dif_ / 2;
   91|  6.07k|    min_correction_ = -max_correction_;
   92|  6.07k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 2.34k, False: 3.72k]
  ------------------
   93|  2.34k|      max_correction_ -= 1;
   94|  2.34k|    }
   95|  6.07k|    return true;
   96|  6.09k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  5.12k|  void Init(int num_components) {
   56|  5.12k|    num_components_ = num_components;
   57|  5.12k|    clamped_value_.resize(num_components);
   58|  5.12k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  33.8M|      const DataTypeT* predicted_val) const {
   64|   629M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 595M, False: 33.8M]
  ------------------
   65|   595M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 253k, False: 595M]
  ------------------
   66|   253k|        clamped_value_[i] = max_value_;
   67|   595M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 3.91M, False: 591M]
  ------------------
   68|  3.91M|        clamped_value_[i] = min_value_;
   69|   591M|      } else {
   70|   591M|        clamped_value_[i] = predicted_val[i];
   71|   591M|      }
   72|   595M|    }
   73|  33.8M|    return clamped_value_.data();
   74|  33.8M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|  1.25G|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|   595M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|  35.5M|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|   561M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    859|  int quantization_bits() const {
   78|    859|    DRACO_DCHECK(false);
   79|    859|    return -1;
   80|    859|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  7.10k|      : num_components_(0),
   45|  7.10k|        min_value_(0),
   46|  7.10k|        max_value_(0),
   47|  7.10k|        max_dif_(0),
   48|  7.10k|        max_correction_(0),
   49|  7.10k|        min_correction_(0) {}

_ZN5draco26SequentialAttributeDecoderC2Ev:
   20|  48.1k|    : decoder_(nullptr), attribute_(nullptr), attribute_id_(-1) {}
_ZN5draco26SequentialAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   23|  48.1k|                                      int attribute_id) {
   24|  48.1k|  decoder_ = decoder;
   25|  48.1k|  attribute_ = decoder->point_cloud()->attribute(attribute_id);
   26|  48.1k|  attribute_id_ = attribute_id;
   27|  48.1k|  return true;
   28|  48.1k|}
_ZN5draco26SequentialAttributeDecoder23DecodePortableAttributeERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   38|  14.0k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   39|  14.0k|  if (attribute_->num_components() <= 0 ||
  ------------------
  |  Branch (39:7): [True: 0, False: 14.0k]
  ------------------
   40|  14.0k|      !attribute_->Reset(point_ids.size())) {
  ------------------
  |  Branch (40:7): [True: 0, False: 14.0k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  14.0k|  if (!DecodeValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (43:7): [True: 2.76k, False: 11.2k]
  ------------------
   44|  2.76k|    return false;
   45|  2.76k|  }
   46|  11.2k|  return true;
   47|  14.0k|}
_ZN5draco26SequentialAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   50|  4.03k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   51|       |  // Default implementation does not apply any transform.
   52|  4.03k|  return true;
   53|  4.03k|}
_ZN5draco26SequentialAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   56|    206|    const std::vector<PointIndex>& point_ids) {
   57|       |  // Default implementation does not apply any transform.
   58|    206|  return true;
   59|    206|}
_ZN5draco26SequentialAttributeDecoder20GetPortableAttributeEv:
   61|  8.47k|const PointAttribute* SequentialAttributeDecoder::GetPortableAttribute() {
   62|       |  // If needed, copy point to attribute value index mapping from the final
   63|       |  // attribute to the portable attribute.
   64|  8.47k|  if (!attribute_->is_mapping_identity() && portable_attribute_ &&
  ------------------
  |  Branch (64:7): [True: 7.48k, False: 991]
  |  Branch (64:45): [True: 7.28k, False: 192]
  ------------------
   65|  7.28k|      portable_attribute_->is_mapping_identity()) {
  ------------------
  |  Branch (65:7): [True: 5.62k, False: 1.66k]
  ------------------
   66|  5.62k|    portable_attribute_->SetExplicitMapping(attribute_->indices_map_size());
   67|  5.62k|    for (PointIndex i(0);
   68|  31.8M|         i < static_cast<uint32_t>(attribute_->indices_map_size()); ++i) {
  ------------------
  |  Branch (68:10): [True: 31.8M, False: 5.62k]
  ------------------
   69|  31.8M|      portable_attribute_->SetPointMapEntry(i, attribute_->mapped_index(i));
   70|  31.8M|    }
   71|  5.62k|  }
   72|  8.47k|  return portable_attribute_.get();
   73|  8.47k|}
_ZN5draco26SequentialAttributeDecoder20InitPredictionSchemeEPNS_25PredictionSchemeInterfaceE:
   76|  8.20k|    PredictionSchemeInterface* ps) {
   77|  11.2k|  for (int i = 0; i < ps->GetNumParentAttributes(); ++i) {
  ------------------
  |  Branch (77:19): [True: 3.08k, False: 8.17k]
  ------------------
   78|  3.08k|    const int att_id = decoder_->point_cloud()->GetNamedAttributeId(
   79|  3.08k|        ps->GetParentAttributeType(i));
   80|  3.08k|    if (att_id == -1) {
  ------------------
  |  Branch (80:9): [True: 4, False: 3.08k]
  ------------------
   81|      4|      return false;  // Requested attribute does not exist.
   82|      4|    }
   83|  3.08k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   84|  3.08k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.08k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:9): [True: 0, False: 3.08k]
  ------------------
   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|  3.08k|#endif
   90|  3.08k|    {
   91|  3.08k|      const PointAttribute* const pa = decoder_->GetPortableAttribute(att_id);
   92|  3.08k|      if (pa == nullptr || !ps->SetParentAttribute(pa)) {
  ------------------
  |  Branch (92:11): [True: 3, False: 3.07k]
  |  Branch (92:28): [True: 19, False: 3.05k]
  ------------------
   93|     22|        return false;
   94|     22|      }
   95|  3.08k|    }
   96|  3.08k|  }
   97|  8.17k|  return true;
   98|  8.20k|}
_ZN5draco26SequentialAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  101|    525|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
  102|    525|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
  103|    525|  const int entry_size = static_cast<int>(attribute_->byte_stride());
  104|    525|  std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
  105|    525|  uint8_t* const value_data = value_data_ptr.get();
  106|    525|  int out_byte_pos = 0;
  107|       |  // Decode raw attribute values in their original format.
  108|  3.95k|  for (int i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (108:19): [True: 3.47k, False: 477]
  ------------------
  109|  3.47k|    if (!in_buffer->Decode(value_data, entry_size)) {
  ------------------
  |  Branch (109:9): [True: 48, False: 3.42k]
  ------------------
  110|     48|      return false;
  111|     48|    }
  112|  3.42k|    attribute_->buffer()->Write(out_byte_pos, value_data, entry_size);
  113|  3.42k|    out_byte_pos += entry_size;
  114|  3.42k|  }
  115|    477|  return true;
  116|    525|}

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  11.8k|  const PointAttribute* attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|   181M|  PointAttribute* attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  8.20k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  39.6k|  PointCloudDecoder* decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  13.0k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  13.0k|    portable_attribute_ = std::move(att);
   71|  13.0k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  44.0k|  PointAttribute* portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  48.1k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  21.8k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  8.43k|    DecoderBuffer* buffer) {
   30|  8.43k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 179, False: 8.25k]
  ------------------
   31|    179|    return false;
   32|    179|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  8.25k|  const int32_t num_attributes = GetNumAttributes();
   35|  8.25k|  sequential_decoders_.resize(num_attributes);
   36|  56.3k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 48.1k, False: 8.22k]
  ------------------
   37|  48.1k|    uint8_t decoder_type;
   38|  48.1k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 5, False: 48.1k]
  ------------------
   39|      5|      return false;
   40|      5|    }
   41|       |    // Create the decoder from the id.
   42|  48.1k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  48.1k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 13, False: 48.1k]
  ------------------
   44|     13|      return false;
   45|     13|    }
   46|  48.1k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 10, False: 48.1k]
  ------------------
   47|     10|      return false;
   48|     10|    }
   49|  48.1k|  }
   50|  8.22k|  return true;
   51|  8.25k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  5.41k|    DecoderBuffer* buffer) {
   55|  5.41k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 5.41k]
  |  Branch (55:22): [True: 1, False: 5.41k]
  ------------------
   56|      1|    return false;
   57|      1|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  5.41k|  const int32_t num_attributes = GetNumAttributes();
   60|  32.1k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 26.7k, False: 5.40k]
  ------------------
   61|  26.7k|    PointAttribute* const pa =
   62|  26.7k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  26.7k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 3, False: 26.7k]
  ------------------
   64|      3|      return false;
   65|      3|    }
   66|  26.7k|  }
   67|  5.40k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  5.41k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  5.40k|    DecoderBuffer* in_buffer) {
   72|  5.40k|  const int32_t num_attributes = GetNumAttributes();
   73|  16.6k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 14.0k, False: 2.64k]
  ------------------
   74|  14.0k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 2.76k, False: 11.2k]
  ------------------
   75|  14.0k|                                                          in_buffer)) {
   76|  2.76k|      return false;
   77|  2.76k|    }
   78|  14.0k|  }
   79|  2.64k|  return true;
   80|  5.40k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  2.64k|    DecodeDataNeededByPortableTransforms(DecoderBuffer* in_buffer) {
   84|  2.64k|  const int32_t num_attributes = GetNumAttributes();
   85|  7.27k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 5.28k, False: 1.99k]
  ------------------
   86|  5.28k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 653, False: 4.62k]
  ------------------
   87|  5.28k|            point_ids_, in_buffer)) {
   88|    653|      return false;
   89|    653|    }
   90|  5.28k|  }
   91|  1.99k|  return true;
   92|  2.64k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  1.99k|    TransformAttributesToOriginalFormat() {
   96|  1.99k|  const int32_t num_attributes = GetNumAttributes();
   97|  4.92k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 3.65k, False: 1.27k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  3.65k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 3.65k, False: 0]
  ------------------
  100|  3.65k|      const PointAttribute* const attribute =
  101|  3.65k|          sequential_decoders_[i]->attribute();
  102|  3.65k|      const PointAttribute* const portable_attribute =
  103|  3.65k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  3.65k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 3.44k, False: 206]
  |  Branch (104:11): [True: 0, False: 3.65k]
  ------------------
  105|  3.44k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 0, False: 3.44k]
  ------------------
  106|  3.44k|              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|      0|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|      0|        continue;
  114|      0|      }
  115|  3.65k|    }
  116|  3.65k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 722, False: 2.92k]
  ------------------
  117|  3.65k|            point_ids_)) {
  118|    722|      return false;
  119|    722|    }
  120|  3.65k|  }
  121|  1.27k|  return true;
  122|  1.99k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  48.1k|    uint8_t decoder_type) {
  127|  48.1k|  switch (decoder_type) {
  128|  3.06k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 3.06k, False: 45.0k]
  ------------------
  129|  3.06k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  3.06k|          new SequentialAttributeDecoder());
  131|  43.4k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 43.4k, False: 4.70k]
  ------------------
  132|  43.4k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  43.4k|          new SequentialIntegerAttributeDecoder());
  134|    378|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 378, False: 47.7k]
  ------------------
  135|    378|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    378|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.25k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.25k, False: 46.9k]
  ------------------
  139|  1.25k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.25k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     13|    default:
  ------------------
  |  Branch (142:5): [True: 13, False: 48.1k]
  ------------------
  143|     13|      break;
  144|  48.1k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     13|  return nullptr;
  147|  48.1k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  45.0k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() =
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   27|  45.0k|                                             int attribute_id) {
   28|  45.0k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (28:7): [True: 0, False: 45.0k]
  ------------------
   29|      0|    return false;
   30|      0|  }
   31|  45.0k|  return true;
   32|  45.0k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   35|  3.44k|    const std::vector<PointIndex>& point_ids) {
   36|  3.44k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   37|  3.44k|  if (decoder() &&
  ------------------
  |  Branch (37:7): [True: 3.44k, False: 0]
  ------------------
   38|  3.44k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.44k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (38:7): [True: 8, False: 3.43k]
  ------------------
   39|      8|    return true;  // Don't revert the transform here for older files.
   40|      8|  }
   41|  3.43k|#endif
   42|  3.43k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   43|  3.44k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   46|  13.5k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   47|       |  // Decode prediction scheme.
   48|  13.5k|  int8_t prediction_scheme_method;
   49|  13.5k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (49:7): [True: 42, False: 13.4k]
  ------------------
   50|     42|    return false;
   51|     42|  }
   52|       |  // Check that decoded prediction scheme method type is valid.
   53|  13.4k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (53:7): [True: 58, False: 13.4k]
  ------------------
   54|  13.4k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (54:7): [True: 185, False: 13.2k]
  ------------------
   55|    243|    return false;
   56|    243|  }
   57|  13.2k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (57:7): [True: 13.2k, False: 20]
  ------------------
   58|  13.2k|    int8_t prediction_transform_type;
   59|  13.2k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (59:9): [True: 34, False: 13.1k]
  ------------------
   60|     34|      return false;
   61|     34|    }
   62|       |    // Check that decoded prediction scheme transform type is valid.
   63|  13.1k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (63:9): [True: 17, False: 13.1k]
  ------------------
   64|  13.1k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (64:9): [True: 108, False: 13.0k]
  ------------------
   65|    125|      return false;
   66|    125|    }
   67|  13.0k|    prediction_scheme_ = CreateIntPredictionScheme(
   68|  13.0k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   69|  13.0k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   70|  13.0k|  }
   71|       |
   72|  13.0k|  if (prediction_scheme_) {
  ------------------
  |  Branch (72:7): [True: 8.20k, False: 4.86k]
  ------------------
   73|  8.20k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (73:9): [True: 26, False: 8.17k]
  ------------------
   74|     26|      return false;
   75|     26|    }
   76|  8.20k|  }
   77|       |
   78|  13.0k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (78:7): [True: 2.24k, False: 10.8k]
  ------------------
   79|  2.24k|    return false;
   80|  2.24k|  }
   81|       |
   82|  10.8k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   83|  10.8k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   84|  10.8k|  if (decoder() &&
  ------------------
  |  Branch (84:7): [True: 10.8k, False: 0]
  ------------------
   85|  10.8k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  10.8k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (85:7): [True: 13, False: 10.7k]
  ------------------
   86|       |    // For older files, revert the transform right after we decode the data.
   87|     13|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (87:9): [True: 0, False: 13]
  ------------------
   88|      0|      return false;
   89|      0|    }
   90|     13|  }
   91|  10.8k|#endif
   92|  10.8k|  return true;
   93|  10.8k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   98|  11.8k|    PredictionSchemeTransformType transform_type) {
   99|  11.8k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (99:7): [True: 4.77k, False: 7.10k]
  ------------------
  100|  4.77k|    return nullptr;  // For now we support only wrap transform.
  101|  4.77k|  }
  102|  7.10k|  return CreatePredictionSchemeForDecoder<
  103|  7.10k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  104|  7.10k|      method, attribute_id(), decoder());
  105|  11.8k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  108|  13.0k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
  109|  13.0k|  const int num_components = GetNumValueComponents();
  110|  13.0k|  if (num_components <= 0) {
  ------------------
  |  Branch (110:7): [True: 0, False: 13.0k]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|  13.0k|  const size_t num_entries = point_ids.size();
  114|  13.0k|  const size_t num_values = num_entries * num_components;
  115|  13.0k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  116|  13.0k|  int32_t* const portable_attribute_data = GetPortableAttributeData();
  117|  13.0k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (117:7): [True: 8, False: 13.0k]
  ------------------
  118|      8|    return false;
  119|      8|  }
  120|  13.0k|  uint8_t compressed;
  121|  13.0k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (121:7): [True: 18, False: 13.0k]
  ------------------
  122|     18|    return false;
  123|     18|  }
  124|  13.0k|  if (compressed > 0) {
  ------------------
  |  Branch (124:7): [True: 725, False: 12.2k]
  ------------------
  125|       |    // Decode compressed values.
  126|    725|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (126:9): [True: 284, False: 441]
  ------------------
  127|    725|                       in_buffer,
  128|    725|                       reinterpret_cast<uint32_t*>(portable_attribute_data))) {
  129|    284|      return false;
  130|    284|    }
  131|  12.2k|  } else {
  132|       |    // Decode the integer data directly.
  133|       |    // Get the number of bytes for a given entry.
  134|  12.2k|    uint8_t num_bytes;
  135|  12.2k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (135:9): [True: 11, False: 12.2k]
  ------------------
  136|     11|      return false;
  137|     11|    }
  138|  12.2k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (138:9): [True: 767, False: 11.5k]
  ------------------
  139|    767|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (139:11): [True: 0, False: 767]
  ------------------
  140|    767|          sizeof(int32_t) * num_values) {
  141|      0|        return false;
  142|      0|      }
  143|    767|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (143:11): [True: 4, False: 763]
  ------------------
  144|    767|                             sizeof(int32_t) * num_values)) {
  145|      4|        return false;
  146|      4|      }
  147|  11.5k|    } else {
  148|  11.5k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (148:11): [True: 50, False: 11.4k]
  ------------------
  149|  11.5k|          num_bytes * num_values) {
  150|     50|        return false;
  151|     50|      }
  152|  11.4k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (152:11): [True: 19, False: 11.4k]
  ------------------
  153|  11.4k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  154|     19|        return false;
  155|     19|      }
  156|  1.09G|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (156:26): [True: 1.09G, False: 11.4k]
  ------------------
  157|  1.09G|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (157:13): [True: 0, False: 1.09G]
  ------------------
  158|      0|          return false;
  159|      0|        }
  160|  1.09G|      }
  161|  11.4k|    }
  162|  12.2k|  }
  163|       |
  164|  12.6k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (164:7): [True: 12.6k, False: 0]
  |  Branch (164:26): [True: 4.66k, False: 7.98k]
  ------------------
  165|  11.5k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (165:26): [True: 6.91k, False: 1.07k]
  ------------------
  166|       |    // Convert the values back to the original signed format.
  167|  11.5k|    ConvertSymbolsToSignedInts(
  168|  11.5k|        reinterpret_cast<const uint32_t*>(portable_attribute_data),
  169|  11.5k|        static_cast<int>(num_values), portable_attribute_data);
  170|  11.5k|  }
  171|       |
  172|       |  // If the data was encoded with a prediction scheme, we must revert it.
  173|  12.6k|  if (prediction_scheme_) {
  ------------------
  |  Branch (173:7): [True: 7.98k, False: 4.66k]
  ------------------
  174|  7.98k|    prediction_scheme_->SetMaxNumPredictedValues(num_values);
  175|  7.98k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (175:9): [True: 1.01k, False: 6.96k]
  ------------------
  176|  1.01k|      return false;
  177|  1.01k|    }
  178|       |
  179|  6.96k|    if (num_values > 0) {
  ------------------
  |  Branch (179:9): [True: 6.96k, False: 0]
  ------------------
  180|  6.96k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (180:11): [True: 829, False: 6.13k]
  ------------------
  181|  6.96k|              portable_attribute_data, portable_attribute_data,
  182|  6.96k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  183|    829|        return false;
  184|    829|      }
  185|  6.96k|    }
  186|  6.96k|  }
  187|  10.8k|  return true;
  188|  12.6k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  190|  2.95k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  191|  2.95k|  switch (attribute()->data_type()) {
  192|    376|    case DT_UINT8:
  ------------------
  |  Branch (192:5): [True: 376, False: 2.57k]
  ------------------
  193|    376|      StoreTypedValues<uint8_t>(num_values);
  194|    376|      break;
  195|  1.31k|    case DT_INT8:
  ------------------
  |  Branch (195:5): [True: 1.31k, False: 1.64k]
  ------------------
  196|  1.31k|      StoreTypedValues<int8_t>(num_values);
  197|  1.31k|      break;
  198|     87|    case DT_UINT16:
  ------------------
  |  Branch (198:5): [True: 87, False: 2.86k]
  ------------------
  199|     87|      StoreTypedValues<uint16_t>(num_values);
  200|     87|      break;
  201|    172|    case DT_INT16:
  ------------------
  |  Branch (201:5): [True: 172, False: 2.78k]
  ------------------
  202|    172|      StoreTypedValues<int16_t>(num_values);
  203|    172|      break;
  204|    187|    case DT_UINT32:
  ------------------
  |  Branch (204:5): [True: 187, False: 2.76k]
  ------------------
  205|    187|      StoreTypedValues<uint32_t>(num_values);
  206|    187|      break;
  207|    394|    case DT_INT32:
  ------------------
  |  Branch (207:5): [True: 394, False: 2.56k]
  ------------------
  208|    394|      StoreTypedValues<int32_t>(num_values);
  209|    394|      break;
  210|    426|    default:
  ------------------
  |  Branch (210:5): [True: 426, False: 2.52k]
  ------------------
  211|    426|      return false;
  212|  2.95k|  }
  213|  2.52k|  return true;
  214|  2.95k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  238|  13.0k|    int num_entries, int num_components) {
  239|  13.0k|  GeometryAttribute ga;
  240|  13.0k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  241|  13.0k|          false, num_components * DataTypeLength(DT_INT32), 0);
  242|  13.0k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  243|  13.0k|  port_att->SetIdentityMapping();
  244|  13.0k|  port_att->Reset(num_entries);
  245|  13.0k|  port_att->set_unique_id(attribute()->unique_id());
  246|  13.0k|  SetPortableAttribute(std::move(port_att));
  247|  13.0k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  217|    376|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    376|  const int num_components = attribute()->num_components();
  219|    376|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    376|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    376|      new AttributeTypeT[num_components]);
  222|    376|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    376|  int val_id = 0;
  224|    376|  int out_byte_pos = 0;
  225|  17.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 17.6M, False: 376]
  ------------------
  226|  95.4M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 77.8M, False: 17.6M]
  ------------------
  227|  77.8M|      const AttributeTypeT value =
  228|  77.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  77.8M|      att_val[c] = value;
  230|  77.8M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  17.6M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  17.6M|    out_byte_pos += entry_size;
  234|  17.6M|  }
  235|    376|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  217|  1.31k|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|  1.31k|  const int num_components = attribute()->num_components();
  219|  1.31k|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|  1.31k|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|  1.31k|      new AttributeTypeT[num_components]);
  222|  1.31k|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|  1.31k|  int val_id = 0;
  224|  1.31k|  int out_byte_pos = 0;
  225|   155M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 155M, False: 1.31k]
  ------------------
  226|   720M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 564M, False: 155M]
  ------------------
  227|   564M|      const AttributeTypeT value =
  228|   564M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   564M|      att_val[c] = value;
  230|   564M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   155M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   155M|    out_byte_pos += entry_size;
  234|   155M|  }
  235|  1.31k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  217|     87|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|     87|  const int num_components = attribute()->num_components();
  219|     87|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|     87|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|     87|      new AttributeTypeT[num_components]);
  222|     87|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|     87|  int val_id = 0;
  224|     87|  int out_byte_pos = 0;
  225|  1.08M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 1.08M, False: 87]
  ------------------
  226|  43.4M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 42.4M, False: 1.08M]
  ------------------
  227|  42.4M|      const AttributeTypeT value =
  228|  42.4M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  42.4M|      att_val[c] = value;
  230|  42.4M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  1.08M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  1.08M|    out_byte_pos += entry_size;
  234|  1.08M|  }
  235|     87|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  217|    172|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    172|  const int num_components = attribute()->num_components();
  219|    172|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    172|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    172|      new AttributeTypeT[num_components]);
  222|    172|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    172|  int val_id = 0;
  224|    172|  int out_byte_pos = 0;
  225|   274k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 274k, False: 172]
  ------------------
  226|  32.4M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 32.1M, False: 274k]
  ------------------
  227|  32.1M|      const AttributeTypeT value =
  228|  32.1M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  32.1M|      att_val[c] = value;
  230|  32.1M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   274k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   274k|    out_byte_pos += entry_size;
  234|   274k|  }
  235|    172|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  217|    187|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    187|  const int num_components = attribute()->num_components();
  219|    187|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    187|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    187|      new AttributeTypeT[num_components]);
  222|    187|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    187|  int val_id = 0;
  224|    187|  int out_byte_pos = 0;
  225|   813k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 813k, False: 187]
  ------------------
  226|  57.3M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 56.5M, False: 813k]
  ------------------
  227|  56.5M|      const AttributeTypeT value =
  228|  56.5M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  56.5M|      att_val[c] = value;
  230|  56.5M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   813k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   813k|    out_byte_pos += entry_size;
  234|   813k|  }
  235|    187|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  217|    394|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    394|  const int num_components = attribute()->num_components();
  219|    394|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    394|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    394|      new AttributeTypeT[num_components]);
  222|    394|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    394|  int val_id = 0;
  224|    394|  int out_byte_pos = 0;
  225|  6.19M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 6.19M, False: 394]
  ------------------
  226|   101M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 95.5M, False: 6.19M]
  ------------------
  227|  95.5M|      const AttributeTypeT value =
  228|  95.5M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  95.5M|      att_val[c] = value;
  230|  95.5M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  6.19M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  6.19M|    out_byte_pos += entry_size;
  234|  6.19M|  }
  235|    394|}

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

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

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

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

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

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

_ZNK5draco12DracoOptionsINS_17GeometryAttribute4TypeEE16GetAttributeBoolERKS2_RKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEb:
  195|  3.44k|                                                   bool default_val) const {
  196|  3.44k|  const Options* const att_options = FindAttributeOptions(att_key);
  197|  3.44k|  if (att_options && att_options->IsOptionSet(name)) {
  ------------------
  |  Branch (197:7): [True: 0, False: 3.44k]
  |  Branch (197:22): [True: 0, False: 0]
  ------------------
  198|      0|    return att_options->GetBool(name, default_val);
  199|      0|  }
  200|  3.44k|  return global_options_.GetBool(name, default_val);
  201|  3.44k|}
_ZNK5draco12DracoOptionsINS_17GeometryAttribute4TypeEE20FindAttributeOptionsERKS2_:
  137|  3.44k|    const AttributeKeyT& att_key) const {
  138|  3.44k|  auto it = attribute_options_.find(att_key);
  139|  3.44k|  if (it == attribute_options_.end()) {
  ------------------
  |  Branch (139:7): [True: 3.44k, False: 0]
  ------------------
  140|  3.44k|    return nullptr;
  141|  3.44k|  }
  142|      0|  return &it->second;
  143|  3.44k|}

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

_ZN5draco10AnsDecoderC2Ev:
   56|  39.2k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  28.0k|                                const uint8_t* const buf, int offset) {
  301|  28.0k|  unsigned x;
  302|  28.0k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 50, False: 27.9k]
  ------------------
  303|     50|    return 1;
  304|     50|  }
  305|  27.9k|  ans->buf = buf;
  306|  27.9k|  x = buf[offset - 1] >> 6;
  307|  27.9k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 22.6k, False: 5.26k]
  ------------------
  308|  22.6k|    ans->buf_offset = offset - 1;
  309|  22.6k|    ans->state = buf[offset - 1] & 0x3F;
  310|  22.6k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 4.77k, False: 486]
  ------------------
  311|  4.77k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 3, False: 4.77k]
  ------------------
  312|      3|      return 1;
  313|      3|    }
  314|  4.77k|    ans->buf_offset = offset - 2;
  315|  4.77k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  4.77k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 475, False: 11]
  ------------------
  317|    475|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 0, False: 475]
  ------------------
  318|      0|      return 1;
  319|      0|    }
  320|    475|    ans->buf_offset = offset - 3;
  321|    475|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    475|  } else {
  323|     11|    return 1;
  324|     11|  }
  325|  27.9k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  27.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  27.9k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  27.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  27.9k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 2, False: 27.9k]
  ------------------
  327|      2|    return 1;
  328|      2|  }
  329|  27.9k|  return 0;
  330|  27.9k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  4.77k|static uint32_t mem_get_le16(const void* vmem) {
   68|  4.77k|  uint32_t val;
   69|  4.77k|  const uint8_t* mem = (const uint8_t*)vmem;
   70|       |
   71|  4.77k|  val = mem[1] << 8;
   72|  4.77k|  val |= mem[0];
   73|  4.77k|  return val;
   74|  4.77k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    475|static uint32_t mem_get_le24(const void* vmem) {
   77|    475|  uint32_t val;
   78|    475|  const uint8_t* mem = (const uint8_t*)vmem;
   79|       |
   80|    475|  val = mem[2] << 16;
   81|    475|  val |= mem[1] << 8;
   82|    475|  val |= mem[0];
   83|    475|  return val;
   84|    475|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|   100M|static inline int rabs_desc_read(struct AnsDecoder* ans, AnsP8 p0) {
  167|   100M|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|   100M|  unsigned quot, rem, x, xn;
  172|   100M|#endif
  173|   100M|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|   100M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|   100M|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|   201M|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 65.9M, False: 34.8M]
  |  Branch (174:40): [True: 246k, False: 65.7M]
  ------------------
  175|   246k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   246k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   246k|  }
  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|   100M|  x = ans->state;
  184|   100M|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   100M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|   100M|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   100M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|   100M|  xn = quot * p;
  187|   100M|  val = rem < p;
  188|   100M|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|   201M|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 94.1M, False: 6.69M]
  |  |  ------------------
  ------------------
  189|  94.1M|    ans->state = xn + rem;
  190|  94.1M|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|  6.69M|    ans->state = x - xn - p;
  193|  6.69M|  }
  194|   100M|#endif
  195|   100M|  return val;
  196|   100M|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  60.5k|static inline int ans_read_end(struct AnsDecoder* const ans) {
  333|  60.5k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  60.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  60.5k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  3.81k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  484|  2.30k|                                       uint32_t num_symbols) {
  485|  2.30k|    lut_table_.resize(rans_precision);
  486|  2.30k|    probability_table_.resize(num_symbols);
  487|  2.30k|    uint32_t cum_prob = 0;
  488|  2.30k|    uint32_t act_prob = 0;
  489|  19.6k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 17.5k, False: 2.10k]
  ------------------
  490|  17.5k|      probability_table_[i].prob = token_probs[i];
  491|  17.5k|      probability_table_[i].cum_prob = cum_prob;
  492|  17.5k|      cum_prob += token_probs[i];
  493|  17.5k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 201, False: 17.3k]
  ------------------
  494|    201|        return false;
  495|    201|      }
  496|  7.51M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 7.49M, False: 17.3k]
  ------------------
  497|  7.49M|        lut_table_[j] = i;
  498|  7.49M|      }
  499|  17.3k|      act_prob = cum_prob;
  500|  17.3k|    }
  501|  2.10k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 302, False: 1.80k]
  ------------------
  502|    302|      return false;
  503|    302|    }
  504|  1.80k|    return true;
  505|  2.10k|  }
_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: 119, False: 1.57k]
  ------------------
  424|    119|      return 1;
  425|    119|    }
  426|  1.57k|    ans_.buf = buf;
  427|  1.57k|    x = buf[offset - 1] >> 6;
  428|  1.57k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 922, False: 650]
  ------------------
  429|    922|      ans_.buf_offset = offset - 1;
  430|    922|      ans_.state = buf[offset - 1] & 0x3F;
  431|    922|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 254, False: 396]
  ------------------
  432|    254|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 41, False: 213]
  ------------------
  433|     41|        return 1;
  434|     41|      }
  435|    213|      ans_.buf_offset = offset - 2;
  436|    213|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    396|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 271, False: 125]
  ------------------
  438|    271|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 64, False: 207]
  ------------------
  439|     64|        return 1;
  440|     64|      }
  441|    207|      ans_.buf_offset = offset - 3;
  442|    207|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    207|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 125, False: 0]
  ------------------
  444|    125|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 39, False: 86]
  ------------------
  445|     39|        return 1;
  446|     39|      }
  447|     86|      ans_.buf_offset = offset - 4;
  448|     86|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     86|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|  1.42k|    ans_.state += l_rans_base;
  453|  1.42k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.42k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 95, False: 1.33k]
  ------------------
  454|     95|      return 1;
  455|     95|    }
  456|  1.33k|    return 0;
  457|  1.42k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    360|static uint32_t mem_get_le16(const void* vmem) {
   68|    360|  uint32_t val;
   69|    360|  const uint8_t* mem = (const uint8_t*)vmem;
   70|       |
   71|    360|  val = mem[1] << 8;
   72|    360|  val |= mem[0];
   73|    360|  return val;
   74|    360|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    326|static uint32_t mem_get_le24(const void* vmem) {
   77|    326|  uint32_t val;
   78|    326|  const uint8_t* mem = (const uint8_t*)vmem;
   79|       |
   80|    326|  val = mem[2] << 16;
   81|    326|  val |= mem[1] << 8;
   82|    326|  val |= mem[0];
   83|    326|  return val;
   84|    326|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    328|static inline uint32_t mem_get_le32(const void* vmem) {
   87|    328|  uint32_t val;
   88|    328|  const uint8_t* mem = (const uint8_t*)vmem;
   89|       |
   90|    328|  val = mem[3] << 24;
   91|    328|  val |= mem[2] << 16;
   92|    328|  val |= mem[1] << 8;
   93|    328|  val |= mem[0];
   94|    328|  return val;
   95|    328|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  465|   421M|  inline int rans_read() {
  466|   421M|    unsigned rem;
  467|   421M|    unsigned quo;
  468|   421M|    struct rans_dec_sym sym;
  469|   421M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 404M, False: 17.2M]
  |  Branch (469:40): [True: 30.1k, False: 404M]
  ------------------
  470|  30.1k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  30.1k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  30.1k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   421M|    quo = ans_.state / rans_precision;
  475|   421M|    rem = ans_.state % rans_precision;
  476|   421M|    fetch_sym(&sym, rem);
  477|   421M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   421M|    return sym.val;
  479|   421M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  508|   421M|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   421M|    uint32_t symbol = lut_table_[rem];
  510|   421M|    out->val = symbol;
  511|   421M|    out->prob = probability_table_[symbol].prob;
  512|   421M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   421M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  459|  1.27k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    283|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  484|    189|                                       uint32_t num_symbols) {
  485|    189|    lut_table_.resize(rans_precision);
  486|    189|    probability_table_.resize(num_symbols);
  487|    189|    uint32_t cum_prob = 0;
  488|    189|    uint32_t act_prob = 0;
  489|  8.49k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 8.32k, False: 162]
  ------------------
  490|  8.32k|      probability_table_[i].prob = token_probs[i];
  491|  8.32k|      probability_table_[i].cum_prob = cum_prob;
  492|  8.32k|      cum_prob += token_probs[i];
  493|  8.32k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 27, False: 8.30k]
  ------------------
  494|     27|        return false;
  495|     27|      }
  496|  1.33M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 1.32M, False: 8.30k]
  ------------------
  497|  1.32M|        lut_table_[j] = i;
  498|  1.32M|      }
  499|  8.30k|      act_prob = cum_prob;
  500|  8.30k|    }
  501|    162|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 10, False: 152]
  ------------------
  502|     10|      return false;
  503|     10|    }
  504|    152|    return true;
  505|    162|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|    123|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    123|    unsigned x;
  423|    123|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 120]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|    120|    ans_.buf = buf;
  427|    120|    x = buf[offset - 1] >> 6;
  428|    120|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 38, False: 82]
  ------------------
  429|     38|      ans_.buf_offset = offset - 1;
  430|     38|      ans_.state = buf[offset - 1] & 0x3F;
  431|     82|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 39, False: 43]
  ------------------
  432|     39|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 30]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     30|      ans_.buf_offset = offset - 2;
  436|     30|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     43|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 20, False: 23]
  ------------------
  438|     20|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 9, False: 11]
  ------------------
  439|      9|        return 1;
  440|      9|      }
  441|     11|      ans_.buf_offset = offset - 3;
  442|     11|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     23|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 23, False: 0]
  ------------------
  444|     23|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 10, False: 13]
  ------------------
  445|     10|        return 1;
  446|     10|      }
  447|     13|      ans_.buf_offset = offset - 4;
  448|     13|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     13|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     92|    ans_.state += l_rans_base;
  453|     92|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     92|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 11, False: 81]
  ------------------
  454|     11|      return 1;
  455|     11|    }
  456|     81|    return 0;
  457|     92|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  465|   603k|  inline int rans_read() {
  466|   603k|    unsigned rem;
  467|   603k|    unsigned quo;
  468|   603k|    struct rans_dec_sym sym;
  469|   606k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 351k, False: 254k]
  |  Branch (469:40): [True: 2.66k, False: 349k]
  ------------------
  470|  2.66k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.66k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  2.66k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   603k|    quo = ans_.state / rans_precision;
  475|   603k|    rem = ans_.state % rans_precision;
  476|   603k|    fetch_sym(&sym, rem);
  477|   603k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   603k|    return sym.val;
  479|   603k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  508|   603k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   603k|    uint32_t symbol = lut_table_[rem];
  510|   603k|    out->val = symbol;
  511|   603k|    out->prob = probability_table_[symbol].prob;
  512|   603k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   603k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  459|     81|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    210|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  484|    123|                                       uint32_t num_symbols) {
  485|    123|    lut_table_.resize(rans_precision);
  486|    123|    probability_table_.resize(num_symbols);
  487|    123|    uint32_t cum_prob = 0;
  488|    123|    uint32_t act_prob = 0;
  489|  4.39k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 4.28k, False: 108]
  ------------------
  490|  4.28k|      probability_table_[i].prob = token_probs[i];
  491|  4.28k|      probability_table_[i].cum_prob = cum_prob;
  492|  4.28k|      cum_prob += token_probs[i];
  493|  4.28k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 15, False: 4.27k]
  ------------------
  494|     15|        return false;
  495|     15|      }
  496|  3.39M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 3.39M, False: 4.27k]
  ------------------
  497|  3.39M|        lut_table_[j] = i;
  498|  3.39M|      }
  499|  4.27k|      act_prob = cum_prob;
  500|  4.27k|    }
  501|    108|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 12, False: 96]
  ------------------
  502|     12|      return false;
  503|     12|    }
  504|     96|    return true;
  505|    108|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     80|  inline int read_init(const uint8_t* const buf, int offset) {
  422|     80|    unsigned x;
  423|     80|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 9, False: 71]
  ------------------
  424|      9|      return 1;
  425|      9|    }
  426|     71|    ans_.buf = buf;
  427|     71|    x = buf[offset - 1] >> 6;
  428|     71|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 24, False: 47]
  ------------------
  429|     24|      ans_.buf_offset = offset - 1;
  430|     24|      ans_.state = buf[offset - 1] & 0x3F;
  431|     47|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 20, False: 27]
  ------------------
  432|     20|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 11]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     11|      ans_.buf_offset = offset - 2;
  436|     11|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     27|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 13, False: 14]
  ------------------
  438|     13|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 2, False: 11]
  ------------------
  439|      2|        return 1;
  440|      2|      }
  441|     11|      ans_.buf_offset = offset - 3;
  442|     11|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     14|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 14, False: 0]
  ------------------
  444|     14|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 3, False: 11]
  ------------------
  445|      3|        return 1;
  446|      3|      }
  447|     11|      ans_.buf_offset = offset - 4;
  448|     11|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     11|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     57|    ans_.state += l_rans_base;
  453|     57|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     57|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 10, False: 47]
  ------------------
  454|     10|      return 1;
  455|     10|    }
  456|     47|    return 0;
  457|     57|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  465|   356k|  inline int rans_read() {
  466|   356k|    unsigned rem;
  467|   356k|    unsigned quo;
  468|   356k|    struct rans_dec_sym sym;
  469|   357k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 118k, False: 238k]
  |  Branch (469:40): [True: 965, False: 117k]
  ------------------
  470|    965|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    965|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    965|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   356k|    quo = ans_.state / rans_precision;
  475|   356k|    rem = ans_.state % rans_precision;
  476|   356k|    fetch_sym(&sym, rem);
  477|   356k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   356k|    return sym.val;
  479|   356k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  508|   356k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   356k|    uint32_t symbol = lut_table_[rem];
  510|   356k|    out->val = symbol;
  511|   356k|    out->prob = probability_table_[symbol].prob;
  512|   356k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   356k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  459|     47|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    301|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  484|    190|                                       uint32_t num_symbols) {
  485|    190|    lut_table_.resize(rans_precision);
  486|    190|    probability_table_.resize(num_symbols);
  487|    190|    uint32_t cum_prob = 0;
  488|    190|    uint32_t act_prob = 0;
  489|  9.79k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 9.63k, False: 158]
  ------------------
  490|  9.63k|      probability_table_[i].prob = token_probs[i];
  491|  9.63k|      probability_table_[i].cum_prob = cum_prob;
  492|  9.63k|      cum_prob += token_probs[i];
  493|  9.63k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 32, False: 9.60k]
  ------------------
  494|     32|        return false;
  495|     32|      }
  496|  10.0M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 10.0M, False: 9.60k]
  ------------------
  497|  10.0M|        lut_table_[j] = i;
  498|  10.0M|      }
  499|  9.60k|      act_prob = cum_prob;
  500|  9.60k|    }
  501|    158|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 26, False: 132]
  ------------------
  502|     26|      return false;
  503|     26|    }
  504|    132|    return true;
  505|    158|  }
_ZN5draco11RAnsDecoderILi16EE9read_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: 5, False: 88]
  ------------------
  424|      5|      return 1;
  425|      5|    }
  426|     88|    ans_.buf = buf;
  427|     88|    x = buf[offset - 1] >> 6;
  428|     88|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 15, False: 73]
  ------------------
  429|     15|      ans_.buf_offset = offset - 1;
  430|     15|      ans_.state = buf[offset - 1] & 0x3F;
  431|     73|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 19, False: 54]
  ------------------
  432|     19|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 10]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     10|      ans_.buf_offset = offset - 2;
  436|     10|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     54|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 23, False: 31]
  ------------------
  438|     23|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 9, False: 14]
  ------------------
  439|      9|        return 1;
  440|      9|      }
  441|     14|      ans_.buf_offset = offset - 3;
  442|     14|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     31|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 31, False: 0]
  ------------------
  444|     31|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 2, False: 29]
  ------------------
  445|      2|        return 1;
  446|      2|      }
  447|     29|      ans_.buf_offset = offset - 4;
  448|     29|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     29|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     68|    ans_.state += l_rans_base;
  453|     68|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     68|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 15, False: 53]
  ------------------
  454|     15|      return 1;
  455|     15|    }
  456|     53|    return 0;
  457|     68|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  465|   246k|  inline int rans_read() {
  466|   246k|    unsigned rem;
  467|   246k|    unsigned quo;
  468|   246k|    struct rans_dec_sym sym;
  469|   247k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 152k, False: 95.1k]
  |  Branch (469:40): [True: 943, False: 151k]
  ------------------
  470|    943|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    943|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    943|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   246k|    quo = ans_.state / rans_precision;
  475|   246k|    rem = ans_.state % rans_precision;
  476|   246k|    fetch_sym(&sym, rem);
  477|   246k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   246k|    return sym.val;
  479|   246k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  508|   246k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   246k|    uint32_t symbol = lut_table_[rem];
  510|   246k|    out->val = symbol;
  511|   246k|    out->prob = probability_table_[symbol].prob;
  512|   246k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   246k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  459|     53|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    275|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  484|    188|                                       uint32_t num_symbols) {
  485|    188|    lut_table_.resize(rans_precision);
  486|    188|    probability_table_.resize(num_symbols);
  487|    188|    uint32_t cum_prob = 0;
  488|    188|    uint32_t act_prob = 0;
  489|  3.83k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 3.66k, False: 176]
  ------------------
  490|  3.66k|      probability_table_[i].prob = token_probs[i];
  491|  3.66k|      probability_table_[i].cum_prob = cum_prob;
  492|  3.66k|      cum_prob += token_probs[i];
  493|  3.66k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 12, False: 3.64k]
  ------------------
  494|     12|        return false;
  495|     12|      }
  496|  43.2M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 43.2M, False: 3.64k]
  ------------------
  497|  43.2M|        lut_table_[j] = i;
  498|  43.2M|      }
  499|  3.64k|      act_prob = cum_prob;
  500|  3.64k|    }
  501|    176|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 19, False: 157]
  ------------------
  502|     19|      return false;
  503|     19|    }
  504|    157|    return true;
  505|    176|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|    113|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    113|    unsigned x;
  423|    113|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 107]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|    107|    ans_.buf = buf;
  427|    107|    x = buf[offset - 1] >> 6;
  428|    107|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 30, False: 77]
  ------------------
  429|     30|      ans_.buf_offset = offset - 1;
  430|     30|      ans_.state = buf[offset - 1] & 0x3F;
  431|     77|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 23, False: 54]
  ------------------
  432|     23|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 14]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     14|      ans_.buf_offset = offset - 2;
  436|     14|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     54|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 21, False: 33]
  ------------------
  438|     21|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 10, False: 11]
  ------------------
  439|     10|        return 1;
  440|     10|      }
  441|     11|      ans_.buf_offset = offset - 3;
  442|     11|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     33|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 33, False: 0]
  ------------------
  444|     33|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 9, False: 24]
  ------------------
  445|      9|        return 1;
  446|      9|      }
  447|     24|      ans_.buf_offset = offset - 4;
  448|     24|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     24|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     79|    ans_.state += l_rans_base;
  453|     79|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     79|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 13, False: 66]
  ------------------
  454|     13|      return 1;
  455|     13|    }
  456|     66|    return 0;
  457|     79|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  465|   359k|  inline int rans_read() {
  466|   359k|    unsigned rem;
  467|   359k|    unsigned quo;
  468|   359k|    struct rans_dec_sym sym;
  469|   360k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 274k, False: 85.6k]
  |  Branch (469:40): [True: 836, False: 273k]
  ------------------
  470|    836|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    836|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    836|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   359k|    quo = ans_.state / rans_precision;
  475|   359k|    rem = ans_.state % rans_precision;
  476|   359k|    fetch_sym(&sym, rem);
  477|   359k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   359k|    return sym.val;
  479|   359k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  508|   359k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   359k|    uint32_t symbol = lut_table_[rem];
  510|   359k|    out->val = symbol;
  511|   359k|    out->prob = probability_table_[symbol].prob;
  512|   359k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   359k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  459|     66|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    398|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  484|    241|                                       uint32_t num_symbols) {
  485|    241|    lut_table_.resize(rans_precision);
  486|    241|    probability_table_.resize(num_symbols);
  487|    241|    uint32_t cum_prob = 0;
  488|    241|    uint32_t act_prob = 0;
  489|  6.45k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 6.22k, False: 226]
  ------------------
  490|  6.22k|      probability_table_[i].prob = token_probs[i];
  491|  6.22k|      probability_table_[i].cum_prob = cum_prob;
  492|  6.22k|      cum_prob += token_probs[i];
  493|  6.22k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 15, False: 6.21k]
  ------------------
  494|     15|        return false;
  495|     15|      }
  496|   106M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 106M, False: 6.21k]
  ------------------
  497|   106M|        lut_table_[j] = i;
  498|   106M|      }
  499|  6.21k|      act_prob = cum_prob;
  500|  6.21k|    }
  501|    226|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 39, False: 187]
  ------------------
  502|     39|      return false;
  503|     39|    }
  504|    187|    return true;
  505|    226|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|    105|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    105|    unsigned x;
  423|    105|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 12, False: 93]
  ------------------
  424|     12|      return 1;
  425|     12|    }
  426|     93|    ans_.buf = buf;
  427|     93|    x = buf[offset - 1] >> 6;
  428|     93|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 21, False: 72]
  ------------------
  429|     21|      ans_.buf_offset = offset - 1;
  430|     21|      ans_.state = buf[offset - 1] & 0x3F;
  431|     72|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 21, False: 51]
  ------------------
  432|     21|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 10, False: 11]
  ------------------
  433|     10|        return 1;
  434|     10|      }
  435|     11|      ans_.buf_offset = offset - 2;
  436|     11|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     51|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 14, False: 37]
  ------------------
  438|     14|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 7, False: 7]
  ------------------
  439|      7|        return 1;
  440|      7|      }
  441|      7|      ans_.buf_offset = offset - 3;
  442|      7|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     37|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 37, False: 0]
  ------------------
  444|     37|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 9, False: 28]
  ------------------
  445|      9|        return 1;
  446|      9|      }
  447|     28|      ans_.buf_offset = offset - 4;
  448|     28|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     28|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     67|    ans_.state += l_rans_base;
  453|     67|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     67|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 18, False: 49]
  ------------------
  454|     18|      return 1;
  455|     18|    }
  456|     49|    return 0;
  457|     67|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  465|   434k|  inline int rans_read() {
  466|   434k|    unsigned rem;
  467|   434k|    unsigned quo;
  468|   434k|    struct rans_dec_sym sym;
  469|   435k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 144k, False: 290k]
  |  Branch (469:40): [True: 831, False: 143k]
  ------------------
  470|    831|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    831|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    831|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   434k|    quo = ans_.state / rans_precision;
  475|   434k|    rem = ans_.state % rans_precision;
  476|   434k|    fetch_sym(&sym, rem);
  477|   434k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   434k|    return sym.val;
  479|   434k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  508|   434k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   434k|    uint32_t symbol = lut_table_[rem];
  510|   434k|    out->val = symbol;
  511|   434k|    out->prob = probability_table_[symbol].prob;
  512|   434k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   434k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  459|     49|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.55k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  484|    902|                                       uint32_t num_symbols) {
  485|    902|    lut_table_.resize(rans_precision);
  486|    902|    probability_table_.resize(num_symbols);
  487|    902|    uint32_t cum_prob = 0;
  488|    902|    uint32_t act_prob = 0;
  489|  19.1k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 18.2k, False: 851]
  ------------------
  490|  18.2k|      probability_table_[i].prob = token_probs[i];
  491|  18.2k|      probability_table_[i].cum_prob = cum_prob;
  492|  18.2k|      cum_prob += token_probs[i];
  493|  18.2k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 51, False: 18.2k]
  ------------------
  494|     51|        return false;
  495|     51|      }
  496|   862M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 862M, False: 18.2k]
  ------------------
  497|   862M|        lut_table_[j] = i;
  498|   862M|      }
  499|  18.2k|      act_prob = cum_prob;
  500|  18.2k|    }
  501|    851|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 52, False: 799]
  ------------------
  502|     52|      return false;
  503|     52|    }
  504|    799|    return true;
  505|    851|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    523|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    523|    unsigned x;
  423|    523|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 29, False: 494]
  ------------------
  424|     29|      return 1;
  425|     29|    }
  426|    494|    ans_.buf = buf;
  427|    494|    x = buf[offset - 1] >> 6;
  428|    494|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 112, False: 382]
  ------------------
  429|    112|      ans_.buf_offset = offset - 1;
  430|    112|      ans_.state = buf[offset - 1] & 0x3F;
  431|    382|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 101, False: 281]
  ------------------
  432|    101|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 30, False: 71]
  ------------------
  433|     30|        return 1;
  434|     30|      }
  435|     71|      ans_.buf_offset = offset - 2;
  436|     71|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    281|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 111, False: 170]
  ------------------
  438|    111|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 46, False: 65]
  ------------------
  439|     46|        return 1;
  440|     46|      }
  441|     65|      ans_.buf_offset = offset - 3;
  442|     65|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    170|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 170, False: 0]
  ------------------
  444|    170|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 33, False: 137]
  ------------------
  445|     33|        return 1;
  446|     33|      }
  447|    137|      ans_.buf_offset = offset - 4;
  448|    137|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|    137|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|    385|    ans_.state += l_rans_base;
  453|    385|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    385|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 39, False: 346]
  ------------------
  454|     39|      return 1;
  455|     39|    }
  456|    346|    return 0;
  457|    385|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  465|  64.1M|  inline int rans_read() {
  466|  64.1M|    unsigned rem;
  467|  64.1M|    unsigned quo;
  468|  64.1M|    struct rans_dec_sym sym;
  469|  64.1M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 46.4M, False: 17.7M]
  |  Branch (469:40): [True: 10.0k, False: 46.4M]
  ------------------
  470|  10.0k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  10.0k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  10.0k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|  64.1M|    quo = ans_.state / rans_precision;
  475|  64.1M|    rem = ans_.state % rans_precision;
  476|  64.1M|    fetch_sym(&sym, rem);
  477|  64.1M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|  64.1M|    return sym.val;
  479|  64.1M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  508|  64.1M|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|  64.1M|    uint32_t symbol = lut_table_[rem];
  510|  64.1M|    out->val = symbol;
  511|  64.1M|    out->prob = probability_table_[symbol].prob;
  512|  64.1M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|  64.1M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  459|    346|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.44k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.44k|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.44k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.44k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.44k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.44k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.44k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 168, False: 1.28k]
  ------------------
   67|    168|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 165]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|    168|  } else
   72|  1.28k|#endif
   73|  1.28k|  {
   74|  1.28k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 30, False: 1.25k]
  ------------------
   75|     30|      return false;
   76|     30|    }
   77|  1.28k|  }
   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.41k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 133, False: 1.28k]
  ------------------
   83|    133|    return false;
   84|    133|  }
   85|  1.28k|  probability_table_.resize(num_symbols_);
   86|  1.28k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 403, False: 880]
  ------------------
   87|    403|    return true;
   88|    403|  }
   89|       |  // Decode the table.
   90|  3.36M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 3.36M, False: 658]
  ------------------
   91|  3.36M|    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|  3.36M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 65, False: 3.36M]
  ------------------
   95|     65|      return false;
   96|     65|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  3.36M|    const int token = prob_data & 3;
  102|  3.36M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.26M, False: 1.10M]
  ------------------
  103|  2.26M|      const uint32_t offset = prob_data >> 2;
  104|  2.26M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 123, False: 2.26M]
  ------------------
  105|    123|        return false;
  106|    123|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   116M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 114M, False: 2.26M]
  ------------------
  109|   114M|        probability_table_[i + j] = 0;
  110|   114M|      }
  111|  2.26M|      i += offset;
  112|  2.26M|    } else {
  113|  1.10M|      const int extra_bytes = token;
  114|  1.10M|      uint32_t prob = prob_data >> 2;
  115|  2.54M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.44M, False: 1.10M]
  ------------------
  116|  1.44M|        uint8_t eb;
  117|  1.44M|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 34, False: 1.44M]
  ------------------
  118|     34|          return false;
  119|     34|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.44M|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.44M|      }
  124|  1.10M|      probability_table_[i] = prob;
  125|  1.10M|    }
  126|  3.36M|  }
  127|    658|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 219, False: 439]
  ------------------
  128|    219|    return false;
  129|    219|  }
  130|    439|  return true;
  131|    658|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    698|    DecoderBuffer* buffer) {
  136|    698|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    698|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    698|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    698|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 45, False: 653]
  ------------------
  140|     45|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 42]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     45|  } else
  145|    653|#endif
  146|    653|  {
  147|    653|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 15, False: 638]
  ------------------
  148|     15|      return false;
  149|     15|    }
  150|    653|  }
  151|    680|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 82, False: 598]
  ------------------
  152|     82|    return false;
  153|     82|  }
  154|    598|  const uint8_t* const data_head =
  155|    598|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    598|  buffer->Advance(bytes_encoded);
  158|    598|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 116, False: 482]
  ------------------
  159|    116|    return false;
  160|    116|  }
  161|    482|  return true;
  162|    598|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    632|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  10.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    427|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    427|  ans_.read_end();
  167|    427|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    467|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    467|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    467|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 467]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    467|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    467|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    467|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 30, False: 437]
  ------------------
   67|     30|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 26]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     30|  } else
   72|    437|#endif
   73|    437|  {
   74|    437|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 14, False: 423]
  ------------------
   75|     14|      return false;
   76|     14|    }
   77|    437|  }
   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|    449|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 25, False: 424]
  ------------------
   83|     25|    return false;
   84|     25|  }
   85|    424|  probability_table_.resize(num_symbols_);
   86|    424|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 411]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|  1.67M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.67M, False: 307]
  ------------------
   91|  1.67M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.67M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 37, False: 1.67M]
  ------------------
   95|     37|      return false;
   96|     37|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.67M|    const int token = prob_data & 3;
  102|  1.67M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 599k, False: 1.07M]
  ------------------
  103|   599k|      const uint32_t offset = prob_data >> 2;
  104|   599k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 39, False: 599k]
  ------------------
  105|     39|        return false;
  106|     39|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  20.9M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 20.3M, False: 599k]
  ------------------
  109|  20.3M|        probability_table_[i + j] = 0;
  110|  20.3M|      }
  111|   599k|      i += offset;
  112|  1.07M|    } else {
  113|  1.07M|      const int extra_bytes = token;
  114|  1.07M|      uint32_t prob = prob_data >> 2;
  115|  1.85M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 781k, False: 1.07M]
  ------------------
  116|   781k|        uint8_t eb;
  117|   781k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 781k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   781k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   781k|      }
  124|  1.07M|      probability_table_[i] = prob;
  125|  1.07M|    }
  126|  1.67M|  }
  127|    307|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 157, False: 150]
  ------------------
  128|    157|    return false;
  129|    157|  }
  130|    150|  return true;
  131|    307|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    163|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_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: 7, False: 143]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 7]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      7|  } else
  145|    143|#endif
  146|    143|  {
  147|    143|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 134]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    143|  }
  151|    141|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 13, False: 128]
  ------------------
  152|     13|    return false;
  153|     13|  }
  154|    128|  const uint8_t* const data_head =
  155|    128|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    128|  buffer->Advance(bytes_encoded);
  158|    128|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 36, False: 92]
  ------------------
  159|     36|    return false;
  160|     36|  }
  161|     92|  return true;
  162|    128|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|   120M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|     92|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     92|  ans_.read_end();
  167|     92|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    370|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    370|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    370|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 370]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    370|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    370|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    370|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 36, False: 334]
  ------------------
   67|     36|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 35]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     36|  } else
   72|    334|#endif
   73|    334|  {
   74|    334|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 327]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    334|  }
   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|    362|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 346]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    346|  probability_table_.resize(num_symbols_);
   86|    346|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 338]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|  82.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 82.1k, False: 265]
  ------------------
   91|  82.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  82.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 34, False: 82.1k]
  ------------------
   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|  82.1k|    const int token = prob_data & 3;
  102|  82.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 57.0k, False: 25.0k]
  ------------------
  103|  57.0k|      const uint32_t offset = prob_data >> 2;
  104|  57.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 23, False: 57.0k]
  ------------------
  105|     23|        return false;
  106|     23|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.37M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.31M, False: 57.0k]
  ------------------
  109|  3.31M|        probability_table_[i + j] = 0;
  110|  3.31M|      }
  111|  57.0k|      i += offset;
  112|  57.0k|    } else {
  113|  25.0k|      const int extra_bytes = token;
  114|  25.0k|      uint32_t prob = prob_data >> 2;
  115|  53.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 28.2k, False: 24.9k]
  ------------------
  116|  28.2k|        uint8_t eb;
  117|  28.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 28.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|  28.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  28.2k|      }
  124|  24.9k|      probability_table_[i] = prob;
  125|  24.9k|    }
  126|  82.1k|  }
  127|    265|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 40, False: 225]
  ------------------
  128|     40|    return false;
  129|     40|  }
  130|    225|  return true;
  131|    265|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    233|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    225|    DecoderBuffer* buffer) {
  136|    225|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    225|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    225|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    225|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 23, False: 202]
  ------------------
  140|     23|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 21]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     23|  } else
  145|    202|#endif
  146|    202|  {
  147|    202|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 193]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    202|  }
  151|    214|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 28, False: 186]
  ------------------
  152|     28|    return false;
  153|     28|  }
  154|    186|  const uint8_t* const data_head =
  155|    186|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    186|  buffer->Advance(bytes_encoded);
  158|    186|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 148]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|    148|  return true;
  162|    186|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  19.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    148|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    148|  ans_.read_end();
  167|    148|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    360|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    360|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    360|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 360]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    360|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    360|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    360|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 331]
  ------------------
   67|     29|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 29]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     29|  } else
   72|    331|#endif
   73|    331|  {
   74|    331|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 20, False: 311]
  ------------------
   75|     20|      return false;
   76|     20|    }
   77|    331|  }
   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|    340|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 335]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    335|  probability_table_.resize(num_symbols_);
   86|    335|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 335]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  51.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 51.1k, False: 266]
  ------------------
   91|  51.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  51.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 32, False: 51.0k]
  ------------------
   95|     32|      return false;
   96|     32|    }
   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|  51.0k|    const int token = prob_data & 3;
  102|  51.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 22.5k, False: 28.5k]
  ------------------
  103|  22.5k|      const uint32_t offset = prob_data >> 2;
  104|  22.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 22.5k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   661k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 639k, False: 22.5k]
  ------------------
  109|   639k|        probability_table_[i + j] = 0;
  110|   639k|      }
  111|  22.5k|      i += offset;
  112|  28.5k|    } else {
  113|  28.5k|      const int extra_bytes = token;
  114|  28.5k|      uint32_t prob = prob_data >> 2;
  115|  53.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 24.7k, False: 28.5k]
  ------------------
  116|  24.7k|        uint8_t eb;
  117|  24.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 24.7k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  24.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  24.7k|      }
  124|  28.5k|      probability_table_[i] = prob;
  125|  28.5k|    }
  126|  51.0k|  }
  127|    266|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 243]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    243|  return true;
  131|    266|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    243|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    243|    DecoderBuffer* buffer) {
  136|    243|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    243|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    243|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    243|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 22, False: 221]
  ------------------
  140|     22|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 20]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     22|  } else
  145|    221|#endif
  146|    221|  {
  147|    221|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 212]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    221|  }
  151|    232|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 26, False: 206]
  ------------------
  152|     26|    return false;
  153|     26|  }
  154|    206|  const uint8_t* const data_head =
  155|    206|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    206|  buffer->Advance(bytes_encoded);
  158|    206|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 36, False: 170]
  ------------------
  159|     36|    return false;
  160|     36|  }
  161|    170|  return true;
  162|    206|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  21.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    170|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    170|  ans_.read_end();
  167|    170|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    192|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    192|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    192|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 192]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    192|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    192|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    192|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 25, False: 167]
  ------------------
   67|     25|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 25]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     25|  } else
   72|    167|#endif
   73|    167|  {
   74|    167|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 160]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    167|  }
   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|    185|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 176]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    176|  probability_table_.resize(num_symbols_);
   86|    176|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 172]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|   111k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 111k, False: 120]
  ------------------
   91|   111k|    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|   111k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 25, False: 111k]
  ------------------
   95|     25|      return false;
   96|     25|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   111k|    const int token = prob_data & 3;
  102|   111k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 36.2k, False: 75.5k]
  ------------------
  103|  36.2k|      const uint32_t offset = prob_data >> 2;
  104|  36.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 16, False: 36.2k]
  ------------------
  105|     16|        return false;
  106|     16|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.07M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.03M, False: 36.2k]
  ------------------
  109|  1.03M|        probability_table_[i + j] = 0;
  110|  1.03M|      }
  111|  36.2k|      i += offset;
  112|  75.5k|    } else {
  113|  75.5k|      const int extra_bytes = token;
  114|  75.5k|      uint32_t prob = prob_data >> 2;
  115|   123k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 47.4k, False: 75.5k]
  ------------------
  116|  47.4k|        uint8_t eb;
  117|  47.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 47.4k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  47.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  47.4k|      }
  124|  75.5k|      probability_table_[i] = prob;
  125|  75.5k|    }
  126|   111k|  }
  127|    120|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 17, False: 103]
  ------------------
  128|     17|    return false;
  129|     17|  }
  130|    103|  return true;
  131|    120|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    107|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    103|    DecoderBuffer* buffer) {
  136|    103|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    103|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    103|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    103|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 14, False: 89]
  ------------------
  140|     14|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 14]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     14|  } else
  145|     89|#endif
  146|     89|  {
  147|     89|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 87]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|     89|  }
  151|    101|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 17, False: 84]
  ------------------
  152|     17|    return false;
  153|     17|  }
  154|     84|  const uint8_t* const data_head =
  155|     84|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     84|  buffer->Advance(bytes_encoded);
  158|     84|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 35, False: 49]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|     49|  return true;
  162|     84|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  2.27M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     49|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     49|  ans_.read_end();
  167|     49|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    337|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    337|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    337|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 337]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    337|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    337|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    337|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 22, False: 315]
  ------------------
   67|     22|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 22]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     22|  } else
   72|    315|#endif
   73|    315|  {
   74|    315|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 315]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    315|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    337|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 325]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    325|  probability_table_.resize(num_symbols_);
   86|    325|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 322]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|  95.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 95.3k, False: 252]
  ------------------
   91|  95.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|  95.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 42, False: 95.2k]
  ------------------
   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|  95.2k|    const int token = prob_data & 3;
  102|  95.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 35.2k, False: 60.0k]
  ------------------
  103|  35.2k|      const uint32_t offset = prob_data >> 2;
  104|  35.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 35.2k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.38M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.35M, False: 35.2k]
  ------------------
  109|  1.35M|        probability_table_[i + j] = 0;
  110|  1.35M|      }
  111|  35.2k|      i += offset;
  112|  60.0k|    } else {
  113|  60.0k|      const int extra_bytes = token;
  114|  60.0k|      uint32_t prob = prob_data >> 2;
  115|   115k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 55.0k, False: 60.0k]
  ------------------
  116|  55.0k|        uint8_t eb;
  117|  55.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 55.0k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  55.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  55.0k|      }
  124|  60.0k|      probability_table_[i] = prob;
  125|  60.0k|    }
  126|  95.2k|  }
  127|    252|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 229]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    229|  return true;
  131|    252|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    232|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    229|    DecoderBuffer* buffer) {
  136|    229|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    229|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    229|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    229|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 18, False: 211]
  ------------------
  140|     18|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 17]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     18|  } else
  145|    211|#endif
  146|    211|  {
  147|    211|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 202]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    211|  }
  151|    219|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 32, False: 187]
  ------------------
  152|     32|    return false;
  153|     32|  }
  154|    187|  const uint8_t* const data_head =
  155|    187|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    187|  buffer->Advance(bytes_encoded);
  158|    187|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 161]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|    161|  return true;
  162|    187|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  4.10M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    161|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    161|  ans_.read_end();
  167|    161|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    396|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    396|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    396|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 396]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    396|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    396|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    396|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 38, False: 358]
  ------------------
   67|     38|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 36]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     38|  } else
   72|    358|#endif
   73|    358|  {
   74|    358|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 349]
  ------------------
   75|      9|      return false;
   76|      9|    }
   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|    385|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 375]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    375|  probability_table_.resize(num_symbols_);
   86|    375|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 368]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|   432k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 432k, False: 284]
  ------------------
   91|   432k|    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|   432k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 33, False: 432k]
  ------------------
   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|   432k|    const int token = prob_data & 3;
  102|   432k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 176k, False: 255k]
  ------------------
  103|   176k|      const uint32_t offset = prob_data >> 2;
  104|   176k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 176k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.87M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.69M, False: 176k]
  ------------------
  109|  4.69M|        probability_table_[i + j] = 0;
  110|  4.69M|      }
  111|   176k|      i += offset;
  112|   255k|    } else {
  113|   255k|      const int extra_bytes = token;
  114|   255k|      uint32_t prob = prob_data >> 2;
  115|   481k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 226k, False: 255k]
  ------------------
  116|   226k|        uint8_t eb;
  117|   226k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 226k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   226k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   226k|      }
  124|   255k|      probability_table_[i] = prob;
  125|   255k|    }
  126|   432k|  }
  127|    284|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 19, False: 265]
  ------------------
  128|     19|    return false;
  129|     19|  }
  130|    265|  return true;
  131|    284|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    272|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    265|    DecoderBuffer* buffer) {
  136|    265|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    265|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    265|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    265|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 14, False: 251]
  ------------------
  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|    251|#endif
  146|    251|  {
  147|    251|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 16, False: 235]
  ------------------
  148|     16|      return false;
  149|     16|    }
  150|    251|  }
  151|    248|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 56, False: 192]
  ------------------
  152|     56|    return false;
  153|     56|  }
  154|    192|  const uint8_t* const data_head =
  155|    192|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    192|  buffer->Advance(bytes_encoded);
  158|    192|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 158]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|    158|  return true;
  162|    192|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  72.2M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    158|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    158|  ans_.read_end();
  167|    158|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    248|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    248|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    248|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 248]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    248|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    248|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    248|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 43, False: 205]
  ------------------
   67|     43|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 40]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     43|  } else
   72|    205|#endif
   73|    205|  {
   74|    205|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 192]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    205|  }
   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|    232|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 220]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    220|  probability_table_.resize(num_symbols_);
   86|    220|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 220]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  1.40M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.40M, False: 153]
  ------------------
   91|  1.40M|    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.40M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 34, False: 1.40M]
  ------------------
   95|     34|      return false;
   96|     34|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.40M|    const int token = prob_data & 3;
  102|  1.40M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.33M, False: 71.2k]
  ------------------
  103|  1.33M|      const uint32_t offset = prob_data >> 2;
  104|  1.33M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 1.33M]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  70.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 69.2M, False: 1.33M]
  ------------------
  109|  69.2M|        probability_table_[i + j] = 0;
  110|  69.2M|      }
  111|  1.33M|      i += offset;
  112|  1.33M|    } else {
  113|  71.2k|      const int extra_bytes = token;
  114|  71.2k|      uint32_t prob = prob_data >> 2;
  115|   127k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 56.1k, False: 71.2k]
  ------------------
  116|  56.1k|        uint8_t eb;
  117|  56.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 9, False: 56.0k]
  ------------------
  118|      9|          return false;
  119|      9|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  56.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  56.0k|      }
  124|  71.2k|      probability_table_[i] = prob;
  125|  71.2k|    }
  126|  1.40M|  }
  127|    153|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 148]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|    148|  return true;
  131|    153|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    148|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_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: 32, False: 116]
  ------------------
  140|     32|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 32]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     32|  } else
  145|    116|#endif
  146|    116|  {
  147|    116|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 116]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    116|  }
  151|    148|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 38, False: 110]
  ------------------
  152|     38|    return false;
  153|     38|  }
  154|    110|  const uint8_t* const data_head =
  155|    110|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    110|  buffer->Advance(bytes_encoded);
  158|    110|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 37, False: 73]
  ------------------
  159|     37|    return false;
  160|     37|  }
  161|     73|  return true;
  162|    110|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|   171M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     73|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     73|  ans_.read_end();
  167|     73|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    283|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    283|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    283|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 283]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    283|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    283|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    283|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 17, False: 266]
  ------------------
   67|     17|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 16]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     17|  } else
   72|    266|#endif
   73|    266|  {
   74|    266|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 257]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    266|  }
   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|    273|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 260]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    260|  probability_table_.resize(num_symbols_);
   86|    260|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 252]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|   767k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 767k, False: 189]
  ------------------
   91|   767k|    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|   767k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 23, False: 767k]
  ------------------
   95|     23|      return false;
   96|     23|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   767k|    const int token = prob_data & 3;
  102|   767k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 261k, False: 505k]
  ------------------
  103|   261k|      const uint32_t offset = prob_data >> 2;
  104|   261k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 261k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  7.35M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.09M, False: 261k]
  ------------------
  109|  7.09M|        probability_table_[i + j] = 0;
  110|  7.09M|      }
  111|   261k|      i += offset;
  112|   505k|    } else {
  113|   505k|      const int extra_bytes = token;
  114|   505k|      uint32_t prob = prob_data >> 2;
  115|   949k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 444k, False: 505k]
  ------------------
  116|   444k|        uint8_t eb;
  117|   444k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 444k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   444k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   444k|      }
  124|   505k|      probability_table_[i] = prob;
  125|   505k|    }
  126|   767k|  }
  127|    189|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 37, False: 152]
  ------------------
  128|     37|    return false;
  129|     37|  }
  130|    152|  return true;
  131|    189|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    160|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_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: 6, False: 146]
  ------------------
  140|      6|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 6]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      6|  } else
  145|    146|#endif
  146|    146|  {
  147|    146|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 13, False: 133]
  ------------------
  148|     13|      return false;
  149|     13|    }
  150|    146|  }
  151|    139|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 16, False: 123]
  ------------------
  152|     16|    return false;
  153|     16|  }
  154|    123|  const uint8_t* const data_head =
  155|    123|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    123|  buffer->Advance(bytes_encoded);
  158|    123|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 42, False: 81]
  ------------------
  159|     42|    return false;
  160|     42|  }
  161|     81|  return true;
  162|    123|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   603k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     81|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     81|  ans_.read_end();
  167|     81|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    210|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    210|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    210|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 210]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    210|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    210|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    210|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 14, False: 196]
  ------------------
   67|     14|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 14]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     14|  } else
   72|    196|#endif
   73|    196|  {
   74|    196|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 192]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    196|  }
   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|    206|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 190]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    190|  probability_table_.resize(num_symbols_);
   86|    190|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 185]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|  38.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 38.1k, False: 123]
  ------------------
   91|  38.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  38.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 30, False: 38.1k]
  ------------------
   95|     30|      return false;
   96|     30|    }
   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|  38.1k|    const int token = prob_data & 3;
  102|  38.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 13.0k, False: 25.1k]
  ------------------
  103|  13.0k|      const uint32_t offset = prob_data >> 2;
  104|  13.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 19, False: 12.9k]
  ------------------
  105|     19|        return false;
  106|     19|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   691k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 678k, False: 12.9k]
  ------------------
  109|   678k|        probability_table_[i + j] = 0;
  110|   678k|      }
  111|  12.9k|      i += offset;
  112|  25.1k|    } else {
  113|  25.1k|      const int extra_bytes = token;
  114|  25.1k|      uint32_t prob = prob_data >> 2;
  115|  61.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 36.7k, False: 25.1k]
  ------------------
  116|  36.7k|        uint8_t eb;
  117|  36.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 36.7k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  36.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  36.7k|      }
  124|  25.1k|      probability_table_[i] = prob;
  125|  25.1k|    }
  126|  38.1k|  }
  127|    123|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 27, False: 96]
  ------------------
  128|     27|    return false;
  129|     27|  }
  130|     96|  return true;
  131|    123|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    101|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|     96|    DecoderBuffer* buffer) {
  136|     96|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     96|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     96|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     96|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 95]
  ------------------
  140|      1|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 1]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      1|  } else
  145|     95|#endif
  146|     95|  {
  147|     95|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 95]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     95|  }
  151|     96|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 16, False: 80]
  ------------------
  152|     16|    return false;
  153|     16|  }
  154|     80|  const uint8_t* const data_head =
  155|     80|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     80|  buffer->Advance(bytes_encoded);
  158|     80|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 47]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     47|  return true;
  162|     80|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   356k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     47|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     47|  ans_.read_end();
  167|     47|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    301|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    301|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    301|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 301]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    301|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    301|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    301|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 60, False: 241]
  ------------------
   67|     60|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 56]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     60|  } else
   72|    241|#endif
   73|    241|  {
   74|    241|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 237]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    241|  }
   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|    293|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 34, False: 259]
  ------------------
   83|     34|    return false;
   84|     34|  }
   85|    259|  probability_table_.resize(num_symbols_);
   86|    259|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 258]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  36.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 36.2k, False: 190]
  ------------------
   91|  36.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|  36.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 33, False: 36.1k]
  ------------------
   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|  36.1k|    const int token = prob_data & 3;
  102|  36.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.5k, False: 25.6k]
  ------------------
  103|  10.5k|      const uint32_t offset = prob_data >> 2;
  104|  10.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 10.5k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   355k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 344k, False: 10.5k]
  ------------------
  109|   344k|        probability_table_[i + j] = 0;
  110|   344k|      }
  111|  10.5k|      i += offset;
  112|  25.6k|    } else {
  113|  25.6k|      const int extra_bytes = token;
  114|  25.6k|      uint32_t prob = prob_data >> 2;
  115|  46.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 20.5k, False: 25.5k]
  ------------------
  116|  20.5k|        uint8_t eb;
  117|  20.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 20.5k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  20.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  20.5k|      }
  124|  25.5k|      probability_table_[i] = prob;
  125|  25.5k|    }
  126|  36.1k|  }
  127|    190|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 58, False: 132]
  ------------------
  128|     58|    return false;
  129|     58|  }
  130|    132|  return true;
  131|    190|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    133|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    132|    DecoderBuffer* buffer) {
  136|    132|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    132|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    132|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    132|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 15, False: 117]
  ------------------
  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|    117|#endif
  146|    117|  {
  147|    117|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 117]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    117|  }
  151|    132|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 39, False: 93]
  ------------------
  152|     39|    return false;
  153|     39|  }
  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: 40, False: 53]
  ------------------
  159|     40|    return false;
  160|     40|  }
  161|     53|  return true;
  162|     93|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   246k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     53|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     53|  ans_.read_end();
  167|     53|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    275|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    275|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    275|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 275]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    275|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    275|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    275|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 19, False: 256]
  ------------------
   67|     19|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 17]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     19|  } else
   72|    256|#endif
   73|    256|  {
   74|    256|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 255]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    256|  }
   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|    272|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 267]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    267|  probability_table_.resize(num_symbols_);
   86|    267|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 265]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   239k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 239k, False: 188]
  ------------------
   91|   239k|    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|   239k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 42, False: 239k]
  ------------------
   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|   239k|    const int token = prob_data & 3;
  102|   239k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 155k, False: 83.5k]
  ------------------
  103|   155k|      const uint32_t offset = prob_data >> 2;
  104|   155k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 155k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.52M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.36M, False: 155k]
  ------------------
  109|  4.36M|        probability_table_[i + j] = 0;
  110|  4.36M|      }
  111|   155k|      i += offset;
  112|   155k|    } else {
  113|  83.5k|      const int extra_bytes = token;
  114|  83.5k|      uint32_t prob = prob_data >> 2;
  115|   144k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 60.8k, False: 83.5k]
  ------------------
  116|  60.8k|        uint8_t eb;
  117|  60.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 60.8k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  60.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  60.8k|      }
  124|  83.5k|      probability_table_[i] = prob;
  125|  83.5k|    }
  126|   239k|  }
  127|    188|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 31, False: 157]
  ------------------
  128|     31|    return false;
  129|     31|  }
  130|    157|  return true;
  131|    188|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    159|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    157|    DecoderBuffer* buffer) {
  136|    157|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    157|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    157|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    157|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 148]
  ------------------
  140|      9|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 9]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      9|  } else
  145|    148|#endif
  146|    148|  {
  147|    148|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 138]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    148|  }
  151|    147|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 34, False: 113]
  ------------------
  152|     34|    return false;
  153|     34|  }
  154|    113|  const uint8_t* const data_head =
  155|    113|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    113|  buffer->Advance(bytes_encoded);
  158|    113|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 47, False: 66]
  ------------------
  159|     47|    return false;
  160|     47|  }
  161|     66|  return true;
  162|    113|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   359k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     66|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     66|  ans_.read_end();
  167|     66|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    398|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    398|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    398|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 398]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    398|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    398|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    398|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 45, False: 353]
  ------------------
   67|     45|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 44]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     45|  } else
   72|    353|#endif
   73|    353|  {
   74|    353|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 344]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    353|  }
   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|    388|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 375]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    375|  probability_table_.resize(num_symbols_);
   86|    375|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 37, False: 338]
  ------------------
   87|     37|    return true;
   88|     37|  }
   89|       |  // Decode the table.
   90|  2.18M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.18M, False: 241]
  ------------------
   91|  2.18M|    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.18M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 39, False: 2.18M]
  ------------------
   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|  2.18M|    const int token = prob_data & 3;
  102|  2.18M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 659k, False: 1.52M]
  ------------------
  103|   659k|      const uint32_t offset = prob_data >> 2;
  104|   659k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 659k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  20.4M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 19.8M, False: 659k]
  ------------------
  109|  19.8M|        probability_table_[i + j] = 0;
  110|  19.8M|      }
  111|   659k|      i += offset;
  112|  1.52M|    } else {
  113|  1.52M|      const int extra_bytes = token;
  114|  1.52M|      uint32_t prob = prob_data >> 2;
  115|  3.07M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.54M, False: 1.52M]
  ------------------
  116|  1.54M|        uint8_t eb;
  117|  1.54M|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 1.54M]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.54M|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.54M|      }
  124|  1.52M|      probability_table_[i] = prob;
  125|  1.52M|    }
  126|  2.18M|  }
  127|    241|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 54, False: 187]
  ------------------
  128|     54|    return false;
  129|     54|  }
  130|    187|  return true;
  131|    241|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    224|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    187|    DecoderBuffer* buffer) {
  136|    187|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    187|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    187|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    187|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 32, False: 155]
  ------------------
  140|     32|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 32]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     32|  } else
  145|    155|#endif
  146|    155|  {
  147|    155|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 20, False: 135]
  ------------------
  148|     20|      return false;
  149|     20|    }
  150|    155|  }
  151|    167|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 62, False: 105]
  ------------------
  152|     62|    return false;
  153|     62|  }
  154|    105|  const uint8_t* const data_head =
  155|    105|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    105|  buffer->Advance(bytes_encoded);
  158|    105|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 56, False: 49]
  ------------------
  159|     56|    return false;
  160|     56|  }
  161|     49|  return true;
  162|    105|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   434k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     49|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     49|  ans_.read_end();
  167|     49|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    389|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    389|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    389|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 389]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    389|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    389|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    389|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 121, False: 268]
  ------------------
   67|    121|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 121]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|    121|  } else
   72|    268|#endif
   73|    268|  {
   74|    268|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 263]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    268|  }
   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|    384|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 67, False: 317]
  ------------------
   83|     67|    return false;
   84|     67|  }
   85|    317|  probability_table_.resize(num_symbols_);
   86|    317|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 316]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  1.91M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.90M, False: 190]
  ------------------
   91|  1.90M|    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.90M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 43, False: 1.90M]
  ------------------
   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|  1.90M|    const int token = prob_data & 3;
  102|  1.90M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.27M, False: 636k]
  ------------------
  103|  1.27M|      const uint32_t offset = prob_data >> 2;
  104|  1.27M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 55, False: 1.27M]
  ------------------
  105|     55|        return false;
  106|     55|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  38.3M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 37.0M, False: 1.27M]
  ------------------
  109|  37.0M|        probability_table_[i + j] = 0;
  110|  37.0M|      }
  111|  1.27M|      i += offset;
  112|  1.27M|    } else {
  113|   636k|      const int extra_bytes = token;
  114|   636k|      uint32_t prob = prob_data >> 2;
  115|  1.49M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 857k, False: 636k]
  ------------------
  116|   857k|        uint8_t eb;
  117|   857k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 857k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   857k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   857k|      }
  124|   636k|      probability_table_[i] = prob;
  125|   636k|    }
  126|  1.90M|  }
  127|    190|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 27, False: 163]
  ------------------
  128|     27|    return false;
  129|     27|  }
  130|    163|  return true;
  131|    190|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    164|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    163|    DecoderBuffer* buffer) {
  136|    163|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    163|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    163|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    163|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 23, False: 140]
  ------------------
  140|     23|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 23]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     23|  } else
  145|    140|#endif
  146|    140|  {
  147|    140|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 16, False: 124]
  ------------------
  148|     16|      return false;
  149|     16|    }
  150|    140|  }
  151|    147|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 41, False: 106]
  ------------------
  152|     41|    return false;
  153|     41|  }
  154|    106|  const uint8_t* const data_head =
  155|    106|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    106|  buffer->Advance(bytes_encoded);
  158|    106|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 37, False: 69]
  ------------------
  159|     37|    return false;
  160|     37|  }
  161|     69|  return true;
  162|    106|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  5.07M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     69|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     69|  ans_.read_end();
  167|     69|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    319|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    319|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    319|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 319]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    319|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    319|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    319|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 69, False: 250]
  ------------------
   67|     69|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 68]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     69|  } else
   72|    250|#endif
   73|    250|  {
   74|    250|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 246]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    250|  }
   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|    314|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 23, False: 291]
  ------------------
   83|     23|    return false;
   84|     23|  }
   85|    291|  probability_table_.resize(num_symbols_);
   86|    291|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 290]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   811k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 811k, False: 190]
  ------------------
   91|   811k|    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|   811k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 47, False: 811k]
  ------------------
   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|   811k|    const int token = prob_data & 3;
  102|   811k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 581k, False: 229k]
  ------------------
  103|   581k|      const uint32_t offset = prob_data >> 2;
  104|   581k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 581k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  24.4M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 23.8M, False: 581k]
  ------------------
  109|  23.8M|        probability_table_[i + j] = 0;
  110|  23.8M|      }
  111|   581k|      i += offset;
  112|   581k|    } else {
  113|   229k|      const int extra_bytes = token;
  114|   229k|      uint32_t prob = prob_data >> 2;
  115|   374k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 144k, False: 229k]
  ------------------
  116|   144k|        uint8_t eb;
  117|   144k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 144k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   144k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   144k|      }
  124|   229k|      probability_table_[i] = prob;
  125|   229k|    }
  126|   811k|  }
  127|    190|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 18, False: 172]
  ------------------
  128|     18|    return false;
  129|     18|  }
  130|    172|  return true;
  131|    190|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    173|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    172|    DecoderBuffer* buffer) {
  136|    172|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    172|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    172|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    172|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 33, False: 139]
  ------------------
  140|     33|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 33]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     33|  } else
  145|    139|#endif
  146|    139|  {
  147|    139|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 12, False: 127]
  ------------------
  148|     12|      return false;
  149|     12|    }
  150|    139|  }
  151|    160|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 56, False: 104]
  ------------------
  152|     56|    return false;
  153|     56|  }
  154|    104|  const uint8_t* const data_head =
  155|    104|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    104|  buffer->Advance(bytes_encoded);
  158|    104|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 66]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|     66|  return true;
  162|    104|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  8.37M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     66|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     66|  ans_.read_end();
  167|     66|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    277|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    277|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    277|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 277]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    277|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    277|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    277|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 56, False: 221]
  ------------------
   67|     56|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 55]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     56|  } else
   72|    221|#endif
   73|    221|  {
   74|    221|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 213]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    221|  }
   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|    268|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 254]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    254|  probability_table_.resize(num_symbols_);
   86|    254|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 251]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   181k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 181k, False: 177]
  ------------------
   91|   181k|    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|   181k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 181k]
  ------------------
   95|     36|      return false;
   96|     36|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   181k|    const int token = prob_data & 3;
  102|   181k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 72.0k, False: 109k]
  ------------------
  103|  72.0k|      const uint32_t offset = prob_data >> 2;
  104|  72.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 72.0k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.93M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.85M, False: 72.0k]
  ------------------
  109|  1.85M|        probability_table_[i + j] = 0;
  110|  1.85M|      }
  111|  72.0k|      i += offset;
  112|   109k|    } else {
  113|   109k|      const int extra_bytes = token;
  114|   109k|      uint32_t prob = prob_data >> 2;
  115|   222k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 113k, False: 109k]
  ------------------
  116|   113k|        uint8_t eb;
  117|   113k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 113k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   113k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   113k|      }
  124|   109k|      probability_table_[i] = prob;
  125|   109k|    }
  126|   181k|  }
  127|    177|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 25, False: 152]
  ------------------
  128|     25|    return false;
  129|     25|  }
  130|    152|  return true;
  131|    177|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    155|  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: 26, False: 126]
  ------------------
  140|     26|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 26]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     26|  } else
  145|    126|#endif
  146|    126|  {
  147|    126|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 125]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    126|  }
  151|    151|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 46, False: 105]
  ------------------
  152|     46|    return false;
  153|     46|  }
  154|    105|  const uint8_t* const data_head =
  155|    105|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    105|  buffer->Advance(bytes_encoded);
  158|    105|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 43, False: 62]
  ------------------
  159|     43|    return false;
  160|     43|  }
  161|     62|  return true;
  162|    105|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  21.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     62|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     62|  ans_.read_end();
  167|     62|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    298|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    298|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    298|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 298]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    298|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    298|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    298|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 46, False: 252]
  ------------------
   67|     46|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 46]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     46|  } else
   72|    252|#endif
   73|    252|  {
   74|    252|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 245]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    252|  }
   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|    291|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 285]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|    285|  probability_table_.resize(num_symbols_);
   86|    285|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 284]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  1.35M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.35M, False: 169]
  ------------------
   91|  1.35M|    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.35M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 52, False: 1.35M]
  ------------------
   95|     52|      return false;
   96|     52|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.35M|    const int token = prob_data & 3;
  102|  1.35M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 801k, False: 553k]
  ------------------
  103|   801k|      const uint32_t offset = prob_data >> 2;
  104|   801k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 41, False: 801k]
  ------------------
  105|     41|        return false;
  106|     41|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  29.2M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 28.4M, False: 801k]
  ------------------
  109|  28.4M|        probability_table_[i + j] = 0;
  110|  28.4M|      }
  111|   801k|      i += offset;
  112|   801k|    } else {
  113|   553k|      const int extra_bytes = token;
  114|   553k|      uint32_t prob = prob_data >> 2;
  115|   866k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 312k, False: 553k]
  ------------------
  116|   312k|        uint8_t eb;
  117|   312k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 312k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   312k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   312k|      }
  124|   553k|      probability_table_[i] = prob;
  125|   553k|    }
  126|  1.35M|  }
  127|    169|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 155]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|    155|  return true;
  131|    169|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    156|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    155|    DecoderBuffer* buffer) {
  136|    155|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    155|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    155|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    155|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 135]
  ------------------
  140|     20|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 20]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     20|  } 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: 36, False: 119]
  ------------------
  152|     36|    return false;
  153|     36|  }
  154|    119|  const uint8_t* const data_head =
  155|    119|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    119|  buffer->Advance(bytes_encoded);
  158|    119|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 42, False: 77]
  ------------------
  159|     42|    return false;
  160|     42|  }
  161|     77|  return true;
  162|    119|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  5.24M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     77|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     77|  ans_.read_end();
  167|     77|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    274|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    274|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    274|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 274]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    274|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    274|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    274|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 64, False: 210]
  ------------------
   67|     64|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 64]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     64|  } else
   72|    210|#endif
   73|    210|  {
   74|    210|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 206]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    210|  }
   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|    270|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 262]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|    262|  probability_table_.resize(num_symbols_);
   86|    262|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 254]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|   263k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 263k, False: 176]
  ------------------
   91|   263k|    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|   263k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 27, False: 263k]
  ------------------
   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|   263k|    const int token = prob_data & 3;
  102|   263k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 170k, False: 92.6k]
  ------------------
  103|   170k|      const uint32_t offset = prob_data >> 2;
  104|   170k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 170k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.33M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.16M, False: 170k]
  ------------------
  109|  4.16M|        probability_table_[i + j] = 0;
  110|  4.16M|      }
  111|   170k|      i += offset;
  112|   170k|    } else {
  113|  92.6k|      const int extra_bytes = token;
  114|  92.6k|      uint32_t prob = prob_data >> 2;
  115|   160k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 68.3k, False: 92.6k]
  ------------------
  116|  68.3k|        uint8_t eb;
  117|  68.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 68.3k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  68.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  68.3k|      }
  124|  92.6k|      probability_table_[i] = prob;
  125|  92.6k|    }
  126|   263k|  }
  127|    176|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 19, False: 157]
  ------------------
  128|     19|    return false;
  129|     19|  }
  130|    157|  return true;
  131|    176|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    165|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    157|    DecoderBuffer* buffer) {
  136|    157|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    157|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    157|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    157|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 49, False: 108]
  ------------------
  140|     49|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 49]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     49|  } else
  145|    108|#endif
  146|    108|  {
  147|    108|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 98]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    108|  }
  151|    147|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 58, False: 89]
  ------------------
  152|     58|    return false;
  153|     58|  }
  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: 17, False: 72]
  ------------------
  159|     17|    return false;
  160|     17|  }
  161|     72|  return true;
  162|     89|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  23.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     72|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     72|  ans_.read_end();
  167|     72|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  11.4k|                   DecoderBuffer* src_buffer, uint32_t* out_values) {
   34|  11.4k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 14, False: 11.4k]
  ------------------
   35|     14|    return true;
   36|     14|  }
   37|       |  // Decode which scheme to use.
   38|  11.4k|  uint8_t scheme;
   39|  11.4k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 207, False: 11.2k]
  ------------------
   40|    207|    return false;
   41|    207|  }
   42|  11.2k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.19k, False: 10.0k]
  ------------------
   43|  1.19k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.19k|                                                  src_buffer, out_values);
   45|  10.0k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 5.98k, False: 4.06k]
  ------------------
   46|  5.98k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  5.98k|                                               out_values);
   48|  5.98k|  }
   49|  4.06k|  return false;
   50|  11.2k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.19k|                         DecoderBuffer* src_buffer, uint32_t* out_values) {
   55|       |  // Decode the encoded data.
   56|  1.19k|  SymbolDecoderT<5> tag_decoder;
   57|  1.19k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 574, False: 617]
  ------------------
   58|    574|    return false;
   59|    574|  }
   60|       |
   61|    617|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 210, False: 407]
  ------------------
   62|    210|    return false;
   63|    210|  }
   64|       |
   65|    407|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 407, False: 0]
  |  Branch (65:25): [True: 52, False: 355]
  ------------------
   66|     52|    return false;  // Wrong number of symbols.
   67|     52|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    355|  src_buffer->StartBitDecoding(false, nullptr);
   72|    355|  int value_id = 0;
   73|  8.24M|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 8.23M, False: 352]
  ------------------
   74|       |    // Decode the tag.
   75|  8.23M|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  17.2M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 8.98M, False: 8.23M]
  ------------------
   78|  8.98M|      uint32_t val;
   79|  8.98M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 3, False: 8.98M]
  ------------------
   80|      3|        return false;
   81|      3|      }
   82|  8.98M|      out_values[value_id++] = val;
   83|  8.98M|    }
   84|  8.23M|  }
   85|    352|  tag_decoder.EndDecoding();
   86|    352|  src_buffer->EndBitDecoding();
   87|    352|  return true;
   88|    355|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  5.98k|                      uint32_t* out_values) {
  117|  5.98k|  uint8_t max_bit_length;
  118|  5.98k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 31, False: 5.95k]
  ------------------
  119|     31|    return false;
  120|     31|  }
  121|  5.95k|  switch (max_bit_length) {
  122|    467|    case 1:
  ------------------
  |  Branch (122:5): [True: 467, False: 5.48k]
  ------------------
  123|    467|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    467|                                                         out_values);
  125|    370|    case 2:
  ------------------
  |  Branch (125:5): [True: 370, False: 5.58k]
  ------------------
  126|    370|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    370|                                                         out_values);
  128|    360|    case 3:
  ------------------
  |  Branch (128:5): [True: 360, False: 5.59k]
  ------------------
  129|    360|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    360|                                                         out_values);
  131|    192|    case 4:
  ------------------
  |  Branch (131:5): [True: 192, False: 5.75k]
  ------------------
  132|    192|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    192|                                                         out_values);
  134|    258|    case 5:
  ------------------
  |  Branch (134:5): [True: 258, False: 5.69k]
  ------------------
  135|    258|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    258|                                                         out_values);
  137|    337|    case 6:
  ------------------
  |  Branch (137:5): [True: 337, False: 5.61k]
  ------------------
  138|    337|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    337|                                                         out_values);
  140|    396|    case 7:
  ------------------
  |  Branch (140:5): [True: 396, False: 5.55k]
  ------------------
  141|    396|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    396|                                                         out_values);
  143|    248|    case 8:
  ------------------
  |  Branch (143:5): [True: 248, False: 5.70k]
  ------------------
  144|    248|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    248|                                                         out_values);
  146|    283|    case 9:
  ------------------
  |  Branch (146:5): [True: 283, False: 5.66k]
  ------------------
  147|    283|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    283|                                                         out_values);
  149|    210|    case 10:
  ------------------
  |  Branch (149:5): [True: 210, False: 5.74k]
  ------------------
  150|    210|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    210|          num_values, src_buffer, out_values);
  152|    301|    case 11:
  ------------------
  |  Branch (152:5): [True: 301, False: 5.64k]
  ------------------
  153|    301|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    301|          num_values, src_buffer, out_values);
  155|    275|    case 12:
  ------------------
  |  Branch (155:5): [True: 275, False: 5.67k]
  ------------------
  156|    275|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    275|          num_values, src_buffer, out_values);
  158|    398|    case 13:
  ------------------
  |  Branch (158:5): [True: 398, False: 5.55k]
  ------------------
  159|    398|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    398|          num_values, src_buffer, out_values);
  161|    389|    case 14:
  ------------------
  |  Branch (161:5): [True: 389, False: 5.56k]
  ------------------
  162|    389|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    389|          num_values, src_buffer, out_values);
  164|    319|    case 15:
  ------------------
  |  Branch (164:5): [True: 319, False: 5.63k]
  ------------------
  165|    319|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    319|          num_values, src_buffer, out_values);
  167|    277|    case 16:
  ------------------
  |  Branch (167:5): [True: 277, False: 5.67k]
  ------------------
  168|    277|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    277|          num_values, src_buffer, out_values);
  170|    298|    case 17:
  ------------------
  |  Branch (170:5): [True: 298, False: 5.65k]
  ------------------
  171|    298|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    298|          num_values, src_buffer, out_values);
  173|    274|    case 18:
  ------------------
  |  Branch (173:5): [True: 274, False: 5.67k]
  ------------------
  174|    274|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    274|          num_values, src_buffer, out_values);
  176|    298|    default:
  ------------------
  |  Branch (176:5): [True: 298, False: 5.65k]
  ------------------
  177|    298|      return false;
  178|  5.95k|  }
  179|  5.95k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    467|                              uint32_t* out_values) {
   93|    467|  SymbolDecoderT decoder;
   94|    467|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 304, False: 163]
  ------------------
   95|    304|    return false;
   96|    304|  }
   97|       |
   98|    163|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 163, False: 0]
  |  Branch (98:25): [True: 13, False: 150]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    150|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 58, False: 92]
  ------------------
  103|     58|    return false;
  104|     58|  }
  105|   120M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 120M, False: 92]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   120M|    const uint32_t value = decoder.DecodeSymbol();
  108|   120M|    out_values[i] = value;
  109|   120M|  }
  110|     92|  decoder.EndDecoding();
  111|     92|  return true;
  112|    150|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    370|                              uint32_t* out_values) {
   93|    370|  SymbolDecoderT decoder;
   94|    370|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 137, False: 233]
  ------------------
   95|    137|    return false;
   96|    137|  }
   97|       |
   98|    233|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 233, False: 0]
  |  Branch (98:25): [True: 8, False: 225]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    225|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 77, False: 148]
  ------------------
  103|     77|    return false;
  104|     77|  }
  105|  19.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 19.1M, False: 148]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  19.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  19.1M|    out_values[i] = value;
  109|  19.1M|  }
  110|    148|  decoder.EndDecoding();
  111|    148|  return true;
  112|    225|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    360|                              uint32_t* out_values) {
   93|    360|  SymbolDecoderT decoder;
   94|    360|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 117, False: 243]
  ------------------
   95|    117|    return false;
   96|    117|  }
   97|       |
   98|    243|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 243, False: 0]
  |  Branch (98:25): [True: 0, False: 243]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    243|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 73, False: 170]
  ------------------
  103|     73|    return false;
  104|     73|  }
  105|  21.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 21.7M, False: 170]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  21.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  21.7M|    out_values[i] = value;
  109|  21.7M|  }
  110|    170|  decoder.EndDecoding();
  111|    170|  return true;
  112|    243|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    192|                              uint32_t* out_values) {
   93|    192|  SymbolDecoderT decoder;
   94|    192|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 85, False: 107]
  ------------------
   95|     85|    return false;
   96|     85|  }
   97|       |
   98|    107|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 107, False: 0]
  |  Branch (98:25): [True: 4, False: 103]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    103|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 54, False: 49]
  ------------------
  103|     54|    return false;
  104|     54|  }
  105|  2.27M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.27M, False: 49]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.27M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.27M|    out_values[i] = value;
  109|  2.27M|  }
  110|     49|  decoder.EndDecoding();
  111|     49|  return true;
  112|    103|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    258|                              uint32_t* out_values) {
   93|    258|  SymbolDecoderT decoder;
   94|    258|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 33, False: 225]
  ------------------
   95|     33|    return false;
   96|     33|  }
   97|       |
   98|    225|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 225, False: 0]
  |  Branch (98:25): [True: 144, False: 81]
  ------------------
   99|    144|    return false;  // Wrong number of symbols.
  100|    144|  }
  101|       |
  102|     81|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 6, False: 75]
  ------------------
  103|      6|    return false;
  104|      6|  }
  105|  2.31M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.31M, False: 75]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.31M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.31M|    out_values[i] = value;
  109|  2.31M|  }
  110|     75|  decoder.EndDecoding();
  111|     75|  return true;
  112|     81|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    337|                              uint32_t* out_values) {
   93|    337|  SymbolDecoderT decoder;
   94|    337|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 105, False: 232]
  ------------------
   95|    105|    return false;
   96|    105|  }
   97|       |
   98|    232|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 232, False: 0]
  |  Branch (98:25): [True: 3, False: 229]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    229|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 68, False: 161]
  ------------------
  103|     68|    return false;
  104|     68|  }
  105|  4.10M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.10M, False: 161]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.10M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.10M|    out_values[i] = value;
  109|  4.10M|  }
  110|    161|  decoder.EndDecoding();
  111|    161|  return true;
  112|    229|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    396|                              uint32_t* out_values) {
   93|    396|  SymbolDecoderT decoder;
   94|    396|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 124, False: 272]
  ------------------
   95|    124|    return false;
   96|    124|  }
   97|       |
   98|    272|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 272, False: 0]
  |  Branch (98:25): [True: 7, False: 265]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    265|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 107, False: 158]
  ------------------
  103|    107|    return false;
  104|    107|  }
  105|  72.2M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 72.2M, False: 158]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  72.2M|    const uint32_t value = decoder.DecodeSymbol();
  108|  72.2M|    out_values[i] = value;
  109|  72.2M|  }
  110|    158|  decoder.EndDecoding();
  111|    158|  return true;
  112|    265|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    248|                              uint32_t* out_values) {
   93|    248|  SymbolDecoderT decoder;
   94|    248|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 100, False: 148]
  ------------------
   95|    100|    return false;
   96|    100|  }
   97|       |
   98|    148|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 148, False: 0]
  |  Branch (98:25): [True: 0, False: 148]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    148|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 75, False: 73]
  ------------------
  103|     75|    return false;
  104|     75|  }
  105|   171M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 171M, False: 73]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   171M|    const uint32_t value = decoder.DecodeSymbol();
  108|   171M|    out_values[i] = value;
  109|   171M|  }
  110|     73|  decoder.EndDecoding();
  111|     73|  return true;
  112|    148|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    283|                              uint32_t* out_values) {
   93|    283|  SymbolDecoderT decoder;
   94|    283|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 123, False: 160]
  ------------------
   95|    123|    return false;
   96|    123|  }
   97|       |
   98|    160|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 160, False: 0]
  |  Branch (98:25): [True: 8, False: 152]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    152|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 71, False: 81]
  ------------------
  103|     71|    return false;
  104|     71|  }
  105|   603k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 603k, False: 81]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   603k|    const uint32_t value = decoder.DecodeSymbol();
  108|   603k|    out_values[i] = value;
  109|   603k|  }
  110|     81|  decoder.EndDecoding();
  111|     81|  return true;
  112|    152|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    210|                              uint32_t* out_values) {
   93|    210|  SymbolDecoderT decoder;
   94|    210|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 109, False: 101]
  ------------------
   95|    109|    return false;
   96|    109|  }
   97|       |
   98|    101|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 101, False: 0]
  |  Branch (98:25): [True: 5, False: 96]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|     96|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 49, False: 47]
  ------------------
  103|     49|    return false;
  104|     49|  }
  105|   356k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 356k, False: 47]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   356k|    const uint32_t value = decoder.DecodeSymbol();
  108|   356k|    out_values[i] = value;
  109|   356k|  }
  110|     47|  decoder.EndDecoding();
  111|     47|  return true;
  112|     96|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    301|                              uint32_t* out_values) {
   93|    301|  SymbolDecoderT decoder;
   94|    301|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 168, False: 133]
  ------------------
   95|    168|    return false;
   96|    168|  }
   97|       |
   98|    133|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 133, False: 0]
  |  Branch (98:25): [True: 1, False: 132]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    132|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 79, False: 53]
  ------------------
  103|     79|    return false;
  104|     79|  }
  105|   246k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 246k, False: 53]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   246k|    const uint32_t value = decoder.DecodeSymbol();
  108|   246k|    out_values[i] = value;
  109|   246k|  }
  110|     53|  decoder.EndDecoding();
  111|     53|  return true;
  112|    132|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    275|                              uint32_t* out_values) {
   93|    275|  SymbolDecoderT decoder;
   94|    275|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 116, False: 159]
  ------------------
   95|    116|    return false;
   96|    116|  }
   97|       |
   98|    159|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 159, False: 0]
  |  Branch (98:25): [True: 2, False: 157]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    157|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 91, False: 66]
  ------------------
  103|     91|    return false;
  104|     91|  }
  105|   359k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 359k, False: 66]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   359k|    const uint32_t value = decoder.DecodeSymbol();
  108|   359k|    out_values[i] = value;
  109|   359k|  }
  110|     66|  decoder.EndDecoding();
  111|     66|  return true;
  112|    157|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    398|                              uint32_t* out_values) {
   93|    398|  SymbolDecoderT decoder;
   94|    398|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 174, False: 224]
  ------------------
   95|    174|    return false;
   96|    174|  }
   97|       |
   98|    224|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 224, False: 0]
  |  Branch (98:25): [True: 37, False: 187]
  ------------------
   99|     37|    return false;  // Wrong number of symbols.
  100|     37|  }
  101|       |
  102|    187|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 138, False: 49]
  ------------------
  103|    138|    return false;
  104|    138|  }
  105|   434k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 434k, False: 49]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   434k|    const uint32_t value = decoder.DecodeSymbol();
  108|   434k|    out_values[i] = value;
  109|   434k|  }
  110|     49|  decoder.EndDecoding();
  111|     49|  return true;
  112|    187|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    389|                              uint32_t* out_values) {
   93|    389|  SymbolDecoderT decoder;
   94|    389|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 225, False: 164]
  ------------------
   95|    225|    return false;
   96|    225|  }
   97|       |
   98|    164|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 164, False: 0]
  |  Branch (98:25): [True: 1, False: 163]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    163|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 94, False: 69]
  ------------------
  103|     94|    return false;
  104|     94|  }
  105|  5.07M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.07M, False: 69]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.07M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.07M|    out_values[i] = value;
  109|  5.07M|  }
  110|     69|  decoder.EndDecoding();
  111|     69|  return true;
  112|    163|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    319|                              uint32_t* out_values) {
   93|    319|  SymbolDecoderT decoder;
   94|    319|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 146, False: 173]
  ------------------
   95|    146|    return false;
   96|    146|  }
   97|       |
   98|    173|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 173, False: 0]
  |  Branch (98:25): [True: 1, False: 172]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    172|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 106, False: 66]
  ------------------
  103|    106|    return false;
  104|    106|  }
  105|  8.37M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.37M, False: 66]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.37M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.37M|    out_values[i] = value;
  109|  8.37M|  }
  110|     66|  decoder.EndDecoding();
  111|     66|  return true;
  112|    172|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    277|                              uint32_t* out_values) {
   93|    277|  SymbolDecoderT decoder;
   94|    277|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 122, False: 155]
  ------------------
   95|    122|    return false;
   96|    122|  }
   97|       |
   98|    155|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 155, False: 0]
  |  Branch (98:25): [True: 3, False: 152]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    152|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 90, False: 62]
  ------------------
  103|     90|    return false;
  104|     90|  }
  105|  21.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 21.9M, False: 62]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  21.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  21.9M|    out_values[i] = value;
  109|  21.9M|  }
  110|     62|  decoder.EndDecoding();
  111|     62|  return true;
  112|    152|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    298|                              uint32_t* out_values) {
   93|    298|  SymbolDecoderT decoder;
   94|    298|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 142, False: 156]
  ------------------
   95|    142|    return false;
   96|    142|  }
   97|       |
   98|    156|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 156, False: 0]
  |  Branch (98:25): [True: 1, False: 155]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    155|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 78, False: 77]
  ------------------
  103|     78|    return false;
  104|     78|  }
  105|  5.24M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.24M, False: 77]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.24M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.24M|    out_values[i] = value;
  109|  5.24M|  }
  110|     77|  decoder.EndDecoding();
  111|     77|  return true;
  112|    155|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    274|                              uint32_t* out_values) {
   93|    274|  SymbolDecoderT decoder;
   94|    274|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 109, False: 165]
  ------------------
   95|    109|    return false;
   96|    109|  }
   97|       |
   98|    165|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 165, False: 0]
  |  Branch (98:25): [True: 8, False: 157]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    157|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 85, False: 72]
  ------------------
  103|     85|    return false;
  104|     85|  }
  105|  23.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 23.5M, False: 72]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  23.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  23.5M|    out_values[i] = value;
  109|  23.5M|  }
  110|     72|  decoder.EndDecoding();
  111|     72|  return true;
  112|    157|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  8.66k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  3.92k|  const CornerTable* GetCornerTable() const override {
   67|  3.92k|    return corner_table_.get();
   68|  3.92k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  15.5M|                       int* out_encoder_split_symbol_id) {
   87|  15.5M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 94.9k, False: 15.4M]
  ------------------
   88|  94.9k|      return false;
   89|  94.9k|    }
   90|  15.4M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 30, False: 15.4M]
  ------------------
   91|  15.4M|        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|     30|      *out_encoder_split_symbol_id = -1;
   98|     30|      return true;
   99|     30|    }
  100|  15.4M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 15.4M, False: 2.38k]
  ------------------
  101|  15.4M|      return false;
  102|  15.4M|    }
  103|  2.38k|    *out_face_edge =
  104|  2.38k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  2.38k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  2.38k|    topology_split_data_.pop_back();
  108|  2.38k|    return true;
  109|  15.4M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  52.0M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  52.0M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  52.0M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  52.0M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  24.3k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  6.83k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  4.95k|  const CornerTable* GetCornerTable() const override {
   67|  4.95k|    return corner_table_.get();
   68|  4.95k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  32.5M|                       int* out_encoder_split_symbol_id) {
   87|  32.5M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 32.4M, False: 59.8k]
  ------------------
   88|  32.4M|      return false;
   89|  32.4M|    }
   90|  59.8k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 14, False: 59.8k]
  ------------------
   91|  59.8k|        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|     14|      *out_encoder_split_symbol_id = -1;
   98|     14|      return true;
   99|     14|    }
  100|  59.8k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 58.5k, False: 1.31k]
  ------------------
  101|  58.5k|      return false;
  102|  58.5k|    }
  103|  1.31k|    *out_face_edge =
  104|  1.31k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.31k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.31k|    topology_split_data_.pop_back();
  108|  1.31k|    return true;
  109|  59.8k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  94.9M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  94.9M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  94.9M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  94.9M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  13.0k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  13.5k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  3.34k|  const CornerTable* GetCornerTable() const override {
   67|  3.34k|    return corner_table_.get();
   68|  3.34k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  77.3M|                       int* out_encoder_split_symbol_id) {
   87|  77.3M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 71.8M, False: 5.52M]
  ------------------
   88|  71.8M|      return false;
   89|  71.8M|    }
   90|  5.52M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 27, False: 5.52M]
  ------------------
   91|  5.52M|        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|     27|      *out_encoder_split_symbol_id = -1;
   98|     27|      return true;
   99|     27|    }
  100|  5.52M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 5.52M, False: 1.59k]
  ------------------
  101|  5.52M|      return false;
  102|  5.52M|    }
  103|  1.59k|    *out_face_edge =
  104|  1.59k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.59k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.59k|    topology_split_data_.pop_back();
  108|  1.59k|    return true;
  109|  5.52M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  86.8M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  86.8M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  86.8M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  86.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  8.90k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  8.05k|      : attribute_connectivity_decoders_(nullptr),
   34|  8.05k|        num_attribute_data_(0),
   35|  8.05k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  7.56k|  void Init(MeshEdgebreakerDecoderImplInterface* decoder) {
   37|  7.56k|    decoder_impl_ = decoder;
   38|  7.56k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  7.56k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  7.56k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  7.56k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  6.41k|  uint16_t BitstreamVersion() const {
   45|  6.41k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  6.41k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  2.88k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  7.56k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  5.16k|  bool Start(DecoderBuffer* out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  5.16k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 52, False: 5.11k]
  ------------------
   63|     52|      return false;
   64|     52|    }
   65|       |
   66|  5.11k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 72, False: 5.04k]
  ------------------
   67|     72|      return false;
   68|     72|    }
   69|       |
   70|  5.04k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 24, False: 5.01k]
  ------------------
   71|     24|      return false;
   72|     24|    }
   73|  5.01k|    *out_buffer = buffer_;
   74|  5.01k|    return true;
   75|  5.04k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  5.06M|  inline bool DecodeStartFaceConfiguration() {
   79|  5.06M|    uint32_t face_configuration;
   80|  5.06M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  5.06M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.06M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 935, False: 5.06M]
  ------------------
   82|    935|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    935|    } else
   85|  5.06M|#endif
   86|  5.06M|    {
   87|  5.06M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  5.06M|    }
   89|  5.06M|    return face_configuration;
   90|  5.06M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  36.9M|  inline uint32_t DecodeSymbol() {
   94|  36.9M|    uint32_t symbol;
   95|  36.9M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  36.9M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 15.7M, False: 21.1M]
  ------------------
   97|  15.7M|      return symbol;
   98|  15.7M|    }
   99|       |    // Else decode two additional bits.
  100|  21.1M|    uint32_t symbol_suffix;
  101|  21.1M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  21.1M|    symbol |= (symbol_suffix << 1);
  103|  21.1M|    return symbol;
  104|  36.9M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  36.5M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  5.46M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  25.3M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  25.3M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  25.3M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  5.24k|  void Done() {
  123|  5.24k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 4.61k, False: 636]
  ------------------
  124|  4.61k|      symbol_buffer_.EndBitDecoding();
  125|  4.61k|    }
  126|  5.24k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  5.24k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.24k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 513, False: 4.73k]
  ------------------
  128|    513|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    513|    } else
  131|  4.73k|#endif
  132|  4.73k|    {
  133|  4.73k|      start_face_decoder_.EndDecoding();
  134|  4.73k|    }
  135|  5.24k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  2.31k|  DecoderBuffer* buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  5.42k|  bool DecodeTraversalSymbols() {
  141|  5.42k|    uint64_t traversal_size;
  142|  5.42k|    symbol_buffer_ = buffer_;
  143|  5.42k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 13, False: 5.41k]
  ------------------
  144|     13|      return false;
  145|     13|    }
  146|  5.41k|    buffer_ = symbol_buffer_;
  147|  5.41k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 65, False: 5.34k]
  ------------------
  148|     65|      return false;
  149|     65|    }
  150|  5.34k|    buffer_.Advance(traversal_size);
  151|  5.34k|    return true;
  152|  5.41k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  7.48k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  7.48k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  7.48k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  7.48k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 859, False: 6.62k]
  ------------------
  158|    859|      start_face_buffer_ = buffer_;
  159|    859|      uint64_t traversal_size;
  160|    859|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 1, False: 858]
  ------------------
  161|      1|        return false;
  162|      1|      }
  163|    858|      buffer_ = start_face_buffer_;
  164|    858|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 99, False: 759]
  ------------------
  165|     99|        return false;
  166|     99|      }
  167|    759|      buffer_.Advance(traversal_size);
  168|    759|      return true;
  169|    858|    }
  170|  6.62k|#endif
  171|  6.62k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  7.48k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  7.37k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  7.37k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 5.45k, False: 1.91k]
  ------------------
  177|  5.45k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  5.45k|          new BinaryDecoder[num_attribute_data_]);
  179|  20.4k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 15.0k, False: 5.42k]
  ------------------
  180|  15.0k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 37, False: 14.9k]
  ------------------
  181|     37|          return false;
  182|     37|        }
  183|  15.0k|      }
  184|  5.45k|    }
  185|  7.33k|    return true;
  186|  7.37k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  2.49k|MeshSequentialDecoder::MeshSequentialDecoder() = default;
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  2.31k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  2.31k|  uint32_t num_faces;
   31|  2.31k|  uint32_t num_points;
   32|  2.31k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  2.31k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.31k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 485, False: 1.82k]
  ------------------
   34|    485|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 0, False: 485]
  ------------------
   35|      0|      return false;
   36|      0|    }
   37|    485|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 0, False: 485]
  ------------------
   38|      0|      return false;
   39|      0|    }
   40|       |
   41|    485|  } else
   42|  1.82k|#endif
   43|  1.82k|  {
   44|  1.82k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 0, False: 1.82k]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|  1.82k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 0, False: 1.82k]
  ------------------
   48|      0|      return false;
   49|      0|    }
   50|  1.82k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  2.31k|  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.31k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 0, False: 2.31k]
  ------------------
   56|      0|    return false;
   57|      0|  }
   58|  2.31k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 4, False: 2.31k]
  ------------------
   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.31k|  uint8_t connectivity_method;
   64|  2.31k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 0, False: 2.31k]
  ------------------
   65|      0|    return false;
   66|      0|  }
   67|  2.31k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 1.62k, False: 688]
  ------------------
   68|  1.62k|    if (!DecodeAndDecompressIndices(num_faces, num_points)) {
  ------------------
  |  Branch (68:9): [True: 1.53k, False: 85]
  ------------------
   69|  1.53k|      return false;
   70|  1.53k|    }
   71|  1.62k|  } else {
   72|    688|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 517, False: 171]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|  1.24k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 728, False: 512]
  ------------------
   75|    728|        Mesh::Face face;
   76|  2.90k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 2.18k, False: 723]
  ------------------
   77|  2.18k|          uint8_t val;
   78|  2.18k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 2, False: 2.17k]
  ------------------
   79|      2|            return false;
   80|      2|          }
   81|  2.17k|          if (val >= num_points) {
  ------------------
  |  Branch (81:15): [True: 3, False: 2.17k]
  ------------------
   82|      3|            return false;
   83|      3|          }
   84|  2.17k|          face[j] = val;
   85|  2.17k|        }
   86|    723|        mesh()->AddFace(face);
   87|    723|      }
   88|    517|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (88:16): [True: 60, False: 111]
  ------------------
   89|       |      // Decode indices as uint16_t.
   90|  21.0k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:28): [True: 20.9k, False: 30]
  ------------------
   91|  20.9k|        Mesh::Face face;
   92|  83.8k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (92:25): [True: 62.8k, False: 20.9k]
  ------------------
   93|  62.8k|          uint16_t val;
   94|  62.8k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (94:15): [True: 8, False: 62.8k]
  ------------------
   95|      8|            return false;
   96|      8|          }
   97|  62.8k|          if (val >= num_points) {
  ------------------
  |  Branch (97:15): [True: 22, False: 62.8k]
  ------------------
   98|     22|            return false;
   99|     22|          }
  100|  62.8k|          face[j] = val;
  101|  62.8k|        }
  102|  20.9k|        mesh()->AddFace(face);
  103|  20.9k|      }
  104|    111|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (104:16): [True: 36, False: 75]
  ------------------
  105|     36|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     36|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (105:16): [True: 32, False: 4]
  ------------------
  106|       |      // Decode indices as uint32_t.
  107|    795|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (107:28): [True: 786, False: 9]
  ------------------
  108|    786|        Mesh::Face face;
  109|  3.10k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (109:25): [True: 2.33k, False: 763]
  ------------------
  110|  2.33k|          uint32_t val;
  111|  2.33k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (111:15): [True: 5, False: 2.33k]
  ------------------
  112|      5|            return false;
  113|      5|          }
  114|  2.33k|          if (val >= num_points) {
  ------------------
  |  Branch (114:15): [True: 18, False: 2.31k]
  ------------------
  115|     18|            return false;
  116|     18|          }
  117|  2.31k|          face[j] = val;
  118|  2.31k|        }
  119|    763|        mesh()->AddFace(face);
  120|    763|      }
  121|     79|    } else {
  122|       |      // Decode faces as uint32_t (default).
  123|  47.2k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (123:28): [True: 47.2k, False: 35]
  ------------------
  124|  47.2k|        Mesh::Face face;
  125|   188k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (125:25): [True: 141k, False: 47.1k]
  ------------------
  126|   141k|          uint32_t val;
  127|   141k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (127:15): [True: 22, False: 141k]
  ------------------
  128|     22|            return false;
  129|     22|          }
  130|   141k|          if (val >= num_points) {
  ------------------
  |  Branch (130:15): [True: 22, False: 141k]
  ------------------
  131|     22|            return false;
  132|     22|          }
  133|   141k|          face[j] = val;
  134|   141k|        }
  135|  47.1k|        mesh()->AddFace(face);
  136|  47.1k|      }
  137|     79|    }
  138|    688|  }
  139|    671|  point_cloud()->set_num_points(num_points);
  140|    671|  return true;
  141|  2.31k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  143|  16.8k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  144|       |  // Always create the basic attribute decoder.
  145|  16.8k|  return SetAttributesDecoder(
  146|  16.8k|      att_decoder_id,
  147|  16.8k|      std::unique_ptr<AttributesDecoder>(
  148|  16.8k|          new SequentialAttributeDecodersController(
  149|  16.8k|              std::unique_ptr<PointsSequencer>(
  150|  16.8k|                  new LinearSequencer(point_cloud()->num_points())))));
  151|  16.8k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEjj:
  154|  1.62k|                                                       uint32_t num_points) {
  155|       |  // Get decoded indices differences that were encoded with an entropy code.
  156|  1.62k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  157|  1.62k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (157:7): [True: 1.44k, False: 179]
  ------------------
  158|  1.44k|    return false;
  159|  1.44k|  }
  160|       |  // Reconstruct the indices from the differences.
  161|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  162|    179|  int32_t last_index_value = 0;  // This will always be >= 0.
  163|    179|  int vertex_index = 0;
  164|  1.52k|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (164:24): [True: 1.44k, False: 85]
  ------------------
  165|  1.44k|    Mesh::Face face;
  166|  5.57k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (166:21): [True: 4.23k, False: 1.34k]
  ------------------
  167|  4.23k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  168|  4.23k|      int32_t index_diff = (encoded_val >> 1);
  169|  4.23k|      if (encoded_val & 1) {
  ------------------
  |  Branch (169:11): [True: 938, False: 3.29k]
  ------------------
  170|    938|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (170:13): [True: 39, False: 899]
  ------------------
  171|       |          // Subtracting index_diff would result in a negative index.
  172|     39|          return false;
  173|     39|        }
  174|    899|        index_diff = -index_diff;
  175|  3.29k|      } else {
  176|  3.29k|        if (index_diff >
  ------------------
  |  Branch (176:13): [True: 32, False: 3.26k]
  ------------------
  177|  3.29k|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  178|       |          // Adding index_diff to last_index_value would overflow.
  179|     32|          return false;
  180|     32|        }
  181|  3.29k|      }
  182|  4.15k|      const int32_t index_value = index_diff + last_index_value;
  183|  4.15k|      if (index_value < 0 || static_cast<uint32_t>(index_value) >= num_points) {
  ------------------
  |  Branch (183:11): [True: 0, False: 4.15k]
  |  Branch (183:30): [True: 23, False: 4.13k]
  ------------------
  184|     23|        return false;
  185|     23|      }
  186|  4.13k|      face[j] = index_value;
  187|  4.13k|      last_index_value = index_value;
  188|  4.13k|    }
  189|  1.34k|    mesh()->AddFace(face);
  190|  1.34k|  }
  191|     85|  return true;
  192|    179|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.41k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.35M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.35M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 2.33M, False: 16.2k]
  ------------------
   61|  2.33M|      return true;  // Already traversed.
   62|  2.33M|    }
   63|       |
   64|  16.2k|    corner_traversal_stack_.clear();
   65|  16.2k|    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|  16.2k|    const VertexIndex next_vert =
   69|  16.2k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  16.2k|    const VertexIndex prev_vert =
   71|  16.2k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  16.2k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 16.2k]
  |  Branch (72:45): [True: 0, False: 16.2k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  16.2k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 15.7k, False: 551]
  ------------------
   76|  15.7k|      this->MarkVertexVisited(next_vert);
   77|  15.7k|      this->traversal_observer().OnNewVertexVisited(
   78|  15.7k|          next_vert, this->corner_table()->Next(corner_id));
   79|  15.7k|    }
   80|  16.2k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 9.24k, False: 7.04k]
  ------------------
   81|  9.24k|      this->MarkVertexVisited(prev_vert);
   82|  9.24k|      this->traversal_observer().OnNewVertexVisited(
   83|  9.24k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  9.24k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  45.8k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 29.5k, False: 16.2k]
  ------------------
   88|       |      // Currently processed corner.
   89|  29.5k|      corner_id = corner_traversal_stack_.back();
   90|  29.5k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  29.5k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 29.5k]
  |  Branch (92:47): [True: 685, False: 28.8k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    685|        corner_traversal_stack_.pop_back();
   95|    685|        continue;
   96|    685|      }
   97|  2.35M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.35M, Folded]
  ------------------
   98|  2.35M|        this->MarkFaceVisited(face_id);
   99|  2.35M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.35M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.35M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.35M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.35M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.18M, False: 1.16M]
  ------------------
  105|  1.18M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.18M|          this->MarkVertexVisited(vert_id);
  107|  1.18M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.18M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.15M, False: 31.8k]
  ------------------
  109|  1.15M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.15M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.15M|            continue;
  112|  1.15M|          }
  113|  1.18M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  1.19M|        const CornerIndex right_corner_id =
  118|  1.19M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.19M|        const CornerIndex left_corner_id =
  120|  1.19M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.19M|        const FaceIndex right_face_id(
  122|  1.19M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 22.7k, False: 1.17M]
  ------------------
  123|  1.19M|                 ? kInvalidFaceIndex
  124|  1.19M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.19M|        const FaceIndex left_face_id(
  126|  1.19M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 21.4k, False: 1.17M]
  ------------------
  127|  1.19M|                 ? kInvalidFaceIndex
  128|  1.19M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.19M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.16M, False: 30.7k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.16M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 22.2k, False: 1.14M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  22.2k|            corner_traversal_stack_.pop_back();
  134|  22.2k|            break;  // Break from the while (true) loop.
  135|  1.14M|          } else {
  136|       |            // Go to the left face.
  137|  1.14M|            corner_id = left_corner_id;
  138|  1.14M|            face_id = left_face_id;
  139|  1.14M|          }
  140|  1.16M|        } else {
  141|       |          // Right face was not visited.
  142|  30.7k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 24.0k, False: 6.62k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  24.0k|            corner_id = right_corner_id;
  145|  24.0k|            face_id = right_face_id;
  146|  24.0k|          } 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|  6.62k|            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|  6.62k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  6.62k|            break;
  159|  6.62k|          }
  160|  30.7k|        }
  161|  1.19M|      }
  162|  28.8k|    }
  163|  16.2k|    return true;
  164|  16.2k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.41k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.99k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  2.29k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.78M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.78M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 620k, False: 3.16M]
  ------------------
   61|   620k|      return true;  // Already traversed.
   62|   620k|    }
   63|       |
   64|  3.16M|    corner_traversal_stack_.clear();
   65|  3.16M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  3.16M|    const VertexIndex next_vert =
   69|  3.16M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  3.16M|    const VertexIndex prev_vert =
   71|  3.16M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  3.16M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3.16M]
  |  Branch (72:45): [True: 0, False: 3.16M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  3.16M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 3.16M, False: 1.44k]
  ------------------
   76|  3.16M|      this->MarkVertexVisited(next_vert);
   77|  3.16M|      this->traversal_observer().OnNewVertexVisited(
   78|  3.16M|          next_vert, this->corner_table()->Next(corner_id));
   79|  3.16M|    }
   80|  3.16M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.16M, False: 1.01k]
  ------------------
   81|  3.16M|      this->MarkVertexVisited(prev_vert);
   82|  3.16M|      this->traversal_observer().OnNewVertexVisited(
   83|  3.16M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.16M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  6.38M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 3.22M, False: 3.16M]
  ------------------
   88|       |      // Currently processed corner.
   89|  3.22M|      corner_id = corner_traversal_stack_.back();
   90|  3.22M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  3.22M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 3.22M]
  |  Branch (92:47): [True: 4.95k, False: 3.21M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  4.95k|        corner_traversal_stack_.pop_back();
   95|  4.95k|        continue;
   96|  4.95k|      }
   97|  3.78M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.78M, Folded]
  ------------------
   98|  3.78M|        this->MarkFaceVisited(face_id);
   99|  3.78M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.78M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.78M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.78M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.78M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 3.49M, False: 292k]
  ------------------
  105|  3.49M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  3.49M|          this->MarkVertexVisited(vert_id);
  107|  3.49M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  3.49M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 279k, False: 3.21M]
  ------------------
  109|   279k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   279k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   279k|            continue;
  112|   279k|          }
  113|  3.49M|        }
  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.50M|        const CornerIndex right_corner_id =
  118|  3.50M|            this->corner_table()->GetRightCorner(corner_id);
  119|  3.50M|        const CornerIndex left_corner_id =
  120|  3.50M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  3.50M|        const FaceIndex right_face_id(
  122|  3.50M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 3.19M, False: 313k]
  ------------------
  123|  3.50M|                 ? kInvalidFaceIndex
  124|  3.50M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  3.50M|        const FaceIndex left_face_id(
  126|  3.50M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 3.18M, False: 320k]
  ------------------
  127|  3.50M|                 ? kInvalidFaceIndex
  128|  3.50M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  3.50M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 3.46M, False: 45.0k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  3.46M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 3.18M, False: 272k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  3.18M|            corner_traversal_stack_.pop_back();
  134|  3.18M|            break;  // Break from the while (true) loop.
  135|  3.18M|          } else {
  136|       |            // Go to the left face.
  137|   272k|            corner_id = left_corner_id;
  138|   272k|            face_id = left_face_id;
  139|   272k|          }
  140|  3.46M|        } else {
  141|       |          // Right face was not visited.
  142|  45.0k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 17.0k, False: 28.0k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  17.0k|            corner_id = right_corner_id;
  145|  17.0k|            face_id = right_face_id;
  146|  28.0k|          } 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|  28.0k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  28.0k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  28.0k|            break;
  159|  28.0k|          }
  160|  45.0k|        }
  161|  3.50M|      }
  162|  3.21M|    }
  163|  3.16M|    return true;
  164|  3.16M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  2.29k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  4.72k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.14k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  2.64k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  2.64k|    const auto* corner_table = traverser_.corner_table();
   50|  2.64k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  2.64k|    const size_t num_faces = mesh_->num_faces();
   52|  2.64k|    const size_t num_points = mesh_->num_points();
   53|  5.37M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.37M, False: 2.64k]
  ------------------
   54|  5.37M|      const auto& face = mesh_->face(f);
   55|  21.5M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 16.1M, False: 5.37M]
  ------------------
   56|  16.1M|        const PointIndex point_id = face[p];
   57|  16.1M|        const VertexIndex vert_id =
   58|  16.1M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  16.1M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 16.1M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  16.1M|        const AttributeValueIndex att_entry_id(
   63|  16.1M|            encoding_data_
   64|  16.1M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  16.1M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 16.1M]
  |  Branch (65:13): [True: 0, False: 16.1M]
  |  Branch (65:39): [True: 0, False: 16.1M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  16.1M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  16.1M|      }
   71|  5.37M|    }
   72|  2.64k|    return true;
   73|  2.64k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.10k|  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.10k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.10k|    traverser_.OnTraversalStart();
   82|  1.10k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.10k]
  ------------------
   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.10k|    } else {
   89|  1.10k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.36M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.36M, False: 1.10k]
  ------------------
   91|  3.36M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.36M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.36M|      }
   95|  1.10k|    }
   96|  1.10k|    traverser_.OnTraversalEnd();
   97|  1.10k|    return true;
   98|  1.10k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.36M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.36M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.36M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.14k|  void SetTraverser(const TraverserT& t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.49k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  8.62k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  8.62k|    const auto* corner_table = traverser_.corner_table();
   50|  8.62k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  8.62k|    const size_t num_faces = mesh_->num_faces();
   52|  8.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.52M, False: 8.62k]
  ------------------
   54|  4.52M|      const auto& face = mesh_->face(f);
   55|  18.1M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 13.5M, False: 4.52M]
  ------------------
   56|  13.5M|        const PointIndex point_id = face[p];
   57|  13.5M|        const VertexIndex vert_id =
   58|  13.5M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  13.5M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 13.5M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  13.5M|        const AttributeValueIndex att_entry_id(
   63|  13.5M|            encoding_data_
   64|  13.5M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  13.5M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 13.5M]
  |  Branch (65:13): [True: 0, False: 13.5M]
  |  Branch (65:39): [True: 0, False: 13.5M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  13.5M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  13.5M|      }
   71|  4.52M|    }
   72|  8.62k|    return true;
   73|  8.62k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.41k|  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.41k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.41k|    traverser_.OnTraversalStart();
   82|  1.41k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.41k]
  ------------------
   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.41k|    } else {
   89|  1.41k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.35M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.35M, False: 1.41k]
  ------------------
   91|  2.35M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.35M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.35M|      }
   95|  1.41k|    }
   96|  1.41k|    traverser_.OnTraversalEnd();
   97|  1.41k|    return true;
   98|  1.41k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.35M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.35M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.35M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.49k|  void SetTraverser(const TraverserT& t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  2.36k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  14.5k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  14.5k|    const auto* corner_table = traverser_.corner_table();
   50|  14.5k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  14.5k|    const size_t num_faces = mesh_->num_faces();
   52|  14.5k|    const size_t num_points = mesh_->num_points();
   53|  6.90M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 6.88M, False: 14.5k]
  ------------------
   54|  6.88M|      const auto& face = mesh_->face(f);
   55|  27.5M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 20.6M, False: 6.88M]
  ------------------
   56|  20.6M|        const PointIndex point_id = face[p];
   57|  20.6M|        const VertexIndex vert_id =
   58|  20.6M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  20.6M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 20.6M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  20.6M|        const AttributeValueIndex att_entry_id(
   63|  20.6M|            encoding_data_
   64|  20.6M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  20.6M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 20.6M]
  |  Branch (65:13): [True: 3, False: 20.6M]
  |  Branch (65:39): [True: 3, False: 20.6M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      3|          return false;
   68|      3|        }
   69|  20.6M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  20.6M|      }
   71|  6.88M|    }
   72|  14.5k|    return true;
   73|  14.5k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  2.29k|  bool GenerateSequenceInternal() override {
   77|       |    // Preallocate memory for storing point indices. We expect the number of
   78|       |    // points to be the same as the number of corner table vertices.
   79|  2.29k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  2.29k|    traverser_.OnTraversalStart();
   82|  2.29k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 2.29k]
  ------------------
   83|      0|      for (uint32_t i = 0; i < corner_order_->size(); ++i) {
  ------------------
  |  Branch (83:28): [True: 0, False: 0]
  ------------------
   84|      0|        if (!ProcessCorner(corner_order_->at(i))) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          return false;
   86|      0|        }
   87|      0|      }
   88|  2.29k|    } else {
   89|  2.29k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.78M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.78M, False: 2.29k]
  ------------------
   91|  3.78M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.78M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.78M|      }
   95|  2.29k|    }
   96|  2.29k|    traverser_.OnTraversalEnd();
   97|  2.29k|    return true;
   98|  2.29k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.78M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.78M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.78M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  2.36k|  void SetTraverser(const TraverserT& t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  4.72k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  39.1M|  inline const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  20.7M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  20.7M|    return is_vertex_visited_[vert_id.value()];
   65|  20.7M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.96M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.96M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.96M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  8.68M|  inline TraversalObserverT& traversal_observer() {
   75|  8.68M|    return traversal_observer_;
   76|  8.68M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  15.6M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  15.6M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 126k, False: 15.4M]
  ------------------
   47|   126k|      return true;  // Invalid faces are always considered as visited.
   48|   126k|    }
   49|  15.4M|    return is_face_visited_[face_id.value()];
   50|  15.6M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  5.71M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  5.71M|    is_face_visited_[face_id.value()] = true;
   62|  5.71M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  5.28k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  5.28k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.64k|                    TraversalObserver traversal_observer) {
   37|  2.64k|    corner_table_ = corner_table;
   38|  2.64k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.64k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.64k|    traversal_observer_ = traversal_observer;
   41|  2.64k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.35M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.35M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.35M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.35M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.35M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  33.5M|  inline const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.78M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.78M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.78M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.78M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.78M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  10.1M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  10.1M|    return is_vertex_visited_[vert_id.value()];
   65|  10.1M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  9.81M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  9.81M|    is_vertex_visited_[vert_id.value()] = true;
   68|  9.81M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  13.6M|  inline TraversalObserverT& traversal_observer() {
   75|  13.6M|    return traversal_observer_;
   76|  13.6M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  10.2M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  10.2M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 6.37M, False: 3.85M]
  ------------------
   47|  6.37M|      return true;  // Invalid faces are always considered as visited.
   48|  6.37M|    }
   49|  3.85M|    return is_face_visited_[face_id.value()];
   50|  10.2M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.78M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.78M|    is_face_visited_[face_id.value()] = true;
   62|  3.78M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  4.72k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.36k|                    TraversalObserver traversal_observer) {
   37|  2.36k|    corner_table_ = corner_table;
   38|  2.36k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.36k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.36k|    traversal_observer_ = traversal_observer;
   41|  2.36k|  }

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

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

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

_ZN5draco18MostSignificantBitEj:
   58|  1.04k|inline int MostSignificantBit(uint32_t n) {
   59|  1.04k|#if defined(__GNUC__)
   60|  1.04k|  return 31 ^ __builtin_clz(n);
   61|       |#elif defined(_MSC_VER)
   62|       |
   63|       |  unsigned long where;
   64|       |  _BitScanReverse(&where, n);
   65|       |  return (int)where;
   66|       |#else
   67|       |  uint32_t msb = 0;
   68|       |  if (n) {
   69|       |    if (0xFFFF0000 & n) {
   70|       |      n >>= (1 << 4);
   71|       |      msb |= (1 << 4);
   72|       |    }
   73|       |    if (0x0000FF00 & n) {
   74|       |      n >>= (1 << 3);
   75|       |      msb |= (1 << 3);
   76|       |    }
   77|       |    if (0x000000F0 & n) {
   78|       |      n >>= (1 << 2);
   79|       |      msb |= (1 << 2);
   80|       |    }
   81|       |    if (0x0000000C & n) {
   82|       |      n >>= (1 << 1);
   83|       |      msb |= (1 << 1);
   84|       |    }
   85|       |    if (0x00000002 & n) {
   86|       |      msb |= (1 << 0);
   87|       |    }
   88|       |  } else {
   89|       |    msb = -1;
   90|       |  }
   91|       |  return msb;
   92|       |#endif
   93|  1.04k|}
_ZN5draco24ConvertSymbolToSignedIntIjEENSt3__111make_signedIT_E4typeES3_:
  127|  1.36G|    IntTypeT val) {
  128|  1.36G|  static_assert(std::is_integral<IntTypeT>::value, "IntTypeT is not integral.");
  129|  1.36G|  typedef typename std::make_signed<IntTypeT>::type SignedType;
  130|  1.36G|  const bool is_positive = !static_cast<bool>(val & 1);
  131|  1.36G|  val >>= 1;
  132|  1.36G|  if (is_positive) {
  ------------------
  |  Branch (132:7): [True: 1.12G, False: 242M]
  ------------------
  133|  1.12G|    return static_cast<SignedType>(val);
  134|  1.12G|  }
  135|   242M|  SignedType ret = static_cast<SignedType>(val);
  136|   242M|  ret = -ret - 1;
  137|   242M|  return ret;
  138|  1.36G|}

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  67.0M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t* out_value) {
   58|  67.0M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 67.0M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  67.0M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  67.0M|  }
_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: 332, False: 1.09G]
  ------------------
   78|    332|      return false;  // Buffer overflow.
   79|    332|    }
   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|  37.2k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  11.0k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  54.2k|  const char* data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   266k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  7.56k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  67.1M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  5.14M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  9.42k|    void reset(const void* b, size_t s) {
  131|  9.42k|      bit_offset_ = 0;
  132|  9.42k|      bit_buffer_ = static_cast<const uint8_t*>(b);
  133|  9.42k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  9.42k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  8.27k|    uint64_t BitsDecoded() const { return static_cast<uint64_t>(bit_offset_); }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  158|  67.0M|    bool GetBits(uint32_t nbits, uint32_t* x) {
  159|  67.0M|      if (nbits > 32) {
  ------------------
  |  Branch (159:11): [True: 3, False: 67.0M]
  ------------------
  160|      3|        return false;
  161|      3|      }
  162|  67.0M|      uint32_t value = 0;
  163|   151M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (163:30): [True: 84.5M, False: 67.0M]
  ------------------
  164|  84.5M|        value |= GetBit() << bit;
  165|  84.5M|      }
  166|  67.0M|      *x = value;
  167|  67.0M|      return true;
  168|  67.0M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  173|  84.5M|    int GetBit() {
  174|  84.5M|      const size_t off = bit_offset_;
  175|  84.5M|      const size_t byte_offset = off >> 3;
  176|  84.5M|      const int bit_shift = static_cast<int>(off & 0x7);
  177|  84.5M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (177:11): [True: 76.8M, False: 7.74M]
  ------------------
  178|  76.8M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  179|  76.8M|        bit_offset_ = off + 1;
  180|  76.8M|        return bit;
  181|  76.8M|      }
  182|  7.74M|      return 0;
  183|  84.5M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  22.9M|  bool Decode(T* out_val) {
   69|  22.9M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2.85k, False: 22.9M]
  ------------------
   70|  2.85k|      return false;
   71|  2.85k|    }
   72|  22.9M|    pos_ += sizeof(T);
   73|  22.9M|    return true;
   74|  22.9M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  22.9M|  bool Peek(T* out_val) {
   88|  22.9M|    const size_t size_to_decode = sizeof(T);
   89|  22.9M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2.85k, False: 22.9M]
  ------------------
   90|  2.85k|      return false;  // Buffer overflow.
   91|  2.85k|    }
   92|  22.9M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  22.9M|    return true;
   94|  22.9M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  17.5k|  bool Decode(T* out_val) {
   69|  17.5k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 132, False: 17.4k]
  ------------------
   70|    132|      return false;
   71|    132|    }
   72|  17.4k|    pos_ += sizeof(T);
   73|  17.4k|    return true;
   74|  17.5k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  17.5k|  bool Peek(T* out_val) {
   88|  17.5k|    const size_t size_to_decode = sizeof(T);
   89|  17.5k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 132, False: 17.4k]
  ------------------
   90|    132|      return false;  // Buffer overflow.
   91|    132|    }
   92|  17.4k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  17.4k|    return true;
   94|  17.5k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   776k|  bool Decode(T* out_val) {
   69|   776k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 169, False: 776k]
  ------------------
   70|    169|      return false;
   71|    169|    }
   72|   776k|    pos_ += sizeof(T);
   73|   776k|    return true;
   74|   776k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   776k|  bool Peek(T* out_val) {
   88|   776k|    const size_t size_to_decode = sizeof(T);
   89|   776k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 169, False: 776k]
  ------------------
   90|    169|      return false;  // Buffer overflow.
   91|    169|    }
   92|   776k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   776k|    return true;
   94|   776k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  32.1k|  bool Decode(T* out_val) {
   69|  32.1k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 108, False: 32.0k]
  ------------------
   70|    108|      return false;
   71|    108|    }
   72|  32.0k|    pos_ += sizeof(T);
   73|  32.0k|    return true;
   74|  32.1k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  32.1k|  bool Peek(T* out_val) {
   88|  32.1k|    const size_t size_to_decode = sizeof(T);
   89|  32.1k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 108, False: 32.0k]
  ------------------
   90|    108|      return false;  // Buffer overflow.
   91|    108|    }
   92|  32.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  32.0k|    return true;
   94|  32.1k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|  2.53M|  bool Decode(T* out_val) {
   69|  2.53M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 139, False: 2.53M]
  ------------------
   70|    139|      return false;
   71|    139|    }
   72|  2.53M|    pos_ += sizeof(T);
   73|  2.53M|    return true;
   74|  2.53M|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|  2.53M|  bool Peek(T* out_val) {
   88|  2.53M|    const size_t size_to_decode = sizeof(T);
   89|  2.53M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 139, False: 2.53M]
  ------------------
   90|    139|      return false;  // Buffer overflow.
   91|    139|    }
   92|  2.53M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.53M|    return true;
   94|  2.53M|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  85.2k|  bool Decode(T* out_val) {
   69|  85.2k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 10, False: 85.2k]
  ------------------
   70|     10|      return false;
   71|     10|    }
   72|  85.2k|    pos_ += sizeof(T);
   73|  85.2k|    return true;
   74|  85.2k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  85.2k|  bool Peek(T* out_val) {
   88|  85.2k|    const size_t size_to_decode = sizeof(T);
   89|  85.2k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 10, False: 85.2k]
  ------------------
   90|     10|      return false;  // Buffer overflow.
   91|     10|    }
   92|  85.2k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  85.2k|    return true;
   94|  85.2k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  2.16k|  bool Decode(T* out_val) {
   69|  2.16k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 10, False: 2.15k]
  ------------------
   70|     10|      return false;
   71|     10|    }
   72|  2.15k|    pos_ += sizeof(T);
   73|  2.15k|    return true;
   74|  2.16k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  2.16k|  bool Peek(T* out_val) {
   88|  2.16k|    const size_t size_to_decode = sizeof(T);
   89|  2.16k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 10, False: 2.15k]
  ------------------
   90|     10|      return false;  // Buffer overflow.
   91|     10|    }
   92|  2.15k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.15k|    return true;
   94|  2.16k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    146|  bool Decode(T* out_val) {
   69|    146|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 15, False: 131]
  ------------------
   70|     15|      return false;
   71|     15|    }
   72|    131|    pos_ += sizeof(T);
   73|    131|    return true;
   74|    146|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    146|  bool Peek(T* out_val) {
   88|    146|    const size_t size_to_decode = sizeof(T);
   89|    146|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 15, False: 131]
  ------------------
   90|     15|      return false;  // Buffer overflow.
   91|     15|    }
   92|    131|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    131|    return true;
   94|    146|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   120M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   132M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  11.2M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|  11.2M|    return value_ >= val;
  100|  11.2M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   337M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  4.36G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  28.1M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   119M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|   119M|    value_ = i.value_;
  153|   119M|    return *this;
  154|   119M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   127M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|   127M|    value_ = i.value_;
  153|   127M|    return *this;
  154|   127M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  28.0M|  inline ThisIndexType& operator++() {
  103|  28.0M|    ++value_;
  104|  28.0M|    return *this;
  105|  28.0M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  3.19G|  constexpr bool operator==(const IndexType& i) const {
   76|  3.19G|    return value_ == i.value_;
   77|  3.19G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|  1.27G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  3.85k|  constexpr bool operator<(const IndexType& i) const {
   88|  3.85k|    return value_ < i.value_;
   89|  3.85k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   161M|  constexpr bool operator==(const IndexType& i) const {
   76|   161M|    return value_ == i.value_;
   77|   161M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   239M|  constexpr ThisIndexType operator-(const ValueTypeT& val) const {
  132|   239M|    return ThisIndexType(value_ - val);
  133|   239M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|  1.01G|  constexpr ThisIndexType operator+(const ValueTypeT& val) const {
  126|  1.01G|    return ThisIndexType(value_ + val);
  127|  1.01G|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  25.8M|  constexpr bool operator==(const IndexType& i) const {
   76|  25.8M|    return value_ == i.value_;
   77|  25.8M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   356M|  constexpr bool operator!=(const IndexType& i) const {
   82|   356M|    return value_ != i.value_;
   83|   356M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   483M|  constexpr bool operator!=(const IndexType& i) const {
   82|   483M|    return value_ != i.value_;
   83|   483M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   675M|  inline ThisIndexType& operator++() {
  103|   675M|    ++value_;
  104|   675M|    return *this;
  105|   675M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   614M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|   614M|    value_ = i.value_;
  153|   614M|    return *this;
  154|   614M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|  1.50G|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  1.50G|    value_ = i.value_;
  153|  1.50G|    return *this;
  154|  1.50G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  50.3M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|  50.3M|    return value_ >= val;
  100|  50.3M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  11.2M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.52G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  21.4G|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   265M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  14.7G|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   356M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  24.8M|  constexpr ThisIndexType operator+(const ValueTypeT& val) const {
  126|  24.8M|    return ThisIndexType(value_ + val);
  127|  24.8M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   233M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  33.3M|  constexpr bool operator<(const IndexType& i) const {
   88|  33.3M|    return value_ < i.value_;
   89|  33.3M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   274M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   127M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  79.4M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|  96.7M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   370M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  6.25M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  6.25M|    value_ = i.value_;
  153|  6.25M|    return *this;
  154|  6.25M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  11.2M|  inline ThisIndexType operator+=(const ValueTypeT& val) {
  140|  11.2M|    value_ += val;
  141|  11.2M|    return *this;
  142|  11.2M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  34.0M|  inline ThisIndexType& operator=(const ValueTypeT& val) {
  156|  34.0M|    value_ = val;
  157|  34.0M|    return *this;
  158|  34.0M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|  93.4M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  9.16M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  9.15M|  inline ThisIndexType& operator++() {
  103|  9.15M|    ++value_;
  104|  9.15M|    return *this;
  105|  9.15M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  31.8M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  31.8M|  inline ThisIndexType& operator++() {
  103|  31.8M|    ++value_;
  104|  31.8M|    return *this;
  105|  31.8M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  49.9M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  49.9M|    return vector_[index.value()];
   75|  49.9M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  31.8M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  14.0k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  31.4k|  void resize(size_t size, const ValueTypeT& val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  82.2M|  inline reference operator[](const IndexTypeT& index) {
   71|  82.2M|    return vector_[index.value()];
   72|  82.2M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  70.9k|  void push_back(const ValueTypeT& val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  22.6M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  5.24k|  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.2M|  inline reference operator[](const IndexTypeT& index) {
   71|  11.2M|    return vector_[index.value()];
   72|  11.2M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  29.5M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  29.5M|    return vector_[index.value()];
   75|  29.5M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   290M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  15.0M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   426M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|   426M|    return vector_[index.value()];
   75|   426M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|  1.13G|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  1.13G|    return vector_[index.value()];
   75|  1.13G|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   562M|  inline reference operator[](const IndexTypeT& index) {
   71|   562M|    return vector_[index.value()];
   72|   562M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  78.5M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  78.5M|    return vector_[index.value()];
   75|  78.5M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   467M|  inline reference operator[](const IndexTypeT& index) {
   71|   467M|    return vector_[index.value()];
   72|   467M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   150M|  void push_back(const ValueTypeT& val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   329M|  inline reference operator[](const IndexTypeT& index) {
   71|   329M|    return vector_[index.value()];
   72|   329M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  3.40k|  void resize(size_t size, const ValueTypeT& val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   320M|  inline reference operator[](const IndexTypeT& index) {
   71|   320M|    return vector_[index.value()];
   72|   320M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  80.0k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  3.36M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  75.1k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  8.01k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  8.01k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  8.01k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  8.01k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  20.8k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  20.8k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT>& arg) {
   56|  20.8k|    vector_.swap(arg.vector_);
   57|  20.8k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  20.8k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  20.8k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT>& arg) {
   56|  20.8k|    vector_.swap(arg.vector_);
   57|  20.8k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  8.01k|  void assign(size_t size, const ValueTypeT& val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  8.01k|  void assign(size_t size, const ValueTypeT& val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  8.01k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  11.0k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  77.8k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|   117k|int32_t DataTypeLength(DataType dt) {
   20|   117k|  switch (dt) {
   21|  64.2k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 64.2k, False: 52.9k]
  ------------------
   22|  67.5k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.31k, False: 113k]
  ------------------
   23|  67.5k|      return 1;
   24|  1.59k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 1.59k, False: 115k]
  ------------------
   25|  2.01k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 416, False: 116k]
  ------------------
   26|  2.01k|      return 2;
   27|  40.9k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 40.9k, False: 76.2k]
  ------------------
   28|  41.4k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 484, False: 116k]
  ------------------
   29|  41.4k|      return 4;
   30|  1.00k|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 1.00k, False: 116k]
  ------------------
   31|  1.83k|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 823, False: 116k]
  ------------------
   32|  1.83k|      return 8;
   33|  3.71k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.71k, False: 113k]
  ------------------
   34|  3.71k|      return 4;
   35|    470|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 470, False: 116k]
  ------------------
   36|    470|      return 8;
   37|    176|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 176, False: 117k]
  ------------------
   38|    176|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 117k]
  ------------------
   40|      0|      return -1;
   41|   117k|  }
   42|   117k|}

_ZN5draco13AddAsUnsignedIiTnPNSt3__19enable_ifIXaasr3std11is_integralIT_EE5valuesr3std9is_signedIS3_EE5valueEvE4typeELPv0EEES3_S3_S3_:
   14|   182M|inline DataTypeT AddAsUnsigned(DataTypeT a, DataTypeT b) {
   15|   182M|  typedef typename std::make_unsigned<DataTypeT>::type DataTypeUT;
   16|   182M|  return static_cast<DataTypeT>(static_cast<DataTypeUT>(a) +
   17|   182M|                                static_cast<DataTypeUT>(b));
   18|   182M|}

_ZN5draco7IntSqrtEm:
   31|  1.17k|inline uint64_t IntSqrt(uint64_t number) {
   32|  1.17k|  if (number == 0) {
  ------------------
  |  Branch (32:7): [True: 165, False: 1.00k]
  ------------------
   33|    165|    return 0;
   34|    165|  }
   35|       |  // First estimate good initial value of the square root as log2(number).
   36|  1.00k|  uint64_t act_number = number;
   37|  1.00k|  uint64_t square_root = 1;
   38|  16.2k|  while (act_number >= 2) {
  ------------------
  |  Branch (38:10): [True: 15.2k, False: 1.00k]
  ------------------
   39|       |    // Double the square root until |square_root * square_root > number|.
   40|  15.2k|    square_root *= 2;
   41|  15.2k|    act_number /= 4;
   42|  15.2k|  }
   43|       |  // Perform Newton's (or Babylonian) method to find the true floor(sqrt()).
   44|  2.52k|  do {
   45|       |    // New |square_root| estimate is computed as the average between
   46|       |    // |square_root| and |number / square_root|.
   47|  2.52k|    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|  2.52k|  } while (square_root * square_root > number);
  ------------------
  |  Branch (53:12): [True: 1.51k, False: 1.00k]
  ------------------
   54|  1.00k|  return square_root;
   55|  1.17k|}

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

_ZN5draco7OptionsC2Ev:
   32|  11.0k|  Options() = default;
_ZN5draco7OptionsD2Ev:
   33|  11.0k|  ~Options() = default;

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

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

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

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

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   629k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|   629k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 629k, Folded]
  ------------------
   65|   629k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.06k, False: 628k]
  ------------------
   66|  1.06k|      return false;
   67|  1.06k|    }
   68|   629k|  } 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|   628k|  return true;
   77|   629k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   283k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|   283k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   283k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 122, False: 283k]
  ------------------
   33|    122|    return false;
   34|    122|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   283k|  uint8_t in;
   39|   283k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 602, False: 282k]
  ------------------
   40|    602|    return false;
   41|    602|  }
   42|   282k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 18.8k, False: 264k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  18.8k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 661, False: 18.1k]
  ------------------
   45|    661|      return false;
   46|    661|    }
   47|       |    // Append decoded info from this byte.
   48|  18.1k|    *out_val <<= 7;
   49|  18.1k|    *out_val |= in & ((1 << 7) - 1);
   50|   264k|  } else {
   51|       |    // Last byte reached
   52|   264k|    *out_val = in;
   53|   264k|  }
   54|   282k|  return true;
   55|   282k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  7.17k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  7.17k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.17k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 7.16k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.16k|  uint8_t in;
   39|  7.16k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 3, False: 7.16k]
  ------------------
   40|      3|    return false;
   41|      3|  }
   42|  7.16k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.17k, False: 5.99k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.17k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 12, False: 1.16k]
  ------------------
   45|     12|      return false;
   46|     12|    }
   47|       |    // Append decoded info from this byte.
   48|  1.16k|    *out_val <<= 7;
   49|  1.16k|    *out_val |= in & ((1 << 7) - 1);
   50|  5.99k|  } else {
   51|       |    // Last byte reached
   52|  5.99k|    *out_val = in;
   53|  5.99k|  }
   54|  7.15k|  return true;
   55|  7.16k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  7.70k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|  7.70k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 7.70k, Folded]
  ------------------
   65|  7.70k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 164, False: 7.54k]
  ------------------
   66|    164|      return false;
   67|    164|    }
   68|  7.70k|  } 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.54k|  return true;
   77|  7.70k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.57k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  4.57k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.57k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 4.57k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.57k|  uint8_t in;
   39|  4.57k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 13, False: 4.56k]
  ------------------
   40|     13|    return false;
   41|     13|  }
   42|  4.56k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 66, False: 4.50k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     66|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 1, False: 65]
  ------------------
   45|      1|      return false;
   46|      1|    }
   47|       |    // Append decoded info from this byte.
   48|     65|    *out_val <<= 7;
   49|     65|    *out_val |= in & ((1 << 7) - 1);
   50|  4.50k|  } else {
   51|       |    // Last byte reached
   52|  4.50k|    *out_val = in;
   53|  4.50k|  }
   54|  4.56k|  return true;
   55|  4.56k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   248k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|   248k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   248k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 19, False: 248k]
  ------------------
   33|     19|    return false;
   34|     19|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   248k|  uint8_t in;
   39|   248k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 73, False: 248k]
  ------------------
   40|     73|    return false;
   41|     73|  }
   42|   248k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.59k, False: 247k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.59k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 103, False: 1.49k]
  ------------------
   45|    103|      return false;
   46|    103|    }
   47|       |    // Append decoded info from this byte.
   48|  1.49k|    *out_val <<= 7;
   49|  1.49k|    *out_val |= in & ((1 << 7) - 1);
   50|   247k|  } else {
   51|       |    // Last byte reached
   52|   247k|    *out_val = in;
   53|   247k|  }
   54|   248k|  return true;
   55|   248k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  6.39k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  6.39k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.39k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 6.39k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.39k|  uint8_t in;
   39|  6.39k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 38, False: 6.35k]
  ------------------
   40|     38|    return false;
   41|     38|  }
   42|  6.35k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 871, False: 5.48k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    871|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 13, False: 858]
  ------------------
   45|     13|      return false;
   46|     13|    }
   47|       |    // Append decoded info from this byte.
   48|    858|    *out_val <<= 7;
   49|    858|    *out_val |= in & ((1 << 7) - 1);
   50|  5.48k|  } else {
   51|       |    // Last byte reached
   52|  5.48k|    *out_val = in;
   53|  5.48k|  }
   54|  6.34k|  return true;
   55|  6.35k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  27.3k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  27.3k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  27.3k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 27.3k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  27.3k|  uint8_t in;
   39|  27.3k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 22, False: 27.3k]
  ------------------
   40|     22|    return false;
   41|     22|  }
   42|  27.3k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 387, False: 26.9k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    387|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 28, False: 359]
  ------------------
   45|     28|      return false;
   46|     28|    }
   47|       |    // Append decoded info from this byte.
   48|    359|    *out_val <<= 7;
   49|    359|    *out_val |= in & ((1 << 7) - 1);
   50|  26.9k|  } else {
   51|       |    // Last byte reached
   52|  26.9k|    *out_val = in;
   53|  26.9k|  }
   54|  27.3k|  return true;
   55|  27.3k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  8.07k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  8.07k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.07k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 98, False: 7.97k]
  ------------------
   33|     98|    return false;
   34|     98|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.97k|  uint8_t in;
   39|  7.97k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 57, False: 7.91k]
  ------------------
   40|     57|    return false;
   41|     57|  }
   42|  7.91k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.13k, False: 5.78k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.13k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 527, False: 1.60k]
  ------------------
   45|    527|      return false;
   46|    527|    }
   47|       |    // Append decoded info from this byte.
   48|  1.60k|    *out_val <<= 7;
   49|  1.60k|    *out_val |= in & ((1 << 7) - 1);
   50|  5.78k|  } else {
   51|       |    // Last byte reached
   52|  5.78k|    *out_val = in;
   53|  5.78k|  }
   54|  7.39k|  return true;
   55|  7.91k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  5.66k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  5.66k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  5.66k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 114, False: 5.54k]
  ------------------
   33|    114|    return false;
   34|    114|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  5.54k|  uint8_t in;
   39|  5.54k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 37, False: 5.50k]
  ------------------
   40|     37|    return false;
   41|     37|  }
   42|  5.50k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.46k, False: 3.04k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.46k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 1.20k, False: 1.26k]
  ------------------
   45|  1.20k|      return false;
   46|  1.20k|    }
   47|       |    // Append decoded info from this byte.
   48|  1.26k|    *out_val <<= 7;
   49|  1.26k|    *out_val |= in & ((1 << 7) - 1);
   50|  3.04k|  } else {
   51|       |    // Last byte reached
   52|  3.04k|    *out_val = in;
   53|  3.04k|  }
   54|  4.30k|  return true;
   55|  5.50k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  75.4k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  75.4k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  75.4k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 75.4k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  75.4k|  uint8_t in;
   39|  75.4k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 15, False: 75.4k]
  ------------------
   40|     15|    return false;
   41|     15|  }
   42|  75.4k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.55k, False: 72.9k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.55k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 30, False: 2.52k]
  ------------------
   45|     30|      return false;
   46|     30|    }
   47|       |    // Append decoded info from this byte.
   48|  2.52k|    *out_val <<= 7;
   49|  2.52k|    *out_val |= in & ((1 << 7) - 1);
   50|  72.9k|  } else {
   51|       |    // Last byte reached
   52|  72.9k|    *out_val = in;
   53|  72.9k|  }
   54|  75.4k|  return true;
   55|  75.4k|}

_ZN5draco7VectorDIfLi3EEC2Ev:
   42|  31.6k|  VectorD() {
   43|   126k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 95.0k, False: 31.6k]
  ------------------
   44|  95.0k|      (*this)[i] = Scalar(0);
   45|  95.0k|    }
   46|  31.6k|  }
_ZN5draco7VectorDIfLi3EEixEi:
  114|   154k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEixEi:
  115|   125k|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEixEi:
  115|   127M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  139|  14.1M|  Self operator-(const Self& o) const {
  140|  14.1M|    Self ret;
  141|  56.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 42.4M, False: 14.1M]
  ------------------
  142|  42.4M|      ret[i] = (*this)[i] - o[i];
  143|  42.4M|    }
  144|  14.1M|    return ret;
  145|  14.1M|  }
_ZN5draco12CrossProductIlTnPNSt3__19enable_ifIXaasr3std11is_integralIT_EE5valuesr3std9is_signedIS3_EE5valueEvE4typeELPv0EEENS_7VectorDIS3_Li3EEERKS9_SB_:
  325|  7.07M|                                 const VectorD<ScalarT, 3>& v) {
  326|       |  // Preventing accidental use with uint32_t and the like.
  327|  7.07M|  static_assert(std::is_signed<ScalarT>::value,
  328|  7.07M|                "ScalarT must be a signed type. ");
  329|  7.07M|  VectorD<ScalarT, 3> r;
  330|  7.07M|  typedef typename std::make_unsigned<ScalarT>::type ScalarUT;
  331|  7.07M|  const ScalarUT u0 = static_cast<ScalarUT>(u[0]);
  332|  7.07M|  const ScalarUT u1 = static_cast<ScalarUT>(u[1]);
  333|  7.07M|  const ScalarUT u2 = static_cast<ScalarUT>(u[2]);
  334|  7.07M|  const ScalarUT v0 = static_cast<ScalarUT>(v[0]);
  335|  7.07M|  const ScalarUT v1 = static_cast<ScalarUT>(v[1]);
  336|  7.07M|  const ScalarUT v2 = static_cast<ScalarUT>(v[2]);
  337|  7.07M|  r[0] = static_cast<ScalarT>((u1 * v2) - (u2 * v1));
  338|  7.07M|  r[1] = static_cast<ScalarT>((u2 * v0) - (u0 * v2));
  339|  7.07M|  r[2] = static_cast<ScalarT>((u0 * v1) - (u1 * v0));
  340|  7.07M|  return r;
  341|  7.07M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  284|  7.07M|  Scalar* data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  285|  7.07M|  const Scalar* data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  239|  3.93M|  Scalar AbsSum() const {
  240|  3.93M|    Scalar result(0);
  241|  15.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (241:21): [True: 11.8M, False: 3.93M]
  ------------------
  242|  11.8M|      Scalar next_value = std::abs(v_[i]);
  243|  11.8M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (243:11): [True: 7.69k, False: 11.8M]
  ------------------
  244|       |        // Return the max if adding would have caused an overflow.
  245|  7.69k|        return std::numeric_limits<Scalar>::max();
  246|  7.69k|      }
  247|  11.8M|      result += next_value;
  248|  11.8M|    }
  249|  3.93M|    return result;
  250|  3.93M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  184|   175k|  Self operator/(const Scalar& o) const {
  185|   175k|    Self ret;
  186|   701k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (186:21): [True: 526k, False: 175k]
  ------------------
  187|   526k|      ret[i] = (*this)[i] / o;
  188|   526k|    }
  189|   175k|    return ret;
  190|   175k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  114|   224M|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  114|  19.1M|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  284|  11.8M|  Scalar* data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  122|  3.19M|  Self operator-() const {
  123|  3.19M|    Self ret;
  124|  12.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (124:21): [True: 9.59M, False: 3.19M]
  ------------------
  125|  9.59M|      ret[i] = -(*this)[i];
  126|  9.59M|    }
  127|  3.19M|    return ret;
  128|  3.19M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  115|  9.59M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  139|  1.61M|  Self operator-(const Self& o) const {
  140|  1.61M|    Self ret;
  141|  4.84M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 3.23M, False: 1.61M]
  ------------------
  142|  3.23M|      ret[i] = (*this)[i] - o[i];
  143|  3.23M|    }
  144|  1.61M|    return ret;
  145|  1.61M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  114|  19.3M|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  115|  29.0M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  114|   113M|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  131|  3.23M|  Self operator+(const Self& o) const {
  132|  3.23M|    Self ret;
  133|  9.69M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 6.46M, False: 3.23M]
  ------------------
  134|  6.46M|      ret[i] = (*this)[i] + o[i];
  135|  6.46M|    }
  136|  3.23M|    return ret;
  137|  3.23M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  115|  92.9M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  139|  3.71M|  Self operator-(const Self& o) const {
  140|  3.71M|    Self ret;
  141|  11.1M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 7.42M, False: 3.71M]
  ------------------
  142|  7.42M|      ret[i] = (*this)[i] - o[i];
  143|  7.42M|    }
  144|  3.71M|    return ret;
  145|  3.71M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  131|  3.71M|  Self operator+(const Self& o) const {
  132|  3.71M|    Self ret;
  133|  11.1M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 7.42M, False: 3.71M]
  ------------------
  134|  7.42M|      ret[i] = (*this)[i] + o[i];
  135|  7.42M|    }
  136|  3.71M|    return ret;
  137|  3.71M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  208|   293k|  bool operator==(const Self& o) const {
  209|   870k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (209:21): [True: 582k, False: 287k]
  ------------------
  210|   582k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (210:11): [True: 6.00k, False: 576k]
  ------------------
  211|  6.00k|        return false;
  212|  6.00k|      }
  213|   582k|    }
  214|   287k|    return true;
  215|   293k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  115|  3.52M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  139|  12.8k|  Self operator-(const Self& o) const {
  140|  12.8k|    Self ret;
  141|  51.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 38.5k, False: 12.8k]
  ------------------
  142|  38.5k|      ret[i] = (*this)[i] - o[i];
  143|  38.5k|    }
  144|  12.8k|    return ret;
  145|  12.8k|  }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  236|  6.83k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  252|  7.67k|  Scalar Dot(const Self& o) const {
  253|  7.67k|    Scalar ret(0);
  254|  30.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (254:21): [True: 23.0k, False: 7.67k]
  ------------------
  255|  23.0k|      ret += (*this)[i] * o[i];
  256|  23.0k|    }
  257|  7.67k|    return ret;
  258|  7.67k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  176|    834|  Self operator*(const Scalar& o) const {
  177|    834|    Self ret;
  178|  3.33k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 2.50k, False: 834]
  ------------------
  179|  2.50k|      ret[i] = (*this)[i] * o;
  180|  2.50k|    }
  181|    834|    return ret;
  182|    834|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  139|  6.00k|  Self operator-(const Self& o) const {
  140|  6.00k|    Self ret;
  141|  18.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 12.0k, False: 6.00k]
  ------------------
  142|  12.0k|      ret[i] = (*this)[i] - o[i];
  143|  12.0k|    }
  144|  6.00k|    return ret;
  145|  6.00k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   42|  12.0k|  VectorD() {
   43|  36.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 24.0k, False: 12.0k]
  ------------------
   44|  24.0k|      (*this)[i] = Scalar(0);
   45|  24.0k|    }
   46|  12.0k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   54|   593k|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|   593k|    DRACO_DCHECK_EQ(dimension, 2);
   56|   593k|    v_[0] = c0;
   57|   593k|    v_[1] = c1;
   58|   593k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  114|  47.8k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  208|   293k|  bool operator==(const Self& o) const {
  209|   872k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (209:21): [True: 582k, False: 289k]
  ------------------
  210|   582k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (210:11): [True: 4.16k, False: 578k]
  ------------------
  211|  4.16k|        return false;
  212|  4.16k|      }
  213|   582k|    }
  214|   289k|    return true;
  215|   293k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  115|  1.77M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   42|  43.4M|  VectorD() {
   43|   173M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 130M, False: 43.4M]
  ------------------
   44|   130M|      (*this)[i] = Scalar(0);
   45|   130M|    }
   46|  43.4M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  236|  5.33k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  252|  6.70k|  Scalar Dot(const Self& o) const {
  253|  6.70k|    Scalar ret(0);
  254|  26.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (254:21): [True: 20.1k, False: 6.70k]
  ------------------
  255|  20.1k|      ret += (*this)[i] * o[i];
  256|  20.1k|    }
  257|  6.70k|    return ret;
  258|  6.70k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  139|  1.37k|  Self operator-(const Self& o) const {
  140|  1.37k|    Self ret;
  141|  4.11k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 2.74k, False: 1.37k]
  ------------------
  142|  2.74k|      ret[i] = (*this)[i] - o[i];
  143|  2.74k|    }
  144|  1.37k|    return ret;
  145|  1.37k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  104|  4.50k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  13.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 9.00k, False: 4.50k]
  ------------------
  106|  9.00k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 9.00k, False: 0]
  ------------------
  107|  9.00k|        v_[i] = Scalar(src_vector[i]);
  108|  9.00k|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|  9.00k|    }
  112|  4.50k|  }
_ZNK5draco7VectorDImLi2EEmlERKm:
  176|  2.42k|  Self operator*(const Scalar& o) const {
  177|  2.42k|    Self ret;
  178|  7.27k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 4.84k, False: 2.42k]
  ------------------
  179|  4.84k|      ret[i] = (*this)[i] * o;
  180|  4.84k|    }
  181|  2.42k|    return ret;
  182|  2.42k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   42|  4.67k|  VectorD() {
   43|  14.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 9.35k, False: 4.67k]
  ------------------
   44|  9.35k|      (*this)[i] = Scalar(0);
   45|  9.35k|    }
   46|  4.67k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  115|  18.3k|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  114|  18.7k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  131|  1.78k|  Self operator+(const Self& o) const {
  132|  1.78k|    Self ret;
  133|  5.34k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 3.56k, False: 1.78k]
  ------------------
  134|  3.56k|      ret[i] = (*this)[i] + o[i];
  135|  3.56k|    }
  136|  1.78k|    return ret;
  137|  1.78k|  }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  104|  2.25k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  6.75k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 4.50k, False: 2.25k]
  ------------------
  106|  4.50k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 4.50k, False: 0]
  ------------------
  107|  4.50k|        v_[i] = Scalar(src_vector[i]);
  108|  4.50k|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|  4.50k|    }
  112|  2.25k|  }
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  131|  1.17k|  Self operator+(const Self& o) const {
  132|  1.17k|    Self ret;
  133|  4.69k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 3.51k, False: 1.17k]
  ------------------
  134|  3.51k|      ret[i] = (*this)[i] + o[i];
  135|  3.51k|    }
  136|  1.17k|    return ret;
  137|  1.17k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  294|  1.17k|    const ScalarT& o, const VectorD<ScalarT, dimension_t>& v) {
  295|  1.17k|  return v * o;
  296|  1.17k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  176|  1.17k|  Self operator*(const Scalar& o) const {
  177|  1.17k|    Self ret;
  178|  4.69k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 3.51k, False: 1.17k]
  ------------------
  179|  3.51k|      ret[i] = (*this)[i] * o;
  180|  3.51k|    }
  181|  1.17k|    return ret;
  182|  1.17k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   54|   587k|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|   587k|    DRACO_DCHECK_EQ(dimension, 2);
   56|   587k|    v_[0] = c0;
   57|   587k|    v_[1] = c1;
   58|   587k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  176|  1.17k|  Self operator*(const Scalar& o) const {
  177|  1.17k|    Self ret;
  178|  3.51k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 2.34k, False: 1.17k]
  ------------------
  179|  2.34k|      ret[i] = (*this)[i] * o;
  180|  2.34k|    }
  181|  1.17k|    return ret;
  182|  1.17k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   42|  4.75k|  VectorD() {
   43|  14.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 9.51k, False: 4.75k]
  ------------------
   44|  9.51k|      (*this)[i] = Scalar(0);
   45|  9.51k|    }
   46|  4.75k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  184|  1.04k|  Self operator/(const Scalar& o) const {
  185|  1.04k|    Self ret;
  186|  3.12k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (186:21): [True: 2.08k, False: 1.04k]
  ------------------
  187|  2.08k|      ret[i] = (*this)[i] / o;
  188|  2.08k|    }
  189|  1.04k|    return ret;
  190|  1.04k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  139|    471|  Self operator-(const Self& o) const {
  140|    471|    Self ret;
  141|  1.41k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 942, False: 471]
  ------------------
  142|    942|      ret[i] = (*this)[i] - o[i];
  143|    942|    }
  144|    471|    return ret;
  145|    471|  }
_ZN5draco7VectorDIlLi2EEixEi:
  114|  18.7k|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   42|  3.20M|  VectorD() {
   43|  12.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 9.60M, False: 3.20M]
  ------------------
   44|  9.60M|      (*this)[i] = Scalar(0);
   45|  9.60M|    }
   46|  3.20M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   54|  19.8M|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|  19.8M|    DRACO_DCHECK_EQ(dimension, 2);
   56|  19.8M|    v_[0] = c0;
   57|  19.8M|    v_[1] = c1;
   58|  19.8M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  104|  9.69M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  29.0M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 19.3M, False: 9.69M]
  ------------------
  106|  19.3M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 19.3M, False: 0]
  ------------------
  107|  19.3M|        v_[i] = Scalar(src_vector[i]);
  108|  19.3M|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|  19.3M|    }
  112|  9.69M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   42|  4.84M|  VectorD() {
   43|  14.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 9.69M, False: 4.84M]
  ------------------
   44|  9.69M|      (*this)[i] = Scalar(0);
   45|  9.69M|    }
   46|  4.84M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  104|  4.84M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  14.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 9.69M, False: 4.84M]
  ------------------
  106|  9.69M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 9.69M, False: 0]
  ------------------
  107|  9.69M|        v_[i] = Scalar(src_vector[i]);
  108|  9.69M|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|  9.69M|    }
  112|  4.84M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   90|  12.8M|  VectorD(const Self& o) {
   91|  38.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (91:21): [True: 25.7M, False: 12.8M]
  ------------------
   92|  25.7M|      (*this)[i] = o[i];
   93|  25.7M|    }
   94|  12.8M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   42|  7.42M|  VectorD() {
   43|  22.2M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 14.8M, False: 7.42M]
  ------------------
   44|  14.8M|      (*this)[i] = Scalar(0);
   45|  14.8M|    }
   46|  7.42M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|   140M|  inline int num_vertices() const {
   74|   140M|    return static_cast<int>(vertex_corners_.size());
   75|   140M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  11.3M|  inline int num_corners() const {
   77|  11.3M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  11.3M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  3.75M|  inline int num_faces() const {
   80|  3.75M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  3.75M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   426M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   426M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 426M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   426M|    return opposite_corners_[corner];
   88|   426M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   696M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   696M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 20.8M, False: 675M]
  ------------------
   91|  20.8M|      return corner;
   92|  20.8M|    }
   93|   675M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 609M, False: 65.8M]
  ------------------
   94|   696M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   620M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   620M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 7.76M, False: 612M]
  ------------------
   97|  7.76M|      return corner;
   98|  7.76M|    }
   99|   612M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 173M, False: 439M]
  ------------------
  100|   620M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.13G|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|  1.13G|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1.13G]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|  1.13G|    return ConfidentVertex(corner);
  106|  1.13G|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  1.13G|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|  1.13G|    DRACO_DCHECK_GE(corner.value(), 0);
  109|  1.13G|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|  1.13G|    return corner_to_vertex_map_[corner];
  111|  1.13G|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  44.6M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  44.6M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 44.6M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  44.6M|    return FaceIndex(corner.value() / 3);
  117|  44.6M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|  1.28G|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  78.5M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  78.5M|    return vertex_corners_[v];
  152|  78.5M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.18M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.18M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.18M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 31.8k, False: 1.15M]
  ------------------
  188|  31.8k|      return true;
  189|  31.8k|    }
  190|  1.15M|    return false;
  191|  1.18M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  98.9M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  98.9M|    return Previous(Opposite(Previous(corner)));
  202|  98.9M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  15.4M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  15.4M|    return Next(Opposite(Next(corner)));
  207|  15.4M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  4.55M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  4.55M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 4.55M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  4.55M|    return Opposite(Previous(corner_id));
  222|  4.55M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  5.71M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  5.71M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 5.71M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  5.71M|    return Opposite(Next(corner_id));
  228|  5.71M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   467M|                                CornerIndex opp_corner_id) {
  249|   467M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   467M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   467M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   562M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   562M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   562M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   562M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|   150M|  VertexIndex AddNewVertex() {
  271|   150M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|   150M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|   150M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|   150M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   323M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   323M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   323M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 323M, False: 0]
  ------------------
  295|   323M|      vertex_corners_[vert] = corner;
  296|   323M|    }
  297|   323M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  5.56M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  5.56M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  5.56M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  5.56M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  3.53k|      : corner_table_(table),
  229|  3.53k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  3.53k|        corner_(start_corner_),
  231|  3.53k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  4.06M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  39.1k|  VertexCornersIterator& operator++() {
  268|  39.1k|    Next();
  269|  39.1k|    return *this;
  270|  39.1k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.46M|  void Next() {
  248|  3.46M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.41M, False: 51.3k]
  ------------------
  249|  3.41M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.41M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 28.4k, False: 3.38M]
  ------------------
  251|       |        // Open boundary reached.
  252|  28.4k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  28.4k|        left_traversal_ = false;
  254|  3.38M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 566k, False: 2.82M]
  ------------------
  255|       |        // End reached.
  256|   566k|        corner_ = kInvalidCornerIndex;
  257|   566k|      }
  258|  3.41M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  51.3k|      corner_ = corner_table_->SwingRight(corner_);
  262|  51.3k|    }
  263|  3.46M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  6.89M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  6.98M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  7.27M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  3.64M|  void Next() {
  248|  3.64M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.62M, False: 18.9k]
  ------------------
  249|  3.62M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.62M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 3.29M, False: 327k]
  ------------------
  251|       |        // Open boundary reached.
  252|  3.29M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  3.29M|        left_traversal_ = false;
  254|  3.29M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 52.6k, False: 275k]
  ------------------
  255|       |        // End reached.
  256|  52.6k|        corner_ = kInvalidCornerIndex;
  257|  52.6k|      }
  258|  3.62M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  18.9k|      corner_ = corner_table_->SwingRight(corner_);
  262|  18.9k|    }
  263|  3.64M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  3.34M|      : corner_table_(table),
  236|  3.34M|        start_corner_(corner_id),
  237|  3.34M|        corner_(start_corner_),
  238|  3.34M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   591k|      : corner_table_(table),
  236|   591k|        start_corner_(corner_id),
  237|   591k|        corner_(start_corner_),
  238|   591k|        left_traversal_(true) {}

_ZN5draco4MeshC2Ev:
   33|  11.0k|Mesh::Mesh() {}

_ZN5draco4Mesh7AddFaceERKNSt3__15arrayINS_9IndexTypeIjNS_20PointIndex_tag_type_EEELm3EEE:
   74|  70.9k|  void AddFace(const Face& face) { faces_.push_back(face); }
_ZN5draco4Mesh7SetFaceENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEERKNSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEE:
   76|  11.2M|  void SetFace(FaceIndex face_id, const Face& face) {
   77|  11.2M|    if (face_id >= static_cast<uint32_t>(faces_.size())) {
  ------------------
  |  Branch (77:9): [True: 0, False: 11.2M]
  ------------------
   78|      0|      faces_.resize(face_id.value() + 1, Face());
   79|      0|    }
   80|  11.2M|    faces_[face_id] = face;
   81|  11.2M|  }
_ZN5draco4Mesh11SetNumFacesEm:
   85|  5.24k|  void SetNumFaces(size_t num_faces) { faces_.resize(num_faces, Face()); }
_ZNK5draco4Mesh9num_facesEv:
   87|  11.3M|  FaceIndex::ValueType num_faces() const {
   88|  11.3M|    return static_cast<uint32_t>(faces_.size());
   89|  11.3M|  }
_ZNK5draco4Mesh4faceENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   90|  29.5M|  const Face& face(FaceIndex face_id) const {
   91|  29.5M|    DRACO_DCHECK_LE(0, face_id.value());
   92|  29.5M|    DRACO_DCHECK_LT(face_id.value(), static_cast<int>(faces_.size()));
   93|  29.5M|    return faces_[face_id];
   94|  29.5M|  }
_ZN5draco4Mesh12SetAttributeEiNSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   96|  64.8k|  void SetAttribute(int att_id, std::unique_ptr<PointAttribute> pa) override {
   97|  64.8k|    PointCloud::SetAttribute(att_id, std::move(pa));
   98|  64.8k|    if (static_cast<int>(attribute_data_.size()) <= att_id) {
  ------------------
  |  Branch (98:9): [True: 64.8k, False: 0]
  ------------------
   99|  64.8k|      attribute_data_.resize(att_id + 1);
  100|  64.8k|    }
  101|  64.8k|  }
_ZN5draco4Mesh13AttributeDataC2Ev:
  170|  64.8k|    AttributeData() : element_type(MESH_CORNER_ATTRIBUTE) {}

_ZN5draco24MeshAttributeCornerTableC2Ev:
   23|  46.3k|    : no_interior_seams_(true), corner_table_(nullptr), valence_cache_(*this) {}
_ZN5draco24MeshAttributeCornerTable9InitEmptyEPKNS_11CornerTableE:
   25|  12.8k|bool MeshAttributeCornerTable::InitEmpty(const CornerTable* table) {
   26|  12.8k|  if (table == nullptr) {
  ------------------
  |  Branch (26:7): [True: 0, False: 12.8k]
  ------------------
   27|      0|    return false;
   28|      0|  }
   29|  12.8k|  valence_cache_.ClearValenceCache();
   30|  12.8k|  valence_cache_.ClearValenceCacheInaccurate();
   31|  12.8k|  is_edge_on_seam_.assign(table->num_corners(), false);
   32|  12.8k|  is_vertex_on_seam_.assign(table->num_vertices(), false);
   33|  12.8k|  corner_to_vertex_map_.assign(table->num_corners(), kInvalidVertexIndex);
   34|  12.8k|  vertex_to_attribute_entry_id_map_.reserve(table->num_vertices());
   35|  12.8k|  vertex_to_left_most_corner_map_.reserve(table->num_vertices());
   36|  12.8k|  corner_table_ = table;
   37|  12.8k|  no_interior_seams_ = true;
   38|  12.8k|  return true;
   39|  12.8k|}
_ZN5draco24MeshAttributeCornerTable11AddSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  108|  22.5M|void MeshAttributeCornerTable::AddSeamEdge(CornerIndex c) {
  109|  22.5M|  DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  110|  22.5M|  is_edge_on_seam_[c.value()] = true;
  111|       |  // Mark seam vertices.
  112|  22.5M|  is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Next(c)).value()] =
  113|  22.5M|      true;
  114|  22.5M|  is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Previous(c))
  115|  22.5M|                         .value()] = true;
  116|       |
  117|  22.5M|  const CornerIndex opp_corner = corner_table_->Opposite(c);
  118|  22.5M|  if (opp_corner != kInvalidCornerIndex) {
  ------------------
  |  Branch (118:7): [True: 21.9M, False: 616k]
  ------------------
  119|  21.9M|    no_interior_seams_ = false;
  120|  21.9M|    is_edge_on_seam_[opp_corner.value()] = true;
  121|  21.9M|    is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Next(opp_corner))
  122|  21.9M|                           .value()] = true;
  123|  21.9M|    is_vertex_on_seam_
  124|  21.9M|        [corner_table_->Vertex(corner_table_->Previous(opp_corner)).value()] =
  125|  21.9M|            true;
  126|  21.9M|  }
  127|  22.5M|}
_ZN5draco24MeshAttributeCornerTable17RecomputeVerticesEPKNS_4MeshEPKNS_14PointAttributeE:
  130|  12.8k|                                                 const PointAttribute* att) {
  131|  12.8k|  DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  132|  12.8k|  if (mesh != nullptr && att != nullptr) {
  ------------------
  |  Branch (132:7): [True: 0, False: 12.8k]
  |  Branch (132:26): [True: 0, False: 0]
  ------------------
  133|      0|    return RecomputeVerticesInternal<true>(mesh, att);
  134|  12.8k|  } else {
  135|  12.8k|    return RecomputeVerticesInternal<false>(nullptr, nullptr);
  136|  12.8k|  }
  137|  12.8k|}
_ZN5draco24MeshAttributeCornerTable25RecomputeVerticesInternalILb0EEEbPKNS_4MeshEPKNS_14PointAttributeE:
  141|  12.8k|    const Mesh* mesh, const PointAttribute* att) {
  142|  12.8k|  DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  143|  12.8k|  vertex_to_attribute_entry_id_map_.clear();
  144|  12.8k|  vertex_to_left_most_corner_map_.clear();
  145|  12.8k|  int num_new_vertices = 0;
  146|  9.16M|  for (VertexIndex v(0); v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (146:26): [True: 9.15M, False: 12.8k]
  ------------------
  147|  9.15M|    const CornerIndex c = corner_table_->LeftMostCorner(v);
  148|  9.15M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (148:9): [True: 29.1k, False: 9.12M]
  ------------------
  149|  29.1k|      continue;  // Isolated vertex?
  150|  29.1k|    }
  151|  9.12M|    AttributeValueIndex first_vert_id(num_new_vertices++);
  152|  9.12M|    if (init_vertex_to_attribute_entry_map) {
  ------------------
  |  Branch (152:9): [Folded, False: 9.12M]
  ------------------
  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|  9.12M|    } else {
  156|       |      // Identity mapping
  157|  9.12M|      vertex_to_attribute_entry_id_map_.push_back(first_vert_id);
  158|  9.12M|    }
  159|  9.12M|    CornerIndex first_c = c;
  160|  9.12M|    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|  9.12M|    if (is_vertex_on_seam_[v.value()]) {
  ------------------
  |  Branch (163:9): [True: 8.06M, False: 1.06M]
  ------------------
  164|       |      // Try to swing left on the modified corner table. We need to get the
  165|       |      // first corner that defines an attribute seam.
  166|  8.06M|      act_c = SwingLeft(first_c);
  167|  8.16M|      while (act_c != kInvalidCornerIndex) {
  ------------------
  |  Branch (167:14): [True: 97.2k, False: 8.06M]
  ------------------
  168|  97.2k|        first_c = act_c;
  169|  97.2k|        act_c = SwingLeft(act_c);
  170|  97.2k|        if (act_c == c) {
  ------------------
  |  Branch (170:13): [True: 0, False: 97.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|  97.2k|      }
  176|  8.06M|    }
  177|  9.12M|    corner_to_vertex_map_[first_c.value()] = VertexIndex(first_vert_id.value());
  178|  9.12M|    vertex_to_left_most_corner_map_.push_back(first_c);
  179|  9.12M|    act_c = corner_table_->SwingRight(first_c);
  180|  52.3M|    while (act_c != kInvalidCornerIndex && act_c != first_c) {
  ------------------
  |  Branch (180:12): [True: 51.7M, False: 622k]
  |  Branch (180:44): [True: 43.2M, False: 8.50M]
  ------------------
  181|  43.2M|      if (IsCornerOppositeToSeamEdge(corner_table_->Next(act_c))) {
  ------------------
  |  Branch (181:11): [True: 37.2M, False: 6.00M]
  ------------------
  182|  37.2M|        first_vert_id = AttributeValueIndex(num_new_vertices++);
  183|  37.2M|        if (init_vertex_to_attribute_entry_map) {
  ------------------
  |  Branch (183:13): [Folded, False: 37.2M]
  ------------------
  184|      0|          const PointIndex point_id = mesh->CornerToPointId(act_c.value());
  185|      0|          vertex_to_attribute_entry_id_map_.push_back(
  186|      0|              att->mapped_index(point_id));
  187|  37.2M|        } else {
  188|       |          // Identity mapping.
  189|  37.2M|          vertex_to_attribute_entry_id_map_.push_back(first_vert_id);
  190|  37.2M|        }
  191|  37.2M|        vertex_to_left_most_corner_map_.push_back(act_c);
  192|  37.2M|      }
  193|  43.2M|      corner_to_vertex_map_[act_c.value()] = VertexIndex(first_vert_id.value());
  194|  43.2M|      act_c = corner_table_->SwingRight(act_c);
  195|  43.2M|    }
  196|  9.12M|  }
  197|  12.8k|  return true;
  198|  12.8k|}

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  82.7M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  82.7M|    return is_edge_on_seam_[corner.value()];
   47|  82.7M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  39.4M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  39.4M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 39.4M]
  |  Branch (50:42): [True: 35.8M, False: 3.60M]
  ------------------
   51|  35.8M|      return kInvalidCornerIndex;
   52|  35.8M|    }
   53|  3.60M|    return corner_table_->Opposite(corner);
   54|  39.4M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  47.5M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  47.5M|    return corner_table_->Next(corner);
   58|  47.5M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  29.8M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  29.8M|    return corner_table_->Previous(corner);
   62|  29.8M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  5.51M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  5.51M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  5.51M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.50M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  3.50M|    return Opposite(Previous(corner));
   73|  3.50M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  3.78M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  3.78M|    return Opposite(Next(corner));
   76|  3.78M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  7.40M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  7.40M|    return Previous(Opposite(Previous(corner)));
   81|  7.40M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  16.1M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  16.1M|    return Next(Opposite(Next(corner)));
   86|  16.1M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  17.5k|  int num_vertices() const {
   89|  17.5k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  17.5k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  4.66k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  2.86k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|   111M|  VertexIndex Vertex(CornerIndex corner) const {
   95|   111M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|   111M|    return ConfidentVertex(corner);
   97|   111M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|   111M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|   111M|    return corner_to_vertex_map_[corner.value()];
  100|   111M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  3.49M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  3.49M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  3.49M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  3.49M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  3.49M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  3.49M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 3.49M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  3.49M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 3.21M, False: 279k]
  ------------------
  128|  3.21M|      return true;
  129|  3.21M|    }
  130|   279k|    return false;
  131|  3.49M|  }

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

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

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

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

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

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

_ZN5draco10PointCloudC2Ev:
   27|  11.0k|PointCloud::PointCloud() : num_points_(0) {}
_ZNK5draco10PointCloud18NumNamedAttributesENS_17GeometryAttribute4TypeE:
   62|  3.08k|int32_t PointCloud::NumNamedAttributes(GeometryAttribute::Type type) const {
   63|  3.08k|  if (type == GeometryAttribute::INVALID ||
  ------------------
  |  Branch (63:7): [True: 0, False: 3.08k]
  ------------------
   64|  3.08k|      type >= GeometryAttribute::NAMED_ATTRIBUTES_COUNT) {
  ------------------
  |  Branch (64:7): [True: 0, False: 3.08k]
  ------------------
   65|      0|    return 0;
   66|      0|  }
   67|  3.08k|  return static_cast<int32_t>(named_attribute_index_[type].size());
   68|  3.08k|}
_ZNK5draco10PointCloud19GetNamedAttributeIdENS_17GeometryAttribute4TypeE:
   70|  3.08k|int32_t PointCloud::GetNamedAttributeId(GeometryAttribute::Type type) const {
   71|  3.08k|  return GetNamedAttributeId(type, 0);
   72|  3.08k|}
_ZNK5draco10PointCloud19GetNamedAttributeIdENS_17GeometryAttribute4TypeEi:
   75|  3.08k|                                        int i) const {
   76|  3.08k|  if (NumNamedAttributes(type) <= i) {
  ------------------
  |  Branch (76:7): [True: 4, False: 3.08k]
  ------------------
   77|      4|    return -1;
   78|      4|  }
   79|  3.08k|  return named_attribute_index_[type][i];
   80|  3.08k|}
_ZN5draco10PointCloud12AddAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
  140|  64.8k|int PointCloud::AddAttribute(std::unique_ptr<PointAttribute> pa) {
  141|  64.8k|  SetAttribute(static_cast<int>(attributes_.size()), std::move(pa));
  142|  64.8k|  return static_cast<int>(attributes_.size() - 1);
  143|  64.8k|}
_ZN5draco10PointCloud12SetAttributeEiNSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
  178|  64.8k|void PointCloud::SetAttribute(int att_id, std::unique_ptr<PointAttribute> pa) {
  179|  64.8k|  DRACO_DCHECK(att_id >= 0);
  180|  64.8k|  if (static_cast<int>(attributes_.size()) <= att_id) {
  ------------------
  |  Branch (180:7): [True: 64.8k, False: 0]
  ------------------
  181|  64.8k|    attributes_.resize(att_id + 1);
  182|  64.8k|  }
  183|  64.8k|  if (pa->attribute_type() < GeometryAttribute::NAMED_ATTRIBUTES_COUNT) {
  ------------------
  |  Branch (183:7): [True: 64.8k, False: 0]
  ------------------
  184|  64.8k|    named_attribute_index_[pa->attribute_type()].push_back(att_id);
  185|  64.8k|  }
  186|  64.8k|  pa->set_unique_id(att_id);
  187|  64.8k|  attributes_[att_id] = std::move(pa);
  188|  64.8k|}

_ZNK5draco10PointCloud14num_attributesEv:
   78|  3.08k|  int32_t num_attributes() const {
   79|  3.08k|    return static_cast<int32_t>(attributes_.size());
   80|  3.08k|  }
_ZNK5draco10PointCloud9attributeEi:
   81|  16.4k|  const PointAttribute* attribute(int32_t att_id) const {
   82|  16.4k|    DRACO_DCHECK_LE(0, att_id);
   83|  16.4k|    DRACO_DCHECK_LT(att_id, static_cast<int32_t>(attributes_.size()));
   84|  16.4k|    return attributes_[att_id].get();
   85|  16.4k|  }
_ZN5draco10PointCloud9attributeEi:
   89|   140k|  PointAttribute* attribute(int32_t att_id) {
   90|   140k|    DRACO_DCHECK_LE(0, att_id);
   91|   140k|    DRACO_DCHECK_LT(att_id, static_cast<int32_t>(attributes_.size()));
   92|   140k|    return attributes_[att_id].get();
   93|   140k|  }
_ZN5draco10PointCloud11AddMetadataENSt3__110unique_ptrINS_16GeometryMetadataENS1_14default_deleteIS3_EEEE:
  144|     16|  void AddMetadata(std::unique_ptr<GeometryMetadata> metadata) {
  145|     16|    metadata_ = std::move(metadata);
  146|     16|  }
_ZNK5draco10PointCloud10num_pointsEv:
  198|  68.4k|  PointIndex::ValueType num_points() const { return num_points_; }
_ZN5draco10PointCloud14set_num_pointsEj:
  203|  5.89k|  void set_num_points(PointIndex::ValueType num) { num_points_ = num; }
_ZN5draco10PointCloudD2Ev:
   39|  11.0k|  virtual ~PointCloud() = default;

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

