_ZNK5draco28AttributeOctahedronTransform28CopyToAttributeTransformDataEPNS_22AttributeTransformDataE:
   36|    526|    AttributeTransformData* out_data) const {
   37|    526|  out_data->set_transform_type(ATTRIBUTE_OCTAHEDRON_TRANSFORM);
   38|    526|  out_data->AppendParameterValue(quantization_bits_);
   39|    526|}
_ZN5draco28AttributeOctahedronTransform25InverseTransformAttributeERKNS_14PointAttributeEPS1_:
   49|    450|    const PointAttribute& attribute, PointAttribute* target_attribute) {
   50|    450|  if (target_attribute->data_type() != DT_FLOAT32) {
  ------------------
  |  Branch (50:7): [True: 0, False: 450]
  ------------------
   51|      0|    return false;
   52|      0|  }
   53|       |
   54|    450|  const int num_points = target_attribute->size();
   55|    450|  const int num_components = target_attribute->num_components();
   56|    450|  if (num_components != 3) {
  ------------------
  |  Branch (56:7): [True: 0, False: 450]
  ------------------
   57|      0|    return false;
   58|      0|  }
   59|    450|  constexpr int kEntrySize = sizeof(float) * 3;
   60|    450|  float att_val[3];
   61|    450|  const int32_t* source_attribute_data = reinterpret_cast<const int32_t*>(
   62|    450|      attribute.GetAddress(AttributeValueIndex(0)));
   63|    450|  uint8_t* target_address =
   64|    450|      target_attribute->GetAddress(AttributeValueIndex(0));
   65|    450|  OctahedronToolBox octahedron_tool_box;
   66|    450|  if (!octahedron_tool_box.SetQuantizationBits(quantization_bits_)) {
  ------------------
  |  Branch (66:7): [True: 329, False: 121]
  ------------------
   67|    329|    return false;
   68|    329|  }
   69|  15.3M|  for (uint32_t i = 0; i < num_points; ++i) {
  ------------------
  |  Branch (69:24): [True: 15.3M, False: 121]
  ------------------
   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|    121|  return true;
   79|    450|}
_ZN5draco28AttributeOctahedronTransform16DecodeParametersERKNS_14PointAttributeEPNS_13DecoderBufferE:
   95|    991|    const PointAttribute& attribute, DecoderBuffer* decoder_buffer) {
   96|    991|  uint8_t quantization_bits;
   97|    991|  if (!decoder_buffer->Decode(&quantization_bits)) {
  ------------------
  |  Branch (97:7): [True: 465, False: 526]
  ------------------
   98|    465|    return false;
   99|    465|  }
  100|    526|  quantization_bits_ = quantization_bits;
  101|    526|  return true;
  102|    991|}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  3.38k|      : quantization_bits_(-1),
   54|  3.38k|        max_quantized_value_(-1),
   55|  3.38k|        max_value_(-1),
   56|  3.38k|        dequantization_scale_(1.f),
   57|  3.38k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  3.10k|  bool SetQuantizationBits(int32_t q) {
   60|  3.10k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 1.14k, False: 1.96k]
  |  Branch (60:18): [True: 141, False: 1.81k]
  ------------------
   61|  1.28k|      return false;
   62|  1.28k|    }
   63|  1.81k|    quantization_bits_ = q;
   64|  1.81k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.81k|    max_value_ = max_quantized_value_ - 1;
   66|  1.81k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.81k|    center_value_ = max_value_ / 2;
   68|  1.81k|    return true;
   69|  3.10k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  3.45M|                                           int32_t* out_t) const {
   77|  3.45M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 3.51k, False: 3.44M]
  |  Branch (77:20): [True: 0, False: 3.51k]
  |  Branch (77:32): [True: 3.51k, False: 3.44M]
  |  Branch (77:42): [True: 0, False: 3.51k]
  ------------------
   78|  3.45M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 2.64M, False: 803k]
  |  Branch (78:29): [True: 6.30k, False: 2.64M]
  ------------------
   79|  6.30k|      s = max_value_;
   80|  6.30k|      t = max_value_;
   81|  3.44M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 3.51k, False: 3.44M]
  |  Branch (81:26): [True: 1.00k, False: 2.51k]
  ------------------
   82|  1.00k|      t = center_value_ - (t - center_value_);
   83|  3.44M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 2.64M, False: 802k]
  |  Branch (83:35): [True: 7.63k, False: 2.63M]
  ------------------
   84|  7.63k|      t = center_value_ + (center_value_ - t);
   85|  3.43M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 2.63M, False: 799k]
  |  Branch (85:35): [True: 522, False: 2.63M]
  ------------------
   86|    522|      s = center_value_ + (center_value_ - s);
   87|  3.43M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 5.87k, False: 3.43M]
  |  Branch (87:26): [True: 1.92k, False: 3.95k]
  ------------------
   88|  1.92k|      s = center_value_ - (s - center_value_);
   89|  1.92k|    }
   90|       |
   91|  3.45M|    *out_s = s;
   92|  3.45M|    *out_t = t;
   93|  3.45M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  3.45M|                                                       int32_t* out_t) const {
  100|  3.45M|    DRACO_DCHECK_EQ(
  101|  3.45M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  3.45M|        center_value_);
  103|  3.45M|    int32_t s, t;
  104|  3.45M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.63M, False: 1.81M]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.63M|      s = (int_vec[1] + center_value_);
  107|  1.63M|      t = (int_vec[2] + center_value_);
  108|  1.81M|    } else {
  109|       |      // Left hemisphere.
  110|  1.81M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 34.7k, False: 1.77M]
  ------------------
  111|  34.7k|        s = std::abs(int_vec[2]);
  112|  1.77M|      } else {
  113|  1.77M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.77M|      }
  115|  1.81M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 38.6k, False: 1.77M]
  ------------------
  116|  38.6k|        t = std::abs(int_vec[1]);
  117|  1.77M|      } else {
  118|  1.77M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.77M|      }
  120|  1.81M|    }
  121|  3.45M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  3.45M|  }
_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|  2.61M|  inline bool IsInDiamond(const int32_t& s, const int32_t& t) const {
  206|       |    // Expect center already at origin.
  207|  2.61M|    DRACO_DCHECK_LE(s, center_value_);
  208|  2.61M|    DRACO_DCHECK_LE(t, center_value_);
  209|  2.61M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  2.61M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  2.61M|    const uint32_t st =
  212|  2.61M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  2.61M|    return st <= center_value_;
  214|  2.61M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  3.77M|  void InvertDiamond(int32_t* s, int32_t* t) const {
  217|       |    // Expect center already at origin.
  218|  3.77M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  3.77M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  3.77M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  3.77M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  3.77M|    int32_t sign_s = 0;
  223|  3.77M|    int32_t sign_t = 0;
  224|  3.77M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 3.69M, False: 78.0k]
  |  Branch (224:20): [True: 3.65M, False: 46.6k]
  ------------------
  225|  3.65M|      sign_s = 1;
  226|  3.65M|      sign_t = 1;
  227|  3.65M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 80.4k, False: 44.1k]
  |  Branch (227:27): [True: 39.9k, False: 40.5k]
  ------------------
  228|  39.9k|      sign_s = -1;
  229|  39.9k|      sign_t = -1;
  230|  84.6k|    } else {
  231|  84.6k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 44.1k, False: 40.5k]
  ------------------
  232|  84.6k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 40.5k, False: 44.1k]
  ------------------
  233|  84.6k|    }
  234|       |
  235|       |    // Perform the addition and subtraction using unsigned integers to avoid
  236|       |    // signed integer overflows for bad data. Note that the result will be
  237|       |    // unchanged for non-overflowing cases.
  238|  3.77M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  3.77M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  3.77M|    uint32_t us = *s;
  241|  3.77M|    uint32_t ut = *t;
  242|  3.77M|    us = us + us - corner_point_s;
  243|  3.77M|    ut = ut + ut - corner_point_t;
  244|  3.77M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 3.69M, False: 84.6k]
  ------------------
  245|  3.69M|      uint32_t temp = us;
  246|  3.69M|      us = -ut;
  247|  3.69M|      ut = -temp;
  248|  3.69M|    } else {
  249|  84.6k|      std::swap(us, ut);
  250|  84.6k|    }
  251|  3.77M|    us = us + corner_point_s;
  252|  3.77M|    ut = ut + corner_point_t;
  253|       |
  254|  3.77M|    *s = us;
  255|  3.77M|    *t = ut;
  256|  3.77M|    *s /= 2;
  257|  3.77M|    *t /= 2;
  258|  3.77M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  5.22M|  int32_t ModMax(int32_t x) const {
  273|  5.22M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 4.72k, False: 5.21M]
  ------------------
  274|  4.72k|      return x - this->max_quantized_value();
  275|  4.72k|    }
  276|  5.21M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 2.94k, False: 5.21M]
  ------------------
  277|  2.94k|      return x + this->max_quantized_value();
  278|  2.94k|    }
  279|  5.21M|    return x;
  280|  5.21M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.75k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  7.67k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  15.6M|  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: 49.2k, 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: 350k]
  ------------------
  348|  15.3M|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 15.0M, False: 350k]
  ------------------
  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.45M|  void CanonicalizeIntegerVector(T* vec) const {
  174|  3.45M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  3.45M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  3.45M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  3.45M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  3.45M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  3.45M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 3.25M, False: 200k]
  ------------------
  181|  3.25M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  3.25M|    } else {
  183|   200k|      vec[0] =
  184|   200k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   200k|          abs_sum;
  186|   200k|      vec[1] =
  187|   200k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   200k|          abs_sum;
  189|   200k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 110k, False: 90.7k]
  ------------------
  190|   110k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   110k|      } else {
  192|  90.7k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|  90.7k|      }
  194|   200k|    }
  195|  3.45M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    627|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    627|            attribute, transform, mesh_data),
   52|    627|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    616|                                                                buffer) {
  197|    616|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    616|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    616|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 8, False: 608]
  ------------------
  199|       |    // Decode prediction mode.
  200|      8|    uint8_t mode;
  201|      8|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 1, False: 7]
  ------------------
  202|      1|      return false;
  203|      1|    }
  204|       |
  205|      7|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 4, False: 3]
  ------------------
  206|       |      // Unsupported mode.
  207|      4|      return false;
  208|      4|    }
  209|      7|  }
  210|    611|#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.34k, False: 537]
  ------------------
  214|  2.34k|    uint32_t num_flags;
  215|  2.34k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 15, False: 2.32k]
  ------------------
  216|     15|      return false;
  217|     15|    }
  218|  2.32k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 33, False: 2.29k]
  ------------------
  219|     33|      return false;
  220|     33|    }
  221|  2.29k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 566, False: 1.72k]
  ------------------
  222|    566|      is_crease_edge_[i].resize(num_flags);
  223|    566|      RAnsBitDecoder decoder;
  224|    566|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 26, False: 540]
  ------------------
  225|     26|        return false;
  226|     26|      }
  227|  1.01M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 1.01M, False: 540]
  ------------------
  228|  1.01M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  1.01M|      }
  230|    540|      decoder.EndDecoding();
  231|    540|    }
  232|  2.29k|  }
  233|    537|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    537|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    611|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    506|                          const PointIndex* /* entry_to_point_id_map */) {
   87|    506|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    506|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  2.53k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 2.02k, False: 506]
  ------------------
   93|  2.02k|    pred_vals[i].resize(num_components, 0);
   94|  2.02k|  }
   95|    506|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    506|                                         out_data);
   97|       |
   98|    506|  const CornerTable* const table = this->mesh_data().corner_table();
   99|    506|  const std::vector<int32_t>* const vertex_to_data_map =
  100|    506|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    506|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    506|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    506|  const int corner_map_size =
  109|    506|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    506|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 506]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   728k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 728k, False: 341]
  ------------------
  114|   728k|    const CornerIndex start_corner_id =
  115|   728k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   728k|    CornerIndex corner_id(start_corner_id);
  118|   728k|    int num_parallelograms = 0;
  119|   728k|    bool first_pass = true;
  120|  1.56M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 861k, False: 703k]
  ------------------
  121|   861k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 51.5k, False: 810k]
  ------------------
  122|   861k|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|   861k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|  51.5k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|  51.5k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 374, False: 51.2k]
  ------------------
  130|    374|          break;
  131|    374|        }
  132|  51.5k|      }
  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|   861k|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 854k, False: 7.55k]
  ------------------
  137|   854k|        corner_id = table->SwingLeft(corner_id);
  138|   854k|      } else {
  139|  7.55k|        corner_id = table->SwingRight(corner_id);
  140|  7.55k|      }
  141|   861k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 23.8k, False: 837k]
  ------------------
  142|  23.8k|        break;
  143|  23.8k|      }
  144|   837k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 707k, False: 130k]
  |  Branch (144:47): [True: 703k, False: 3.17k]
  ------------------
  145|   703k|        first_pass = false;
  146|   703k|        corner_id = table->SwingRight(start_corner_id);
  147|   703k|      }
  148|   837k|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   728k|    int num_used_parallelograms = 0;
  153|   728k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 28.7k, False: 699k]
  ------------------
  154|   938k|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 910k, False: 28.7k]
  ------------------
  155|   910k|        multi_pred_vals[i] = 0;
  156|   910k|      }
  157|       |      // Check which parallelograms are actually used.
  158|  80.0k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 51.4k, False: 28.5k]
  ------------------
  159|  51.4k|        const int context = num_parallelograms - 1;
  160|  51.4k|        const int pos = is_crease_edge_pos[context]++;
  161|  51.4k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 165, False: 51.3k]
  ------------------
  162|    165|          return false;
  163|    165|        }
  164|  51.3k|        const bool is_crease = is_crease_edge_[context][pos];
  165|  51.3k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 23.1k, False: 28.1k]
  ------------------
  166|  23.1k|          ++num_used_parallelograms;
  167|   954k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 931k, False: 23.1k]
  ------------------
  168|   931k|            multi_pred_vals[j] =
  169|   931k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|   931k|          }
  171|  23.1k|        }
  172|  51.3k|      }
  173|  28.7k|    }
  174|   728k|    const int dst_offset = p * num_components;
  175|   728k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 715k, False: 12.0k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|   715k|      const int src_offset = (p - 1) * num_components;
  179|   715k|      this->transform().ComputeOriginalValue(
  180|   715k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|   715k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|   505k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 493k, False: 12.0k]
  ------------------
  184|   493k|        multi_pred_vals[c] /= num_used_parallelograms;
  185|   493k|      }
  186|  12.0k|      this->transform().ComputeOriginalValue(
  187|  12.0k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  12.0k|    }
  189|   728k|  }
  190|    341|  return true;
  191|    506|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    653|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    653|            attribute, transform, mesh_data),
   52|    653|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    634|                                                                buffer) {
  197|    634|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    634|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    634|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 13, False: 621]
  ------------------
  199|       |    // Decode prediction mode.
  200|     13|    uint8_t mode;
  201|     13|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 1, False: 12]
  ------------------
  202|      1|      return false;
  203|      1|    }
  204|       |
  205|     12|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 11, False: 1]
  ------------------
  206|       |      // Unsupported mode.
  207|     11|      return false;
  208|     11|    }
  209|     12|  }
  210|    622|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  2.78k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 2.29k, False: 487]
  ------------------
  214|  2.29k|    uint32_t num_flags;
  215|  2.29k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 18, False: 2.27k]
  ------------------
  216|     18|      return false;
  217|     18|    }
  218|  2.27k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 86, False: 2.19k]
  ------------------
  219|     86|      return false;
  220|     86|    }
  221|  2.19k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 939, False: 1.25k]
  ------------------
  222|    939|      is_crease_edge_[i].resize(num_flags);
  223|    939|      RAnsBitDecoder decoder;
  224|    939|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 31, False: 908]
  ------------------
  225|     31|        return false;
  226|     31|      }
  227|  1.24M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 1.24M, False: 908]
  ------------------
  228|  1.24M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  1.24M|      }
  230|    908|      decoder.EndDecoding();
  231|    908|    }
  232|  2.19k|  }
  233|    487|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    487|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    622|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    448|                          const PointIndex* /* entry_to_point_id_map */) {
   87|    448|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    448|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  2.24k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.79k, False: 448]
  ------------------
   93|  1.79k|    pred_vals[i].resize(num_components, 0);
   94|  1.79k|  }
   95|    448|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    448|                                         out_data);
   97|       |
   98|    448|  const CornerTable* const table = this->mesh_data().corner_table();
   99|    448|  const std::vector<int32_t>* const vertex_to_data_map =
  100|    448|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    448|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    448|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    448|  const int corner_map_size =
  109|    448|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    448|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 448]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   106k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 106k, False: 205]
  ------------------
  114|   106k|    const CornerIndex start_corner_id =
  115|   106k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   106k|    CornerIndex corner_id(start_corner_id);
  118|   106k|    int num_parallelograms = 0;
  119|   106k|    bool first_pass = true;
  120|   609k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 601k, False: 7.95k]
  ------------------
  121|   601k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 192k, False: 409k]
  ------------------
  122|   601k|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|   601k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|   192k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|   192k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 303, False: 191k]
  ------------------
  130|    303|          break;
  131|    303|        }
  132|   192k|      }
  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|   601k|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 595k, False: 6.59k]
  ------------------
  137|   595k|        corner_id = table->SwingLeft(corner_id);
  138|   595k|      } else {
  139|  6.59k|        corner_id = table->SwingRight(corner_id);
  140|  6.59k|      }
  141|   601k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 98.1k, False: 503k]
  ------------------
  142|  98.1k|        break;
  143|  98.1k|      }
  144|   503k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 11.3k, False: 492k]
  |  Branch (144:47): [True: 7.95k, False: 3.41k]
  ------------------
  145|  7.95k|        first_pass = false;
  146|  7.95k|        corner_id = table->SwingRight(start_corner_id);
  147|  7.95k|      }
  148|   503k|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   106k|    int num_used_parallelograms = 0;
  153|   106k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 99.4k, False: 7.00k]
  ------------------
  154|  11.3M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 11.2M, False: 99.4k]
  ------------------
  155|  11.2M|        multi_pred_vals[i] = 0;
  156|  11.2M|      }
  157|       |      // Check which parallelograms are actually used.
  158|   291k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 191k, False: 99.1k]
  ------------------
  159|   191k|        const int context = num_parallelograms - 1;
  160|   191k|        const int pos = is_crease_edge_pos[context]++;
  161|   191k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 243, False: 191k]
  ------------------
  162|    243|          return false;
  163|    243|        }
  164|   191k|        const bool is_crease = is_crease_edge_[context][pos];
  165|   191k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 137k, False: 53.7k]
  ------------------
  166|   137k|          ++num_used_parallelograms;
  167|  19.3M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 19.2M, False: 137k]
  ------------------
  168|  19.2M|            multi_pred_vals[j] =
  169|  19.2M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|  19.2M|          }
  171|   137k|        }
  172|   191k|      }
  173|  99.4k|    }
  174|   106k|    const int dst_offset = p * num_components;
  175|   106k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 36.3k, False: 69.8k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|  36.3k|      const int src_offset = (p - 1) * num_components;
  179|  36.3k|      this->transform().ComputeOriginalValue(
  180|  36.3k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|  69.8k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|  9.74M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 9.67M, False: 69.8k]
  ------------------
  184|  9.67M|        multi_pred_vals[c] /= num_used_parallelograms;
  185|  9.67M|      }
  186|  69.8k|      this->transform().ComputeOriginalValue(
  187|  69.8k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  69.8k|    }
  189|   106k|  }
  190|    205|  return true;
  191|    448|}

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

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   863k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   239k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  1.06M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   214k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.79k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.79k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  9.56M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.97k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.97k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  4.17M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    163|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    163|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    211|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    211|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    178|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    178|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    228|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    228|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    324|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    163|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    163|    DRACO_DCHECK_EQ(i, 0);
   70|    163|    (void)i;
   71|    163|    return GeometryAttribute::POSITION;
   72|    163|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    162|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    162|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 162]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    162|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 161]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    161|    predictor_.SetPositionAttribute(*att);
   82|    161|    return true;
   83|    162|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    160|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    160|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 6, False: 154]
  ------------------
  148|      6|    return false;
  149|      6|  }
  150|       |
  151|    154|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    154|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    154|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 47, False: 107]
  ------------------
  153|     47|    uint8_t prediction_mode;
  154|     47|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 46]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     46|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 44]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     44|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 44]
  ------------------
  163|     44|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     44|  }
  167|    151|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    151|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 13, False: 138]
  ------------------
  171|     13|    return false;
  172|     13|  }
  173|       |
  174|    138|  return true;
  175|    151|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    138|                                      const PointIndex* entry_to_point_id_map) {
  103|    138|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    138|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    138|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    138|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    138|  const int corner_map_size =
  111|    138|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    138|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 138]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    138|  VectorD<int32_t, 3> pred_normal_3d;
  117|    138|  int32_t pred_normal_oct[2];
  118|       |
  119|   863k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 863k, False: 138]
  ------------------
  120|   863k|    const CornerIndex corner_id =
  121|   863k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   863k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   863k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   863k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   863k|                    octahedron_tool_box_.center_value());
  128|   863k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 670k, False: 193k]
  ------------------
  129|   670k|      pred_normal_3d = -pred_normal_3d;
  130|   670k|    }
  131|   863k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   863k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   863k|    const int data_offset = data_id * 2;
  135|   863k|    this->transform().ComputeOriginalValue(
  136|   863k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   863k|  }
  138|    138|  flip_normal_bit_decoder_.EndDecoding();
  139|    138|  return true;
  140|    138|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    138|  void SetQuantizationBits(int q) {
   85|    138|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    138|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    420|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    211|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    211|    DRACO_DCHECK_EQ(i, 0);
   70|    211|    (void)i;
   71|    211|    return GeometryAttribute::POSITION;
   72|    211|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    211|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    211|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 211]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    211|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 209]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    209|    predictor_.SetPositionAttribute(*att);
   82|    209|    return true;
   83|    211|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    209|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    209|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 8, False: 201]
  ------------------
  148|      8|    return false;
  149|      8|  }
  150|       |
  151|    201|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    201|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    201|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 50, False: 151]
  ------------------
  153|     50|    uint8_t prediction_mode;
  154|     50|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 49]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     49|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 47]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     47|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 47]
  ------------------
  163|     47|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     47|  }
  167|    198|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    198|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 4, False: 194]
  ------------------
  171|      4|    return false;
  172|      4|  }
  173|       |
  174|    194|  return true;
  175|    198|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    194|                                      const PointIndex* entry_to_point_id_map) {
  103|    194|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    194|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    194|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    194|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    194|  const int corner_map_size =
  111|    194|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    194|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 194]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    194|  VectorD<int32_t, 3> pred_normal_3d;
  117|    194|  int32_t pred_normal_oct[2];
  118|       |
  119|   239k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 239k, False: 194]
  ------------------
  120|   239k|    const CornerIndex corner_id =
  121|   239k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   239k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   239k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   239k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   239k|                    octahedron_tool_box_.center_value());
  128|   239k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 203k, False: 35.9k]
  ------------------
  129|   203k|      pred_normal_3d = -pred_normal_3d;
  130|   203k|    }
  131|   239k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   239k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   239k|    const int data_offset = data_id * 2;
  135|   239k|    this->transform().ComputeOriginalValue(
  136|   239k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   239k|  }
  138|    194|  flip_normal_bit_decoder_.EndDecoding();
  139|    194|  return true;
  140|    194|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    194|  void SetQuantizationBits(int q) {
   85|    194|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    194|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    354|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    178|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    178|    DRACO_DCHECK_EQ(i, 0);
   70|    178|    (void)i;
   71|    178|    return GeometryAttribute::POSITION;
   72|    178|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    178|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    178|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 178]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    178|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 176]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    176|    predictor_.SetPositionAttribute(*att);
   82|    176|    return true;
   83|    178|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    176|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    176|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 9, False: 167]
  ------------------
  148|      9|    return false;
  149|      9|  }
  150|       |
  151|    167|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    167|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    167|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 67, False: 100]
  ------------------
  153|     67|    uint8_t prediction_mode;
  154|     67|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 66]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     66|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 65]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     65|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 65]
  ------------------
  163|     65|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     65|  }
  167|    165|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    165|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 20, False: 145]
  ------------------
  171|     20|    return false;
  172|     20|  }
  173|       |
  174|    145|  return true;
  175|    165|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    145|                                      const PointIndex* entry_to_point_id_map) {
  103|    145|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    145|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    145|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    145|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    145|  const int corner_map_size =
  111|    145|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    145|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 145]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    145|  VectorD<int32_t, 3> pred_normal_3d;
  117|    145|  int32_t pred_normal_oct[2];
  118|       |
  119|  1.06M|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 1.06M, False: 145]
  ------------------
  120|  1.06M|    const CornerIndex corner_id =
  121|  1.06M|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|  1.06M|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|  1.06M|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|  1.06M|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|  1.06M|                    octahedron_tool_box_.center_value());
  128|  1.06M|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 723k, False: 341k]
  ------------------
  129|   723k|      pred_normal_3d = -pred_normal_3d;
  130|   723k|    }
  131|  1.06M|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|  1.06M|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|  1.06M|    const int data_offset = data_id * 2;
  135|  1.06M|    this->transform().ComputeOriginalValue(
  136|  1.06M|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|  1.06M|  }
  138|    145|  flip_normal_bit_decoder_.EndDecoding();
  139|    145|  return true;
  140|    145|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    145|  void SetQuantizationBits(int q) {
   85|    145|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    145|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    454|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    228|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    228|    DRACO_DCHECK_EQ(i, 0);
   70|    228|    (void)i;
   71|    228|    return GeometryAttribute::POSITION;
   72|    228|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    228|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    228|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 228]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    228|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 226]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    226|    predictor_.SetPositionAttribute(*att);
   82|    226|    return true;
   83|    228|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    225|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    225|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 7, False: 218]
  ------------------
  148|      7|    return false;
  149|      7|  }
  150|       |
  151|    218|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    218|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    218|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 50, False: 168]
  ------------------
  153|     50|    uint8_t prediction_mode;
  154|     50|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 49]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     49|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 3, False: 46]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      3|      return false;
  160|      3|    }
  161|       |
  162|     46|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 46]
  ------------------
  163|     46|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     46|  }
  167|    214|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    214|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 8, False: 206]
  ------------------
  171|      8|    return false;
  172|      8|  }
  173|       |
  174|    206|  return true;
  175|    214|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    206|                                      const PointIndex* entry_to_point_id_map) {
  103|    206|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    206|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    206|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    206|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    206|  const int corner_map_size =
  111|    206|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    206|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 206]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    206|  VectorD<int32_t, 3> pred_normal_3d;
  117|    206|  int32_t pred_normal_oct[2];
  118|       |
  119|   214k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 214k, False: 206]
  ------------------
  120|   214k|    const CornerIndex corner_id =
  121|   214k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   214k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   214k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   214k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   214k|                    octahedron_tool_box_.center_value());
  128|   214k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 159k, False: 55.0k]
  ------------------
  129|   159k|      pred_normal_3d = -pred_normal_3d;
  130|   159k|    }
  131|   214k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   214k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   214k|    const int data_offset = data_id * 2;
  135|   214k|    this->transform().ComputeOriginalValue(
  136|   214k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   214k|  }
  138|    206|  flip_normal_bit_decoder_.EndDecoding();
  139|    206|  return true;
  140|    206|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    206|  void SetQuantizationBits(int q) {
   85|    206|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    206|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    510|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    510|            attribute, transform, mesh_data),
   37|    510|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|  1.01k|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    510|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    510|    DRACO_DCHECK_EQ(i, 0);
   70|    510|    (void)i;
   71|    510|    return GeometryAttribute::POSITION;
   72|    510|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    509|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    509|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 509]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    509|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 507]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    507|    predictor_.SetPositionAttribute(*att);
   82|    507|    return true;
   83|    509|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    506|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    506|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 32, False: 474]
  ------------------
  148|     32|    return false;
  149|     32|  }
  150|       |
  151|    474|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    474|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    474|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 273, False: 201]
  ------------------
  153|    273|    uint8_t prediction_mode;
  154|    273|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 272]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|    272|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 270]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|    270|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 270]
  ------------------
  163|    270|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|    270|  }
  167|    471|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    471|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 22, False: 449]
  ------------------
  171|     22|    return false;
  172|     22|  }
  173|       |
  174|    449|  return true;
  175|    471|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    449|                                      const PointIndex* entry_to_point_id_map) {
  103|    449|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    449|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    449|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    449|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    449|  const int corner_map_size =
  111|    449|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    449|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 449]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    449|  VectorD<int32_t, 3> pred_normal_3d;
  117|    449|  int32_t pred_normal_oct[2];
  118|       |
  119|   880k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 880k, False: 449]
  ------------------
  120|   880k|    const CornerIndex corner_id =
  121|   880k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   880k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   880k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   880k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   880k|                    octahedron_tool_box_.center_value());
  128|   880k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 746k, False: 133k]
  ------------------
  129|   746k|      pred_normal_3d = -pred_normal_3d;
  130|   746k|    }
  131|   880k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   880k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   880k|    const int data_offset = data_id * 2;
  135|   880k|    this->transform().ComputeOriginalValue(
  136|   880k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   880k|  }
  138|    449|  flip_normal_bit_decoder_.EndDecoding();
  139|    449|  return true;
  140|    449|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    449|  void SetQuantizationBits(int q) {
   85|    449|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    449|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    550|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    550|            attribute, transform, mesh_data),
   37|    550|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|  1.09k|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    550|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    550|    DRACO_DCHECK_EQ(i, 0);
   70|    550|    (void)i;
   71|    550|    return GeometryAttribute::POSITION;
   72|    550|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    549|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    549|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 549]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    549|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 547]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    547|    predictor_.SetPositionAttribute(*att);
   82|    547|    return true;
   83|    549|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    546|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    546|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 34, False: 512]
  ------------------
  148|     34|    return false;
  149|     34|  }
  150|       |
  151|    512|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    512|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    512|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 189, False: 323]
  ------------------
  153|    189|    uint8_t prediction_mode;
  154|    189|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 188]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|    188|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 187]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|    187|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 187]
  ------------------
  163|    187|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|    187|  }
  167|    510|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    510|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 29, False: 481]
  ------------------
  171|     29|    return false;
  172|     29|  }
  173|       |
  174|    481|  return true;
  175|    510|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    481|                                      const PointIndex* entry_to_point_id_map) {
  103|    481|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    481|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    481|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    481|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    481|  const int corner_map_size =
  111|    481|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    481|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 481]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    481|  VectorD<int32_t, 3> pred_normal_3d;
  117|    481|  int32_t pred_normal_oct[2];
  118|       |
  119|   189k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 189k, False: 481]
  ------------------
  120|   189k|    const CornerIndex corner_id =
  121|   189k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   189k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   189k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   189k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   189k|                    octahedron_tool_box_.center_value());
  128|   189k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 162k, False: 26.3k]
  ------------------
  129|   162k|      pred_normal_3d = -pred_normal_3d;
  130|   162k|    }
  131|   189k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   189k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   189k|    const int data_offset = data_id * 2;
  135|   189k|    this->transform().ComputeOriginalValue(
  136|   189k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   189k|  }
  138|    481|  flip_normal_bit_decoder_.EndDecoding();
  139|    481|  return true;
  140|    481|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    481|  void SetQuantizationBits(int q) {
   85|    481|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    481|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    163|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    163|            attribute, transform, mesh_data),
   37|    163|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    211|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    211|            attribute, transform, mesh_data),
   37|    211|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    178|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    178|            attribute, transform, mesh_data),
   37|    178|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    228|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    228|            attribute, transform, mesh_data),
   37|    228|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    207|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    207|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 42, False: 165]
  ------------------
  105|     42|      this->normal_prediction_mode_ = mode;
  106|     42|      return true;
  107|    165|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 165, False: 0]
  ------------------
  108|    165|      this->normal_prediction_mode_ = mode;
  109|    165|      return true;
  110|    165|    }
  111|      0|    return false;
  112|    207|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   863k|                             DataTypeT* prediction) override {
   42|   863k|    DRACO_DCHECK(this->IsInitialized());
   43|   863k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   863k|    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|   863k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   863k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   863k|    VectorD<int64_t, 3> normal;
   53|   863k|    CornerIndex c_next, c_prev;
   54|  1.73M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 874k, False: 863k]
  ------------------
   55|       |      // Getting corners.
   56|   874k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 186, False: 874k]
  ------------------
   57|    186|        c_next = corner_table->Next(corner_id);
   58|    186|        c_prev = corner_table->Previous(corner_id);
   59|   874k|      } else {
   60|   874k|        c_next = corner_table->Next(cit.Corner());
   61|   874k|        c_prev = corner_table->Previous(cit.Corner());
   62|   874k|      }
   63|   874k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   874k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   874k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   874k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   874k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   874k|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|   874k|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|   874k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   874k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   874k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   874k|      cit.Next();
   81|   874k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   863k|    constexpr int64_t upper_bound = 1 << 29;
   85|   863k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 126, False: 863k]
  ------------------
   86|    126|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    126|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 37, False: 89]
  ------------------
   88|     37|        const int64_t quotient = abs_sum / upper_bound;
   89|     37|        normal = normal / quotient;
   90|     37|      }
   91|   863k|    } else {
   92|   863k|      const int64_t abs_sum = normal.AbsSum();
   93|   863k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.51k, False: 861k]
  ------------------
   94|  1.51k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.51k|        normal = normal / quotient;
   96|  1.51k|      }
   97|   863k|    }
   98|   863k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   863k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   863k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   863k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   863k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    258|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    258|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 45, False: 213]
  ------------------
  105|     45|      this->normal_prediction_mode_ = mode;
  106|     45|      return true;
  107|    213|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 213, False: 0]
  ------------------
  108|    213|      this->normal_prediction_mode_ = mode;
  109|    213|      return true;
  110|    213|    }
  111|      0|    return false;
  112|    258|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   239k|                             DataTypeT* prediction) override {
   42|   239k|    DRACO_DCHECK(this->IsInitialized());
   43|   239k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   239k|    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|   239k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   239k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   239k|    VectorD<int64_t, 3> normal;
   53|   239k|    CornerIndex c_next, c_prev;
   54|  1.66M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.42M, False: 239k]
  ------------------
   55|       |      // Getting corners.
   56|  1.42M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 264, False: 1.42M]
  ------------------
   57|    264|        c_next = corner_table->Next(corner_id);
   58|    264|        c_prev = corner_table->Previous(corner_id);
   59|  1.42M|      } else {
   60|  1.42M|        c_next = corner_table->Next(cit.Corner());
   61|  1.42M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.42M|      }
   63|  1.42M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.42M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.42M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.42M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.42M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.42M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.42M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.42M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.42M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.42M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.42M|      cit.Next();
   81|  1.42M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   239k|    constexpr int64_t upper_bound = 1 << 29;
   85|   239k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 176, False: 238k]
  ------------------
   86|    176|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    176|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 32, False: 144]
  ------------------
   88|     32|        const int64_t quotient = abs_sum / upper_bound;
   89|     32|        normal = normal / quotient;
   90|     32|      }
   91|   238k|    } else {
   92|   238k|      const int64_t abs_sum = normal.AbsSum();
   93|   238k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 109k, False: 129k]
  ------------------
   94|   109k|        const int64_t quotient = abs_sum / upper_bound;
   95|   109k|        normal = normal / quotient;
   96|   109k|      }
   97|   238k|    }
   98|   239k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   239k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   239k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   239k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   239k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    243|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    243|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 63, False: 180]
  ------------------
  105|     63|      this->normal_prediction_mode_ = mode;
  106|     63|      return true;
  107|    180|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 180, False: 0]
  ------------------
  108|    180|      this->normal_prediction_mode_ = mode;
  109|    180|      return true;
  110|    180|    }
  111|      0|    return false;
  112|    243|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  1.06M|                             DataTypeT* prediction) override {
   42|  1.06M|    DRACO_DCHECK(this->IsInitialized());
   43|  1.06M|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  1.06M|    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.06M|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  1.06M|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  1.06M|    VectorD<int64_t, 3> normal;
   53|  1.06M|    CornerIndex c_next, c_prev;
   54|  2.39M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.32M, False: 1.06M]
  ------------------
   55|       |      // Getting corners.
   56|  1.32M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 276, False: 1.32M]
  ------------------
   57|    276|        c_next = corner_table->Next(corner_id);
   58|    276|        c_prev = corner_table->Previous(corner_id);
   59|  1.32M|      } else {
   60|  1.32M|        c_next = corner_table->Next(cit.Corner());
   61|  1.32M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.32M|      }
   63|  1.32M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.32M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.32M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.32M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.32M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.32M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.32M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.32M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.32M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.32M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.32M|      cit.Next();
   81|  1.32M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  1.06M|    constexpr int64_t upper_bound = 1 << 29;
   85|  1.06M|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 184, False: 1.06M]
  ------------------
   86|    184|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    184|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 58, False: 126]
  ------------------
   88|     58|        const int64_t quotient = abs_sum / upper_bound;
   89|     58|        normal = normal / quotient;
   90|     58|      }
   91|  1.06M|    } else {
   92|  1.06M|      const int64_t abs_sum = normal.AbsSum();
   93|  1.06M|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.36k, False: 1.06M]
  ------------------
   94|  1.36k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.36k|        normal = normal / quotient;
   96|  1.36k|      }
   97|  1.06M|    }
   98|  1.06M|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  1.06M|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  1.06M|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  1.06M|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  1.06M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    274|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    274|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 45, False: 229]
  ------------------
  105|     45|      this->normal_prediction_mode_ = mode;
  106|     45|      return true;
  107|    229|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 229, False: 0]
  ------------------
  108|    229|      this->normal_prediction_mode_ = mode;
  109|    229|      return true;
  110|    229|    }
  111|      0|    return false;
  112|    274|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   214k|                             DataTypeT* prediction) override {
   42|   214k|    DRACO_DCHECK(this->IsInitialized());
   43|   214k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   214k|    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|   214k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   214k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   214k|    VectorD<int64_t, 3> normal;
   53|   214k|    CornerIndex c_next, c_prev;
   54|  1.48M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.27M, False: 214k]
  ------------------
   55|       |      // Getting corners.
   56|  1.27M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 264, False: 1.27M]
  ------------------
   57|    264|        c_next = corner_table->Next(corner_id);
   58|    264|        c_prev = corner_table->Previous(corner_id);
   59|  1.27M|      } else {
   60|  1.27M|        c_next = corner_table->Next(cit.Corner());
   61|  1.27M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.27M|      }
   63|  1.27M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.27M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.27M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.27M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.27M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.27M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.27M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.27M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.27M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.27M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.27M|      cit.Next();
   81|  1.27M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   214k|    constexpr int64_t upper_bound = 1 << 29;
   85|   214k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 176, False: 214k]
  ------------------
   86|    176|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    176|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 46, False: 130]
  ------------------
   88|     46|        const int64_t quotient = abs_sum / upper_bound;
   89|     46|        normal = normal / quotient;
   90|     46|      }
   91|   214k|    } else {
   92|   214k|      const int64_t abs_sum = normal.AbsSum();
   93|   214k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 55.5k, False: 158k]
  ------------------
   94|  55.5k|        const int64_t quotient = abs_sum / upper_bound;
   95|  55.5k|        normal = normal / quotient;
   96|  55.5k|      }
   97|   214k|    }
   98|   214k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   214k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   214k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   214k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   214k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    510|      : Base(md) {
   35|    510|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    510|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    780|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    780|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 258, False: 522]
  ------------------
  105|    258|      this->normal_prediction_mode_ = mode;
  106|    258|      return true;
  107|    522|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 522, False: 0]
  ------------------
  108|    522|      this->normal_prediction_mode_ = mode;
  109|    522|      return true;
  110|    522|    }
  111|      0|    return false;
  112|    780|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   880k|                             DataTypeT* prediction) override {
   42|   880k|    DRACO_DCHECK(this->IsInitialized());
   43|   880k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   880k|    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|   880k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   880k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   880k|    VectorD<int64_t, 3> normal;
   53|   880k|    CornerIndex c_next, c_prev;
   54|  1.78M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 905k, False: 880k]
  ------------------
   55|       |      // Getting corners.
   56|   905k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 1.47k, False: 904k]
  ------------------
   57|  1.47k|        c_next = corner_table->Next(corner_id);
   58|  1.47k|        c_prev = corner_table->Previous(corner_id);
   59|   904k|      } else {
   60|   904k|        c_next = corner_table->Next(cit.Corner());
   61|   904k|        c_prev = corner_table->Previous(cit.Corner());
   62|   904k|      }
   63|   905k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   905k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   905k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   905k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   905k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   905k|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|   905k|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|   905k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   905k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   905k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   905k|      cit.Next();
   81|   905k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   880k|    constexpr int64_t upper_bound = 1 << 29;
   85|   880k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 982, False: 879k]
  ------------------
   86|    982|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    982|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 303, False: 679]
  ------------------
   88|    303|        const int64_t quotient = abs_sum / upper_bound;
   89|    303|        normal = normal / quotient;
   90|    303|      }
   91|   879k|    } else {
   92|   879k|      const int64_t abs_sum = normal.AbsSum();
   93|   879k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.24k, False: 875k]
  ------------------
   94|  3.24k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.24k|        normal = normal / quotient;
   96|  3.24k|      }
   97|   879k|    }
   98|   880k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   880k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   880k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   880k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   880k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    550|      : Base(md) {
   35|    550|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    550|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    737|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    737|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 176, False: 561]
  ------------------
  105|    176|      this->normal_prediction_mode_ = mode;
  106|    176|      return true;
  107|    561|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 561, False: 0]
  ------------------
  108|    561|      this->normal_prediction_mode_ = mode;
  109|    561|      return true;
  110|    561|    }
  111|      0|    return false;
  112|    737|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   189k|                             DataTypeT* prediction) override {
   42|   189k|    DRACO_DCHECK(this->IsInitialized());
   43|   189k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   189k|    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|   189k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   189k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   189k|    VectorD<int64_t, 3> normal;
   53|   189k|    CornerIndex c_next, c_prev;
   54|  1.25M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.06M, False: 189k]
  ------------------
   55|       |      // Getting corners.
   56|  1.06M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 1.02k, False: 1.06M]
  ------------------
   57|  1.02k|        c_next = corner_table->Next(corner_id);
   58|  1.02k|        c_prev = corner_table->Previous(corner_id);
   59|  1.06M|      } else {
   60|  1.06M|        c_next = corner_table->Next(cit.Corner());
   61|  1.06M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.06M|      }
   63|  1.06M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.06M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.06M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.06M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.06M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.06M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.06M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.06M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.06M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.06M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.06M|      cit.Next();
   81|  1.06M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   189k|    constexpr int64_t upper_bound = 1 << 29;
   85|   189k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 683, False: 188k]
  ------------------
   86|    683|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    683|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 186, False: 497]
  ------------------
   88|    186|        const int64_t quotient = abs_sum / upper_bound;
   89|    186|        normal = normal / quotient;
   90|    186|      }
   91|   188k|    } else {
   92|   188k|      const int64_t abs_sum = normal.AbsSum();
   93|   188k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.44k, False: 185k]
  ------------------
   94|  3.44k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.44k|        normal = normal / quotient;
   96|  3.44k|      }
   97|   188k|    }
   98|   189k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   189k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   189k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   189k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   189k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    163|      : Base(md) {
   35|    163|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    163|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    211|      : Base(md) {
   35|    211|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    211|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    178|      : Base(md) {
   35|    178|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    178|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    228|      : Base(md) {
   35|    228|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    228|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.61M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.61M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.61M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.61M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.61M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.61M|    return GetPositionForDataId(data_id);
   77|  2.61M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.61M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.61M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.61M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.61M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.61M|    VectorD<int64_t, 3> pos;
   68|  2.61M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.61M|    return pos;
   70|  2.61M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    161|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    161|    pos_attribute_ = &position_attribute;
   43|    161|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    138|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    138|    entry_to_point_id_map_ = map;
   46|    138|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.08M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.08M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.08M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.08M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.08M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.08M|    return GetPositionForDataId(data_id);
   77|  3.08M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.08M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.08M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.08M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.08M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.08M|    VectorD<int64_t, 3> pos;
   68|  3.08M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.08M|    return pos;
   70|  3.08M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    209|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    209|    pos_attribute_ = &position_attribute;
   43|    209|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    194|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    194|    entry_to_point_id_map_ = map;
   46|    194|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.72M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.72M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.72M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.72M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.72M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.72M|    return GetPositionForDataId(data_id);
   77|  3.72M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  3.72M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.72M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.72M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.72M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.72M|    VectorD<int64_t, 3> pos;
   68|  3.72M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.72M|    return pos;
   70|  3.72M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    176|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    176|    pos_attribute_ = &position_attribute;
   43|    176|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    145|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    145|    entry_to_point_id_map_ = map;
   46|    145|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.76M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.76M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.76M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.76M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.76M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.76M|    return GetPositionForDataId(data_id);
   77|  2.76M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.76M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.76M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.76M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.76M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.76M|    VectorD<int64_t, 3> pos;
   68|  2.76M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.76M|    return pos;
   70|  2.76M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    226|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    226|    pos_attribute_ = &position_attribute;
   43|    226|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    206|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    206|    entry_to_point_id_map_ = map;
   46|    206|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    510|      : pos_attribute_(nullptr),
   36|    510|        entry_to_point_id_map_(nullptr),
   37|    510|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    510|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.69M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.69M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.69M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.69M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.69M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.69M|    return GetPositionForDataId(data_id);
   77|  2.69M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.69M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.69M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.69M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.69M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.69M|    VectorD<int64_t, 3> pos;
   68|  2.69M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.69M|    return pos;
   70|  2.69M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    507|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    507|    pos_attribute_ = &position_attribute;
   43|    507|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    449|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    449|    entry_to_point_id_map_ = map;
   46|    449|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    550|      : pos_attribute_(nullptr),
   36|    550|        entry_to_point_id_map_(nullptr),
   37|    550|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    550|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.32M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.32M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.32M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.32M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.32M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.32M|    return GetPositionForDataId(data_id);
   77|  2.32M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.32M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.32M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.32M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.32M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.32M|    VectorD<int64_t, 3> pos;
   68|  2.32M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.32M|    return pos;
   70|  2.32M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    547|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    547|    pos_attribute_ = &position_attribute;
   43|    547|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    481|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    481|    entry_to_point_id_map_ = map;
   46|    481|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    163|      : pos_attribute_(nullptr),
   36|    163|        entry_to_point_id_map_(nullptr),
   37|    163|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    163|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    211|      : pos_attribute_(nullptr),
   36|    211|        entry_to_point_id_map_(nullptr),
   37|    211|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    211|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    178|      : pos_attribute_(nullptr),
   36|    178|        entry_to_point_id_map_(nullptr),
   37|    178|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    178|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    228|      : pos_attribute_(nullptr),
   36|    228|        entry_to_point_id_map_(nullptr),
   37|    228|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    228|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    456|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    456|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    443|                          const PointIndex* /* entry_to_point_id_map */) {
   64|    443|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    443|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    443|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    443|      new DataTypeT[num_components]());
   70|       |
   71|    443|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    443|  const CornerTable* const table = this->mesh_data().corner_table();
   74|    443|  const std::vector<int32_t>* const vertex_to_data_map =
   75|    443|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    443|  const int corner_map_size =
   78|    443|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    443|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 443]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|  3.11M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 3.11M, False: 443]
  ------------------
   83|  3.11M|    const CornerIndex start_corner_id =
   84|  3.11M|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|  3.11M|    CornerIndex corner_id(start_corner_id);
   87|  3.11M|    int num_parallelograms = 0;
   88|   118M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 115M, False: 3.11M]
  ------------------
   89|   115M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|   115M|    }
   91|  6.89M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 3.77M, False: 3.11M]
  ------------------
   92|  3.77M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 272k, False: 3.50M]
  ------------------
   93|  3.77M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  3.77M|              num_components, parallelogram_pred_vals.get())) {
   95|  26.8M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 26.5M, False: 272k]
  ------------------
   96|  26.5M|          pred_vals[c] =
   97|  26.5M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  26.5M|        }
   99|   272k|        ++num_parallelograms;
  100|   272k|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  3.77M|      corner_id = table->SwingRight(corner_id);
  104|  3.77M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 126k, False: 3.65M]
  ------------------
  105|   126k|        corner_id = kInvalidCornerIndex;
  106|   126k|      }
  107|  3.77M|    }
  108|       |
  109|  3.11M|    const int dst_offset = p * num_components;
  110|  3.11M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 2.96M, False: 148k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  2.96M|      const int src_offset = (p - 1) * num_components;
  114|  2.96M|      this->transform().ComputeOriginalValue(
  115|  2.96M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|  2.96M|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  14.1M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 13.9M, False: 148k]
  ------------------
  119|  13.9M|        pred_vals[c] /= num_parallelograms;
  120|  13.9M|      }
  121|   148k|      this->transform().ComputeOriginalValue(
  122|   148k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|   148k|    }
  124|  3.11M|  }
  125|    443|  return true;
  126|    443|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    601|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    601|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    577|                          const PointIndex* /* entry_to_point_id_map */) {
   64|    577|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    577|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    577|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    577|      new DataTypeT[num_components]());
   70|       |
   71|    577|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    577|  const CornerTable* const table = this->mesh_data().corner_table();
   74|    577|  const std::vector<int32_t>* const vertex_to_data_map =
   75|    577|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    577|  const int corner_map_size =
   78|    577|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    577|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 577]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|  1.40M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 1.40M, False: 577]
  ------------------
   83|  1.40M|    const CornerIndex start_corner_id =
   84|  1.40M|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|  1.40M|    CornerIndex corner_id(start_corner_id);
   87|  1.40M|    int num_parallelograms = 0;
   88|  56.1M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 54.7M, False: 1.40M]
  ------------------
   89|  54.7M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  54.7M|    }
   91|  9.63M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 8.22M, False: 1.40M]
  ------------------
   92|  8.22M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 2.71M, False: 5.51M]
  ------------------
   93|  8.22M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  8.22M|              num_components, parallelogram_pred_vals.get())) {
   95|   102M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 99.6M, False: 2.71M]
  ------------------
   96|  99.6M|          pred_vals[c] =
   97|  99.6M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  99.6M|        }
   99|  2.71M|        ++num_parallelograms;
  100|  2.71M|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  8.22M|      corner_id = table->SwingRight(corner_id);
  104|  8.22M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 1.36M, False: 6.86M]
  ------------------
  105|  1.36M|        corner_id = kInvalidCornerIndex;
  106|  1.36M|      }
  107|  8.22M|    }
  108|       |
  109|  1.40M|    const int dst_offset = p * num_components;
  110|  1.40M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 19.0k, False: 1.38M]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  19.0k|      const int src_offset = (p - 1) * num_components;
  114|  19.0k|      this->transform().ComputeOriginalValue(
  115|  19.0k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|  1.38M|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  52.7M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 51.3M, False: 1.38M]
  ------------------
  119|  51.3M|        pred_vals[c] /= num_parallelograms;
  120|  51.3M|      }
  121|  1.38M|      this->transform().ComputeOriginalValue(
  122|  1.38M|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|  1.38M|    }
  124|  1.40M|  }
  125|    577|  return true;
  126|    577|}

_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|    770|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|    770|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|    739|                          const PointIndex* /* entry_to_point_id_map */) {
   61|    739|  this->transform().Init(num_components);
   62|       |
   63|    739|  const CornerTable* const table = this->mesh_data().corner_table();
   64|    739|  const std::vector<int32_t>* const vertex_to_data_map =
   65|    739|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|    739|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|    739|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    739|  const int corner_map_size =
   74|    739|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|    739|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (75:7): [True: 0, False: 739]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|  3.33M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (78:19): [True: 3.33M, False: 739]
  ------------------
   79|  3.33M|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   80|  3.33M|    const int dst_offset = p * num_components;
   81|  3.33M|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (81:9): [True: 3.27M, False: 53.2k]
  ------------------
   82|  3.33M|                                        *vertex_to_data_map, out_data,
   83|  3.33M|                                        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.27M|      const int src_offset = (p - 1) * num_components;
   88|  3.27M|      this->transform().ComputeOriginalValue(
   89|  3.27M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   90|  3.27M|    } else {
   91|       |      // Apply the parallelogram prediction.
   92|  53.2k|      this->transform().ComputeOriginalValue(
   93|  53.2k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   94|  53.2k|    }
   95|  3.33M|  }
   96|    739|  return true;
   97|    739|}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|    693|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|    693|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|    639|                          const PointIndex* /* entry_to_point_id_map */) {
   61|    639|  this->transform().Init(num_components);
   62|       |
   63|    639|  const CornerTable* const table = this->mesh_data().corner_table();
   64|    639|  const std::vector<int32_t>* const vertex_to_data_map =
   65|    639|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|    639|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|    639|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    639|  const int corner_map_size =
   74|    639|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|    639|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (75:7): [True: 0, False: 639]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|   445k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (78:19): [True: 445k, False: 639]
  ------------------
   79|   445k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   80|   445k|    const int dst_offset = p * num_components;
   81|   445k|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (81:9): [True: 3.32k, False: 441k]
  ------------------
   82|   445k|                                        *vertex_to_data_map, out_data,
   83|   445k|                                        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.32k|      const int src_offset = (p - 1) * num_components;
   88|  3.32k|      this->transform().ComputeOriginalValue(
   89|  3.32k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   90|   441k|    } else {
   91|       |      // Apply the parallelogram prediction.
   92|   441k|      this->transform().ComputeOriginalValue(
   93|   441k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   94|   441k|    }
   95|   445k|  }
   96|    639|  return true;
   97|    639|}

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  7.97M|    int num_components, DataTypeT* out_prediction) {
   49|  7.97M|  const CornerIndex oci = table->Opposite(ci);
   50|  7.97M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 6.95M, False: 1.01M]
  ------------------
   51|  6.95M|    return false;
   52|  6.95M|  }
   53|  1.01M|  int vert_opp, vert_next, vert_prev;
   54|  1.01M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  1.01M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  1.01M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 526k, False: 486k]
  |  Branch (56:35): [True: 401k, False: 125k]
  ------------------
   57|   401k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 377k, False: 24.1k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   377k|    const int v_opp_off = vert_opp * num_components;
   60|   377k|    const int v_next_off = vert_next * num_components;
   61|   377k|    const int v_prev_off = vert_prev * num_components;
   62|  29.5M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 29.1M, False: 377k]
  ------------------
   63|  29.1M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  29.1M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  29.1M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  29.1M|      const int64_t result =
   67|  29.1M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  29.1M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  29.1M|    }
   71|   377k|    return true;
   72|   377k|  }
   73|   636k|  return false;  // Not all data is available for prediction
   74|  1.01M|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  1.01M|    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.01M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  1.01M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  1.01M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  1.01M|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  9.27M|    int num_components, DataTypeT* out_prediction) {
   49|  9.27M|  const CornerIndex oci = table->Opposite(ci);
   50|  9.27M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 52.5k, False: 9.22M]
  ------------------
   51|  52.5k|    return false;
   52|  52.5k|  }
   53|  9.22M|  int vert_opp, vert_next, vert_prev;
   54|  9.22M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  9.22M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  9.22M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 4.79M, False: 4.42M]
  |  Branch (56:35): [True: 3.75M, False: 1.04M]
  ------------------
   57|  3.75M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 3.34M, False: 404k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  3.34M|    const int v_opp_off = vert_opp * num_components;
   60|  3.34M|    const int v_next_off = vert_next * num_components;
   61|  3.34M|    const int v_prev_off = vert_prev * num_components;
   62|   192M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 189M, False: 3.34M]
  ------------------
   63|   189M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|   189M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|   189M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|   189M|      const int64_t result =
   67|   189M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|   189M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|   189M|    }
   71|  3.34M|    return true;
   72|  3.34M|  }
   73|  5.87M|  return false;  // Not all data is available for prediction
   74|  9.22M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  9.22M|    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|  9.22M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  9.22M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  9.22M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  9.22M|}

_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    224|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    224|            attribute, transform, mesh_data),
   46|    224|        pos_attribute_(nullptr),
   47|    224|        entry_to_point_id_map_(nullptr),
   48|    224|        num_components_(0),
   49|    224|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   71|    444|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   73|    224|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    224|    DRACO_DCHECK_EQ(i, 0);
   75|    224|    (void)i;
   76|    224|    return GeometryAttribute::POSITION;
   77|    224|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    222|  bool SetParentAttribute(const PointAttribute* att) override {
   80|    222|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 222]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    222|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 222]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    222|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 2, False: 220]
  ------------------
   87|      2|      return false;  // Currently works only for 3 component positions.
   88|      2|    }
   89|    220|    pos_attribute_ = att;
   90|    220|    return true;
   91|    222|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  156|    216|    DecodePredictionData(DecoderBuffer* buffer) {
  157|       |  // Decode the delta coded orientations.
  158|    216|  uint32_t num_orientations = 0;
  159|    216|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    216|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (159:7): [True: 12, False: 204]
  ------------------
  160|     12|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (160:9): [True: 1, False: 11]
  ------------------
  161|      1|      return false;
  162|      1|    }
  163|    204|  } else {
  164|    204|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (164:9): [True: 1, False: 203]
  ------------------
  165|      1|      return false;
  166|      1|    }
  167|    204|  }
  168|    214|  if (num_orientations == 0) {
  ------------------
  |  Branch (168:7): [True: 2, False: 212]
  ------------------
  169|      2|    return false;
  170|      2|  }
  171|    212|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (171:7): [True: 20, False: 192]
  ------------------
  172|       |    // We can't have more orientations than the maximum number of decoded
  173|       |    // values.
  174|     20|    return false;
  175|     20|  }
  176|    192|  orientations_.resize(num_orientations);
  177|    192|  bool last_orientation = true;
  178|    192|  RAnsBitDecoder decoder;
  179|    192|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (179:7): [True: 4, False: 188]
  ------------------
  180|      4|    return false;
  181|      4|  }
  182|  49.4k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (182:24): [True: 49.2k, False: 188]
  ------------------
  183|  49.2k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (183:9): [True: 19.3k, False: 29.9k]
  ------------------
  184|  19.3k|      last_orientation = !last_orientation;
  185|  19.3k|    }
  186|  49.2k|    orientations_[i] = last_orientation;
  187|  49.2k|  }
  188|    188|  decoder.EndDecoding();
  189|    188|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  190|    188|                                     MeshDataT>::DecodePredictionData(buffer);
  191|    192|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|    138|                          const PointIndex* entry_to_point_id_map) {
  126|    138|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 11, False: 127]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|     11|    return false;
  129|     11|  }
  130|    127|  num_components_ = num_components;
  131|    127|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|    127|  predicted_value_ =
  133|    127|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|    127|  this->transform().Init(num_components);
  135|       |
  136|    127|  const int corner_map_size =
  137|    127|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|    127|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (138:7): [True: 0, False: 127]
  ------------------
  139|      0|    return false;
  140|      0|  }
  141|   213k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (141:19): [True: 213k, False: 96]
  ------------------
  142|   213k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  143|   213k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (143:9): [True: 31, False: 213k]
  ------------------
  144|     31|      return false;
  145|     31|    }
  146|       |
  147|   213k|    const int dst_offset = p * num_components;
  148|   213k|    this->transform().ComputeOriginalValue(
  149|   213k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  150|   213k|  }
  151|     96|  return true;
  152|    127|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  196|   213k|                          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|   213k|  const CornerIndex next_corner_id =
  201|   213k|      this->mesh_data().corner_table()->Next(corner_id);
  202|   213k|  const CornerIndex prev_corner_id =
  203|   213k|      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|   213k|  int next_data_id, prev_data_id;
  207|       |
  208|   213k|  int next_vert_id, prev_vert_id;
  209|   213k|  next_vert_id =
  210|   213k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  211|   213k|  prev_vert_id =
  212|   213k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  213|       |
  214|   213k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  215|   213k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  216|       |
  217|   213k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (217:7): [True: 143k, False: 69.7k]
  |  Branch (217:33): [True: 73.5k, False: 69.7k]
  ------------------
  218|       |    // Both other corners have available UV coordinates for prediction.
  219|  73.5k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  220|  73.5k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  221|  73.5k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (221:9): [True: 70.5k, False: 3.01k]
  ------------------
  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|   141k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (225:24): [True: 141k, False: 70.5k]
  ------------------
  226|   141k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (226:13): [True: 0, False: 141k]
  |  Branch (226:36): [True: 85, False: 141k]
  ------------------
  227|   141k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (227:13): [True: 0, False: 141k]
  ------------------
  228|     85|          predicted_value_[i] = INT_MIN;
  229|   141k|        } else {
  230|   141k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  231|   141k|        }
  232|   141k|      }
  233|  70.5k|      return true;
  234|  70.5k|    }
  235|       |
  236|       |    // Get positions at all corners.
  237|  3.01k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  238|  3.01k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  239|  3.01k|    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.01k|    const Vector3f pn = prev_pos - next_pos;
  264|  3.01k|    const Vector3f cn = tip_pos - next_pos;
  265|  3.01k|    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.01k|    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.01k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  6.03k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (276:9): [True: 0, False: 3.01k]
  |  Branch (276:53): [True: 517, False: 2.50k]
  ------------------
  277|    517|      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|    517|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  282|  2.50k|    } else {
  283|  2.50k|      s = 0;
  284|  2.50k|      t = 0;
  285|  2.50k|    }
  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.01k|    const Vector2f pn_uv = p_uv - n_uv;
  302|  3.01k|    const float pnus = pn_uv[0] * s + n_uv[0];
  303|  3.01k|    const float pnut = pn_uv[0] * t;
  304|  3.01k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  305|  3.01k|    const float pnvt = pn_uv[1] * t;
  306|  3.01k|    Vector2f predicted_uv;
  307|  3.01k|    if (orientations_.empty()) {
  ------------------
  |  Branch (307:9): [True: 31, False: 2.98k]
  ------------------
  308|     31|      return false;
  309|     31|    }
  310|       |
  311|       |    // When decoding the data, we already know which orientation to use.
  312|  2.98k|    const bool orientation = orientations_.back();
  313|  2.98k|    orientations_.pop_back();
  314|  2.98k|    if (orientation) {
  ------------------
  |  Branch (314:9): [True: 909, False: 2.07k]
  ------------------
  315|    909|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  316|  2.07k|    } else {
  317|  2.07k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  318|  2.07k|    }
  319|  2.98k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (319:9): [True: 2.98k, 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.98k|      const double u = floor(predicted_uv[0] + 0.5);
  324|  2.98k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (324:11): [True: 0, False: 2.98k]
  |  Branch (324:28): [True: 80, False: 2.90k]
  |  Branch (324:43): [True: 45, False: 2.86k]
  ------------------
  325|    125|        predicted_value_[0] = INT_MIN;
  326|  2.86k|      } else {
  327|  2.86k|        predicted_value_[0] = static_cast<int>(u);
  328|  2.86k|      }
  329|  2.98k|      const double v = floor(predicted_uv[1] + 0.5);
  330|  2.98k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (330:11): [True: 0, False: 2.98k]
  |  Branch (330:28): [True: 75, False: 2.91k]
  |  Branch (330:43): [True: 46, False: 2.86k]
  ------------------
  331|    121|        predicted_value_[1] = INT_MIN;
  332|  2.86k|      } else {
  333|  2.86k|        predicted_value_[1] = static_cast<int>(v);
  334|  2.86k|      }
  335|  2.98k|    } 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.98k|    return true;
  341|  3.01k|  }
  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|   139k|  int data_offset = 0;
  346|   139k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (346:7): [True: 69.7k, False: 69.7k]
  ------------------
  347|       |    // Use the value on the previous corner as the prediction.
  348|  69.7k|    data_offset = prev_data_id * num_components_;
  349|  69.7k|  }
  350|   139k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (350:7): [True: 21, False: 139k]
  ------------------
  351|       |    // Use the value on the next corner as the prediction.
  352|     21|    data_offset = next_data_id * num_components_;
  353|   139k|  } else {
  354|       |    // None of the other corners have a valid value. Use the last encoded value
  355|       |    // as the prediction if possible.
  356|   139k|    if (data_id > 0) {
  ------------------
  |  Branch (356:9): [True: 139k, False: 127]
  ------------------
  357|   139k|      data_offset = (data_id - 1) * num_components_;
  358|   139k|    } else {
  359|       |      // We are encoding the first value. Predict 0.
  360|    381|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (360:23): [True: 254, False: 127]
  ------------------
  361|    254|        predicted_value_[i] = 0;
  362|    254|      }
  363|    127|      return true;
  364|    127|    }
  365|   139k|  }
  366|   418k|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (366:19): [True: 278k, False: 139k]
  ------------------
  367|   278k|    predicted_value_[i] = data[data_offset + i];
  368|   278k|  }
  369|   139k|  return true;
  370|   139k|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   147k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT* data) const {
  103|   147k|    const int data_offset = entry_id * num_components_;
  104|   147k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   147k|                    static_cast<float>(data[data_offset + 1]));
  106|   147k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   94|  9.05k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  9.05k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  9.05k|    Vector3f pos;
   97|  9.05k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  9.05k|                                 &pos[0]);
   99|  9.05k|    return pos;
  100|  9.05k|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    250|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    250|            attribute, transform, mesh_data),
   46|    250|        pos_attribute_(nullptr),
   47|    250|        entry_to_point_id_map_(nullptr),
   48|    250|        num_components_(0),
   49|    250|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   71|    498|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   73|    250|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    250|    DRACO_DCHECK_EQ(i, 0);
   75|    250|    (void)i;
   76|    250|    return GeometryAttribute::POSITION;
   77|    250|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    249|  bool SetParentAttribute(const PointAttribute* att) override {
   80|    249|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 249]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    249|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 249]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    249|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 1, False: 248]
  ------------------
   87|      1|      return false;  // Currently works only for 3 component positions.
   88|      1|    }
   89|    248|    pos_attribute_ = att;
   90|    248|    return true;
   91|    249|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  156|    245|    DecodePredictionData(DecoderBuffer* buffer) {
  157|       |  // Decode the delta coded orientations.
  158|    245|  uint32_t num_orientations = 0;
  159|    245|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    245|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (159:7): [True: 5, False: 240]
  ------------------
  160|      5|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (160:9): [True: 0, False: 5]
  ------------------
  161|      0|      return false;
  162|      0|    }
  163|    240|  } else {
  164|    240|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (164:9): [True: 3, False: 237]
  ------------------
  165|      3|      return false;
  166|      3|    }
  167|    240|  }
  168|    242|  if (num_orientations == 0) {
  ------------------
  |  Branch (168:7): [True: 2, False: 240]
  ------------------
  169|      2|    return false;
  170|      2|  }
  171|    240|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (171:7): [True: 31, False: 209]
  ------------------
  172|       |    // We can't have more orientations than the maximum number of decoded
  173|       |    // values.
  174|     31|    return false;
  175|     31|  }
  176|    209|  orientations_.resize(num_orientations);
  177|    209|  bool last_orientation = true;
  178|    209|  RAnsBitDecoder decoder;
  179|    209|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (179:7): [True: 4, False: 205]
  ------------------
  180|      4|    return false;
  181|      4|  }
  182|   552k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (182:24): [True: 552k, False: 205]
  ------------------
  183|   552k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (183:9): [True: 229k, False: 323k]
  ------------------
  184|   229k|      last_orientation = !last_orientation;
  185|   229k|    }
  186|   552k|    orientations_[i] = last_orientation;
  187|   552k|  }
  188|    205|  decoder.EndDecoding();
  189|    205|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  190|    205|                                     MeshDataT>::DecodePredictionData(buffer);
  191|    209|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|    174|                          const PointIndex* entry_to_point_id_map) {
  126|    174|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 9, False: 165]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      9|    return false;
  129|      9|  }
  130|    165|  num_components_ = num_components;
  131|    165|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|    165|  predicted_value_ =
  133|    165|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|    165|  this->transform().Init(num_components);
  135|       |
  136|    165|  const int corner_map_size =
  137|    165|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|    165|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (138:7): [True: 0, False: 165]
  ------------------
  139|      0|    return false;
  140|      0|  }
  141|   253k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (141:19): [True: 253k, False: 147]
  ------------------
  142|   253k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  143|   253k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (143:9): [True: 18, False: 253k]
  ------------------
  144|     18|      return false;
  145|     18|    }
  146|       |
  147|   253k|    const int dst_offset = p * num_components;
  148|   253k|    this->transform().ComputeOriginalValue(
  149|   253k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  150|   253k|  }
  151|    147|  return true;
  152|    165|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  196|   253k|                          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|   253k|  const CornerIndex next_corner_id =
  201|   253k|      this->mesh_data().corner_table()->Next(corner_id);
  202|   253k|  const CornerIndex prev_corner_id =
  203|   253k|      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|   253k|  int next_data_id, prev_data_id;
  207|       |
  208|   253k|  int next_vert_id, prev_vert_id;
  209|   253k|  next_vert_id =
  210|   253k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  211|   253k|  prev_vert_id =
  212|   253k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  213|       |
  214|   253k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  215|   253k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  216|       |
  217|   253k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (217:7): [True: 253k, False: 454]
  |  Branch (217:33): [True: 252k, False: 396]
  ------------------
  218|       |    // Both other corners have available UV coordinates for prediction.
  219|   252k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  220|   252k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  221|   252k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (221:9): [True: 247k, False: 5.07k]
  ------------------
  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|   495k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (225:24): [True: 495k, False: 247k]
  ------------------
  226|   495k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (226:13): [True: 0, False: 495k]
  |  Branch (226:36): [True: 239, False: 495k]
  ------------------
  227|   495k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (227:13): [True: 0, False: 495k]
  ------------------
  228|    239|          predicted_value_[i] = INT_MIN;
  229|   495k|        } else {
  230|   495k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  231|   495k|        }
  232|   495k|      }
  233|   247k|      return true;
  234|   247k|    }
  235|       |
  236|       |    // Get positions at all corners.
  237|  5.07k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  238|  5.07k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  239|  5.07k|    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|  5.07k|    const Vector3f pn = prev_pos - next_pos;
  264|  5.07k|    const Vector3f cn = tip_pos - next_pos;
  265|  5.07k|    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|  5.07k|    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|  5.07k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  10.1k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (276:9): [True: 0, False: 5.07k]
  |  Branch (276:53): [True: 415, False: 4.66k]
  ------------------
  277|    415|      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|    415|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  282|  4.66k|    } else {
  283|  4.66k|      s = 0;
  284|  4.66k|      t = 0;
  285|  4.66k|    }
  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|  5.07k|    const Vector2f pn_uv = p_uv - n_uv;
  302|  5.07k|    const float pnus = pn_uv[0] * s + n_uv[0];
  303|  5.07k|    const float pnut = pn_uv[0] * t;
  304|  5.07k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  305|  5.07k|    const float pnvt = pn_uv[1] * t;
  306|  5.07k|    Vector2f predicted_uv;
  307|  5.07k|    if (orientations_.empty()) {
  ------------------
  |  Branch (307:9): [True: 18, False: 5.06k]
  ------------------
  308|     18|      return false;
  309|     18|    }
  310|       |
  311|       |    // When decoding the data, we already know which orientation to use.
  312|  5.06k|    const bool orientation = orientations_.back();
  313|  5.06k|    orientations_.pop_back();
  314|  5.06k|    if (orientation) {
  ------------------
  |  Branch (314:9): [True: 954, False: 4.10k]
  ------------------
  315|    954|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  316|  4.10k|    } else {
  317|  4.10k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  318|  4.10k|    }
  319|  5.06k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (319:9): [True: 5.06k, 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|  5.06k|      const double u = floor(predicted_uv[0] + 0.5);
  324|  5.06k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (324:11): [True: 0, False: 5.06k]
  |  Branch (324:28): [True: 143, False: 4.91k]
  |  Branch (324:43): [True: 69, False: 4.84k]
  ------------------
  325|    212|        predicted_value_[0] = INT_MIN;
  326|  4.84k|      } else {
  327|  4.84k|        predicted_value_[0] = static_cast<int>(u);
  328|  4.84k|      }
  329|  5.06k|      const double v = floor(predicted_uv[1] + 0.5);
  330|  5.06k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (330:11): [True: 0, False: 5.06k]
  |  Branch (330:28): [True: 143, False: 4.91k]
  |  Branch (330:43): [True: 73, False: 4.84k]
  ------------------
  331|    216|        predicted_value_[1] = INT_MIN;
  332|  4.84k|      } else {
  333|  4.84k|        predicted_value_[1] = static_cast<int>(v);
  334|  4.84k|      }
  335|  5.06k|    } 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|  5.06k|    return true;
  341|  5.07k|  }
  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|    850|  int data_offset = 0;
  346|    850|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (346:7): [True: 396, False: 454]
  ------------------
  347|       |    // Use the value on the previous corner as the prediction.
  348|    396|    data_offset = prev_data_id * num_components_;
  349|    396|  }
  350|    850|  if (next_data_id < data_id) {
  ------------------
  |  Branch (350:7): [True: 147, False: 703]
  ------------------
  351|       |    // Use the value on the next corner as the prediction.
  352|    147|    data_offset = next_data_id * num_components_;
  353|    703|  } else {
  354|       |    // None of the other corners have a valid value. Use the last encoded value
  355|       |    // as the prediction if possible.
  356|    703|    if (data_id > 0) {
  ------------------
  |  Branch (356:9): [True: 538, False: 165]
  ------------------
  357|    538|      data_offset = (data_id - 1) * num_components_;
  358|    538|    } else {
  359|       |      // We are encoding the first value. Predict 0.
  360|    495|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (360:23): [True: 330, False: 165]
  ------------------
  361|    330|        predicted_value_[i] = 0;
  362|    330|      }
  363|    165|      return true;
  364|    165|    }
  365|    703|  }
  366|  2.05k|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (366:19): [True: 1.37k, False: 685]
  ------------------
  367|  1.37k|    predicted_value_[i] = data[data_offset + i];
  368|  1.37k|  }
  369|    685|  return true;
  370|    850|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   505k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT* data) const {
  103|   505k|    const int data_offset = entry_id * num_components_;
  104|   505k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   505k|                    static_cast<float>(data[data_offset + 1]));
  106|   505k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   94|  15.2k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  15.2k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  15.2k|    Vector3f pos;
   97|  15.2k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  15.2k|                                 &pos[0]);
   99|  15.2k|    return pos;
  100|  15.2k|  }

_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   38|    210|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   39|    210|            attribute, transform, mesh_data),
   40|    210|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   62|    418|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   64|    210|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   65|    210|    DRACO_DCHECK_EQ(i, 0);
   66|    210|    (void)i;
   67|    210|    return GeometryAttribute::POSITION;
   68|    210|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   70|    209|  bool SetParentAttribute(const PointAttribute* att) override {
   71|    209|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (71:9): [True: 0, False: 209]
  |  Branch (71:17): [True: 0, False: 209]
  ------------------
   72|      0|      return false;  // Invalid attribute type.
   73|      0|    }
   74|    209|    if (att->num_components() != 3) {
  ------------------
  |  Branch (74:9): [True: 1, False: 208]
  ------------------
   75|      1|      return false;  // Currently works only for 3 component positions.
   76|      1|    }
   77|    208|    predictor_.SetPositionAttribute(*att);
   78|    208|    return true;
   79|    209|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  128|    203|                                                                buffer) {
  129|       |  // Decode the delta coded orientations.
  130|    203|  int32_t num_orientations = 0;
  131|    203|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (131:7): [True: 2, False: 201]
  |  Branch (131:45): [True: 8, False: 193]
  ------------------
  132|     10|    return false;
  133|     10|  }
  134|       |
  135|       |  // Check that the decoded number of orientations is not unreasonably high.
  136|    193|  const int32_t max_num_orientations = max_num_predicted_values_;
  137|    193|  if (max_num_orientations != -1 && num_orientations > max_num_orientations) {
  ------------------
  |  Branch (137:7): [True: 193, False: 0]
  |  Branch (137:37): [True: 45, False: 148]
  ------------------
  138|     45|    return false;
  139|     45|  }
  140|       |
  141|    148|  predictor_.ResizeOrientations(num_orientations);
  142|    148|  bool last_orientation = true;
  143|    148|  RAnsBitDecoder decoder;
  144|    148|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (144:7): [True: 4, False: 144]
  ------------------
  145|      4|    return false;
  146|      4|  }
  147|   102k|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (147:19): [True: 102k, False: 144]
  ------------------
  148|   102k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (148:9): [True: 4.04k, False: 98.2k]
  ------------------
  149|  4.04k|      last_orientation = !last_orientation;
  150|  4.04k|    }
  151|   102k|    predictor_.set_orientation(i, last_orientation);
  152|   102k|  }
  153|    144|  decoder.EndDecoding();
  154|    144|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  155|    144|                                     MeshDataT>::DecodePredictionData(buffer);
  156|    148|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE24SetMaxNumPredictedValuesEi:
   81|    203|  virtual void SetMaxNumPredictedValues(int32_t num) {
   82|    203|    max_num_predicted_values_ = num;
   83|    203|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   97|    114|                                      const PointIndex* entry_to_point_id_map) {
   98|    114|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (98:7): [True: 14, False: 100]
  ------------------
   99|    114|                            DataTypeT, MeshDataT>::kNumComponents) {
  100|     14|    return false;
  101|     14|  }
  102|    100|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  103|    100|  this->transform().Init(num_components);
  104|       |
  105|    100|  const int corner_map_size =
  106|    100|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  107|    100|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (107:7): [True: 0, False: 100]
  ------------------
  108|      0|    return false;
  109|      0|  }
  110|  11.4k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 11.4k, False: 73]
  ------------------
  111|  11.4k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  112|  11.4k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (112:9): [True: 27, False: 11.3k]
  ------------------
  113|  11.4k|                                                          p)) {
  114|     27|      return false;
  115|     27|    }
  116|       |
  117|  11.3k|    const int dst_offset = p * num_components;
  118|  11.3k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  119|  11.3k|                                           in_corr + dst_offset,
  120|  11.3k|                                           out_data + dst_offset);
  121|  11.3k|  }
  122|     73|  return true;
  123|    100|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   38|    232|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   39|    232|            attribute, transform, mesh_data),
   40|    232|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   62|    462|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   64|    232|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   65|    232|    DRACO_DCHECK_EQ(i, 0);
   66|    232|    (void)i;
   67|    232|    return GeometryAttribute::POSITION;
   68|    232|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   70|    231|  bool SetParentAttribute(const PointAttribute* att) override {
   71|    231|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (71:9): [True: 0, False: 231]
  |  Branch (71:17): [True: 0, False: 231]
  ------------------
   72|      0|      return false;  // Invalid attribute type.
   73|      0|    }
   74|    231|    if (att->num_components() != 3) {
  ------------------
  |  Branch (74:9): [True: 1, False: 230]
  ------------------
   75|      1|      return false;  // Currently works only for 3 component positions.
   76|      1|    }
   77|    230|    predictor_.SetPositionAttribute(*att);
   78|    230|    return true;
   79|    231|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  128|    224|                                                                buffer) {
  129|       |  // Decode the delta coded orientations.
  130|    224|  int32_t num_orientations = 0;
  131|    224|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (131:7): [True: 2, False: 222]
  |  Branch (131:45): [True: 22, False: 200]
  ------------------
  132|     24|    return false;
  133|     24|  }
  134|       |
  135|       |  // Check that the decoded number of orientations is not unreasonably high.
  136|    200|  const int32_t max_num_orientations = max_num_predicted_values_;
  137|    200|  if (max_num_orientations != -1 && num_orientations > max_num_orientations) {
  ------------------
  |  Branch (137:7): [True: 200, False: 0]
  |  Branch (137:37): [True: 77, False: 123]
  ------------------
  138|     77|    return false;
  139|     77|  }
  140|       |
  141|    123|  predictor_.ResizeOrientations(num_orientations);
  142|    123|  bool last_orientation = true;
  143|    123|  RAnsBitDecoder decoder;
  144|    123|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (144:7): [True: 1, False: 122]
  ------------------
  145|      1|    return false;
  146|      1|  }
  147|  26.6k|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (147:19): [True: 26.5k, False: 122]
  ------------------
  148|  26.5k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (148:9): [True: 966, False: 25.5k]
  ------------------
  149|    966|      last_orientation = !last_orientation;
  150|    966|    }
  151|  26.5k|    predictor_.set_orientation(i, last_orientation);
  152|  26.5k|  }
  153|    122|  decoder.EndDecoding();
  154|    122|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  155|    122|                                     MeshDataT>::DecodePredictionData(buffer);
  156|    123|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE24SetMaxNumPredictedValuesEi:
   81|    224|  virtual void SetMaxNumPredictedValues(int32_t num) {
   82|    224|    max_num_predicted_values_ = num;
   83|    224|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   97|    106|                                      const PointIndex* entry_to_point_id_map) {
   98|    106|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (98:7): [True: 1, False: 105]
  ------------------
   99|    106|                            DataTypeT, MeshDataT>::kNumComponents) {
  100|      1|    return false;
  101|      1|  }
  102|    105|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  103|    105|  this->transform().Init(num_components);
  104|       |
  105|    105|  const int corner_map_size =
  106|    105|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  107|    105|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (107:7): [True: 0, False: 105]
  ------------------
  108|      0|    return false;
  109|      0|  }
  110|   245k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 245k, False: 82]
  ------------------
  111|   245k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  112|   245k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (112:9): [True: 23, False: 245k]
  ------------------
  113|   245k|                                                          p)) {
  114|     23|      return false;
  115|     23|    }
  116|       |
  117|   245k|    const int dst_offset = p * num_components;
  118|   245k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  119|   245k|                                           in_corr + dst_offset,
  120|   245k|                                           out_data + dst_offset);
  121|   245k|  }
  122|     82|  return true;
  123|    105|}

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    210|      : pos_attribute_(nullptr),
   39|    210|        entry_to_point_id_map_(nullptr),
   40|    210|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    208|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    208|    pos_attribute_ = &position_attribute;
   43|    208|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    148|  void ResizeOrientations(int num_orientations) {
   74|    148|    orientations_.resize(num_orientations);
   75|    148|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|   102k|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    100|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    100|    entry_to_point_id_map_ = map;
   46|    100|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|  11.4k|                                                 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|  11.4k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|  11.4k|  const CornerIndex prev_corner_id =
   99|  11.4k|      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|  11.4k|  int next_data_id, prev_data_id;
  103|       |
  104|  11.4k|  int next_vert_id, prev_vert_id;
  105|  11.4k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|  11.4k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|  11.4k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|  11.4k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|  11.4k|  typedef VectorD<int64_t, 2> Vec2;
  112|  11.4k|  typedef VectorD<int64_t, 3> Vec3;
  113|  11.4k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|  11.4k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 8.36k, False: 3.05k]
  |  Branch (115:33): [True: 5.30k, False: 3.05k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|  5.30k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|  5.30k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|  5.30k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 1.81k, False: 3.49k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|  1.81k|      predicted_value_[0] = p_uv[0];
  122|  1.81k|      predicted_value_[1] = p_uv[1];
  123|  1.81k|      return true;
  124|  1.81k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  3.49k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  3.49k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  3.49k|    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.49k|    const Vec3 pn = prev_pos - next_pos;
  146|  3.49k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  3.49k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 27, False: 3.46k]
  ------------------
  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|     27|      const Vec3 cn = tip_pos - next_pos;
  153|     27|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|     27|      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|     27|      const int64_t n_uv_absmax_element =
  164|     27|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|     27|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 6, False: 21]
  ------------------
  166|     27|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|      6|        return false;
  169|      6|      }
  170|     21|      const int64_t pn_uv_absmax_element =
  171|     21|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|     21|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 2, False: 19]
  ------------------
  173|     21|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      2|        return false;
  176|      2|      }
  177|       |      // Keep the scaled prediction arithmetic in the unsigned domain.
  178|     19|      const Vec2 x_uv = Vec2(Vec2u(n_uv) * pn_norm2_squared +
  179|     19|                             Vec2u(pn_uv) * static_cast<uint64_t>(cn_dot_pn));
  180|     19|      const int64_t pn_absmax_element =
  181|     19|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  182|     19|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (182:11): [True: 0, False: 19]
  ------------------
  183|     19|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  184|       |        // Return false if squared length calculation would overflow.
  185|      0|        return false;
  186|      0|      }
  187|       |
  188|       |      // Compute squared length of vector CX in position coordinate system:
  189|     19|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  190|     19|      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|     19|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  207|       |      // Compute CX.Norm2() * PN.Norm2()
  208|     19|      const uint64_t norm_squared =
  209|     19|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  210|       |      // Final cx_uv in the scaled coordinate space.
  211|     19|      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|     19|      Vec2 predicted_uv;
  216|     19|      if (is_encoder_t) {
  ------------------
  |  Branch (216:11): [Folded, False: 19]
  ------------------
  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|     19|      } else {
  233|       |        // When decoding the data, we already know which orientation to use.
  234|     19|        if (orientations_.empty()) {
  ------------------
  |  Branch (234:13): [True: 19, False: 0]
  ------------------
  235|     19|          return false;
  236|     19|        }
  237|      0|        const bool orientation = orientations_.back();
  238|      0|        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|      0|        if (orientation) {
  ------------------
  |  Branch (241:13): [True: 0, False: 0]
  ------------------
  242|      0|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  243|      0|        } else {
  244|      0|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  245|      0|        }
  246|      0|      }
  247|      0|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  248|      0|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  249|      0|      return true;
  250|     19|    }
  251|  3.49k|  }
  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|  9.57k|  int data_offset = 0;
  256|  9.57k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (256:7): [True: 6.52k, False: 3.05k]
  ------------------
  257|       |    // Use the value on the previous corner as the prediction.
  258|  6.52k|    data_offset = prev_data_id * kNumComponents;
  259|  6.52k|  }
  260|  9.57k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (260:7): [True: 3.46k, False: 6.11k]
  ------------------
  261|       |    // Use the value on the next corner as the prediction.
  262|  3.46k|    data_offset = next_data_id * kNumComponents;
  263|  6.11k|  } else {
  264|       |    // None of the other corners have a valid value. Use the last encoded value
  265|       |    // as the prediction if possible.
  266|  6.11k|    if (data_id > 0) {
  ------------------
  |  Branch (266:9): [True: 6.01k, False: 100]
  ------------------
  267|  6.01k|      data_offset = (data_id - 1) * kNumComponents;
  268|  6.01k|    } else {
  269|       |      // We are encoding the first value. Predict 0.
  270|    300|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (270:23): [True: 200, False: 100]
  ------------------
  271|    200|        predicted_value_[i] = 0;
  272|    200|      }
  273|    100|      return true;
  274|    100|    }
  275|  6.11k|  }
  276|  28.4k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (276:19): [True: 18.9k, False: 9.47k]
  ------------------
  277|  18.9k|    predicted_value_[i] = data[data_offset + i];
  278|  18.9k|  }
  279|  9.47k|  return true;
  280|  9.57k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|  10.6k|                                            const DataTypeT* data) const {
   59|  10.6k|    const int data_offset = entry_id * kNumComponents;
   60|  10.6k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|  10.6k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  10.4k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  10.4k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  10.4k|    VectorD<int64_t, 3> pos;
   52|  10.4k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  10.4k|                                 &pos[0]);
   54|  10.4k|    return pos;
   55|  10.4k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|  11.3k|  const DataTypeT* predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    232|      : pos_attribute_(nullptr),
   39|    232|        entry_to_point_id_map_(nullptr),
   40|    232|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    230|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    230|    pos_attribute_ = &position_attribute;
   43|    230|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    123|  void ResizeOrientations(int num_orientations) {
   74|    123|    orientations_.resize(num_orientations);
   75|    123|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  26.5k|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    105|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    105|    entry_to_point_id_map_ = map;
   46|    105|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   245k|                                                 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|   245k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   245k|  const CornerIndex prev_corner_id =
   99|   245k|      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|   245k|  int next_data_id, prev_data_id;
  103|       |
  104|   245k|  int next_vert_id, prev_vert_id;
  105|   245k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   245k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   245k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   245k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   245k|  typedef VectorD<int64_t, 2> Vec2;
  112|   245k|  typedef VectorD<int64_t, 3> Vec3;
  113|   245k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   245k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 245k, False: 214]
  |  Branch (115:33): [True: 245k, False: 210]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   245k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   245k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   245k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 243k, False: 2.21k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   243k|      predicted_value_[0] = p_uv[0];
  122|   243k|      predicted_value_[1] = p_uv[1];
  123|   243k|      return true;
  124|   243k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  2.21k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  2.21k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  2.21k|    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|  2.21k|    const Vec3 pn = prev_pos - next_pos;
  146|  2.21k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  2.21k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 23, False: 2.19k]
  ------------------
  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|     23|      const Vec3 cn = tip_pos - next_pos;
  153|     23|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|     23|      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|     23|      const int64_t n_uv_absmax_element =
  164|     23|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|     23|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 2, False: 21]
  ------------------
  166|     23|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|      2|        return false;
  169|      2|      }
  170|     21|      const int64_t pn_uv_absmax_element =
  171|     21|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|     21|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 4, False: 17]
  ------------------
  173|     21|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      4|        return false;
  176|      4|      }
  177|       |      // Keep the scaled prediction arithmetic in the unsigned domain.
  178|     17|      const Vec2 x_uv = Vec2(Vec2u(n_uv) * pn_norm2_squared +
  179|     17|                             Vec2u(pn_uv) * static_cast<uint64_t>(cn_dot_pn));
  180|     17|      const int64_t pn_absmax_element =
  181|     17|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  182|     17|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (182:11): [True: 3, False: 14]
  ------------------
  183|     17|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  184|       |        // Return false if squared length calculation would overflow.
  185|      3|        return false;
  186|      3|      }
  187|       |
  188|       |      // Compute squared length of vector CX in position coordinate system:
  189|     14|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  190|     14|      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|     14|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  207|       |      // Compute CX.Norm2() * PN.Norm2()
  208|     14|      const uint64_t norm_squared =
  209|     14|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  210|       |      // Final cx_uv in the scaled coordinate space.
  211|     14|      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|     14|      Vec2 predicted_uv;
  216|     14|      if (is_encoder_t) {
  ------------------
  |  Branch (216:11): [Folded, False: 14]
  ------------------
  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|     14|      } else {
  233|       |        // When decoding the data, we already know which orientation to use.
  234|     14|        if (orientations_.empty()) {
  ------------------
  |  Branch (234:13): [True: 14, False: 0]
  ------------------
  235|     14|          return false;
  236|     14|        }
  237|      0|        const bool orientation = orientations_.back();
  238|      0|        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|      0|        if (orientation) {
  ------------------
  |  Branch (241:13): [True: 0, False: 0]
  ------------------
  242|      0|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  243|      0|        } else {
  244|      0|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  245|      0|        }
  246|      0|      }
  247|      0|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  248|      0|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  249|      0|      return true;
  250|     14|    }
  251|  2.21k|  }
  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|  2.61k|  int data_offset = 0;
  256|  2.61k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (256:7): [True: 2.40k, False: 214]
  ------------------
  257|       |    // Use the value on the previous corner as the prediction.
  258|  2.40k|    data_offset = prev_data_id * kNumComponents;
  259|  2.40k|  }
  260|  2.61k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (260:7): [True: 2.20k, False: 406]
  ------------------
  261|       |    // Use the value on the next corner as the prediction.
  262|  2.20k|    data_offset = next_data_id * kNumComponents;
  263|  2.20k|  } else {
  264|       |    // None of the other corners have a valid value. Use the last encoded value
  265|       |    // as the prediction if possible.
  266|    406|    if (data_id > 0) {
  ------------------
  |  Branch (266:9): [True: 301, False: 105]
  ------------------
  267|    301|      data_offset = (data_id - 1) * kNumComponents;
  268|    301|    } else {
  269|       |      // We are encoding the first value. Predict 0.
  270|    315|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (270:23): [True: 210, False: 105]
  ------------------
  271|    210|        predicted_value_[i] = 0;
  272|    210|      }
  273|    105|      return true;
  274|    105|    }
  275|    406|  }
  276|  7.53k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (276:19): [True: 5.02k, False: 2.51k]
  ------------------
  277|  5.02k|    predicted_value_[i] = data[data_offset + i];
  278|  5.02k|  }
  279|  2.51k|  return true;
  280|  2.61k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   490k|                                            const DataTypeT* data) const {
   59|   490k|    const int data_offset = entry_id * kNumComponents;
   60|   490k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   490k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  6.64k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  6.64k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  6.64k|    VectorD<int64_t, 3> pos;
   52|  6.64k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  6.64k|                                 &pos[0]);
   54|  6.64k|    return pos;
   55|  6.64k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   245k|  const DataTypeT* predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    144|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    500|  bool AreCorrectionsPositive() override {
   71|    500|    return transform_.AreCorrectionsPositive();
   72|    500|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    131|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|    131|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 9, False: 122]
  ------------------
   50|      9|      return false;
   51|      9|    }
   52|    122|    return true;
   53|    131|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  1.15M|  inline Transform& transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    172|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    569|  bool AreCorrectionsPositive() override {
   71|    569|    return transform_.AreCorrectionsPositive();
   72|    569|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    168|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|    168|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 15, False: 153]
  ------------------
   50|     15|      return false;
   51|     15|    }
   52|    153|    return true;
   53|    168|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  1.46M|  inline Transform& transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  6.14k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  4.16k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  5.93k|  bool AreCorrectionsPositive() override {
   71|  5.93k|    return transform_.AreCorrectionsPositive();
   72|  5.93k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  4.43k|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|  4.43k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 255, False: 4.17k]
  ------------------
   50|    255|      return false;
   51|    255|    }
   52|  4.17k|    return true;
   53|  4.43k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  11.0M|  inline Transform& transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    518|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    578|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    518|                                 const PointCloudDecoder* decoder) {
  188|    518|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    518|      method, att_id, decoder, TransformT());
  190|    518|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    518|                                 const TransformT& transform) {
  156|    518|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 518]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    518|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|    518|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 518, 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|    518|    const MeshDecoder* const mesh_decoder =
  167|    518|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|    518|    auto ret = CreateMeshPredictionScheme<
  170|    518|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    518|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    518|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    518|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 374, False: 144]
  ------------------
  174|    374|      return ret;
  175|    374|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    518|  }
  178|       |  // Create delta decoder.
  179|    144|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    144|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    518|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    178|      uint16_t bitstream_version) {
  143|    178|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    178|        method, attribute, transform, mesh_data, bitstream_version);
  145|    178|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    178|        uint16_t bitstream_version) {
  127|    178|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 163, False: 15]
  ------------------
  128|    163|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    163|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    163|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    163|                                                  mesh_data));
  132|    163|      }
  133|     15|      return nullptr;
  134|    178|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    220|      uint16_t bitstream_version) {
  143|    220|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    220|        method, attribute, transform, mesh_data, bitstream_version);
  145|    220|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    220|        uint16_t bitstream_version) {
  127|    220|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 211, False: 9]
  ------------------
  128|    211|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    211|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    211|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    211|                                                  mesh_data));
  132|    211|      }
  133|      9|      return nullptr;
  134|    220|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    578|                                 const PointCloudDecoder* decoder) {
  188|    578|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    578|      method, att_id, decoder, TransformT());
  190|    578|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    578|                                 const TransformT& transform) {
  156|    578|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 578]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    578|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|    578|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 578, 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|    578|    const MeshDecoder* const mesh_decoder =
  167|    578|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|    578|    auto ret = CreateMeshPredictionScheme<
  170|    578|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    578|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    578|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    578|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 406, False: 172]
  ------------------
  174|    406|      return ret;
  175|    406|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    578|  }
  178|       |  // Create delta decoder.
  179|    172|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    172|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    578|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    193|      uint16_t bitstream_version) {
  143|    193|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    193|        method, attribute, transform, mesh_data, bitstream_version);
  145|    193|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    193|        uint16_t bitstream_version) {
  111|    193|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 178, False: 15]
  ------------------
  112|    178|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    178|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    178|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    178|                                                  mesh_data));
  116|    178|      }
  117|     15|      return nullptr;
  118|    193|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    229|      uint16_t bitstream_version) {
  143|    229|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    229|        method, attribute, transform, mesh_data, bitstream_version);
  145|    229|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    229|        uint16_t bitstream_version) {
  111|    229|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 228, False: 1]
  ------------------
  112|    228|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    228|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    228|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    228|                                                  mesh_data));
  116|    228|      }
  117|      1|      return nullptr;
  118|    229|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  6.14k|                                 const PointCloudDecoder* decoder) {
  188|  6.14k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  6.14k|      method, att_id, decoder, TransformT());
  190|  6.14k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  6.14k|                                 const TransformT& transform) {
  156|  6.14k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 6.14k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  6.14k|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|  6.14k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 6.14k, 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|  6.14k|    const MeshDecoder* const mesh_decoder =
  167|  6.14k|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|  6.14k|    auto ret = CreateMeshPredictionScheme<
  170|  6.14k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  6.14k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  6.14k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  6.14k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 5.77k, False: 366]
  ------------------
  174|  5.77k|      return ret;
  175|  5.77k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  6.14k|  }
  178|       |  // Create delta decoder.
  179|    366|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    366|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  6.14k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.79k|      uint16_t bitstream_version) {
  143|  2.79k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.79k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.79k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.79k|        uint16_t bitstream_version) {
   53|  2.79k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 770, False: 2.02k]
  ------------------
   54|    770|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    770|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    770|                                                         MeshDataT>(
   57|    770|                attribute, transform, mesh_data));
   58|    770|      }
   59|  2.02k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  2.02k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 456, False: 1.57k]
  ------------------
   61|    456|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    456|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    456|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    456|                                                  mesh_data));
   65|    456|      }
   66|  1.57k|#endif
   67|  1.57k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 627, False: 944]
  ------------------
   68|    627|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    627|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    627|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    627|                                                  mesh_data));
   72|    627|      }
   73|    944|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    944|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 224, False: 720]
  ------------------
   75|    224|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    224|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    224|                                                     MeshDataT>(
   78|    224|                attribute, transform, mesh_data, bitstream_version));
   79|    224|      }
   80|    720|#endif
   81|    720|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 210, False: 510]
  ------------------
   82|    210|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    210|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    210|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    210|                                                  mesh_data));
   86|    210|      }
   87|    510|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    510|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 510, False: 0]
  ------------------
   89|    510|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    510|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    510|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    510|                                                  mesh_data));
   93|    510|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.79k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.97k|      uint16_t bitstream_version) {
  143|  2.97k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.97k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.97k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.97k|        uint16_t bitstream_version) {
   53|  2.97k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 693, False: 2.28k]
  ------------------
   54|    693|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    693|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    693|                                                         MeshDataT>(
   57|    693|                attribute, transform, mesh_data));
   58|    693|      }
   59|  2.28k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  2.28k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 601, False: 1.68k]
  ------------------
   61|    601|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    601|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    601|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    601|                                                  mesh_data));
   65|    601|      }
   66|  1.68k|#endif
   67|  1.68k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 653, False: 1.03k]
  ------------------
   68|    653|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    653|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    653|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    653|                                                  mesh_data));
   72|    653|      }
   73|  1.03k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|  1.03k|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 250, False: 782]
  ------------------
   75|    250|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    250|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    250|                                                     MeshDataT>(
   78|    250|                attribute, transform, mesh_data, bitstream_version));
   79|    250|      }
   80|    782|#endif
   81|    782|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 232, False: 550]
  ------------------
   82|    232|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    232|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    232|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    232|                                                  mesh_data));
   86|    232|      }
   87|    550|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    550|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 550, False: 0]
  ------------------
   89|    550|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    550|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    550|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    550|                                                  mesh_data));
   93|    550|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.97k|    }

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

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    122|    const PointIndex*) {
   50|    122|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    122|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    122|  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|  48.2k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 48.1k, False: 122]
  ------------------
   57|  48.1k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  48.1k|                                           in_corr + i, out_data + i);
   59|  48.1k|  }
   60|    122|  return true;
   61|    122|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    153|    const PointIndex*) {
   50|    153|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    153|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    153|  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|   179k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 179k, False: 153]
  ------------------
   57|   179k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   179k|                                           in_corr + i, out_data + i);
   59|   179k|  }
   60|    153|  return true;
   61|    153|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    366|      : 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|  90.7k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 90.4k, False: 291]
  ------------------
   57|  90.4k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  90.4k|                                           in_corr + i, out_data + i);
   59|  90.4k|  }
   60|    291|  return true;
   61|    291|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    144|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    172|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    518|    uint16_t bitstream_version) {
   38|    518|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|    518|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 518, False: 0]
  ------------------
   40|    518|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 21, False: 497]
  ------------------
   41|    497|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 24, False: 473]
  ------------------
   42|    473|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 59, False: 414]
  ------------------
   43|    414|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 414]
  ------------------
   44|    414|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 374, False: 40]
  ------------------
   45|    493|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 15, False: 25]
  ------------------
   46|    493|    const CornerTable* const ct = source->GetCornerTable();
   47|    493|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|    493|        source->GetAttributeEncodingData(att_id);
   49|    493|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 95, False: 398]
  |  Branch (49:26): [True: 0, False: 398]
  ------------------
   50|       |      // No connectivity data found.
   51|     95|      return nullptr;
   52|     95|    }
   53|       |    // Connectivity data exists.
   54|    398|    const MeshAttributeCornerTable* const att_ct =
   55|    398|        source->GetAttributeCornerTable(att_id);
   56|    398|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 178, False: 220]
  ------------------
   57|    178|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    178|      MeshData md;
   59|    178|      md.Set(source->mesh(), att_ct,
   60|    178|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    178|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    178|      MeshPredictionSchemeFactoryT factory;
   63|    178|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    178|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 163, False: 15]
  ------------------
   65|    163|        return ret;
   66|    163|      }
   67|    220|    } else {
   68|    220|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    220|      MeshData md;
   70|    220|      md.Set(source->mesh(), ct,
   71|    220|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    220|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    220|      MeshPredictionSchemeFactoryT factory;
   74|    220|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    220|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 211, False: 9]
  ------------------
   76|    211|        return ret;
   77|    211|      }
   78|    220|    }
   79|    398|  }
   80|     49|  return nullptr;
   81|    518|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    578|    uint16_t bitstream_version) {
   38|    578|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|    578|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 578, False: 0]
  ------------------
   40|    578|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1, False: 577]
  ------------------
   41|    577|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 5, False: 572]
  ------------------
   42|    572|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 139, False: 433]
  ------------------
   43|    433|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 2, False: 431]
  ------------------
   44|    431|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 406, False: 25]
  ------------------
   45|    561|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 8, False: 17]
  ------------------
   46|    561|    const CornerTable* const ct = source->GetCornerTable();
   47|    561|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|    561|        source->GetAttributeEncodingData(att_id);
   49|    561|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 139, False: 422]
  |  Branch (49:26): [True: 0, False: 422]
  ------------------
   50|       |      // No connectivity data found.
   51|    139|      return nullptr;
   52|    139|    }
   53|       |    // Connectivity data exists.
   54|    422|    const MeshAttributeCornerTable* const att_ct =
   55|    422|        source->GetAttributeCornerTable(att_id);
   56|    422|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 193, False: 229]
  ------------------
   57|    193|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    193|      MeshData md;
   59|    193|      md.Set(source->mesh(), att_ct,
   60|    193|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    193|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    193|      MeshPredictionSchemeFactoryT factory;
   63|    193|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    193|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 178, False: 15]
  ------------------
   65|    178|        return ret;
   66|    178|      }
   67|    229|    } else {
   68|    229|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    229|      MeshData md;
   70|    229|      md.Set(source->mesh(), ct,
   71|    229|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    229|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    229|      MeshPredictionSchemeFactoryT factory;
   74|    229|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    229|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 228, False: 1]
  ------------------
   76|    228|        return ret;
   77|    228|      }
   78|    229|    }
   79|    422|  }
   80|     33|  return nullptr;
   81|    578|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  6.14k|    uint16_t bitstream_version) {
   38|  6.14k|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|  6.14k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 6.14k, False: 0]
  ------------------
   40|  6.14k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.55k, False: 4.58k]
  ------------------
   41|  4.58k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1.05k, False: 3.52k]
  ------------------
   42|  3.52k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 1.31k, False: 2.21k]
  ------------------
   43|  2.21k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 442, False: 1.77k]
  ------------------
   44|  1.77k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 1.06k, False: 713]
  ------------------
   45|  5.90k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 476, False: 237]
  ------------------
   46|  5.90k|    const CornerTable* const ct = source->GetCornerTable();
   47|  5.90k|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|  5.90k|        source->GetAttributeEncodingData(att_id);
   49|  5.90k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 129, False: 5.77k]
  |  Branch (49:26): [True: 0, False: 5.77k]
  ------------------
   50|       |      // No connectivity data found.
   51|    129|      return nullptr;
   52|    129|    }
   53|       |    // Connectivity data exists.
   54|  5.77k|    const MeshAttributeCornerTable* const att_ct =
   55|  5.77k|        source->GetAttributeCornerTable(att_id);
   56|  5.77k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 2.79k, False: 2.97k]
  ------------------
   57|  2.79k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  2.79k|      MeshData md;
   59|  2.79k|      md.Set(source->mesh(), att_ct,
   60|  2.79k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  2.79k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  2.79k|      MeshPredictionSchemeFactoryT factory;
   63|  2.79k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  2.79k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 2.79k, False: 0]
  ------------------
   65|  2.79k|        return ret;
   66|  2.79k|      }
   67|  2.97k|    } else {
   68|  2.97k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.97k|      MeshData md;
   70|  2.97k|      md.Set(source->mesh(), ct,
   71|  2.97k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.97k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.97k|      MeshPredictionSchemeFactoryT factory;
   74|  2.97k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.97k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.97k, False: 0]
  ------------------
   76|  2.97k|        return ret;
   77|  2.97k|      }
   78|  2.97k|    }
   79|  5.77k|  }
   80|    237|  return nullptr;
   81|  6.14k|}

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

_ZN5draco62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiE19DecodeTransformDataEPNS_13DecoderBufferE:
   46|    569|  bool DecodeTransformData(DecoderBuffer* buffer) {
   47|    569|    DataTypeT max_quantized_value, center_value;
   48|    569|    if (!buffer->Decode(&max_quantized_value)) {
  ------------------
  |  Branch (48:9): [True: 5, False: 564]
  ------------------
   49|      5|      return false;
   50|      5|    }
   51|    564|    if (!buffer->Decode(&center_value)) {
  ------------------
  |  Branch (51:9): [True: 4, False: 560]
  ------------------
   52|      4|      return false;
   53|      4|    }
   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|  1.46M|                                   DataType* out_orig_vals) const {
   71|  1.46M|    DRACO_DCHECK_LE(pred_vals[0], 2 * this->center_value());
   72|  1.46M|    DRACO_DCHECK_LE(pred_vals[1], 2 * this->center_value());
   73|  1.46M|    DRACO_DCHECK_LE(corr_vals[0], 2 * this->center_value());
   74|  1.46M|    DRACO_DCHECK_LE(corr_vals[1], 2 * this->center_value());
   75|       |
   76|  1.46M|    DRACO_DCHECK_LE(0, pred_vals[0]);
   77|  1.46M|    DRACO_DCHECK_LE(0, pred_vals[1]);
   78|  1.46M|    DRACO_DCHECK_LE(0, corr_vals[0]);
   79|  1.46M|    DRACO_DCHECK_LE(0, corr_vals[1]);
   80|       |
   81|  1.46M|    const Point2 pred = Point2(pred_vals[0], pred_vals[1]);
   82|  1.46M|    const Point2 corr = Point2(corr_vals[0], corr_vals[1]);
   83|  1.46M|    const Point2 orig = ComputeOriginalValue(pred, corr);
   84|       |
   85|  1.46M|    out_orig_vals[0] = orig[0];
   86|  1.46M|    out_orig_vals[1] = orig[1];
   87|  1.46M|  }
_ZNK5draco62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiE20ComputeOriginalValueENS_7VectorDIiLi2EEES3_:
   90|  1.46M|  Point2 ComputeOriginalValue(Point2 pred, Point2 corr) const {
   91|  1.46M|    const Point2 t(this->center_value(), this->center_value());
   92|  1.46M|    pred = pred - t;
   93|  1.46M|    const bool pred_is_in_diamond = this->IsInDiamond(pred[0], pred[1]);
   94|  1.46M|    if (!pred_is_in_diamond) {
  ------------------
  |  Branch (94:9): [True: 1.02M, False: 430k]
  ------------------
   95|  1.02M|      this->InvertDiamond(&pred[0], &pred[1]);
   96|  1.02M|    }
   97|  1.46M|    const bool pred_is_in_bottom_left = this->IsInBottomLeft(pred);
   98|  1.46M|    const int32_t rotation_count = this->GetRotationCount(pred);
   99|  1.46M|    if (!pred_is_in_bottom_left) {
  ------------------
  |  Branch (99:9): [True: 53.1k, False: 1.40M]
  ------------------
  100|  53.1k|      pred = this->RotatePoint(pred, rotation_count);
  101|  53.1k|    }
  102|  1.46M|    Point2 orig(this->ModMax(AddAsUnsigned(pred[0], corr[0])),
  103|  1.46M|                this->ModMax(AddAsUnsigned(pred[1], corr[1])));
  104|  1.46M|    if (!pred_is_in_bottom_left) {
  ------------------
  |  Branch (104:9): [True: 53.1k, False: 1.40M]
  ------------------
  105|  53.1k|      const int32_t reverse_rotation_count = (4 - rotation_count) % 4;
  106|  53.1k|      orig = this->RotatePoint(orig, reverse_rotation_count);
  107|  53.1k|    }
  108|  1.46M|    if (!pred_is_in_diamond) {
  ------------------
  |  Branch (108:9): [True: 1.02M, False: 430k]
  ------------------
  109|  1.02M|      this->InvertDiamond(&orig[0], &orig[1]);
  110|  1.02M|    }
  111|  1.46M|    orig = orig + t;
  112|  1.46M|    return orig;
  113|  1.46M|  }
_ZN5draco62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiE4InitEi:
   44|    153|  void Init(int num_components) {}
_ZN5draco62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEC2Ev:
   41|    578|  PredictionSchemeNormalOctahedronCanonicalizedDecodingTransform() {}

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  1.46M|  bool IsInBottomLeft(const Point2& p) const {
   93|  1.46M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 1.39M, False: 62.3k]
  |  Branch (93:22): [True: 1.39M, False: 5.70k]
  ------------------
   94|  1.39M|      return true;
   95|  1.39M|    }
   96|  68.0k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 31.0k, False: 37.0k]
  |  Branch (96:25): [True: 14.8k, False: 16.1k]
  ------------------
   97|  1.46M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  1.46M|  int32_t GetRotationCount(Point2 pred) const {
   51|  1.46M|    const DataType sign_x = pred[0];
   52|  1.46M|    const DataType sign_y = pred[1];
   53|       |
   54|  1.46M|    int32_t rotation_count = 0;
   55|  1.46M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 1.39M, False: 62.3k]
  ------------------
   56|  1.39M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 1.39M, False: 5.70k]
  ------------------
   57|  1.39M|        rotation_count = 0;
   58|  1.39M|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 2.91k, False: 2.78k]
  ------------------
   59|  2.91k|        rotation_count = 3;
   60|  2.91k|      } else {
   61|  2.78k|        rotation_count = 1;
   62|  2.78k|      }
   63|  1.39M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 31.3k, False: 31.0k]
  ------------------
   64|  31.3k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 15.2k, False: 16.0k]
  ------------------
   65|  15.2k|        rotation_count = 2;
   66|  16.0k|      } else {
   67|  16.0k|        rotation_count = 1;
   68|  16.0k|      }
   69|  31.3k|    } else {
   70|  31.0k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 14.8k, False: 16.1k]
  ------------------
   71|  14.8k|        rotation_count = 0;
   72|  16.1k|      } else {
   73|  16.1k|        rotation_count = 3;
   74|  16.1k|      }
   75|  31.0k|    }
   76|  1.46M|    return rotation_count;
   77|  1.46M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   106k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   106k|    switch (rotation_count) {
   81|  37.9k|      case 1:
  ------------------
  |  Branch (81:7): [True: 37.9k, False: 68.4k]
  ------------------
   82|  37.9k|        return Point2(p[1], -p[0]);
   83|  30.4k|      case 2:
  ------------------
  |  Branch (83:7): [True: 30.4k, False: 75.8k]
  ------------------
   84|  30.4k|        return Point2(-p[0], -p[1]);
   85|  37.9k|      case 3:
  ------------------
  |  Branch (85:7): [True: 37.9k, False: 68.4k]
  ------------------
   86|  37.9k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 106k]
  ------------------
   88|      0|        return p;
   89|   106k|    }
   90|   106k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    578|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

_ZN5draco37PredictionSchemeWrapDecodingTransformIiiE19DecodeTransformDataEPNS_13DecoderBufferE:
   65|  5.48k|  bool DecodeTransformData(DecoderBuffer* buffer) {
   66|  5.48k|    DataTypeT min_value, max_value;
   67|  5.48k|    if (!buffer->Decode(&min_value)) {
  ------------------
  |  Branch (67:9): [True: 73, False: 5.40k]
  ------------------
   68|     73|      return false;
   69|     73|    }
   70|  5.40k|    if (!buffer->Decode(&max_value)) {
  ------------------
  |  Branch (70:9): [True: 51, False: 5.35k]
  ------------------
   71|     51|      return false;
   72|     51|    }
   73|  5.35k|    if (min_value > max_value) {
  ------------------
  |  Branch (73:9): [True: 180, False: 5.17k]
  ------------------
   74|    180|      return false;
   75|    180|    }
   76|  5.17k|    this->set_min_value(min_value);
   77|  5.17k|    this->set_max_value(max_value);
   78|  5.17k|    if (!this->InitCorrectionBounds()) {
  ------------------
  |  Branch (78:9): [True: 17, False: 5.16k]
  ------------------
   79|     17|      return false;
   80|     17|    }
   81|  5.16k|    return true;
   82|  5.17k|  }
_ZNK5draco37PredictionSchemeWrapDecodingTransformIiiE20ComputeOriginalValueEPKiS3_Pi:
   38|  11.0M|                                   DataTypeT* out_original_vals) const {
   39|       |    // For now we assume both |DataTypeT| and |CorrTypeT| are equal.
   40|  11.0M|    static_assert(std::is_same<DataTypeT, CorrTypeT>::value,
   41|  11.0M|                  "Predictions and corrections must have the same type.");
   42|       |
   43|       |    // The only valid implementation right now is for int32_t.
   44|  11.0M|    static_assert(std::is_same<DataTypeT, int32_t>::value,
   45|  11.0M|                  "Only int32_t is supported for predicted values.");
   46|       |
   47|  11.0M|    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|   412M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (53:21): [True: 401M, False: 11.0M]
  ------------------
   54|   401M|      int64_t value = static_cast<int64_t>(predicted_vals[i]) +
   55|   401M|                      static_cast<int64_t>(corr_vals[i]);
   56|   401M|      if (value > this->max_value()) {
  ------------------
  |  Branch (56:11): [True: 134k, False: 400M]
  ------------------
   57|   134k|        value -= this->max_dif();
   58|   400M|      } else if (value < this->min_value()) {
  ------------------
  |  Branch (58:18): [True: 673k, False: 400M]
  ------------------
   59|   673k|        value += this->max_dif();
   60|   673k|      }
   61|   401M|      out_original_vals[i] = static_cast<DataTypeT>(value);
   62|   401M|    }
   63|  11.0M|  }
_ZN5draco37PredictionSchemeWrapDecodingTransformIiiEC2Ev:
   32|  6.14k|  PredictionSchemeWrapDecodingTransform() {}

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  5.93k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  5.17k|  inline void set_min_value(const DataTypeT& v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  5.17k|  inline void set_max_value(const DataTypeT& v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  5.17k|  bool InitCorrectionBounds() {
   84|  5.17k|    const int64_t dif =
   85|  5.17k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  5.17k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 5.17k]
  |  Branch (86:20): [True: 17, False: 5.16k]
  ------------------
   87|     17|      return false;
   88|     17|    }
   89|  5.16k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  5.16k|    max_correction_ = max_dif_ / 2;
   91|  5.16k|    min_correction_ = -max_correction_;
   92|  5.16k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 2.13k, False: 3.02k]
  ------------------
   93|  2.13k|      max_correction_ -= 1;
   94|  2.13k|    }
   95|  5.16k|    return true;
   96|  5.17k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  4.14k|  void Init(int num_components) {
   56|  4.14k|    num_components_ = num_components;
   57|  4.14k|    clamped_value_.resize(num_components);
   58|  4.14k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  11.0M|      const DataTypeT* predicted_val) const {
   64|   412M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 401M, False: 11.0M]
  ------------------
   65|   401M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 255k, False: 400M]
  ------------------
   66|   255k|        clamped_value_[i] = max_value_;
   67|   400M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 4.09M, False: 396M]
  ------------------
   68|  4.09M|        clamped_value_[i] = min_value_;
   69|   396M|      } else {
   70|   396M|        clamped_value_[i] = predicted_val[i];
   71|   396M|      }
   72|   401M|    }
   73|  11.0M|    return clamped_value_.data();
   74|  11.0M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|   824M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|   401M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|   807k|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|   400M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    930|  int quantization_bits() const {
   78|    930|    DRACO_DCHECK(false);
   79|    930|    return -1;
   80|    930|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  6.14k|      : num_components_(0),
   45|  6.14k|        min_value_(0),
   46|  6.14k|        max_value_(0),
   47|  6.14k|        max_dif_(0),
   48|  6.14k|        max_correction_(0),
   49|  6.14k|        min_correction_(0) {}

_ZN5draco26SequentialAttributeDecoderC2Ev:
   20|  49.2k|    : decoder_(nullptr), attribute_(nullptr), attribute_id_(-1) {}
_ZN5draco26SequentialAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   23|  49.2k|                                      int attribute_id) {
   24|  49.2k|  decoder_ = decoder;
   25|  49.2k|  attribute_ = decoder->point_cloud()->attribute(attribute_id);
   26|  49.2k|  attribute_id_ = attribute_id;
   27|  49.2k|  return true;
   28|  49.2k|}
_ZN5draco26SequentialAttributeDecoder23DecodePortableAttributeERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   38|  12.8k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   39|  12.8k|  if (attribute_->num_components() <= 0 ||
  ------------------
  |  Branch (39:7): [True: 0, False: 12.8k]
  ------------------
   40|  12.8k|      !attribute_->Reset(point_ids.size())) {
  ------------------
  |  Branch (40:7): [True: 0, False: 12.8k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  12.8k|  if (!DecodeValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (43:7): [True: 2.41k, False: 10.4k]
  ------------------
   44|  2.41k|    return false;
   45|  2.41k|  }
   46|  10.4k|  return true;
   47|  12.8k|}
_ZN5draco26SequentialAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   50|  3.76k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   51|       |  // Default implementation does not apply any transform.
   52|  3.76k|  return true;
   53|  3.76k|}
_ZN5draco26SequentialAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   56|    357|    const std::vector<PointIndex>& point_ids) {
   57|       |  // Default implementation does not apply any transform.
   58|    357|  return true;
   59|    357|}
_ZN5draco26SequentialAttributeDecoder20GetPortableAttributeEv:
   61|  8.22k|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.22k|  if (!attribute_->is_mapping_identity() && portable_attribute_ &&
  ------------------
  |  Branch (64:7): [True: 7.17k, False: 1.04k]
  |  Branch (64:45): [True: 6.84k, False: 327]
  ------------------
   65|  6.84k|      portable_attribute_->is_mapping_identity()) {
  ------------------
  |  Branch (65:7): [True: 4.99k, False: 1.84k]
  ------------------
   66|  4.99k|    portable_attribute_->SetExplicitMapping(attribute_->indices_map_size());
   67|  4.99k|    for (PointIndex i(0);
   68|  32.6M|         i < static_cast<uint32_t>(attribute_->indices_map_size()); ++i) {
  ------------------
  |  Branch (68:10): [True: 32.6M, False: 4.99k]
  ------------------
   69|  32.6M|      portable_attribute_->SetPointMapEntry(i, attribute_->mapped_index(i));
   70|  32.6M|    }
   71|  4.99k|  }
   72|  8.22k|  return portable_attribute_.get();
   73|  8.22k|}
_ZN5draco26SequentialAttributeDecoder20InitPredictionSchemeEPNS_25PredictionSchemeInterfaceE:
   76|  7.23k|    PredictionSchemeInterface* ps) {
   77|  9.97k|  for (int i = 0; i < ps->GetNumParentAttributes(); ++i) {
  ------------------
  |  Branch (77:19): [True: 2.75k, False: 7.21k]
  ------------------
   78|  2.75k|    const int att_id = decoder_->point_cloud()->GetNamedAttributeId(
   79|  2.75k|        ps->GetParentAttributeType(i));
   80|  2.75k|    if (att_id == -1) {
  ------------------
  |  Branch (80:9): [True: 5, False: 2.75k]
  ------------------
   81|      5|      return false;  // Requested attribute does not exist.
   82|      5|    }
   83|  2.75k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   84|  2.75k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.75k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:9): [True: 0, False: 2.75k]
  ------------------
   85|      0|      if (!ps->SetParentAttribute(decoder_->point_cloud()->attribute(att_id))) {
  ------------------
  |  Branch (85:11): [True: 0, False: 0]
  ------------------
   86|      0|        return false;
   87|      0|      }
   88|      0|    } else
   89|  2.75k|#endif
   90|  2.75k|    {
   91|  2.75k|      const PointAttribute* const pa = decoder_->GetPortableAttribute(att_id);
   92|  2.75k|      if (pa == nullptr || !ps->SetParentAttribute(pa)) {
  ------------------
  |  Branch (92:11): [True: 3, False: 2.74k]
  |  Branch (92:28): [True: 16, False: 2.73k]
  ------------------
   93|     19|        return false;
   94|     19|      }
   95|  2.75k|    }
   96|  2.75k|  }
   97|  7.21k|  return true;
   98|  7.23k|}
_ZN5draco26SequentialAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  101|    706|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
  102|    706|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
  103|    706|  const int entry_size = static_cast<int>(attribute_->byte_stride());
  104|    706|  std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
  105|    706|  uint8_t* const value_data = value_data_ptr.get();
  106|    706|  int out_byte_pos = 0;
  107|       |  // Decode raw attribute values in their original format.
  108|  3.51k|  for (int i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (108:19): [True: 2.87k, False: 641]
  ------------------
  109|  2.87k|    if (!in_buffer->Decode(value_data, entry_size)) {
  ------------------
  |  Branch (109:9): [True: 65, False: 2.80k]
  ------------------
  110|     65|      return false;
  111|     65|    }
  112|  2.80k|    attribute_->buffer()->Write(out_byte_pos, value_data, entry_size);
  113|  2.80k|    out_byte_pos += entry_size;
  114|  2.80k|  }
  115|    641|  return true;
  116|    706|}

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  10.5k|  const PointAttribute* attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|   354M|  PointAttribute* attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  7.23k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  36.5k|  PointCloudDecoder* decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  11.6k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  11.6k|    portable_attribute_ = std::move(att);
   71|  11.6k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  39.8k|  PointAttribute* portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  49.2k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  17.9k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  7.27k|    DecoderBuffer* buffer) {
   30|  7.27k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 122, False: 7.15k]
  ------------------
   31|    122|    return false;
   32|    122|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  7.15k|  const int32_t num_attributes = GetNumAttributes();
   35|  7.15k|  sequential_decoders_.resize(num_attributes);
   36|  56.4k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 49.2k, False: 7.12k]
  ------------------
   37|  49.2k|    uint8_t decoder_type;
   38|  49.2k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 5, False: 49.2k]
  ------------------
   39|      5|      return false;
   40|      5|    }
   41|       |    // Create the decoder from the id.
   42|  49.2k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  49.2k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 14, False: 49.2k]
  ------------------
   44|     14|      return false;
   45|     14|    }
   46|  49.2k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 8, False: 49.2k]
  ------------------
   47|      8|      return false;
   48|      8|    }
   49|  49.2k|  }
   50|  7.12k|  return true;
   51|  7.15k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  5.05k|    DecoderBuffer* buffer) {
   55|  5.05k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 5.05k]
  |  Branch (55:22): [True: 3, False: 5.05k]
  ------------------
   56|      3|    return false;
   57|      3|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  5.05k|  const int32_t num_attributes = GetNumAttributes();
   60|  30.2k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 25.2k, False: 5.04k]
  ------------------
   61|  25.2k|    PointAttribute* const pa =
   62|  25.2k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  25.2k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 3, False: 25.2k]
  ------------------
   64|      3|      return false;
   65|      3|    }
   66|  25.2k|  }
   67|  5.04k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  5.05k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  5.04k|    DecoderBuffer* in_buffer) {
   72|  5.04k|  const int32_t num_attributes = GetNumAttributes();
   73|  15.4k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 12.8k, False: 2.63k]
  ------------------
   74|  12.8k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 2.41k, False: 10.4k]
  ------------------
   75|  12.8k|                                                          in_buffer)) {
   76|  2.41k|      return false;
   77|  2.41k|    }
   78|  12.8k|  }
   79|  2.63k|  return true;
   80|  5.04k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  2.63k|    DecodeDataNeededByPortableTransforms(DecoderBuffer* in_buffer) {
   84|  2.63k|  const int32_t num_attributes = GetNumAttributes();
   85|  7.01k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 5.05k, False: 1.96k]
  ------------------
   86|  5.05k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 675, False: 4.37k]
  ------------------
   87|  5.05k|            point_ids_, in_buffer)) {
   88|    675|      return false;
   89|    675|    }
   90|  5.05k|  }
   91|  1.96k|  return true;
   92|  2.63k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  1.96k|    TransformAttributesToOriginalFormat() {
   96|  1.96k|  const int32_t num_attributes = GetNumAttributes();
   97|  4.98k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 3.65k, False: 1.32k]
  ------------------
   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.30k, False: 357]
  |  Branch (104:11): [True: 0, False: 3.65k]
  ------------------
  105|  3.30k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 0, False: 3.30k]
  ------------------
  106|  3.30k|              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: 638, False: 3.02k]
  ------------------
  117|  3.65k|            point_ids_)) {
  118|    638|      return false;
  119|    638|    }
  120|  3.65k|  }
  121|  1.32k|  return true;
  122|  1.96k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  49.2k|    uint8_t decoder_type) {
  127|  49.2k|  switch (decoder_type) {
  128|  3.00k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 3.00k, False: 46.2k]
  ------------------
  129|  3.00k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  3.00k|          new SequentialAttributeDecoder());
  131|  44.5k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 44.5k, False: 4.70k]
  ------------------
  132|  44.5k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  44.5k|          new SequentialIntegerAttributeDecoder());
  134|    421|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 421, False: 48.8k]
  ------------------
  135|    421|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    421|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.26k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.26k, False: 48.0k]
  ------------------
  139|  1.26k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.26k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     14|    default:
  ------------------
  |  Branch (142:5): [True: 14, False: 49.2k]
  ------------------
  143|     14|      break;
  144|  49.2k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     14|  return nullptr;
  147|  49.2k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  46.2k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() =
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   27|  46.2k|                                             int attribute_id) {
   28|  46.2k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (28:7): [True: 0, False: 46.2k]
  ------------------
   29|      0|    return false;
   30|      0|  }
   31|  46.2k|  return true;
   32|  46.2k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   35|  3.30k|    const std::vector<PointIndex>& point_ids) {
   36|  3.30k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   37|  3.30k|  if (decoder() &&
  ------------------
  |  Branch (37:7): [True: 3.30k, False: 0]
  ------------------
   38|  3.30k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.30k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (38:7): [True: 7, False: 3.29k]
  ------------------
   39|      7|    return true;  // Don't revert the transform here for older files.
   40|      7|  }
   41|  3.29k|#endif
   42|  3.29k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   43|  3.30k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   46|  12.1k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   47|       |  // Decode prediction scheme.
   48|  12.1k|  int8_t prediction_scheme_method;
   49|  12.1k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (49:7): [True: 57, False: 12.0k]
  ------------------
   50|     57|    return false;
   51|     57|  }
   52|       |  // Check that decoded prediction scheme method type is valid.
   53|  12.0k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (53:7): [True: 66, False: 12.0k]
  ------------------
   54|  12.0k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (54:7): [True: 151, False: 11.8k]
  ------------------
   55|    217|    return false;
   56|    217|  }
   57|  11.8k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (57:7): [True: 11.8k, False: 17]
  ------------------
   58|  11.8k|    int8_t prediction_transform_type;
   59|  11.8k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (59:9): [True: 38, False: 11.8k]
  ------------------
   60|     38|      return false;
   61|     38|    }
   62|       |    // Check that decoded prediction scheme transform type is valid.
   63|  11.8k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (63:9): [True: 18, False: 11.8k]
  ------------------
   64|  11.8k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (64:9): [True: 111, False: 11.6k]
  ------------------
   65|    129|      return false;
   66|    129|    }
   67|  11.6k|    prediction_scheme_ = CreateIntPredictionScheme(
   68|  11.6k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   69|  11.6k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   70|  11.6k|  }
   71|       |
   72|  11.7k|  if (prediction_scheme_) {
  ------------------
  |  Branch (72:7): [True: 7.23k, False: 4.47k]
  ------------------
   73|  7.23k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (73:9): [True: 24, False: 7.21k]
  ------------------
   74|     24|      return false;
   75|     24|    }
   76|  7.23k|  }
   77|       |
   78|  11.6k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (78:7): [True: 1.88k, False: 9.80k]
  ------------------
   79|  1.88k|    return false;
   80|  1.88k|  }
   81|       |
   82|  9.80k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   83|  9.80k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   84|  9.80k|  if (decoder() &&
  ------------------
  |  Branch (84:7): [True: 9.80k, False: 0]
  ------------------
   85|  9.80k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  9.80k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (85:7): [True: 16, False: 9.78k]
  ------------------
   86|       |    // For older files, revert the transform right after we decode the data.
   87|     16|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (87:9): [True: 0, False: 16]
  ------------------
   88|      0|      return false;
   89|      0|    }
   90|     16|  }
   91|  9.80k|#endif
   92|  9.80k|  return true;
   93|  9.80k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   98|  10.5k|    PredictionSchemeTransformType transform_type) {
   99|  10.5k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (99:7): [True: 4.40k, False: 6.14k]
  ------------------
  100|  4.40k|    return nullptr;  // For now we support only wrap transform.
  101|  4.40k|  }
  102|  6.14k|  return CreatePredictionSchemeForDecoder<
  103|  6.14k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  104|  6.14k|      method, attribute_id(), decoder());
  105|  10.5k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  108|  11.6k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
  109|  11.6k|  const int num_components = GetNumValueComponents();
  110|  11.6k|  if (num_components <= 0) {
  ------------------
  |  Branch (110:7): [True: 0, False: 11.6k]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|  11.6k|  const size_t num_entries = point_ids.size();
  114|  11.6k|  const size_t num_values = num_entries * num_components;
  115|  11.6k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  116|  11.6k|  int32_t* const portable_attribute_data = GetPortableAttributeData();
  117|  11.6k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (117:7): [True: 16, False: 11.6k]
  ------------------
  118|     16|    return false;
  119|     16|  }
  120|  11.6k|  uint8_t compressed;
  121|  11.6k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (121:7): [True: 18, False: 11.6k]
  ------------------
  122|     18|    return false;
  123|     18|  }
  124|  11.6k|  if (compressed > 0) {
  ------------------
  |  Branch (124:7): [True: 646, False: 11.0k]
  ------------------
  125|       |    // Decode compressed values.
  126|    646|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (126:9): [True: 254, False: 392]
  ------------------
  127|    646|                       in_buffer,
  128|    646|                       reinterpret_cast<uint32_t*>(portable_attribute_data))) {
  129|    254|      return false;
  130|    254|    }
  131|  11.0k|  } else {
  132|       |    // Decode the integer data directly.
  133|       |    // Get the number of bytes for a given entry.
  134|  11.0k|    uint8_t num_bytes;
  135|  11.0k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (135:9): [True: 11, False: 10.9k]
  ------------------
  136|     11|      return false;
  137|     11|    }
  138|  10.9k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (138:9): [True: 698, False: 10.2k]
  ------------------
  139|    698|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (139:11): [True: 0, False: 698]
  ------------------
  140|    698|          sizeof(int32_t) * num_values) {
  141|      0|        return false;
  142|      0|      }
  143|    698|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (143:11): [True: 6, False: 692]
  ------------------
  144|    698|                             sizeof(int32_t) * num_values)) {
  145|      6|        return false;
  146|      6|      }
  147|  10.2k|    } else {
  148|  10.2k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (148:11): [True: 67, False: 10.2k]
  ------------------
  149|  10.2k|          num_bytes * num_values) {
  150|     67|        return false;
  151|     67|      }
  152|  10.2k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (152:11): [True: 23, False: 10.2k]
  ------------------
  153|  10.2k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  154|     23|        return false;
  155|     23|      }
  156|  1.48G|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (156:26): [True: 1.48G, False: 10.2k]
  ------------------
  157|  1.48G|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (157:13): [True: 0, False: 1.48G]
  ------------------
  158|      0|          return false;
  159|      0|        }
  160|  1.48G|      }
  161|  10.2k|    }
  162|  10.9k|  }
  163|       |
  164|  11.2k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (164:7): [True: 11.2k, False: 0]
  |  Branch (164:26): [True: 4.28k, False: 7.00k]
  ------------------
  165|  10.2k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (165:26): [True: 5.93k, False: 1.06k]
  ------------------
  166|       |    // Convert the values back to the original signed format.
  167|  10.2k|    ConvertSymbolsToSignedInts(
  168|  10.2k|        reinterpret_cast<const uint32_t*>(portable_attribute_data),
  169|  10.2k|        static_cast<int>(num_values), portable_attribute_data);
  170|  10.2k|  }
  171|       |
  172|       |  // If the data was encoded with a prediction scheme, we must revert it.
  173|  11.2k|  if (prediction_scheme_) {
  ------------------
  |  Branch (173:7): [True: 7.00k, False: 4.28k]
  ------------------
  174|  7.00k|    prediction_scheme_->SetMaxNumPredictedValues(num_values);
  175|  7.00k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (175:9): [True: 943, False: 6.06k]
  ------------------
  176|    943|      return false;
  177|    943|    }
  178|       |
  179|  6.06k|    if (num_values > 0) {
  ------------------
  |  Branch (179:9): [True: 6.06k, False: 0]
  ------------------
  180|  6.06k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (180:11): [True: 542, False: 5.52k]
  ------------------
  181|  6.06k|              portable_attribute_data, portable_attribute_data,
  182|  6.06k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  183|    542|        return false;
  184|    542|      }
  185|  6.06k|    }
  186|  6.06k|  }
  187|  9.80k|  return true;
  188|  11.2k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  190|  2.78k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  191|  2.78k|  switch (attribute()->data_type()) {
  192|    349|    case DT_UINT8:
  ------------------
  |  Branch (192:5): [True: 349, False: 2.43k]
  ------------------
  193|    349|      StoreTypedValues<uint8_t>(num_values);
  194|    349|      break;
  195|  1.23k|    case DT_INT8:
  ------------------
  |  Branch (195:5): [True: 1.23k, False: 1.55k]
  ------------------
  196|  1.23k|      StoreTypedValues<int8_t>(num_values);
  197|  1.23k|      break;
  198|     87|    case DT_UINT16:
  ------------------
  |  Branch (198:5): [True: 87, False: 2.69k]
  ------------------
  199|     87|      StoreTypedValues<uint16_t>(num_values);
  200|     87|      break;
  201|    186|    case DT_INT16:
  ------------------
  |  Branch (201:5): [True: 186, False: 2.59k]
  ------------------
  202|    186|      StoreTypedValues<int16_t>(num_values);
  203|    186|      break;
  204|    208|    case DT_UINT32:
  ------------------
  |  Branch (204:5): [True: 208, False: 2.57k]
  ------------------
  205|    208|      StoreTypedValues<uint32_t>(num_values);
  206|    208|      break;
  207|    411|    case DT_INT32:
  ------------------
  |  Branch (207:5): [True: 411, False: 2.36k]
  ------------------
  208|    411|      StoreTypedValues<int32_t>(num_values);
  209|    411|      break;
  210|    309|    default:
  ------------------
  |  Branch (210:5): [True: 309, False: 2.47k]
  ------------------
  211|    309|      return false;
  212|  2.78k|  }
  213|  2.47k|  return true;
  214|  2.78k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  238|  11.6k|    int num_entries, int num_components) {
  239|  11.6k|  GeometryAttribute ga;
  240|  11.6k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  241|  11.6k|          false, num_components * DataTypeLength(DT_INT32), 0);
  242|  11.6k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  243|  11.6k|  port_att->SetIdentityMapping();
  244|  11.6k|  port_att->Reset(num_entries);
  245|  11.6k|  port_att->set_unique_id(attribute()->unique_id());
  246|  11.6k|  SetPortableAttribute(std::move(port_att));
  247|  11.6k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  217|    349|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    349|  const int num_components = attribute()->num_components();
  219|    349|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    349|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    349|      new AttributeTypeT[num_components]);
  222|    349|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    349|  int val_id = 0;
  224|    349|  int out_byte_pos = 0;
  225|  34.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 34.7M, False: 349]
  ------------------
  226|   148M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 113M, False: 34.7M]
  ------------------
  227|   113M|      const AttributeTypeT value =
  228|   113M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   113M|      att_val[c] = value;
  230|   113M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  34.7M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  34.7M|    out_byte_pos += entry_size;
  234|  34.7M|  }
  235|    349|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  217|  1.23k|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|  1.23k|  const int num_components = attribute()->num_components();
  219|  1.23k|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|  1.23k|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|  1.23k|      new AttributeTypeT[num_components]);
  222|  1.23k|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|  1.23k|  int val_id = 0;
  224|  1.23k|  int out_byte_pos = 0;
  225|   312M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 312M, False: 1.23k]
  ------------------
  226|  1.02G|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 709M, False: 312M]
  ------------------
  227|   709M|      const AttributeTypeT value =
  228|   709M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   709M|      att_val[c] = value;
  230|   709M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   312M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   312M|    out_byte_pos += entry_size;
  234|   312M|  }
  235|  1.23k|}
_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.22M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 1.22M, False: 87]
  ------------------
  226|  61.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 60.5M, False: 1.22M]
  ------------------
  227|  60.5M|      const AttributeTypeT value =
  228|  60.5M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  60.5M|      att_val[c] = value;
  230|  60.5M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  1.22M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  1.22M|    out_byte_pos += entry_size;
  234|  1.22M|  }
  235|     87|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  217|    186|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    186|  const int num_components = attribute()->num_components();
  219|    186|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    186|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    186|      new AttributeTypeT[num_components]);
  222|    186|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    186|  int val_id = 0;
  224|    186|  int out_byte_pos = 0;
  225|   412k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 412k, False: 186]
  ------------------
  226|  45.3M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 44.8M, False: 412k]
  ------------------
  227|  44.8M|      const AttributeTypeT value =
  228|  44.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  44.8M|      att_val[c] = value;
  230|  44.8M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   412k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   412k|    out_byte_pos += entry_size;
  234|   412k|  }
  235|    186|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  217|    208|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    208|  const int num_components = attribute()->num_components();
  219|    208|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    208|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    208|      new AttributeTypeT[num_components]);
  222|    208|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    208|  int val_id = 0;
  224|    208|  int out_byte_pos = 0;
  225|   939k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 939k, False: 208]
  ------------------
  226|  73.9M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 73.0M, False: 939k]
  ------------------
  227|  73.0M|      const AttributeTypeT value =
  228|  73.0M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  73.0M|      att_val[c] = value;
  230|  73.0M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   939k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   939k|    out_byte_pos += entry_size;
  234|   939k|  }
  235|    208|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  217|    411|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    411|  const int num_components = attribute()->num_components();
  219|    411|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    411|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    411|      new AttributeTypeT[num_components]);
  222|    411|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    411|  int val_id = 0;
  224|    411|  int out_byte_pos = 0;
  225|  3.83M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 3.83M, False: 411]
  ------------------
  226|   179M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 175M, False: 3.83M]
  ------------------
  227|   175M|      const AttributeTypeT value =
  228|   175M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   175M|      att_val[c] = value;
  230|   175M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  3.83M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  3.83M|    out_byte_pos += entry_size;
  234|  3.83M|  }
  235|    411|}

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

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

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

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

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  32.6k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  23.1k|                                const uint8_t* const buf, int offset) {
  301|  23.1k|  unsigned x;
  302|  23.1k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 34, False: 23.1k]
  ------------------
  303|     34|    return 1;
  304|     34|  }
  305|  23.1k|  ans->buf = buf;
  306|  23.1k|  x = buf[offset - 1] >> 6;
  307|  23.1k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 18.9k, False: 4.22k]
  ------------------
  308|  18.9k|    ans->buf_offset = offset - 1;
  309|  18.9k|    ans->state = buf[offset - 1] & 0x3F;
  310|  18.9k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 3.73k, False: 495]
  ------------------
  311|  3.73k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 2, False: 3.72k]
  ------------------
  312|      2|      return 1;
  313|      2|    }
  314|  3.72k|    ans->buf_offset = offset - 2;
  315|  3.72k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  3.72k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 486, False: 9]
  ------------------
  317|    486|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 0, False: 486]
  ------------------
  318|      0|      return 1;
  319|      0|    }
  320|    486|    ans->buf_offset = offset - 3;
  321|    486|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    486|  } else {
  323|      9|    return 1;
  324|      9|  }
  325|  23.1k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  23.1k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  23.1k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  23.1k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  23.1k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 2, False: 23.1k]
  ------------------
  327|      2|    return 1;
  328|      2|  }
  329|  23.1k|  return 0;
  330|  23.1k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  3.72k|static uint32_t mem_get_le16(const void* vmem) {
   68|  3.72k|  uint32_t val;
   69|  3.72k|  const uint8_t* mem = (const uint8_t*)vmem;
   70|       |
   71|  3.72k|  val = mem[1] << 8;
   72|  3.72k|  val |= mem[0];
   73|  3.72k|  return val;
   74|  3.72k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    486|static uint32_t mem_get_le24(const void* vmem) {
   77|    486|  uint32_t val;
   78|    486|  const uint8_t* mem = (const uint8_t*)vmem;
   79|       |
   80|    486|  val = mem[2] << 16;
   81|    486|  val |= mem[1] << 8;
   82|    486|  val |= mem[0];
   83|    486|  return val;
   84|    486|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  98.4M|static inline int rabs_desc_read(struct AnsDecoder* ans, AnsP8 p0) {
  167|  98.4M|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  98.4M|  unsigned quot, rem, x, xn;
  172|  98.4M|#endif
  173|  98.4M|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  98.4M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  98.4M|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|   196M|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 68.5M, False: 29.9M]
  |  Branch (174:40): [True: 208k, False: 68.3M]
  ------------------
  175|   208k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   208k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   208k|  }
  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|  98.4M|  x = ans->state;
  184|  98.4M|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  98.4M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  98.4M|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  98.4M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  98.4M|  xn = quot * p;
  187|  98.4M|  val = rem < p;
  188|  98.4M|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|   196M|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 90.7M, False: 7.69M]
  |  |  ------------------
  ------------------
  189|  90.7M|    ans->state = xn + rem;
  190|  90.7M|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|  7.69M|    ans->state = x - xn - p;
  193|  7.69M|  }
  194|  98.4M|#endif
  195|  98.4M|  return val;
  196|  98.4M|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  49.7k|static inline int ans_read_end(struct AnsDecoder* const ans) {
  333|  49.7k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  49.7k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  49.7k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  3.45k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  484|  2.10k|                                       uint32_t num_symbols) {
  485|  2.10k|    lut_table_.resize(rans_precision);
  486|  2.10k|    probability_table_.resize(num_symbols);
  487|  2.10k|    uint32_t cum_prob = 0;
  488|  2.10k|    uint32_t act_prob = 0;
  489|  23.2k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 21.3k, False: 1.93k]
  ------------------
  490|  21.3k|      probability_table_[i].prob = token_probs[i];
  491|  21.3k|      probability_table_[i].cum_prob = cum_prob;
  492|  21.3k|      cum_prob += token_probs[i];
  493|  21.3k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 168, False: 21.1k]
  ------------------
  494|    168|        return false;
  495|    168|      }
  496|  7.17M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 7.15M, False: 21.1k]
  ------------------
  497|  7.15M|        lut_table_[j] = i;
  498|  7.15M|      }
  499|  21.1k|      act_prob = cum_prob;
  500|  21.1k|    }
  501|  1.93k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 217, False: 1.71k]
  ------------------
  502|    217|      return false;
  503|    217|    }
  504|  1.71k|    return true;
  505|  1.93k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.61k|  inline int read_init(const uint8_t* const buf, int offset) {
  422|  1.61k|    unsigned x;
  423|  1.61k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 131, False: 1.48k]
  ------------------
  424|    131|      return 1;
  425|    131|    }
  426|  1.48k|    ans_.buf = buf;
  427|  1.48k|    x = buf[offset - 1] >> 6;
  428|  1.48k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 905, False: 583]
  ------------------
  429|    905|      ans_.buf_offset = offset - 1;
  430|    905|      ans_.state = buf[offset - 1] & 0x3F;
  431|    905|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 242, False: 341]
  ------------------
  432|    242|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 47, False: 195]
  ------------------
  433|     47|        return 1;
  434|     47|      }
  435|    195|      ans_.buf_offset = offset - 2;
  436|    195|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    341|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 213, False: 128]
  ------------------
  438|    213|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 54, False: 159]
  ------------------
  439|     54|        return 1;
  440|     54|      }
  441|    159|      ans_.buf_offset = offset - 3;
  442|    159|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    159|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 128, False: 0]
  ------------------
  444|    128|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 54, False: 74]
  ------------------
  445|     54|        return 1;
  446|     54|      }
  447|     74|      ans_.buf_offset = offset - 4;
  448|     74|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     74|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|  1.33k|    ans_.state += l_rans_base;
  453|  1.33k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.33k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 85, False: 1.24k]
  ------------------
  454|     85|      return 1;
  455|     85|    }
  456|  1.24k|    return 0;
  457|  1.33k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    305|static uint32_t mem_get_le16(const void* vmem) {
   68|    305|  uint32_t val;
   69|    305|  const uint8_t* mem = (const uint8_t*)vmem;
   70|       |
   71|    305|  val = mem[1] << 8;
   72|    305|  val |= mem[0];
   73|    305|  return val;
   74|    305|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    259|static uint32_t mem_get_le24(const void* vmem) {
   77|    259|  uint32_t val;
   78|    259|  const uint8_t* mem = (const uint8_t*)vmem;
   79|       |
   80|    259|  val = mem[2] << 16;
   81|    259|  val |= mem[1] << 8;
   82|    259|  val |= mem[0];
   83|    259|  return val;
   84|    259|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    255|static inline uint32_t mem_get_le32(const void* vmem) {
   87|    255|  uint32_t val;
   88|    255|  const uint8_t* mem = (const uint8_t*)vmem;
   89|       |
   90|    255|  val = mem[3] << 24;
   91|    255|  val |= mem[2] << 16;
   92|    255|  val |= mem[1] << 8;
   93|    255|  val |= mem[0];
   94|    255|  return val;
   95|    255|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  465|   158M|  inline int rans_read() {
  466|   158M|    unsigned rem;
  467|   158M|    unsigned quo;
  468|   158M|    struct rans_dec_sym sym;
  469|   158M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 141M, False: 16.9M]
  |  Branch (469:40): [True: 27.3k, False: 141M]
  ------------------
  470|  27.3k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  27.3k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  27.3k|    }
  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|   158M|    quo = ans_.state / rans_precision;
  475|   158M|    rem = ans_.state % rans_precision;
  476|   158M|    fetch_sym(&sym, rem);
  477|   158M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   158M|    return sym.val;
  479|   158M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  508|   158M|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   158M|    uint32_t symbol = lut_table_[rem];
  510|   158M|    out->val = symbol;
  511|   158M|    out->prob = probability_table_[symbol].prob;
  512|   158M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   158M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  459|  1.18k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    217|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  484|    129|                                       uint32_t num_symbols) {
  485|    129|    lut_table_.resize(rans_precision);
  486|    129|    probability_table_.resize(num_symbols);
  487|    129|    uint32_t cum_prob = 0;
  488|    129|    uint32_t act_prob = 0;
  489|  7.46k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 7.35k, False: 109]
  ------------------
  490|  7.35k|      probability_table_[i].prob = token_probs[i];
  491|  7.35k|      probability_table_[i].cum_prob = cum_prob;
  492|  7.35k|      cum_prob += token_probs[i];
  493|  7.35k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 20, False: 7.33k]
  ------------------
  494|     20|        return false;
  495|     20|      }
  496|   875k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 868k, False: 7.33k]
  ------------------
  497|   868k|        lut_table_[j] = i;
  498|   868k|      }
  499|  7.33k|      act_prob = cum_prob;
  500|  7.33k|    }
  501|    109|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 8, False: 101]
  ------------------
  502|      8|      return false;
  503|      8|    }
  504|    101|    return true;
  505|    109|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     79|  inline int read_init(const uint8_t* const buf, int offset) {
  422|     79|    unsigned x;
  423|     79|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 79]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     79|    ans_.buf = buf;
  427|     79|    x = buf[offset - 1] >> 6;
  428|     79|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 30, False: 49]
  ------------------
  429|     30|      ans_.buf_offset = offset - 1;
  430|     30|      ans_.state = buf[offset - 1] & 0x3F;
  431|     49|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 20, False: 29]
  ------------------
  432|     20|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 7, False: 13]
  ------------------
  433|      7|        return 1;
  434|      7|      }
  435|     13|      ans_.buf_offset = offset - 2;
  436|     13|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     29|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 14, False: 15]
  ------------------
  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|     15|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 15, False: 0]
  ------------------
  444|     15|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 9, False: 6]
  ------------------
  445|      9|        return 1;
  446|      9|      }
  447|      6|      ans_.buf_offset = offset - 4;
  448|      6|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|      6|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     56|    ans_.state += l_rans_base;
  453|     56|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     56|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 4, False: 52]
  ------------------
  454|      4|      return 1;
  455|      4|    }
  456|     52|    return 0;
  457|     56|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  465|   352k|  inline int rans_read() {
  466|   352k|    unsigned rem;
  467|   352k|    unsigned quo;
  468|   352k|    struct rans_dec_sym sym;
  469|   353k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 238k, False: 114k]
  |  Branch (469:40): [True: 1.25k, False: 237k]
  ------------------
  470|  1.25k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.25k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  1.25k|    }
  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|   352k|    quo = ans_.state / rans_precision;
  475|   352k|    rem = ans_.state % rans_precision;
  476|   352k|    fetch_sym(&sym, rem);
  477|   352k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   352k|    return sym.val;
  479|   352k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  508|   352k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   352k|    uint32_t symbol = lut_table_[rem];
  510|   352k|    out->val = symbol;
  511|   352k|    out->prob = probability_table_[symbol].prob;
  512|   352k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   352k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  459|     52|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    224|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  484|    139|                                       uint32_t num_symbols) {
  485|    139|    lut_table_.resize(rans_precision);
  486|    139|    probability_table_.resize(num_symbols);
  487|    139|    uint32_t cum_prob = 0;
  488|    139|    uint32_t act_prob = 0;
  489|  15.2k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 15.1k, False: 119]
  ------------------
  490|  15.1k|      probability_table_[i].prob = token_probs[i];
  491|  15.1k|      probability_table_[i].cum_prob = cum_prob;
  492|  15.1k|      cum_prob += token_probs[i];
  493|  15.1k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 20, False: 15.0k]
  ------------------
  494|     20|        return false;
  495|     20|      }
  496|  3.70M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 3.69M, False: 15.0k]
  ------------------
  497|  3.69M|        lut_table_[j] = i;
  498|  3.69M|      }
  499|  15.0k|      act_prob = cum_prob;
  500|  15.0k|    }
  501|    119|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 14, False: 105]
  ------------------
  502|     14|      return false;
  503|     14|    }
  504|    105|    return true;
  505|    119|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     88|  inline int read_init(const uint8_t* const buf, int offset) {
  422|     88|    unsigned x;
  423|     88|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 9, False: 79]
  ------------------
  424|      9|      return 1;
  425|      9|    }
  426|     79|    ans_.buf = buf;
  427|     79|    x = buf[offset - 1] >> 6;
  428|     79|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 27, False: 52]
  ------------------
  429|     27|      ans_.buf_offset = offset - 1;
  430|     27|      ans_.state = buf[offset - 1] & 0x3F;
  431|     52|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 16, False: 36]
  ------------------
  432|     16|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 7, False: 9]
  ------------------
  433|      7|        return 1;
  434|      7|      }
  435|      9|      ans_.buf_offset = offset - 2;
  436|      9|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     36|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 13, False: 23]
  ------------------
  438|     13|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 5, False: 8]
  ------------------
  439|      5|        return 1;
  440|      5|      }
  441|      8|      ans_.buf_offset = offset - 3;
  442|      8|      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: 9, False: 14]
  ------------------
  445|      9|        return 1;
  446|      9|      }
  447|     14|      ans_.buf_offset = offset - 4;
  448|     14|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     14|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     58|    ans_.state += l_rans_base;
  453|     58|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     58|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 13, False: 45]
  ------------------
  454|     13|      return 1;
  455|     13|    }
  456|     45|    return 0;
  457|     58|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  465|   316k|  inline int rans_read() {
  466|   316k|    unsigned rem;
  467|   316k|    unsigned quo;
  468|   316k|    struct rans_dec_sym sym;
  469|   317k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 120k, False: 196k]
  |  Branch (469:40): [True: 789, False: 119k]
  ------------------
  470|    789|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    789|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    789|    }
  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|   316k|    quo = ans_.state / rans_precision;
  475|   316k|    rem = ans_.state % rans_precision;
  476|   316k|    fetch_sym(&sym, rem);
  477|   316k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   316k|    return sym.val;
  479|   316k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  508|   316k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   316k|    uint32_t symbol = lut_table_[rem];
  510|   316k|    out->val = symbol;
  511|   316k|    out->prob = probability_table_[symbol].prob;
  512|   316k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   316k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  459|     45|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    307|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  484|    191|                                       uint32_t num_symbols) {
  485|    191|    lut_table_.resize(rans_precision);
  486|    191|    probability_table_.resize(num_symbols);
  487|    191|    uint32_t cum_prob = 0;
  488|    191|    uint32_t act_prob = 0;
  489|  2.63k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 2.46k, False: 161]
  ------------------
  490|  2.46k|      probability_table_[i].prob = token_probs[i];
  491|  2.46k|      probability_table_[i].cum_prob = cum_prob;
  492|  2.46k|      cum_prob += token_probs[i];
  493|  2.46k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 30, False: 2.43k]
  ------------------
  494|     30|        return false;
  495|     30|      }
  496|  10.0M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 10.0M, False: 2.43k]
  ------------------
  497|  10.0M|        lut_table_[j] = i;
  498|  10.0M|      }
  499|  2.43k|      act_prob = cum_prob;
  500|  2.43k|    }
  501|    161|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 24, False: 137]
  ------------------
  502|     24|      return false;
  503|     24|    }
  504|    137|    return true;
  505|    161|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     97|  inline int read_init(const uint8_t* const buf, int offset) {
  422|     97|    unsigned x;
  423|     97|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 10, False: 87]
  ------------------
  424|     10|      return 1;
  425|     10|    }
  426|     87|    ans_.buf = buf;
  427|     87|    x = buf[offset - 1] >> 6;
  428|     87|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 21, False: 66]
  ------------------
  429|     21|      ans_.buf_offset = offset - 1;
  430|     21|      ans_.state = buf[offset - 1] & 0x3F;
  431|     66|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 21, False: 45]
  ------------------
  432|     21|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 12]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     45|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 19, False: 26]
  ------------------
  438|     19|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 9, False: 10]
  ------------------
  439|      9|        return 1;
  440|      9|      }
  441|     10|      ans_.buf_offset = offset - 3;
  442|     10|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     26|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 26, False: 0]
  ------------------
  444|     26|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 3, False: 23]
  ------------------
  445|      3|        return 1;
  446|      3|      }
  447|     23|      ans_.buf_offset = offset - 4;
  448|     23|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     23|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     66|    ans_.state += l_rans_base;
  453|     66|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     66|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 8, False: 58]
  ------------------
  454|      8|      return 1;
  455|      8|    }
  456|     58|    return 0;
  457|     66|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  465|   291k|  inline int rans_read() {
  466|   291k|    unsigned rem;
  467|   291k|    unsigned quo;
  468|   291k|    struct rans_dec_sym sym;
  469|   292k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 150k, False: 142k]
  |  Branch (469:40): [True: 737, False: 149k]
  ------------------
  470|    737|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    737|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    737|    }
  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|   291k|    quo = ans_.state / rans_precision;
  475|   291k|    rem = ans_.state % rans_precision;
  476|   291k|    fetch_sym(&sym, rem);
  477|   291k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   291k|    return sym.val;
  479|   291k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  508|   291k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   291k|    uint32_t symbol = lut_table_[rem];
  510|   291k|    out->val = symbol;
  511|   291k|    out->prob = probability_table_[symbol].prob;
  512|   291k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   291k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  459|     58|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    273|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  484|    186|                                       uint32_t num_symbols) {
  485|    186|    lut_table_.resize(rans_precision);
  486|    186|    probability_table_.resize(num_symbols);
  487|    186|    uint32_t cum_prob = 0;
  488|    186|    uint32_t act_prob = 0;
  489|  4.49k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 4.32k, False: 169]
  ------------------
  490|  4.32k|      probability_table_[i].prob = token_probs[i];
  491|  4.32k|      probability_table_[i].cum_prob = cum_prob;
  492|  4.32k|      cum_prob += token_probs[i];
  493|  4.32k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 17, False: 4.31k]
  ------------------
  494|     17|        return false;
  495|     17|      }
  496|  39.7M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 39.7M, False: 4.31k]
  ------------------
  497|  39.7M|        lut_table_[j] = i;
  498|  39.7M|      }
  499|  4.31k|      act_prob = cum_prob;
  500|  4.31k|    }
  501|    169|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 27, False: 142]
  ------------------
  502|     27|      return false;
  503|     27|    }
  504|    142|    return true;
  505|    169|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     90|  inline int read_init(const uint8_t* const buf, int offset) {
  422|     90|    unsigned x;
  423|     90|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 5, False: 85]
  ------------------
  424|      5|      return 1;
  425|      5|    }
  426|     85|    ans_.buf = buf;
  427|     85|    x = buf[offset - 1] >> 6;
  428|     85|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 24, False: 61]
  ------------------
  429|     24|      ans_.buf_offset = offset - 1;
  430|     24|      ans_.state = buf[offset - 1] & 0x3F;
  431|     61|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 16, False: 45]
  ------------------
  432|     16|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 7, False: 9]
  ------------------
  433|      7|        return 1;
  434|      7|      }
  435|      9|      ans_.buf_offset = offset - 2;
  436|      9|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     45|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 17, False: 28]
  ------------------
  438|     17|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 5, False: 12]
  ------------------
  439|      5|        return 1;
  440|      5|      }
  441|     12|      ans_.buf_offset = offset - 3;
  442|     12|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     28|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 28, False: 0]
  ------------------
  444|     28|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 9, False: 19]
  ------------------
  445|      9|        return 1;
  446|      9|      }
  447|     19|      ans_.buf_offset = offset - 4;
  448|     19|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     19|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     64|    ans_.state += l_rans_base;
  453|     64|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     64|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 14, False: 50]
  ------------------
  454|     14|      return 1;
  455|     14|    }
  456|     50|    return 0;
  457|     64|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  465|   254k|  inline int rans_read() {
  466|   254k|    unsigned rem;
  467|   254k|    unsigned quo;
  468|   254k|    struct rans_dec_sym sym;
  469|   255k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 173k, False: 81.5k]
  |  Branch (469:40): [True: 610, False: 173k]
  ------------------
  470|    610|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    610|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    610|    }
  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|   254k|    quo = ans_.state / rans_precision;
  475|   254k|    rem = ans_.state % rans_precision;
  476|   254k|    fetch_sym(&sym, rem);
  477|   254k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   254k|    return sym.val;
  479|   254k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  508|   254k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   254k|    uint32_t symbol = lut_table_[rem];
  510|   254k|    out->val = symbol;
  511|   254k|    out->prob = probability_table_[symbol].prob;
  512|   254k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   254k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  459|     50|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    380|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  484|    230|                                       uint32_t num_symbols) {
  485|    230|    lut_table_.resize(rans_precision);
  486|    230|    probability_table_.resize(num_symbols);
  487|    230|    uint32_t cum_prob = 0;
  488|    230|    uint32_t act_prob = 0;
  489|  10.4k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 10.1k, False: 209]
  ------------------
  490|  10.1k|      probability_table_[i].prob = token_probs[i];
  491|  10.1k|      probability_table_[i].cum_prob = cum_prob;
  492|  10.1k|      cum_prob += token_probs[i];
  493|  10.1k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 21, False: 10.1k]
  ------------------
  494|     21|        return false;
  495|     21|      }
  496|   100M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 100M, False: 10.1k]
  ------------------
  497|   100M|        lut_table_[j] = i;
  498|   100M|      }
  499|  10.1k|      act_prob = cum_prob;
  500|  10.1k|    }
  501|    209|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 30, False: 179]
  ------------------
  502|     30|      return false;
  503|     30|    }
  504|    179|    return true;
  505|    209|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|    102|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    102|    unsigned x;
  423|    102|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 10, False: 92]
  ------------------
  424|     10|      return 1;
  425|     10|    }
  426|     92|    ans_.buf = buf;
  427|     92|    x = buf[offset - 1] >> 6;
  428|     92|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 20, False: 72]
  ------------------
  429|     20|      ans_.buf_offset = offset - 1;
  430|     20|      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: 9, False: 12]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     51|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 18, False: 33]
  ------------------
  438|     18|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 9, False: 9]
  ------------------
  439|      9|        return 1;
  440|      9|      }
  441|      9|      ans_.buf_offset = offset - 3;
  442|      9|      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: 10, False: 23]
  ------------------
  445|     10|        return 1;
  446|     10|      }
  447|     23|      ans_.buf_offset = offset - 4;
  448|     23|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     23|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     64|    ans_.state += l_rans_base;
  453|     64|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     64|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 10, False: 54]
  ------------------
  454|     10|      return 1;
  455|     10|    }
  456|     54|    return 0;
  457|     64|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  465|   399k|  inline int rans_read() {
  466|   399k|    unsigned rem;
  467|   399k|    unsigned quo;
  468|   399k|    struct rans_dec_sym sym;
  469|   400k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 68.8k, False: 331k]
  |  Branch (469:40): [True: 667, False: 68.1k]
  ------------------
  470|    667|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    667|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    667|    }
  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|   399k|    quo = ans_.state / rans_precision;
  475|   399k|    rem = ans_.state % rans_precision;
  476|   399k|    fetch_sym(&sym, rem);
  477|   399k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   399k|    return sym.val;
  479|   399k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  508|   399k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   399k|    uint32_t symbol = lut_table_[rem];
  510|   399k|    out->val = symbol;
  511|   399k|    out->prob = probability_table_[symbol].prob;
  512|   399k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   399k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  459|     54|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.42k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  484|    853|                                       uint32_t num_symbols) {
  485|    853|    lut_table_.resize(rans_precision);
  486|    853|    probability_table_.resize(num_symbols);
  487|    853|    uint32_t cum_prob = 0;
  488|    853|    uint32_t act_prob = 0;
  489|  17.0k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 16.2k, False: 801]
  ------------------
  490|  16.2k|      probability_table_[i].prob = token_probs[i];
  491|  16.2k|      probability_table_[i].cum_prob = cum_prob;
  492|  16.2k|      cum_prob += token_probs[i];
  493|  16.2k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 52, False: 16.1k]
  ------------------
  494|     52|        return false;
  495|     52|      }
  496|   795M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 794M, False: 16.1k]
  ------------------
  497|   794M|        lut_table_[j] = i;
  498|   794M|      }
  499|  16.1k|      act_prob = cum_prob;
  500|  16.1k|    }
  501|    801|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 63, False: 738]
  ------------------
  502|     63|      return false;
  503|     63|    }
  504|    738|    return true;
  505|    801|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    455|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    455|    unsigned x;
  423|    455|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 27, False: 428]
  ------------------
  424|     27|      return 1;
  425|     27|    }
  426|    428|    ans_.buf = buf;
  427|    428|    x = buf[offset - 1] >> 6;
  428|    428|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 103, False: 325]
  ------------------
  429|    103|      ans_.buf_offset = offset - 1;
  430|    103|      ans_.state = buf[offset - 1] & 0x3F;
  431|    325|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 84, False: 241]
  ------------------
  432|     84|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 29, False: 55]
  ------------------
  433|     29|        return 1;
  434|     29|      }
  435|     55|      ans_.buf_offset = offset - 2;
  436|     55|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    241|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 103, False: 138]
  ------------------
  438|    103|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 49, False: 54]
  ------------------
  439|     49|        return 1;
  440|     49|      }
  441|     54|      ans_.buf_offset = offset - 3;
  442|     54|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    138|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 138, False: 0]
  ------------------
  444|    138|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 42, False: 96]
  ------------------
  445|     42|        return 1;
  446|     42|      }
  447|     96|      ans_.buf_offset = offset - 4;
  448|     96|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     96|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|    308|    ans_.state += l_rans_base;
  453|    308|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    308|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 31, False: 277]
  ------------------
  454|     31|      return 1;
  455|     31|    }
  456|    277|    return 0;
  457|    308|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  465|  68.1M|  inline int rans_read() {
  466|  68.1M|    unsigned rem;
  467|  68.1M|    unsigned quo;
  468|  68.1M|    struct rans_dec_sym sym;
  469|  68.1M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 56.4M, False: 11.6M]
  |  Branch (469:40): [True: 6.19k, False: 56.4M]
  ------------------
  470|  6.19k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  6.19k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  6.19k|    }
  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|  68.1M|    quo = ans_.state / rans_precision;
  475|  68.1M|    rem = ans_.state % rans_precision;
  476|  68.1M|    fetch_sym(&sym, rem);
  477|  68.1M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|  68.1M|    return sym.val;
  479|  68.1M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  508|  68.1M|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|  68.1M|    uint32_t symbol = lut_table_[rem];
  510|  68.1M|    out->val = symbol;
  511|  68.1M|    out->prob = probability_table_[symbol].prob;
  512|  68.1M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|  68.1M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  459|    277|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.29k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.29k|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.29k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.29k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.29k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.29k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 175, False: 1.11k]
  ------------------
   67|    175|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 6, False: 169]
  ------------------
   68|      6|      return false;
   69|      6|    }
   70|       |
   71|    175|  } else
   72|  1.11k|#endif
   73|  1.11k|  {
   74|  1.11k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 20, False: 1.09k]
  ------------------
   75|     20|      return false;
   76|     20|    }
   77|  1.11k|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|  1.26k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 108, False: 1.15k]
  ------------------
   83|    108|    return false;
   84|    108|  }
   85|  1.15k|  probability_table_.resize(num_symbols_);
   86|  1.15k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 383, False: 776]
  ------------------
   87|    383|    return true;
   88|    383|  }
   89|       |  // Decode the table.
   90|  3.75M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 3.75M, False: 608]
  ------------------
   91|  3.75M|    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.75M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 66, False: 3.75M]
  ------------------
   95|     66|      return false;
   96|     66|    }
   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.75M|    const int token = prob_data & 3;
  102|  3.75M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.19M, False: 1.56M]
  ------------------
  103|  2.19M|      const uint32_t offset = prob_data >> 2;
  104|  2.19M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 74, False: 2.19M]
  ------------------
  105|     74|        return false;
  106|     74|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   130M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 128M, False: 2.19M]
  ------------------
  109|   128M|        probability_table_[i + j] = 0;
  110|   128M|      }
  111|  2.19M|      i += offset;
  112|  2.19M|    } else {
  113|  1.56M|      const int extra_bytes = token;
  114|  1.56M|      uint32_t prob = prob_data >> 2;
  115|  4.11M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.55M, False: 1.56M]
  ------------------
  116|  2.55M|        uint8_t eb;
  117|  2.55M|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 2.55M]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.55M|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.55M|      }
  124|  1.56M|      probability_table_[i] = prob;
  125|  1.56M|    }
  126|  3.75M|  }
  127|    608|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 157, False: 451]
  ------------------
  128|    157|    return false;
  129|    157|  }
  130|    451|  return true;
  131|    608|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    717|    DecoderBuffer* buffer) {
  136|    717|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    717|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    717|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    717|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 60, False: 657]
  ------------------
  140|     60|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 56]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     60|  } else
  145|    657|#endif
  146|    657|  {
  147|    657|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 650]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    657|  }
  151|    706|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 91, False: 615]
  ------------------
  152|     91|    return false;
  153|     91|  }
  154|    615|  const uint8_t* const data_head =
  155|    615|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    615|  buffer->Advance(bytes_encoded);
  158|    615|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 120, False: 495]
  ------------------
  159|    120|    return false;
  160|    120|  }
  161|    495|  return true;
  162|    615|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    621|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  22.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    433|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    433|  ans_.read_end();
  167|    433|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    356|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    356|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    356|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 356]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    356|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    356|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    356|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 18, False: 338]
  ------------------
   67|     18|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 16]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     18|  } else
   72|    338|#endif
   73|    338|  {
   74|    338|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 12, False: 326]
  ------------------
   75|     12|      return false;
   76|     12|    }
   77|    338|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    342|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 327]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    327|  probability_table_.resize(num_symbols_);
   86|    327|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 316]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|  1.85M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.85M, False: 239]
  ------------------
   91|  1.85M|    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.85M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 1.85M]
  ------------------
   95|     31|      return false;
   96|     31|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.85M|    const int token = prob_data & 3;
  102|  1.85M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 479k, False: 1.37M]
  ------------------
  103|   479k|      const uint32_t offset = prob_data >> 2;
  104|   479k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 479k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  15.0M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 14.6M, False: 479k]
  ------------------
  109|  14.6M|        probability_table_[i + j] = 0;
  110|  14.6M|      }
  111|   479k|      i += offset;
  112|  1.37M|    } else {
  113|  1.37M|      const int extra_bytes = token;
  114|  1.37M|      uint32_t prob = prob_data >> 2;
  115|  2.52M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.14M, False: 1.37M]
  ------------------
  116|  1.14M|        uint8_t eb;
  117|  1.14M|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 1.14M]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.14M|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.14M|      }
  124|  1.37M|      probability_table_[i] = prob;
  125|  1.37M|    }
  126|  1.85M|  }
  127|    239|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 114, False: 125]
  ------------------
  128|    114|    return false;
  129|    114|  }
  130|    125|  return true;
  131|    239|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    136|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    125|    DecoderBuffer* buffer) {
  136|    125|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    125|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    125|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    125|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 123]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      2|  } else
  145|    123|#endif
  146|    123|  {
  147|    123|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 118]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    123|  }
  151|    120|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 7, False: 113]
  ------------------
  152|      7|    return false;
  153|      7|  }
  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: 34, False: 79]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|     79|  return true;
  162|    113|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  2.11M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|     79|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     79|  ans_.read_end();
  167|     79|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    354|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    354|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    354|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 354]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    354|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    354|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    354|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 37, False: 317]
  ------------------
   67|     37|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 36]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     37|  } else
   72|    317|#endif
   73|    317|  {
   74|    317|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 308]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    317|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    344|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 329]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    329|  probability_table_.resize(num_symbols_);
   86|    329|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 318]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|   756k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 756k, False: 250]
  ------------------
   91|   756k|    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|   756k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 30, False: 756k]
  ------------------
   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|   756k|    const int token = prob_data & 3;
  102|   756k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 650k, False: 106k]
  ------------------
  103|   650k|      const uint32_t offset = prob_data >> 2;
  104|   650k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 650k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  26.9M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 26.3M, False: 650k]
  ------------------
  109|  26.3M|        probability_table_[i + j] = 0;
  110|  26.3M|      }
  111|   650k|      i += offset;
  112|   650k|    } else {
  113|   106k|      const int extra_bytes = token;
  114|   106k|      uint32_t prob = prob_data >> 2;
  115|   196k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 90.7k, False: 106k]
  ------------------
  116|  90.7k|        uint8_t eb;
  117|  90.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 90.7k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  90.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  90.7k|      }
  124|   106k|      probability_table_[i] = prob;
  125|   106k|    }
  126|   756k|  }
  127|    250|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 41, False: 209]
  ------------------
  128|     41|    return false;
  129|     41|  }
  130|    209|  return true;
  131|    250|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    220|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    209|    DecoderBuffer* buffer) {
  136|    209|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    209|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    209|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    209|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 26, False: 183]
  ------------------
  140|     26|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 23]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     26|  } else
  145|    183|#endif
  146|    183|  {
  147|    183|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 174]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    183|  }
  151|    197|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 28, False: 169]
  ------------------
  152|     28|    return false;
  153|     28|  }
  154|    169|  const uint8_t* const data_head =
  155|    169|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    169|  buffer->Advance(bytes_encoded);
  158|    169|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 40, False: 129]
  ------------------
  159|     40|    return false;
  160|     40|  }
  161|    129|  return true;
  162|    169|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  13.0M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    129|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    129|  ans_.read_end();
  167|    129|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    332|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    332|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    332|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 332]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    332|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    332|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    332|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 303]
  ------------------
   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|    303|#endif
   73|    303|  {
   74|    303|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 290]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    303|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    319|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 308]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    308|  probability_table_.resize(num_symbols_);
   86|    308|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 306]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  49.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 49.7k, False: 241]
  ------------------
   91|  49.7k|    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|  49.7k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 23, False: 49.6k]
  ------------------
   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|  49.6k|    const int token = prob_data & 3;
  102|  49.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 17.8k, False: 31.8k]
  ------------------
  103|  17.8k|      const uint32_t offset = prob_data >> 2;
  104|  17.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 35, False: 17.7k]
  ------------------
  105|     35|        return false;
  106|     35|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   604k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 586k, False: 17.7k]
  ------------------
  109|   586k|        probability_table_[i + j] = 0;
  110|   586k|      }
  111|  17.7k|      i += offset;
  112|  31.8k|    } else {
  113|  31.8k|      const int extra_bytes = token;
  114|  31.8k|      uint32_t prob = prob_data >> 2;
  115|  57.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 26.1k, False: 31.8k]
  ------------------
  116|  26.1k|        uint8_t eb;
  117|  26.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 26.1k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  26.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  26.1k|      }
  124|  31.8k|      probability_table_[i] = prob;
  125|  31.8k|    }
  126|  49.6k|  }
  127|    241|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 220]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    220|  return true;
  131|    241|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    222|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    220|    DecoderBuffer* buffer) {
  136|    220|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    220|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    220|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    220|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 24, False: 196]
  ------------------
  140|     24|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 21]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     24|  } else
  145|    196|#endif
  146|    196|  {
  147|    196|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 187]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    196|  }
  151|    208|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 28, False: 180]
  ------------------
  152|     28|    return false;
  153|     28|  }
  154|    180|  const uint8_t* const data_head =
  155|    180|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    180|  buffer->Advance(bytes_encoded);
  158|    180|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 37, False: 143]
  ------------------
  159|     37|    return false;
  160|     37|  }
  161|    143|  return true;
  162|    180|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  30.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    143|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    143|  ans_.read_end();
  167|    143|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    200|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    200|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    200|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 200]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    200|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    200|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    200|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 25, False: 175]
  ------------------
   67|     25|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 24]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     25|  } else
   72|    175|#endif
   73|    175|  {
   74|    175|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 170]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    175|  }
   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|    194|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 191]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    191|  probability_table_.resize(num_symbols_);
   86|    191|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 190]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  23.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 22.8k, False: 124]
  ------------------
   91|  22.8k|    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|  22.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 32, False: 22.8k]
  ------------------
   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|  22.8k|    const int token = prob_data & 3;
  102|  22.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.04k, False: 13.8k]
  ------------------
  103|  9.04k|      const uint32_t offset = prob_data >> 2;
  104|  9.04k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 16, False: 9.02k]
  ------------------
  105|     16|        return false;
  106|     16|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   360k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 351k, False: 9.02k]
  ------------------
  109|   351k|        probability_table_[i + j] = 0;
  110|   351k|      }
  111|  9.02k|      i += offset;
  112|  13.8k|    } else {
  113|  13.8k|      const int extra_bytes = token;
  114|  13.8k|      uint32_t prob = prob_data >> 2;
  115|  21.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 7.39k, False: 13.8k]
  ------------------
  116|  7.39k|        uint8_t eb;
  117|  7.39k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 7.37k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  7.37k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  7.37k|      }
  124|  13.8k|      probability_table_[i] = prob;
  125|  13.8k|    }
  126|  22.8k|  }
  127|    124|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 7, False: 117]
  ------------------
  128|      7|    return false;
  129|      7|  }
  130|    117|  return true;
  131|    124|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    118|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    117|    DecoderBuffer* buffer) {
  136|    117|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    117|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    117|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    117|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 15, False: 102]
  ------------------
  140|     15|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 14]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     15|  } else
  145|    102|#endif
  146|    102|  {
  147|    102|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 99]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    102|  }
  151|    113|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 21, False: 92]
  ------------------
  152|     21|    return false;
  153|     21|  }
  154|     92|  const uint8_t* const data_head =
  155|     92|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     92|  buffer->Advance(bytes_encoded);
  158|     92|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 41, False: 51]
  ------------------
  159|     41|    return false;
  160|     41|  }
  161|     51|  return true;
  162|     92|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  2.54M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     51|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     51|  ans_.read_end();
  167|     51|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    345|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    345|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    345|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 345]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    345|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    345|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    345|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 39, False: 306]
  ------------------
   67|     39|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 38]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     39|  } else
   72|    306|#endif
   73|    306|  {
   74|    306|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 303]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    306|  }
   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|    341|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 330]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    330|  probability_table_.resize(num_symbols_);
   86|    330|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 330]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   117k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 117k, False: 264]
  ------------------
   91|   117k|    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|   117k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 28, False: 117k]
  ------------------
   95|     28|      return false;
   96|     28|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   117k|    const int token = prob_data & 3;
  102|   117k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 101k, False: 15.6k]
  ------------------
  103|   101k|      const uint32_t offset = prob_data >> 2;
  104|   101k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 101k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.38M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.28M, False: 101k]
  ------------------
  109|  3.28M|        probability_table_[i + j] = 0;
  110|  3.28M|      }
  111|   101k|      i += offset;
  112|   101k|    } else {
  113|  15.6k|      const int extra_bytes = token;
  114|  15.6k|      uint32_t prob = prob_data >> 2;
  115|  26.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.8k, False: 15.6k]
  ------------------
  116|  10.8k|        uint8_t eb;
  117|  10.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 10.8k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.8k|      }
  124|  15.6k|      probability_table_[i] = prob;
  125|  15.6k|    }
  126|   117k|  }
  127|    264|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 251]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|    251|  return true;
  131|    264|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    251|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    251|    DecoderBuffer* buffer) {
  136|    251|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    251|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    251|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    251|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 32, False: 219]
  ------------------
  140|     32|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 31]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     32|  } else
  145|    219|#endif
  146|    219|  {
  147|    219|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 210]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    219|  }
  151|    241|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 46, False: 195]
  ------------------
  152|     46|    return false;
  153|     46|  }
  154|    195|  const uint8_t* const data_head =
  155|    195|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    195|  buffer->Advance(bytes_encoded);
  158|    195|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 32, False: 163]
  ------------------
  159|     32|    return false;
  160|     32|  }
  161|    163|  return true;
  162|    195|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  3.65M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    163|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    163|  ans_.read_end();
  167|    163|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    332|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    332|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    332|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 332]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    332|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    332|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    332|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 43, False: 289]
  ------------------
   67|     43|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 41]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     43|  } else
   72|    289|#endif
   73|    289|  {
   74|    289|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 282]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    289|  }
   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|    323|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 313]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    313|  probability_table_.resize(num_symbols_);
   86|    313|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 312]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   258k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 257k, False: 226]
  ------------------
   91|   257k|    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|   257k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 257k]
  ------------------
   95|     31|      return false;
   96|     31|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   257k|    const int token = prob_data & 3;
  102|   257k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 127k, False: 130k]
  ------------------
  103|   127k|      const uint32_t offset = prob_data >> 2;
  104|   127k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 127k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.41M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.29M, False: 127k]
  ------------------
  109|  3.29M|        probability_table_[i + j] = 0;
  110|  3.29M|      }
  111|   127k|      i += offset;
  112|   130k|    } else {
  113|   130k|      const int extra_bytes = token;
  114|   130k|      uint32_t prob = prob_data >> 2;
  115|   241k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 111k, False: 130k]
  ------------------
  116|   111k|        uint8_t eb;
  117|   111k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 111k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   111k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   111k|      }
  124|   130k|      probability_table_[i] = prob;
  125|   130k|    }
  126|   257k|  }
  127|    226|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 16, False: 210]
  ------------------
  128|     16|    return false;
  129|     16|  }
  130|    210|  return true;
  131|    226|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    211|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    210|    DecoderBuffer* buffer) {
  136|    210|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    210|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    210|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    210|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 17, False: 193]
  ------------------
  140|     17|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 15]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     17|  } else
  145|    193|#endif
  146|    193|  {
  147|    193|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 12, False: 181]
  ------------------
  148|     12|      return false;
  149|     12|    }
  150|    193|  }
  151|    196|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 38, False: 158]
  ------------------
  152|     38|    return false;
  153|     38|  }
  154|    158|  const uint8_t* const data_head =
  155|    158|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    158|  buffer->Advance(bytes_encoded);
  158|    158|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 31, False: 127]
  ------------------
  159|     31|    return false;
  160|     31|  }
  161|    127|  return true;
  162|    158|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  41.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    127|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    127|  ans_.read_end();
  167|    127|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    241|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    241|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    241|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 241]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    241|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    241|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    241|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 34, False: 207]
  ------------------
   67|     34|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 32]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     34|  } else
   72|    207|#endif
   73|    207|  {
   74|    207|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 201]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    207|  }
   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|    233|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 223]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    223|  probability_table_.resize(num_symbols_);
   86|    223|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 220]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   709k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 709k, False: 152]
  ------------------
   91|   709k|    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|   709k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 25, False: 709k]
  ------------------
   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|   709k|    const int token = prob_data & 3;
  102|   709k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 671k, False: 37.7k]
  ------------------
  103|   671k|      const uint32_t offset = prob_data >> 2;
  104|   671k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 671k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  35.4M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 34.7M, False: 671k]
  ------------------
  109|  34.7M|        probability_table_[i + j] = 0;
  110|  34.7M|      }
  111|   671k|      i += offset;
  112|   671k|    } else {
  113|  37.7k|      const int extra_bytes = token;
  114|  37.7k|      uint32_t prob = prob_data >> 2;
  115|  67.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 29.6k, False: 37.6k]
  ------------------
  116|  29.6k|        uint8_t eb;
  117|  29.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 29.6k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  29.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  29.6k|      }
  124|  37.6k|      probability_table_[i] = prob;
  125|  37.6k|    }
  126|   709k|  }
  127|    152|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 16, False: 136]
  ------------------
  128|     16|    return false;
  129|     16|  }
  130|    136|  return true;
  131|    152|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    139|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    136|    DecoderBuffer* buffer) {
  136|    136|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    136|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    136|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    136|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 25, False: 111]
  ------------------
  140|     25|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 24]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     25|  } else
  145|    111|#endif
  146|    111|  {
  147|    111|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 101]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    111|  }
  151|    125|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 28, False: 97]
  ------------------
  152|     28|    return false;
  153|     28|  }
  154|     97|  const uint8_t* const data_head =
  155|     97|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     97|  buffer->Advance(bytes_encoded);
  158|     97|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 36, False: 61]
  ------------------
  159|     36|    return false;
  160|     36|  }
  161|     61|  return true;
  162|     97|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  42.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     61|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     61|  ans_.read_end();
  167|     61|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    217|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    217|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    217|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 217]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    217|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    217|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    217|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 17, False: 200]
  ------------------
   67|     17|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 17]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     17|  } else
   72|    200|#endif
   73|    200|  {
   74|    200|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 191]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    200|  }
   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|    208|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 193]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    193|  probability_table_.resize(num_symbols_);
   86|    193|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 184]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  69.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 69.3k, False: 129]
  ------------------
   91|  69.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|  69.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 29, False: 69.3k]
  ------------------
   95|     29|      return false;
   96|     29|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  69.3k|    const int token = prob_data & 3;
  102|  69.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.96k, False: 62.3k]
  ------------------
  103|  6.96k|      const uint32_t offset = prob_data >> 2;
  104|  6.96k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 6.94k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   258k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 251k, False: 6.94k]
  ------------------
  109|   251k|        probability_table_[i + j] = 0;
  110|   251k|      }
  111|  6.94k|      i += offset;
  112|  62.3k|    } else {
  113|  62.3k|      const int extra_bytes = token;
  114|  62.3k|      uint32_t prob = prob_data >> 2;
  115|   110k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 48.3k, False: 62.3k]
  ------------------
  116|  48.3k|        uint8_t eb;
  117|  48.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 48.3k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  48.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  48.3k|      }
  124|  62.3k|      probability_table_[i] = prob;
  125|  62.3k|    }
  126|  69.3k|  }
  127|    129|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 28, False: 101]
  ------------------
  128|     28|    return false;
  129|     28|  }
  130|    101|  return true;
  131|    129|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    110|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    101|    DecoderBuffer* buffer) {
  136|    101|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    101|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    101|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    101|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 97]
  ------------------
  140|      4|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 4]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      4|  } else
  145|     97|#endif
  146|     97|  {
  147|     97|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 88]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|     97|  }
  151|     92|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 13, False: 79]
  ------------------
  152|     13|    return false;
  153|     13|  }
  154|     79|  const uint8_t* const data_head =
  155|     79|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     79|  buffer->Advance(bytes_encoded);
  158|     79|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 27, False: 52]
  ------------------
  159|     27|    return false;
  160|     27|  }
  161|     52|  return true;
  162|     79|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   352k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     52|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     52|  ans_.read_end();
  167|     52|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    224|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    224|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    224|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 224]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    224|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    224|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    224|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 7, False: 217]
  ------------------
   67|      7|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 7]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      7|  } else
   72|    217|#endif
   73|    217|  {
   74|    217|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 214]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    217|  }
   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|    221|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 216]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    216|  probability_table_.resize(num_symbols_);
   86|    216|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 208]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|  16.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 16.0k, False: 139]
  ------------------
   91|  16.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  16.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 30, False: 16.0k]
  ------------------
   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|  16.0k|    const int token = prob_data & 3;
  102|  16.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.21k, False: 6.83k]
  ------------------
  103|  9.21k|      const uint32_t offset = prob_data >> 2;
  104|  9.21k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 19, False: 9.19k]
  ------------------
  105|     19|        return false;
  106|     19|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   332k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 323k, False: 9.19k]
  ------------------
  109|   323k|        probability_table_[i + j] = 0;
  110|   323k|      }
  111|  9.19k|      i += offset;
  112|  9.19k|    } else {
  113|  6.83k|      const int extra_bytes = token;
  114|  6.83k|      uint32_t prob = prob_data >> 2;
  115|  10.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.38k, False: 6.81k]
  ------------------
  116|  3.38k|        uint8_t eb;
  117|  3.38k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 3.36k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.36k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.36k|      }
  124|  6.81k|      probability_table_[i] = prob;
  125|  6.81k|    }
  126|  16.0k|  }
  127|    139|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 34, False: 105]
  ------------------
  128|     34|    return false;
  129|     34|  }
  130|    105|  return true;
  131|    139|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    113|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    105|    DecoderBuffer* buffer) {
  136|    105|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    105|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    105|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    105|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 104]
  ------------------
  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|    104|#endif
  146|    104|  {
  147|    104|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 104]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    104|  }
  151|    105|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 17, False: 88]
  ------------------
  152|     17|    return false;
  153|     17|  }
  154|     88|  const uint8_t* const data_head =
  155|     88|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     88|  buffer->Advance(bytes_encoded);
  158|     88|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 43, False: 45]
  ------------------
  159|     43|    return false;
  160|     43|  }
  161|     45|  return true;
  162|     88|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   316k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     45|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     45|  ans_.read_end();
  167|     45|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    307|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    307|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    307|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 307]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    307|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    307|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    307|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 49, False: 258]
  ------------------
   67|     49|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 46]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     49|  } else
   72|    258|#endif
   73|    258|  {
   74|    258|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 252]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    258|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    298|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 22, False: 276]
  ------------------
   83|     22|    return false;
   84|     22|  }
   85|    276|  probability_table_.resize(num_symbols_);
   86|    276|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 271]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|   244k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 244k, False: 191]
  ------------------
   91|   244k|    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|   244k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 39, False: 244k]
  ------------------
   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|   244k|    const int token = prob_data & 3;
  102|   244k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 121k, False: 122k]
  ------------------
  103|   121k|      const uint32_t offset = prob_data >> 2;
  104|   121k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 121k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.38M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.26M, False: 121k]
  ------------------
  109|  3.26M|        probability_table_[i + j] = 0;
  110|  3.26M|      }
  111|   121k|      i += offset;
  112|   122k|    } else {
  113|   122k|      const int extra_bytes = token;
  114|   122k|      uint32_t prob = prob_data >> 2;
  115|   243k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 120k, False: 122k]
  ------------------
  116|   120k|        uint8_t eb;
  117|   120k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 120k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   120k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   120k|      }
  124|   122k|      probability_table_[i] = prob;
  125|   122k|    }
  126|   244k|  }
  127|    191|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 54, False: 137]
  ------------------
  128|     54|    return false;
  129|     54|  }
  130|    137|  return true;
  131|    191|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    142|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    137|    DecoderBuffer* buffer) {
  136|    137|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    137|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    137|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    137|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 13, False: 124]
  ------------------
  140|     13|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 13]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     13|  } else
  145|    124|#endif
  146|    124|  {
  147|    124|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 124]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    124|  }
  151|    137|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 40, False: 97]
  ------------------
  152|     40|    return false;
  153|     40|  }
  154|     97|  const uint8_t* const data_head =
  155|     97|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     97|  buffer->Advance(bytes_encoded);
  158|     97|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 39, False: 58]
  ------------------
  159|     39|    return false;
  160|     39|  }
  161|     58|  return true;
  162|     97|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   291k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    273|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    273|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    273|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 273]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    273|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    273|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    273|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 46, False: 227]
  ------------------
   67|     46|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 44]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     46|  } else
   72|    227|#endif
   73|    227|  {
   74|    227|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 227]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    227|  }
   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|    271|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 260]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    260|  probability_table_.resize(num_symbols_);
   86|    260|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 253]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  1.12M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.12M, False: 186]
  ------------------
   91|  1.12M|    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.12M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 40, False: 1.12M]
  ------------------
   95|     40|      return false;
   96|     40|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.12M|    const int token = prob_data & 3;
  102|  1.12M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 627k, False: 493k]
  ------------------
  103|   627k|      const uint32_t offset = prob_data >> 2;
  104|   627k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 627k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  18.2M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 17.6M, False: 627k]
  ------------------
  109|  17.6M|        probability_table_[i + j] = 0;
  110|  17.6M|      }
  111|   627k|      i += offset;
  112|   627k|    } else {
  113|   493k|      const int extra_bytes = token;
  114|   493k|      uint32_t prob = prob_data >> 2;
  115|   919k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 426k, False: 493k]
  ------------------
  116|   426k|        uint8_t eb;
  117|   426k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 426k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   426k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   426k|      }
  124|   493k|      probability_table_[i] = prob;
  125|   493k|    }
  126|  1.12M|  }
  127|    186|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 44, False: 142]
  ------------------
  128|     44|    return false;
  129|     44|  }
  130|    142|  return true;
  131|    186|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    149|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    142|    DecoderBuffer* buffer) {
  136|    142|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    142|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    142|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    142|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 23, False: 119]
  ------------------
  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|    119|#endif
  146|    119|  {
  147|    119|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 114]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    119|  }
  151|    137|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 47, False: 90]
  ------------------
  152|     47|    return false;
  153|     47|  }
  154|     90|  const uint8_t* const data_head =
  155|     90|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     90|  buffer->Advance(bytes_encoded);
  158|     90|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 40, False: 50]
  ------------------
  159|     40|    return false;
  160|     40|  }
  161|     50|  return true;
  162|     90|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   254k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     50|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     50|  ans_.read_end();
  167|     50|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    380|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    380|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    380|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 380]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    380|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    380|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    380|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 67, False: 313]
  ------------------
   67|     67|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 67]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     67|  } else
   72|    313|#endif
   73|    313|  {
   74|    313|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 303]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    313|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    370|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 354]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    354|  probability_table_.resize(num_symbols_);
   86|    354|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 26, False: 328]
  ------------------
   87|     26|    return true;
   88|     26|  }
   89|       |  // Decode the table.
   90|  1.60M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.60M, False: 230]
  ------------------
   91|  1.60M|    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.60M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 33, False: 1.60M]
  ------------------
   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|  1.60M|    const int token = prob_data & 3;
  102|  1.60M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 451k, False: 1.15M]
  ------------------
  103|   451k|      const uint32_t offset = prob_data >> 2;
  104|   451k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 43, False: 451k]
  ------------------
  105|     43|        return false;
  106|     43|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  14.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 14.3M, False: 451k]
  ------------------
  109|  14.3M|        probability_table_[i + j] = 0;
  110|  14.3M|      }
  111|   451k|      i += offset;
  112|  1.15M|    } else {
  113|  1.15M|      const int extra_bytes = token;
  114|  1.15M|      uint32_t prob = prob_data >> 2;
  115|  2.30M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.15M, False: 1.15M]
  ------------------
  116|  1.15M|        uint8_t eb;
  117|  1.15M|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 1.15M]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.15M|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.15M|      }
  124|  1.15M|      probability_table_[i] = prob;
  125|  1.15M|    }
  126|  1.60M|  }
  127|    230|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 51, False: 179]
  ------------------
  128|     51|    return false;
  129|     51|  }
  130|    179|  return true;
  131|    230|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    205|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    179|    DecoderBuffer* buffer) {
  136|    179|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    179|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    179|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    179|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 45, False: 134]
  ------------------
  140|     45|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 45]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     45|  } else
  145|    134|#endif
  146|    134|  {
  147|    134|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 124]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    134|  }
  151|    169|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 67, False: 102]
  ------------------
  152|     67|    return false;
  153|     67|  }
  154|    102|  const uint8_t* const data_head =
  155|    102|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    102|  buffer->Advance(bytes_encoded);
  158|    102|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 48, False: 54]
  ------------------
  159|     48|    return false;
  160|     48|  }
  161|     54|  return true;
  162|    102|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   399k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     54|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     54|  ans_.read_end();
  167|     54|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    330|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    330|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    330|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 330]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    330|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    330|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    330|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 94, False: 236]
  ------------------
   67|     94|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 94]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     94|  } else
   72|    236|#endif
   73|    236|  {
   74|    236|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 231]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    236|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    325|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 51, False: 274]
  ------------------
   83|     51|    return false;
   84|     51|  }
   85|    274|  probability_table_.resize(num_symbols_);
   86|    274|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 269]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|   640k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 640k, False: 170]
  ------------------
   91|   640k|    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|   640k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 639k]
  ------------------
   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|   639k|    const int token = prob_data & 3;
  102|   639k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 470k, False: 169k]
  ------------------
  103|   470k|      const uint32_t offset = prob_data >> 2;
  104|   470k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 43, False: 470k]
  ------------------
  105|     43|        return false;
  106|     43|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  14.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 14.3M, False: 470k]
  ------------------
  109|  14.3M|        probability_table_[i + j] = 0;
  110|  14.3M|      }
  111|   470k|      i += offset;
  112|   470k|    } else {
  113|   169k|      const int extra_bytes = token;
  114|   169k|      uint32_t prob = prob_data >> 2;
  115|   338k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 169k, False: 169k]
  ------------------
  116|   169k|        uint8_t eb;
  117|   169k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 168k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   168k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   168k|      }
  124|   169k|      probability_table_[i] = prob;
  125|   169k|    }
  126|   639k|  }
  127|    170|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 147]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    147|  return true;
  131|    170|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    152|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    147|    DecoderBuffer* buffer) {
  136|    147|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    147|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    147|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    147|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 22, False: 125]
  ------------------
  140|     22|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 22]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     22|  } else
  145|    125|#endif
  146|    125|  {
  147|    125|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 15, False: 110]
  ------------------
  148|     15|      return false;
  149|     15|    }
  150|    125|  }
  151|    132|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 41, False: 91]
  ------------------
  152|     41|    return false;
  153|     41|  }
  154|     91|  const uint8_t* const data_head =
  155|     91|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     91|  buffer->Advance(bytes_encoded);
  158|     91|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 35, False: 56]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|     56|  return true;
  162|     91|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  3.33M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     56|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     56|  ans_.read_end();
  167|     56|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    303|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    303|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    303|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 303]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    303|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    303|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    303|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 45, False: 258]
  ------------------
   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|    258|#endif
   73|    258|  {
   74|    258|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 251]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    258|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    295|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 279]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    279|  probability_table_.resize(num_symbols_);
   86|    279|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 279]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   973k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 973k, False: 195]
  ------------------
   91|   973k|    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|   973k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 32, False: 973k]
  ------------------
   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|   973k|    const int token = prob_data & 3;
  102|   973k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 312k, False: 660k]
  ------------------
  103|   312k|      const uint32_t offset = prob_data >> 2;
  104|   312k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 312k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  8.88M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.57M, False: 312k]
  ------------------
  109|  8.57M|        probability_table_[i + j] = 0;
  110|  8.57M|      }
  111|   312k|      i += offset;
  112|   660k|    } else {
  113|   660k|      const int extra_bytes = token;
  114|   660k|      uint32_t prob = prob_data >> 2;
  115|  1.47M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 817k, False: 660k]
  ------------------
  116|   817k|        uint8_t eb;
  117|   817k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 817k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   817k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   817k|      }
  124|   660k|      probability_table_[i] = prob;
  125|   660k|    }
  126|   973k|  }
  127|    195|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 33, False: 162]
  ------------------
  128|     33|    return false;
  129|     33|  }
  130|    162|  return true;
  131|    195|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    162|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    162|    DecoderBuffer* buffer) {
  136|    162|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    162|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    162|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    162|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 21, False: 141]
  ------------------
  140|     21|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 21]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     21|  } else
  145|    141|#endif
  146|    141|  {
  147|    141|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 11, False: 130]
  ------------------
  148|     11|      return false;
  149|     11|    }
  150|    141|  }
  151|    151|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 56, False: 95]
  ------------------
  152|     56|    return false;
  153|     56|  }
  154|     95|  const uint8_t* const data_head =
  155|     95|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     95|  buffer->Advance(bytes_encoded);
  158|     95|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 43, False: 52]
  ------------------
  159|     43|    return false;
  160|     43|  }
  161|     52|  return true;
  162|     95|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  9.86M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     52|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     52|  ans_.read_end();
  167|     52|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    283|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_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: 58, False: 225]
  ------------------
   67|     58|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 57]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     58|  } else
   72|    225|#endif
   73|    225|  {
   74|    225|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 215]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    225|  }
   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: 14, False: 258]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    258|  probability_table_.resize(num_symbols_);
   86|    258|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 256]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   451k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 451k, False: 181]
  ------------------
   91|   451k|    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|   451k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 451k]
  ------------------
   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|   451k|    const int token = prob_data & 3;
  102|   451k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 212k, False: 238k]
  ------------------
  103|   212k|      const uint32_t offset = prob_data >> 2;
  104|   212k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 212k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  7.81M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.60M, False: 212k]
  ------------------
  109|  7.60M|        probability_table_[i + j] = 0;
  110|  7.60M|      }
  111|   212k|      i += offset;
  112|   238k|    } else {
  113|   238k|      const int extra_bytes = token;
  114|   238k|      uint32_t prob = prob_data >> 2;
  115|   461k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 222k, False: 238k]
  ------------------
  116|   222k|        uint8_t eb;
  117|   222k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 222k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   222k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   222k|      }
  124|   238k|      probability_table_[i] = prob;
  125|   238k|    }
  126|   451k|  }
  127|    181|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 161]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|    161|  return true;
  131|    181|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    163|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    161|    DecoderBuffer* buffer) {
  136|    161|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    161|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    161|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    161|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 26, False: 135]
  ------------------
  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|    135|#endif
  146|    135|  {
  147|    135|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 133]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    135|  }
  151|    159|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 45, False: 114]
  ------------------
  152|     45|    return false;
  153|     45|  }
  154|    114|  const uint8_t* const data_head =
  155|    114|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    114|  buffer->Advance(bytes_encoded);
  158|    114|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 45, False: 69]
  ------------------
  159|     45|    return false;
  160|     45|  }
  161|     69|  return true;
  162|    114|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  20.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     69|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     69|  ans_.read_end();
  167|     69|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    269|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    269|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    269|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 269]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    269|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    269|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    269|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 61, False: 208]
  ------------------
   67|     61|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 61]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     61|  } else
   72|    208|#endif
   73|    208|  {
   74|    208|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 205]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    208|  }
   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|    266|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 259]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    259|  probability_table_.resize(num_symbols_);
   86|    259|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 259]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   698k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 698k, False: 160]
  ------------------
   91|   698k|    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|   698k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 698k]
  ------------------
   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|   698k|    const int token = prob_data & 3;
  102|   698k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 431k, False: 267k]
  ------------------
  103|   431k|      const uint32_t offset = prob_data >> 2;
  104|   431k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 42, False: 430k]
  ------------------
  105|     42|        return false;
  106|     42|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  14.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 14.3M, False: 430k]
  ------------------
  109|  14.3M|        probability_table_[i + j] = 0;
  110|  14.3M|      }
  111|   430k|      i += offset;
  112|   430k|    } else {
  113|   267k|      const int extra_bytes = token;
  114|   267k|      uint32_t prob = prob_data >> 2;
  115|   415k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 148k, False: 267k]
  ------------------
  116|   148k|        uint8_t eb;
  117|   148k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 148k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   148k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   148k|      }
  124|   267k|      probability_table_[i] = prob;
  125|   267k|    }
  126|   698k|  }
  127|    160|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 139]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    139|  return true;
  131|    160|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    139|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    139|    DecoderBuffer* buffer) {
  136|    139|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    139|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    139|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    139|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 31, False: 108]
  ------------------
  140|     31|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 31]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     31|  } else
  145|    108|#endif
  146|    108|  {
  147|    108|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 108]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    108|  }
  151|    139|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 53, False: 86]
  ------------------
  152|     53|    return false;
  153|     53|  }
  154|     86|  const uint8_t* const data_head =
  155|     86|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     86|  buffer->Advance(bytes_encoded);
  158|     86|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 37, False: 49]
  ------------------
  159|     37|    return false;
  160|     37|  }
  161|     49|  return true;
  162|     86|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  8.09M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     49|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     49|  ans_.read_end();
  167|     49|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    236|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    236|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    236|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 236]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    236|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    236|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    236|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 51, False: 185]
  ------------------
   67|     51|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 51]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     51|  } else
   72|    185|#endif
   73|    185|  {
   74|    185|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 181]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    185|  }
   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: 5, False: 227]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    227|  probability_table_.resize(num_symbols_);
   86|    227|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 220]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|   271k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 271k, False: 147]
  ------------------
   91|   271k|    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|   271k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 32, False: 271k]
  ------------------
   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|   271k|    const int token = prob_data & 3;
  102|   271k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 191k, False: 79.9k]
  ------------------
  103|   191k|      const uint32_t offset = prob_data >> 2;
  104|   191k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 191k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.91M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.72M, False: 191k]
  ------------------
  109|  4.72M|        probability_table_[i + j] = 0;
  110|  4.72M|      }
  111|   191k|      i += offset;
  112|   191k|    } else {
  113|  79.9k|      const int extra_bytes = token;
  114|  79.9k|      uint32_t prob = prob_data >> 2;
  115|   150k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 70.0k, False: 79.9k]
  ------------------
  116|  70.0k|        uint8_t eb;
  117|  70.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 70.0k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  70.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  70.0k|      }
  124|  79.9k|      probability_table_[i] = prob;
  125|  79.9k|    }
  126|   271k|  }
  127|    147|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 18, False: 129]
  ------------------
  128|     18|    return false;
  129|     18|  }
  130|    129|  return true;
  131|    147|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    136|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    129|    DecoderBuffer* buffer) {
  136|    129|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    129|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    129|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    129|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 36, False: 93]
  ------------------
  140|     36|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 36]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     36|  } else
  145|     93|#endif
  146|     93|  {
  147|     93|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 83]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|     93|  }
  151|    119|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 50, False: 69]
  ------------------
  152|     50|    return false;
  153|     50|  }
  154|     69|  const uint8_t* const data_head =
  155|     69|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     69|  buffer->Advance(bytes_encoded);
  158|     69|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 18, False: 51]
  ------------------
  159|     18|    return false;
  160|     18|  }
  161|     51|  return true;
  162|     69|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  26.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     51|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     51|  ans_.read_end();
  167|     51|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  10.3k|                   DecoderBuffer* src_buffer, uint32_t* out_values) {
   34|  10.3k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 18, False: 10.3k]
  ------------------
   35|     18|    return true;
   36|     18|  }
   37|       |  // Decode which scheme to use.
   38|  10.3k|  uint8_t scheme;
   39|  10.3k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 186, False: 10.1k]
  ------------------
   40|    186|    return false;
   41|    186|  }
   42|  10.1k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.04k, False: 9.12k]
  ------------------
   43|  1.04k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.04k|                                                  src_buffer, out_values);
   45|  9.12k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 5.52k, False: 3.60k]
  ------------------
   46|  5.52k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  5.52k|                                               out_values);
   48|  5.52k|  }
   49|  3.60k|  return false;
   50|  10.1k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.04k|                         DecoderBuffer* src_buffer, uint32_t* out_values) {
   55|       |  // Decode the encoded data.
   56|  1.04k|  SymbolDecoderT<5> tag_decoder;
   57|  1.04k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 431, False: 616]
  ------------------
   58|    431|    return false;
   59|    431|  }
   60|       |
   61|    616|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 213, False: 403]
  ------------------
   62|    213|    return false;
   63|    213|  }
   64|       |
   65|    403|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 403, False: 0]
  |  Branch (65:25): [True: 59, False: 344]
  ------------------
   66|     59|    return false;  // Wrong number of symbols.
   67|     59|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    344|  src_buffer->StartBitDecoding(false, nullptr);
   72|    344|  int value_id = 0;
   73|  10.1M|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 10.1M, False: 341]
  ------------------
   74|       |    // Decode the tag.
   75|  10.1M|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  20.5M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 10.3M, False: 10.1M]
  ------------------
   78|  10.3M|      uint32_t val;
   79|  10.3M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 3, False: 10.3M]
  ------------------
   80|      3|        return false;
   81|      3|      }
   82|  10.3M|      out_values[value_id++] = val;
   83|  10.3M|    }
   84|  10.1M|  }
   85|    341|  tag_decoder.EndDecoding();
   86|    341|  src_buffer->EndBitDecoding();
   87|    341|  return true;
   88|    344|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  5.52k|                      uint32_t* out_values) {
  117|  5.52k|  uint8_t max_bit_length;
  118|  5.52k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 34, False: 5.49k]
  ------------------
  119|     34|    return false;
  120|     34|  }
  121|  5.49k|  switch (max_bit_length) {
  122|    356|    case 1:
  ------------------
  |  Branch (122:5): [True: 356, False: 5.13k]
  ------------------
  123|    356|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    356|                                                         out_values);
  125|    354|    case 2:
  ------------------
  |  Branch (125:5): [True: 354, False: 5.13k]
  ------------------
  126|    354|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    354|                                                         out_values);
  128|    332|    case 3:
  ------------------
  |  Branch (128:5): [True: 332, False: 5.16k]
  ------------------
  129|    332|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    332|                                                         out_values);
  131|    200|    case 4:
  ------------------
  |  Branch (131:5): [True: 200, False: 5.29k]
  ------------------
  132|    200|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    200|                                                         out_values);
  134|    246|    case 5:
  ------------------
  |  Branch (134:5): [True: 246, False: 5.24k]
  ------------------
  135|    246|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    246|                                                         out_values);
  137|    345|    case 6:
  ------------------
  |  Branch (137:5): [True: 345, False: 5.14k]
  ------------------
  138|    345|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    345|                                                         out_values);
  140|    332|    case 7:
  ------------------
  |  Branch (140:5): [True: 332, False: 5.16k]
  ------------------
  141|    332|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    332|                                                         out_values);
  143|    241|    case 8:
  ------------------
  |  Branch (143:5): [True: 241, False: 5.25k]
  ------------------
  144|    241|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    241|                                                         out_values);
  146|    217|    case 9:
  ------------------
  |  Branch (146:5): [True: 217, False: 5.27k]
  ------------------
  147|    217|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    217|                                                         out_values);
  149|    224|    case 10:
  ------------------
  |  Branch (149:5): [True: 224, False: 5.26k]
  ------------------
  150|    224|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    224|          num_values, src_buffer, out_values);
  152|    307|    case 11:
  ------------------
  |  Branch (152:5): [True: 307, False: 5.18k]
  ------------------
  153|    307|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    307|          num_values, src_buffer, out_values);
  155|    273|    case 12:
  ------------------
  |  Branch (155:5): [True: 273, False: 5.22k]
  ------------------
  156|    273|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    273|          num_values, src_buffer, out_values);
  158|    380|    case 13:
  ------------------
  |  Branch (158:5): [True: 380, False: 5.11k]
  ------------------
  159|    380|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    380|          num_values, src_buffer, out_values);
  161|    330|    case 14:
  ------------------
  |  Branch (161:5): [True: 330, False: 5.16k]
  ------------------
  162|    330|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    330|          num_values, src_buffer, out_values);
  164|    303|    case 15:
  ------------------
  |  Branch (164:5): [True: 303, False: 5.19k]
  ------------------
  165|    303|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    303|          num_values, src_buffer, out_values);
  167|    283|    case 16:
  ------------------
  |  Branch (167:5): [True: 283, False: 5.21k]
  ------------------
  168|    283|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    283|          num_values, src_buffer, out_values);
  170|    269|    case 17:
  ------------------
  |  Branch (170:5): [True: 269, False: 5.22k]
  ------------------
  171|    269|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    269|          num_values, src_buffer, out_values);
  173|    236|    case 18:
  ------------------
  |  Branch (173:5): [True: 236, False: 5.25k]
  ------------------
  174|    236|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    236|          num_values, src_buffer, out_values);
  176|    265|    default:
  ------------------
  |  Branch (176:5): [True: 265, False: 5.22k]
  ------------------
  177|    265|      return false;
  178|  5.49k|  }
  179|  5.49k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    356|                              uint32_t* out_values) {
   93|    356|  SymbolDecoderT decoder;
   94|    356|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 220, False: 136]
  ------------------
   95|    220|    return false;
   96|    220|  }
   97|       |
   98|    136|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 136, False: 0]
  |  Branch (98:25): [True: 11, False: 125]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    125|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 46, False: 79]
  ------------------
  103|     46|    return false;
  104|     46|  }
  105|  2.11M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.11M, False: 79]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.11M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.11M|    out_values[i] = value;
  109|  2.11M|  }
  110|     79|  decoder.EndDecoding();
  111|     79|  return true;
  112|    125|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    354|                              uint32_t* out_values) {
   93|    354|  SymbolDecoderT decoder;
   94|    354|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 134, False: 220]
  ------------------
   95|    134|    return false;
   96|    134|  }
   97|       |
   98|    220|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 220, False: 0]
  |  Branch (98:25): [True: 11, False: 209]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    209|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 80, False: 129]
  ------------------
  103|     80|    return false;
  104|     80|  }
  105|  13.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 13.0M, False: 129]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  13.0M|    const uint32_t value = decoder.DecodeSymbol();
  108|  13.0M|    out_values[i] = value;
  109|  13.0M|  }
  110|    129|  decoder.EndDecoding();
  111|    129|  return true;
  112|    209|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    332|                              uint32_t* out_values) {
   93|    332|  SymbolDecoderT decoder;
   94|    332|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 110, False: 222]
  ------------------
   95|    110|    return false;
   96|    110|  }
   97|       |
   98|    222|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 222, False: 0]
  |  Branch (98:25): [True: 2, False: 220]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    220|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 77, False: 143]
  ------------------
  103|     77|    return false;
  104|     77|  }
  105|  30.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 30.3M, False: 143]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  30.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  30.3M|    out_values[i] = value;
  109|  30.3M|  }
  110|    143|  decoder.EndDecoding();
  111|    143|  return true;
  112|    220|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    200|                              uint32_t* out_values) {
   93|    200|  SymbolDecoderT decoder;
   94|    200|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 82, False: 118]
  ------------------
   95|     82|    return false;
   96|     82|  }
   97|       |
   98|    118|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 118, False: 0]
  |  Branch (98:25): [True: 1, False: 117]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    117|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 66, False: 51]
  ------------------
  103|     66|    return false;
  104|     66|  }
  105|  2.54M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.54M, False: 51]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.54M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.54M|    out_values[i] = value;
  109|  2.54M|  }
  110|     51|  decoder.EndDecoding();
  111|     51|  return true;
  112|    117|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    246|                              uint32_t* out_values) {
   93|    246|  SymbolDecoderT decoder;
   94|    246|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 28, False: 218]
  ------------------
   95|     28|    return false;
   96|     28|  }
   97|       |
   98|    218|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 218, False: 0]
  |  Branch (98:25): [True: 117, False: 101]
  ------------------
   99|    117|    return false;  // Wrong number of symbols.
  100|    117|  }
  101|       |
  102|    101|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 9, False: 92]
  ------------------
  103|      9|    return false;
  104|      9|  }
  105|  12.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.7M, False: 92]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.7M|    out_values[i] = value;
  109|  12.7M|  }
  110|     92|  decoder.EndDecoding();
  111|     92|  return true;
  112|    101|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    345|                              uint32_t* out_values) {
   93|    345|  SymbolDecoderT decoder;
   94|    345|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 94, False: 251]
  ------------------
   95|     94|    return false;
   96|     94|  }
   97|       |
   98|    251|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 251, False: 0]
  |  Branch (98:25): [True: 0, False: 251]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    251|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 88, False: 163]
  ------------------
  103|     88|    return false;
  104|     88|  }
  105|  3.65M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.65M, False: 163]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.65M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.65M|    out_values[i] = value;
  109|  3.65M|  }
  110|    163|  decoder.EndDecoding();
  111|    163|  return true;
  112|    251|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    332|                              uint32_t* out_values) {
   93|    332|  SymbolDecoderT decoder;
   94|    332|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 121, False: 211]
  ------------------
   95|    121|    return false;
   96|    121|  }
   97|       |
   98|    211|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 211, False: 0]
  |  Branch (98:25): [True: 1, False: 210]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    210|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 83, False: 127]
  ------------------
  103|     83|    return false;
  104|     83|  }
  105|  41.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 41.3M, False: 127]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  41.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  41.3M|    out_values[i] = value;
  109|  41.3M|  }
  110|    127|  decoder.EndDecoding();
  111|    127|  return true;
  112|    210|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    241|                              uint32_t* out_values) {
   93|    241|  SymbolDecoderT decoder;
   94|    241|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 102, False: 139]
  ------------------
   95|    102|    return false;
   96|    102|  }
   97|       |
   98|    139|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 139, False: 0]
  |  Branch (98:25): [True: 3, False: 136]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    136|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 75, False: 61]
  ------------------
  103|     75|    return false;
  104|     75|  }
  105|  42.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 42.3M, False: 61]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  42.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  42.3M|    out_values[i] = value;
  109|  42.3M|  }
  110|     61|  decoder.EndDecoding();
  111|     61|  return true;
  112|    136|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    217|                              uint32_t* out_values) {
   93|    217|  SymbolDecoderT decoder;
   94|    217|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 107, False: 110]
  ------------------
   95|    107|    return false;
   96|    107|  }
   97|       |
   98|    110|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 110, False: 0]
  |  Branch (98:25): [True: 9, False: 101]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    101|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 49, False: 52]
  ------------------
  103|     49|    return false;
  104|     49|  }
  105|   352k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 352k, False: 52]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   352k|    const uint32_t value = decoder.DecodeSymbol();
  108|   352k|    out_values[i] = value;
  109|   352k|  }
  110|     52|  decoder.EndDecoding();
  111|     52|  return true;
  112|    101|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    224|                              uint32_t* out_values) {
   93|    224|  SymbolDecoderT decoder;
   94|    224|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 111, False: 113]
  ------------------
   95|    111|    return false;
   96|    111|  }
   97|       |
   98|    113|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 113, False: 0]
  |  Branch (98:25): [True: 8, False: 105]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    105|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 60, False: 45]
  ------------------
  103|     60|    return false;
  104|     60|  }
  105|   316k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 316k, False: 45]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   316k|    const uint32_t value = decoder.DecodeSymbol();
  108|   316k|    out_values[i] = value;
  109|   316k|  }
  110|     45|  decoder.EndDecoding();
  111|     45|  return true;
  112|    105|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    307|                              uint32_t* out_values) {
   93|    307|  SymbolDecoderT decoder;
   94|    307|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 165, False: 142]
  ------------------
   95|    165|    return false;
   96|    165|  }
   97|       |
   98|    142|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 142, False: 0]
  |  Branch (98:25): [True: 5, False: 137]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    137|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 79, False: 58]
  ------------------
  103|     79|    return false;
  104|     79|  }
  105|   292k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 291k, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   291k|    const uint32_t value = decoder.DecodeSymbol();
  108|   291k|    out_values[i] = value;
  109|   291k|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|    137|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    273|                              uint32_t* out_values) {
   93|    273|  SymbolDecoderT decoder;
   94|    273|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 124, False: 149]
  ------------------
   95|    124|    return false;
   96|    124|  }
   97|       |
   98|    149|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 149, False: 0]
  |  Branch (98:25): [True: 7, False: 142]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    142|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 92, False: 50]
  ------------------
  103|     92|    return false;
  104|     92|  }
  105|   254k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 254k, False: 50]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   254k|    const uint32_t value = decoder.DecodeSymbol();
  108|   254k|    out_values[i] = value;
  109|   254k|  }
  110|     50|  decoder.EndDecoding();
  111|     50|  return true;
  112|    142|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    380|                              uint32_t* out_values) {
   93|    380|  SymbolDecoderT decoder;
   94|    380|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 175, False: 205]
  ------------------
   95|    175|    return false;
   96|    175|  }
   97|       |
   98|    205|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 205, False: 0]
  |  Branch (98:25): [True: 26, False: 179]
  ------------------
   99|     26|    return false;  // Wrong number of symbols.
  100|     26|  }
  101|       |
  102|    179|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 125, False: 54]
  ------------------
  103|    125|    return false;
  104|    125|  }
  105|   399k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 399k, False: 54]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   399k|    const uint32_t value = decoder.DecodeSymbol();
  108|   399k|    out_values[i] = value;
  109|   399k|  }
  110|     54|  decoder.EndDecoding();
  111|     54|  return true;
  112|    179|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    330|                              uint32_t* out_values) {
   93|    330|  SymbolDecoderT decoder;
   94|    330|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 178, False: 152]
  ------------------
   95|    178|    return false;
   96|    178|  }
   97|       |
   98|    152|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 152, False: 0]
  |  Branch (98:25): [True: 5, False: 147]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    147|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 91, False: 56]
  ------------------
  103|     91|    return false;
  104|     91|  }
  105|  3.33M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.33M, False: 56]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.33M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.33M|    out_values[i] = value;
  109|  3.33M|  }
  110|     56|  decoder.EndDecoding();
  111|     56|  return true;
  112|    147|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    303|                              uint32_t* out_values) {
   93|    303|  SymbolDecoderT decoder;
   94|    303|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 141, False: 162]
  ------------------
   95|    141|    return false;
   96|    141|  }
   97|       |
   98|    162|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 162, False: 0]
  |  Branch (98:25): [True: 0, False: 162]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    162|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 110, False: 52]
  ------------------
  103|    110|    return false;
  104|    110|  }
  105|  9.86M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.86M, False: 52]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.86M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.86M|    out_values[i] = value;
  109|  9.86M|  }
  110|     52|  decoder.EndDecoding();
  111|     52|  return true;
  112|    162|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    283|                              uint32_t* out_values) {
   93|    283|  SymbolDecoderT decoder;
   94|    283|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 120, False: 163]
  ------------------
   95|    120|    return false;
   96|    120|  }
   97|       |
   98|    163|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 163, False: 0]
  |  Branch (98:25): [True: 2, False: 161]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    161|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 92, False: 69]
  ------------------
  103|     92|    return false;
  104|     92|  }
  105|  20.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 20.3M, False: 69]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  20.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  20.3M|    out_values[i] = value;
  109|  20.3M|  }
  110|     69|  decoder.EndDecoding();
  111|     69|  return true;
  112|    161|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    269|                              uint32_t* out_values) {
   93|    269|  SymbolDecoderT decoder;
   94|    269|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 130, False: 139]
  ------------------
   95|    130|    return false;
   96|    130|  }
   97|       |
   98|    139|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 139, False: 0]
  |  Branch (98:25): [True: 0, False: 139]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    139|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 90, False: 49]
  ------------------
  103|     90|    return false;
  104|     90|  }
  105|  8.09M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.09M, False: 49]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.09M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.09M|    out_values[i] = value;
  109|  8.09M|  }
  110|     49|  decoder.EndDecoding();
  111|     49|  return true;
  112|    139|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    236|                              uint32_t* out_values) {
   93|    236|  SymbolDecoderT decoder;
   94|    236|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 100, False: 136]
  ------------------
   95|    100|    return false;
   96|    100|  }
   97|       |
   98|    136|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 136, False: 0]
  |  Branch (98:25): [True: 7, False: 129]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    129|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 78, False: 51]
  ------------------
  103|     78|    return false;
  104|     78|  }
  105|  26.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 26.5M, False: 51]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  26.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  26.5M|    out_values[i] = value;
  109|  26.5M|  }
  110|     51|  decoder.EndDecoding();
  111|     51|  return true;
  112|    129|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  2.58k|    : decoder_(nullptr),
   49|  2.58k|      last_symbol_id_(-1),
   50|  2.58k|      last_vert_id_(-1),
   51|  2.58k|      last_face_id_(-1),
   52|  2.58k|      num_new_vertices_(0),
   53|  2.58k|      num_encoded_vertices_(0),
   54|  2.58k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.58k|    MeshEdgebreakerDecoder* decoder) {
   59|  2.58k|  decoder_ = decoder;
   60|  2.58k|  return true;
   61|  2.58k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  3.17k|    int att_id) const {
   67|  5.83k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 5.32k, False: 510]
  ------------------
   68|  5.32k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  5.32k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 2.65k, False: 2.66k]
  |  Branch (69:27): [True: 0, False: 2.66k]
  ------------------
   70|  2.65k|      continue;
   71|  2.65k|    }
   72|  2.66k|    const AttributesDecoderInterface* const dec =
   73|  2.66k|        decoder_->attributes_decoder(decoder_id);
   74|  10.6k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 10.6k, False: 0]
  ------------------
   75|  10.6k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 2.66k, False: 7.97k]
  ------------------
   76|  2.66k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.54k, False: 1.12k]
  ------------------
   77|  1.54k|          return &attribute_data_[i].connectivity_data;
   78|  1.54k|        }
   79|  1.12k|        return nullptr;
   80|  2.66k|      }
   81|  10.6k|    }
   82|  2.66k|  }
   83|    510|  return nullptr;
   84|  3.17k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  3.17k|    int att_id) const {
   90|  5.83k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 5.32k, False: 510]
  ------------------
   91|  5.32k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  5.32k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 2.65k, False: 2.66k]
  |  Branch (92:27): [True: 0, False: 2.66k]
  ------------------
   93|  2.65k|      continue;
   94|  2.65k|    }
   95|  2.66k|    const AttributesDecoderInterface* const dec =
   96|  2.66k|        decoder_->attributes_decoder(decoder_id);
   97|  10.6k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 10.6k, False: 0]
  ------------------
   98|  10.6k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 2.66k, False: 7.97k]
  ------------------
   99|  2.66k|        return &attribute_data_[i].encoding_data;
  100|  2.66k|      }
  101|  10.6k|    }
  102|  2.66k|  }
  103|    510|  return &pos_encoding_data_;
  104|  3.17k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  2.07k|    int32_t att_decoder_id) {
  131|  2.07k|  int8_t att_data_id;
  132|  2.07k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 14, False: 2.06k]
  ------------------
  133|     14|    return false;
  134|     14|  }
  135|  2.06k|  uint8_t decoder_type;
  136|  2.06k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 5, False: 2.06k]
  ------------------
  137|      5|    return false;
  138|      5|  }
  139|       |
  140|  2.06k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.64k, False: 412]
  ------------------
  141|  1.64k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 49, False: 1.59k]
  ------------------
  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.59k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 1, False: 1.59k]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|       |
  151|  1.59k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.59k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    412|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 411]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    411|    pos_data_decoder_id_ = att_decoder_id;
  158|    411|  }
  159|       |
  160|  2.00k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  2.00k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  2.00k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 2.00k, False: 2]
  ------------------
  162|  2.00k|    uint8_t traversal_method_encoded;
  163|  2.00k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 2, False: 2.00k]
  ------------------
  164|      2|      return false;
  165|      2|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  2.00k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 22, False: 1.98k]
  ------------------
  168|     22|      return false;
  169|     22|    }
  170|  1.98k|    traversal_method =
  171|  1.98k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.98k|  }
  173|       |
  174|  1.98k|  const Mesh* mesh = decoder_->mesh();
  175|  1.98k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.98k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 1.04k, False: 942]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|  1.04k|    MeshAttributeIndicesEncodingData* encoding_data = nullptr;
  181|  1.04k|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 392, False: 651]
  ------------------
  182|    392|      encoding_data = &pos_encoding_data_;
  183|    651|    } else {
  184|    651|      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|    651|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    651|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|  1.04k|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 378, False: 665]
  ------------------
  191|    378|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    378|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    378|          AttTraverser;
  194|    378|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    665|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 665, False: 0]
  ------------------
  196|    665|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    665|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    665|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    665|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|  1.04k|  } else {
  203|    942|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 9, False: 933]
  ------------------
  204|      9|      return false;  // Unsupported method.
  205|      9|    }
  206|    933|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 4, False: 929]
  ------------------
  207|      4|      return false;  // Attribute data must be specified.
  208|      4|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    929|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    929|        AttObserver;
  214|    929|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    929|        AttTraverser;
  216|       |
  217|    929|    MeshAttributeIndicesEncodingData* const encoding_data =
  218|    929|        &attribute_data_[att_data_id].encoding_data;
  219|    929|    const MeshAttributeCornerTable* const corner_table =
  220|    929|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    929|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    929|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    929|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    929|                             encoding_data);
  227|       |
  228|    929|    AttTraverser att_traverser;
  229|    929|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    929|    traversal_sequencer->SetTraverser(att_traverser);
  232|    929|    sequencer = std::move(traversal_sequencer);
  233|    929|  }
  234|       |
  235|  1.97k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.97k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.97k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.97k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.97k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.97k|                                        std::move(att_controller));
  244|  1.97k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  2.58k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.58k|  num_new_vertices_ = 0;
  249|  2.58k|  new_to_parent_vertex_map_.clear();
  250|  2.58k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.58k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.58k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 760, False: 1.82k]
  ------------------
  252|    760|    uint32_t num_new_verts;
  253|    760|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    760|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 172, False: 588]
  ------------------
  254|    172|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 172]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    588|    } else {
  258|    588|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 588]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    588|    }
  262|    760|    num_new_vertices_ = num_new_verts;
  263|    760|  }
  264|  2.58k|#endif
  265|       |
  266|  2.58k|  uint32_t num_encoded_vertices;
  267|  2.58k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.58k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.58k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 172, False: 2.41k]
  ------------------
  269|    172|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 172]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    172|  } else
  274|  2.41k|#endif
  275|  2.41k|  {
  276|  2.41k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 2.41k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  2.41k|  }
  280|  2.58k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.58k|  uint32_t num_faces;
  283|  2.58k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.58k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.58k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 172, False: 2.41k]
  ------------------
  285|    172|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 172]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    172|  } else
  290|  2.41k|#endif
  291|  2.41k|  {
  292|  2.41k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 2.41k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  2.41k|  }
  296|  2.58k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 0, False: 2.58k]
  ------------------
  297|      0|    return false;  // Draco cannot handle this many faces.
  298|      0|  }
  299|       |
  300|  2.58k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 3, False: 2.58k]
  ------------------
  301|      3|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      3|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.58k|  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.58k|  const uint64_t num_encoded_vertices_64 =
  311|  2.58k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.58k|  const uint64_t max_num_vertex_edges =
  313|  2.58k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.58k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 1, False: 2.57k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      1|    return false;
  317|      1|  }
  318|       |
  319|  2.57k|  uint8_t num_attribute_data;
  320|  2.57k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 2.57k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  2.57k|  uint32_t num_encoded_symbols;
  325|  2.57k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.57k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.57k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 168, False: 2.41k]
  ------------------
  327|    168|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 168]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    168|  } else
  332|  2.41k|#endif
  333|  2.41k|  {
  334|  2.41k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 2.41k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  2.41k|  }
  338|       |
  339|  2.57k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 0, False: 2.57k]
  ------------------
  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|      0|    return false;
  344|      0|  }
  345|  2.57k|  const uint32_t max_encoded_faces =
  346|  2.57k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.57k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 3, False: 2.57k]
  ------------------
  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|      3|    return false;
  352|      3|  }
  353|       |
  354|  2.57k|  uint32_t num_encoded_split_symbols;
  355|  2.57k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.57k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.57k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 165, False: 2.41k]
  ------------------
  357|    165|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 165]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    165|  } else
  362|  2.41k|#endif
  363|  2.41k|  {
  364|  2.41k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 2.41k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  2.41k|  }
  368|       |
  369|  2.57k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 4, False: 2.57k]
  ------------------
  370|      4|    return false;  // Split symbols are a sub-set of all symbols.
  371|      4|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.57k|  vertex_traversal_length_.clear();
  375|  2.57k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.57k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.57k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.57k|  processed_corner_ids_.clear();
  380|  2.57k|  processed_corner_ids_.reserve(num_faces);
  381|  2.57k|  processed_connectivity_corners_.clear();
  382|  2.57k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.57k|  topology_split_data_.clear();
  384|  2.57k|  hole_event_data_.clear();
  385|  2.57k|  init_face_configurations_.clear();
  386|  2.57k|  init_corners_.clear();
  387|       |
  388|  2.57k|  last_symbol_id_ = -1;
  389|  2.57k|  last_face_id_ = -1;
  390|  2.57k|  last_vert_id_ = -1;
  391|       |
  392|  2.57k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.57k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.57k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.57k]
  ------------------
  397|  2.57k|          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.57k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.57k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.57k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.57k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.57k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 750, False: 1.82k]
  ------------------
  411|    750|    uint32_t encoded_connectivity_size;
  412|    750|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    750|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 163, False: 587]
  ------------------
  413|    163|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 0, False: 163]
  ------------------
  414|      0|        return false;
  415|      0|      }
  416|    587|    } else {
  417|    587|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 587]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|    587|    }
  421|    750|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 0, False: 750]
  ------------------
  422|    750|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 13, False: 737]
  ------------------
  423|     13|      return false;
  424|     13|    }
  425|    737|    DecoderBuffer event_buffer;
  426|    737|    event_buffer.Init(
  427|    737|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    737|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    737|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    737|    topology_split_decoded_bytes =
  432|    737|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    737|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 152, False: 585]
  ------------------
  434|    152|      return false;
  435|    152|    }
  436|       |
  437|    737|  } else
  438|  1.82k|#endif
  439|  1.82k|  {
  440|  1.82k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 12, False: 1.81k]
  ------------------
  441|     12|      return false;
  442|     12|    }
  443|  1.82k|  }
  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: 102, False: 2.29k]
  ------------------
  453|    102|    return false;
  454|    102|  }
  455|       |
  456|  2.29k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  2.29k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 209, False: 2.08k]
  ------------------
  458|    209|    return false;
  459|    209|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  2.08k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  2.08k|                           traversal_end_buffer.remaining_size(),
  464|  2.08k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  2.08k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  2.08k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.08k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 473, False: 1.61k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    473|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    473|  }
  471|  2.08k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  2.08k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 2.05k, False: 32]
  ------------------
  475|  2.05k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  2.05k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.05k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 467, False: 1.58k]
  ------------------
  477|  2.38k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.91k, False: 467]
  ------------------
  478|  1.91k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.91k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.91k|      }
  482|       |
  483|    467|    } else
  484|  1.58k|#endif
  485|  1.58k|    {
  486|   267k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 265k, False: 1.58k]
  ------------------
  487|   265k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 265k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   265k|      }
  491|  1.58k|    }
  492|  2.05k|  }
  493|  2.08k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  8.62k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 6.54k, False: 2.08k]
  ------------------
  498|  6.54k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  4.10M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 4.10M, False: 6.54k]
  ------------------
  501|  4.10M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  4.10M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  6.54k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 6.54k]
  ------------------
  505|  6.54k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  6.54k|  }
  509|       |
  510|  2.08k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  8.62k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 6.54k, False: 2.08k]
  ------------------
  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|  6.54k|    int32_t att_connectivity_verts =
  517|  6.54k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  6.54k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 586, False: 5.95k]
  ------------------
  519|    586|      att_connectivity_verts = corner_table_->num_vertices();
  520|    586|    }
  521|  6.54k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  6.54k|  }
  523|  2.08k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 3, False: 2.08k]
  ------------------
  524|      3|    return false;
  525|      3|  }
  526|  2.08k|  return true;
  527|  2.08k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|    289|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    289|  return true;
  532|    289|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  2.29k|    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.29k|  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.29k|  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.29k|  std::vector<VertexIndex> invalid_vertices;
  558|  2.29k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  2.29k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  2.29k|  int num_faces = 0;
  562|  26.7M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 26.7M, False: 2.14k]
  ------------------
  563|  26.7M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  26.7M|    bool check_topology_split = false;
  566|  26.7M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  26.7M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 11.5M, False: 15.2M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  11.5M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 0, False: 11.5M]
  ------------------
  588|      0|        return -1;
  589|      0|      }
  590|       |
  591|  11.5M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  11.5M|      const VertexIndex vertex_x =
  593|  11.5M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  11.5M|      const CornerIndex corner_b =
  595|  11.5M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  11.5M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 103, False: 11.5M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    103|        return -1;
  600|    103|      }
  601|  11.5M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 11.5M]
  |  Branch (601:11): [True: 0, False: 11.5M]
  ------------------
  602|  11.5M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 11.5M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  11.5M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  11.5M|      SetOppositeCorners(corner_a, corner + 1);
  612|  11.5M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  11.5M|      const VertexIndex vert_a_prev =
  616|  11.5M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  11.5M|      const VertexIndex vert_b_next =
  618|  11.5M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  11.5M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 11.5M]
  |  Branch (619:38): [True: 0, False: 11.5M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  11.5M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  11.5M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  11.5M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  11.5M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  11.5M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  11.5M|      active_corner_stack.back() = corner;
  631|  15.2M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 3.88M, False: 11.3M]
  |  Branch (631:40): [True: 2.56M, False: 8.75M]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|  6.45M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 6.45M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  6.45M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  6.45M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 6.45M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  6.45M|      const CornerIndex corner(3 * face.value());
  658|  6.45M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  6.45M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 3.88M, False: 2.56M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  3.88M|        opp_corner = corner + 2;
  662|  3.88M|        corner_l = corner + 1;
  663|  3.88M|        corner_r = corner;
  664|  3.88M|      } else {
  665|       |        // "l" is the new first corner.
  666|  2.56M|        opp_corner = corner + 1;
  667|  2.56M|        corner_l = corner;
  668|  2.56M|        corner_r = corner + 2;
  669|  2.56M|      }
  670|  6.45M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  6.45M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  6.45M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 1, False: 6.45M]
  ------------------
  675|      1|        return -1;  // Unexpected number of decoded vertices.
  676|      1|      }
  677|       |
  678|  6.45M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  6.45M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  6.45M|      const VertexIndex vertex_r =
  682|  6.45M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  6.45M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  6.45M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  6.45M|      corner_table_->MapCornerToVertex(
  688|  6.45M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  6.45M|      active_corner_stack.back() = corner;
  690|  6.45M|      check_topology_split = true;
  691|  8.75M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 4.26M, False: 4.49M]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  4.26M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 4.26M]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  4.26M|      const CornerIndex corner_b = active_corner_stack.back();
  706|  4.26M|      active_corner_stack.pop_back();
  707|       |
  708|       |      // Corner "a" can correspond either to a normal active edge, or to an edge
  709|       |      // created from the topology split event.
  710|  4.26M|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  4.26M|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 60, False: 4.26M]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     60|        active_corner_stack.push_back(it->second);
  714|     60|      }
  715|  4.26M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 6, False: 4.26M]
  ------------------
  716|      6|        return -1;
  717|      6|      }
  718|  4.26M|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  4.26M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 4.26M]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  4.26M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 7, False: 4.26M]
  |  Branch (724:11): [True: 7, False: 4.26M]
  ------------------
  725|  4.26M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 4.26M]
  ------------------
  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|  4.26M|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  4.26M|      SetOppositeCorners(corner_a, corner + 2);
  735|  4.26M|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  4.26M|      const VertexIndex vertex_p =
  739|  4.26M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  4.26M|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  4.26M|      corner_table_->MapCornerToVertex(
  742|  4.26M|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  4.26M|      const VertexIndex vert_b_prev =
  744|  4.26M|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  4.26M|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  4.26M|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  4.26M|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  4.26M|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  4.26M|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  4.26M|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  4.26M|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  4.26M|      const CornerIndex first_corner = corner_n;
  757|  14.1M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 9.87M, False: 4.26M]
  ------------------
  758|  9.87M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  9.87M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  9.87M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 9.87M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  9.87M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  4.26M|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  4.26M|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 10.9k, False: 4.25M]
  ------------------
  770|  10.9k|        invalid_vertices.push_back(vertex_n);
  771|  10.9k|      }
  772|  4.26M|      active_corner_stack.back() = corner;
  773|  4.49M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 4.49M, False: 0]
  ------------------
  774|  4.49M|      const CornerIndex corner(3 * face.value());
  775|  4.49M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  4.49M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  4.49M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  4.49M|                                       corner_table_->AddNewVertex());
  780|  4.49M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  4.49M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  4.49M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 1, False: 4.49M]
  ------------------
  784|      1|        return -1;  // Unexpected number of decoded vertices.
  785|      1|      }
  786|       |
  787|  4.49M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  4.49M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  4.49M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  4.49M|      active_corner_stack.push_back(corner);
  792|  4.49M|      check_topology_split = true;
  793|  4.49M|    } 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|  26.7M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  26.7M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 10.9M, False: 15.8M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  10.9M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  10.9M|      EdgeFaceName split_edge;
  812|  10.9M|      int encoder_split_symbol_id;
  813|  10.9M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 2.29k, False: 10.9M]
  ------------------
  814|  10.9M|                             &encoder_split_symbol_id)) {
  815|  2.29k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 25, False: 2.27k]
  ------------------
  816|     25|          return -1;  // Wrong split symbol id.
  817|     25|        }
  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.27k|        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.27k|        CornerIndex new_active_corner;
  831|  2.27k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 761, False: 1.51k]
  ------------------
  832|    761|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.51k|        } else {
  834|  1.51k|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|  1.51k|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  2.27k|        const int decoder_split_symbol_id =
  839|  2.27k|            num_symbols - encoder_split_symbol_id - 1;
  840|  2.27k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  2.27k|            new_active_corner;
  842|  2.27k|      }
  843|  10.9M|    }
  844|  26.7M|  }
  845|  2.14k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 2.14k]
  ------------------
  846|      0|    return -1;  // Unexpected number of decoded vertices.
  847|      0|  }
  848|       |  // Decode start faces and connect them to the faces from the active stack.
  849|  31.0k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 28.8k, False: 2.10k]
  ------------------
  850|  28.8k|    const CornerIndex corner = active_corner_stack.back();
  851|  28.8k|    active_corner_stack.pop_back();
  852|  28.8k|    const bool interior_face =
  853|  28.8k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  28.8k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 20.6k, False: 8.26k]
  ------------------
  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|  20.6k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 5, False: 20.6k]
  ------------------
  877|      5|        return -1;  // More faces than expected added to the mesh.
  878|      5|      }
  879|       |
  880|  20.6k|      const CornerIndex corner_a = corner;
  881|  20.6k|      const VertexIndex vert_n =
  882|  20.6k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  20.6k|      const CornerIndex corner_b =
  884|  20.6k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  20.6k|      const VertexIndex vert_x =
  887|  20.6k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  20.6k|      const CornerIndex corner_c =
  889|  20.6k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  20.6k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 20.6k]
  |  Branch (891:33): [True: 27, False: 20.6k]
  |  Branch (891:55): [True: 0, False: 20.6k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     29|        return -1;
  894|     29|      }
  895|  20.6k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 6, False: 20.5k]
  |  Branch (895:11): [True: 9, False: 20.5k]
  ------------------
  896|  20.5k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 1, False: 20.5k]
  ------------------
  897|  20.5k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 2, False: 20.5k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      9|        return -1;
  901|      9|      }
  902|       |
  903|  20.5k|      const VertexIndex vert_p =
  904|  20.5k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  20.5k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  20.5k|      const CornerIndex new_corner(3 * face.value());
  909|  20.5k|      SetOppositeCorners(new_corner, corner);
  910|  20.5k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  20.5k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  20.5k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  20.5k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  20.5k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  82.3k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 61.7k, False: 20.5k]
  ------------------
  920|  61.7k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  61.7k|      }
  922|       |
  923|  20.5k|      init_face_configurations_.push_back(true);
  924|  20.5k|      init_corners_.push_back(new_corner);
  925|  20.5k|    } 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.26k|      init_face_configurations_.push_back(false);
  930|  8.26k|      init_corners_.push_back(corner);
  931|  8.26k|    }
  932|  28.8k|  }
  933|  2.10k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 21, False: 2.08k]
  ------------------
  934|     21|    return -1;  // Unexpected number of decoded faces.
  935|     21|  }
  936|       |
  937|  2.08k|  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.21k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 3.21k, False: 2.08k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  3.21k|    VertexIndex src_vert(num_vertices - 1);
  943|  3.55k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 339, False: 3.21k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    339|      src_vert = VertexIndex(--num_vertices - 1);
  946|    339|    }
  947|  3.21k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 339, False: 2.87k]
  ------------------
  948|    339|      continue;  // No need to swap anything.
  949|    339|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  2.87k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  34.9k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 32.0k, False: 2.87k]
  ------------------
  954|  32.0k|      const CornerIndex cid = vcit.Corner();
  955|  32.0k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 0, False: 32.0k]
  ------------------
  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|  32.0k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  32.0k|    }
  962|  2.87k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  2.87k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  2.87k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  2.87k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  2.87k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  2.87k|    num_vertices--;
  972|  2.87k|  }
  973|  2.08k|  return num_vertices;
  974|  2.08k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.55k|    DecoderBuffer* decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.55k|  uint32_t num_topology_splits;
  982|  2.55k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.55k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.55k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 151, False: 2.40k]
  ------------------
  984|    151|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 151]
  ------------------
  985|      0|      return -1;
  986|      0|    }
  987|       |
  988|    151|  } else
  989|  2.40k|#endif
  990|  2.40k|  {
  991|  2.40k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 2.40k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  2.40k|  }
  995|  2.55k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 1.73k, False: 827]
  ------------------
  996|  1.73k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 20, False: 1.71k]
  ------------------
  997|  1.73k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     20|      return -1;
  999|     20|    }
 1000|  1.71k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  1.71k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.71k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 85, False: 1.62k]
  ------------------
 1002|   231k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 231k, False: 33]
  ------------------
 1003|   231k|        TopologySplitEventData event_data;
 1004|   231k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 29, False: 231k]
  ------------------
 1005|     29|          return -1;
 1006|     29|        }
 1007|   231k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 17, False: 231k]
  ------------------
 1008|     17|          return -1;
 1009|     17|        }
 1010|   231k|        uint8_t edge_data;
 1011|   231k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 6, False: 231k]
  ------------------
 1012|      6|          return -1;
 1013|      6|        }
 1014|   231k|        event_data.source_edge = edge_data & 1;
 1015|   231k|        topology_split_data_.push_back(event_data);
 1016|   231k|      }
 1017|       |
 1018|     85|    } else
 1019|  1.62k|#endif
 1020|  1.62k|    {
 1021|       |      // Decode source and split symbol ids using delta and varint coding. See
 1022|       |      // description in mesh_edgebreaker_encoder_impl.cc for more details.
 1023|  1.62k|      int last_source_symbol_id = 0;
 1024|  6.89k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 5.28k, False: 1.61k]
  ------------------
 1025|  5.28k|        TopologySplitEventData event_data;
 1026|  5.28k|        uint32_t delta;
 1027|  5.28k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 5, False: 5.27k]
  ------------------
 1028|      5|          return -1;
 1029|      5|        }
 1030|  5.27k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  5.27k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 2, False: 5.27k]
  ------------------
 1032|      2|          return -1;
 1033|      2|        }
 1034|  5.27k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 4, False: 5.27k]
  ------------------
 1035|      4|          return -1;
 1036|      4|        }
 1037|  5.27k|        event_data.split_symbol_id =
 1038|  5.27k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  5.27k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  5.27k|        topology_split_data_.push_back(event_data);
 1041|  5.27k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  1.61k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  6.07k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 4.46k, False: 1.61k]
  ------------------
 1045|  4.46k|        uint32_t edge_data;
 1046|  4.46k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.46k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 948, False: 3.51k]
  ------------------
 1047|    948|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  3.51k|        } else {
 1049|  3.51k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  3.51k|        }
 1051|  4.46k|        TopologySplitEventData& event_data = topology_split_data_[i];
 1052|  4.46k|        event_data.source_edge = edge_data & 1;
 1053|  4.46k|      }
 1054|  1.61k|      decoder_buffer->EndBitDecoding();
 1055|  1.61k|    }
 1056|  1.71k|  }
 1057|  2.47k|  uint32_t num_hole_events = 0;
 1058|  2.47k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.47k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.47k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 80, False: 2.39k]
  ------------------
 1060|     80|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 77]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  2.39k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.39k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 582, False: 1.81k]
  ------------------
 1064|    582|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 2, False: 580]
  ------------------
 1065|      2|      return -1;
 1066|      2|    }
 1067|    582|  }
 1068|  2.47k|#endif
 1069|  2.47k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 83, False: 2.38k]
  ------------------
 1070|     83|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     83|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     83|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 60, False: 23]
  ------------------
 1072|  1.19M|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 1.19M, False: 1]
  ------------------
 1073|  1.19M|        HoleEventData event_data;
 1074|  1.19M|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 59, False: 1.19M]
  ------------------
 1075|     59|          return -1;
 1076|     59|        }
 1077|  1.19M|        hole_event_data_.push_back(event_data);
 1078|  1.19M|      }
 1079|       |
 1080|     60|    } else
 1081|     23|#endif
 1082|     23|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     23|      int last_symbol_id = 0;
 1085|  76.8k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 76.8k, False: 6]
  ------------------
 1086|  76.8k|        HoleEventData event_data;
 1087|  76.8k|        uint32_t delta;
 1088|  76.8k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 17, False: 76.8k]
  ------------------
 1089|     17|          return -1;
 1090|     17|        }
 1091|  76.8k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  76.8k|        last_symbol_id = event_data.symbol_id;
 1093|  76.8k|        hole_event_data_.push_back(event_data);
 1094|  76.8k|      }
 1095|     23|    }
 1096|     83|  }
 1097|  2.39k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.47k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.91k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.91k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.91k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  7.67k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 5.75k, False: 1.91k]
  ------------------
 1109|  5.75k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  5.75k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 2.08k, False: 3.67k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  4.24k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 2.16k, False: 2.08k]
  ------------------
 1114|  2.16k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  2.16k|      }
 1116|  2.08k|      continue;
 1117|  2.08k|    }
 1118|       |
 1119|  8.05k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 4.38k, False: 3.67k]
  ------------------
 1120|  4.38k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  4.38k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 2.48k, False: 1.90k]
  ------------------
 1122|  2.48k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  2.48k|      }
 1124|  4.38k|    }
 1125|  3.67k|  }
 1126|  1.91k|  return true;
 1127|  1.91k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   265k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   265k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   265k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   265k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.06M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 797k, False: 265k]
  ------------------
 1139|   797k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   797k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 23.4k, False: 774k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   211k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 187k, False: 23.4k]
  ------------------
 1144|   187k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   187k|      }
 1146|  23.4k|      continue;
 1147|  23.4k|    }
 1148|   774k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   774k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 387k, False: 387k]
  ------------------
 1151|   387k|      continue;
 1152|   387k|    }
 1153|       |
 1154|  4.46M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 4.07M, False: 387k]
  ------------------
 1155|  4.07M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  4.07M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 3.91M, False: 163k]
  ------------------
 1157|  3.91M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  3.91M|      }
 1159|  4.07M|    }
 1160|   387k|  }
 1161|   265k|  return true;
 1162|   265k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  2.08k|    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.08k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  2.08k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 32, False: 2.05k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  75.5k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 75.5k, False: 32]
  ------------------
 1176|  75.5k|      Mesh::Face face;
 1177|  75.5k|      const CornerIndex start_corner(3 * f.value());
 1178|   302k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 226k, False: 75.5k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   226k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   226k|        face[c] = vert_id;
 1182|   226k|      }
 1183|  75.5k|      decoder_->mesh()->SetFace(f, face);
 1184|  75.5k|    }
 1185|     32|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     32|    return true;
 1187|     32|  }
 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.05k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  2.05k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   154k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 152k, False: 2.04k]
  ------------------
 1197|   152k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   152k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 3.81k, False: 148k]
  ------------------
 1199|  3.81k|      continue;  // Isolated vertex.
 1200|  3.81k|    }
 1201|   148k|    CornerIndex deduplication_first_corner = c;
 1202|   148k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 25.3k, False: 123k]
  ------------------
 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.3k|      deduplication_first_corner = c;
 1206|   123k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   157k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 129k, False: 28.8k]
  ------------------
 1210|   129k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 25.0k, False: 103k]
  ------------------
 1211|  25.0k|          continue;  // No seam for this attribute, ignore it.
 1212|  25.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|   103k|        const VertexIndex vert_id =
 1217|   103k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   103k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   103k|        bool seam_found = false;
 1220|   138k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 128k, False: 9.58k]
  ------------------
 1221|   128k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 3, False: 128k]
  ------------------
 1222|      3|            return false;
 1223|      3|          }
 1224|   128k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 94.3k, False: 34.4k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  94.3k|            deduplication_first_corner = act_c;
 1227|  94.3k|            seam_found = true;
 1228|  94.3k|            break;
 1229|  94.3k|          }
 1230|  34.4k|          act_c = corner_table_->SwingRight(act_c);
 1231|  34.4k|        }
 1232|   103k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 94.3k, False: 9.58k]
  ------------------
 1233|  94.3k|          break;  // No reason to process other attributes if we found a seam.
 1234|  94.3k|        }
 1235|   103k|      }
 1236|   123k|    }
 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|   148k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   148k|    corner_to_point_map[c.value()] =
 1246|   148k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   148k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   148k|    CornerIndex prev_c = c;
 1250|   148k|    c = corner_table_->SwingRight(c);
 1251|   834k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 808k, False: 25.5k]
  |  Branch (1251:40): [True: 685k, False: 123k]
  ------------------
 1252|   685k|      bool attribute_seam = false;
 1253|   873k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 720k, False: 152k]
  ------------------
 1254|   720k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 532k, False: 188k]
  ------------------
 1255|   720k|            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|   532k|          attribute_seam = true;
 1259|   532k|          break;
 1260|   532k|        }
 1261|   720k|      }
 1262|   685k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 532k, False: 152k]
  ------------------
 1263|   532k|        corner_to_point_map[c.value()] =
 1264|   532k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   532k|        point_to_corner_map.push_back(c.value());
 1266|   532k|      } else {
 1267|   152k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   152k|      }
 1269|   685k|      prev_c = c;
 1270|   685k|      c = corner_table_->SwingRight(c);
 1271|   685k|    }
 1272|   148k|  }
 1273|       |  // Add faces.
 1274|   257k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 255k, False: 2.04k]
  ------------------
 1275|   255k|    Mesh::Face face;
 1276|  1.02M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 765k, False: 255k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   765k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   765k|    }
 1280|   255k|    decoder_->mesh()->SetFace(f, face);
 1281|   255k|  }
 1282|  2.04k|  decoder_->point_cloud()->set_num_points(
 1283|  2.04k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  2.04k|  return true;
 1285|  2.05k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  2.50k|    : decoder_(nullptr),
   49|  2.50k|      last_symbol_id_(-1),
   50|  2.50k|      last_vert_id_(-1),
   51|  2.50k|      last_face_id_(-1),
   52|  2.50k|      num_new_vertices_(0),
   53|  2.50k|      num_encoded_vertices_(0),
   54|  2.50k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.50k|    MeshEdgebreakerDecoder* decoder) {
   59|  2.50k|  decoder_ = decoder;
   60|  2.50k|  return true;
   61|  2.50k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  2.69k|    int att_id) const {
   67|  3.97k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 3.13k, False: 843]
  ------------------
   68|  3.13k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  3.13k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.28k, False: 1.85k]
  |  Branch (69:27): [True: 0, False: 1.85k]
  ------------------
   70|  1.28k|      continue;
   71|  1.28k|    }
   72|  1.85k|    const AttributesDecoderInterface* const dec =
   73|  1.85k|        decoder_->attributes_decoder(decoder_id);
   74|  5.89k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 5.89k, False: 0]
  ------------------
   75|  5.89k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.85k, False: 4.04k]
  ------------------
   76|  1.85k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.20k, False: 642]
  ------------------
   77|  1.20k|          return &attribute_data_[i].connectivity_data;
   78|  1.20k|        }
   79|    642|        return nullptr;
   80|  1.85k|      }
   81|  5.89k|    }
   82|  1.85k|  }
   83|    843|  return nullptr;
   84|  2.69k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  2.69k|    int att_id) const {
   90|  3.97k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 3.13k, False: 843]
  ------------------
   91|  3.13k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  3.13k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.28k, False: 1.85k]
  |  Branch (92:27): [True: 0, False: 1.85k]
  ------------------
   93|  1.28k|      continue;
   94|  1.28k|    }
   95|  1.85k|    const AttributesDecoderInterface* const dec =
   96|  1.85k|        decoder_->attributes_decoder(decoder_id);
   97|  5.89k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 5.89k, False: 0]
  ------------------
   98|  5.89k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.85k, False: 4.04k]
  ------------------
   99|  1.85k|        return &attribute_data_[i].encoding_data;
  100|  1.85k|      }
  101|  5.89k|    }
  102|  1.85k|  }
  103|    843|  return &pos_encoding_data_;
  104|  2.69k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  2.10k|    int32_t att_decoder_id) {
  131|  2.10k|  int8_t att_data_id;
  132|  2.10k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 12, False: 2.09k]
  ------------------
  133|     12|    return false;
  134|     12|  }
  135|  2.09k|  uint8_t decoder_type;
  136|  2.09k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 6, False: 2.08k]
  ------------------
  137|      6|    return false;
  138|      6|  }
  139|       |
  140|  2.08k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.38k, False: 707]
  ------------------
  141|  1.38k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 22, False: 1.35k]
  ------------------
  142|     22|      return false;  // Unexpected attribute data.
  143|     22|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.35k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 2, False: 1.35k]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|       |
  151|  1.35k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.35k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    707|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 0, False: 707]
  ------------------
  155|      0|      return false;  // Some other decoder is already using the data. Error.
  156|      0|    }
  157|    707|    pos_data_decoder_id_ = att_decoder_id;
  158|    707|  }
  159|       |
  160|  2.06k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  2.06k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  2.06k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 2.06k, False: 0]
  ------------------
  162|  2.06k|    uint8_t traversal_method_encoded;
  163|  2.06k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 0, False: 2.06k]
  ------------------
  164|      0|      return false;
  165|      0|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  2.06k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 15, False: 2.04k]
  ------------------
  168|     15|      return false;
  169|     15|    }
  170|  2.04k|    traversal_method =
  171|  2.04k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  2.04k|  }
  173|       |
  174|  2.04k|  const Mesh* mesh = decoder_->mesh();
  175|  2.04k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  2.04k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 1.17k, False: 878]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|  1.17k|    MeshAttributeIndicesEncodingData* encoding_data = nullptr;
  181|  1.17k|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 685, False: 485]
  ------------------
  182|    685|      encoding_data = &pos_encoding_data_;
  183|    685|    } else {
  184|    485|      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|    485|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    485|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|  1.17k|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 467, False: 703]
  ------------------
  191|    467|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    467|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    467|          AttTraverser;
  194|    467|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    703|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 703, False: 0]
  ------------------
  196|    703|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    703|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    703|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    703|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|  1.17k|  } else {
  203|    878|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 4, False: 874]
  ------------------
  204|      4|      return false;  // Unsupported method.
  205|      4|    }
  206|    874|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 9, False: 865]
  ------------------
  207|      9|      return false;  // Attribute data must be specified.
  208|      9|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    865|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    865|        AttObserver;
  214|    865|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    865|        AttTraverser;
  216|       |
  217|    865|    MeshAttributeIndicesEncodingData* const encoding_data =
  218|    865|        &attribute_data_[att_data_id].encoding_data;
  219|    865|    const MeshAttributeCornerTable* const corner_table =
  220|    865|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    865|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    865|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    865|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    865|                             encoding_data);
  227|       |
  228|    865|    AttTraverser att_traverser;
  229|    865|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    865|    traversal_sequencer->SetTraverser(att_traverser);
  232|    865|    sequencer = std::move(traversal_sequencer);
  233|    865|  }
  234|       |
  235|  2.03k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 2.03k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  2.03k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  2.03k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  2.03k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  2.03k|                                        std::move(att_controller));
  244|  2.03k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  2.50k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.50k|  num_new_vertices_ = 0;
  249|  2.50k|  new_to_parent_vertex_map_.clear();
  250|  2.50k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.50k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.50k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 206, False: 2.30k]
  ------------------
  252|    206|    uint32_t num_new_verts;
  253|    206|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    206|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 142, False: 64]
  ------------------
  254|    142|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 142]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    142|    } else {
  258|     64|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 64]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|     64|    }
  262|    206|    num_new_vertices_ = num_new_verts;
  263|    206|  }
  264|  2.50k|#endif
  265|       |
  266|  2.50k|  uint32_t num_encoded_vertices;
  267|  2.50k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.50k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.50k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 142, False: 2.36k]
  ------------------
  269|    142|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 142]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    142|  } else
  274|  2.36k|#endif
  275|  2.36k|  {
  276|  2.36k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 2.36k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  2.36k|  }
  280|  2.50k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.50k|  uint32_t num_faces;
  283|  2.50k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.50k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.50k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 142, False: 2.36k]
  ------------------
  285|    142|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 142]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    142|  } else
  290|  2.36k|#endif
  291|  2.36k|  {
  292|  2.36k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 2.36k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  2.36k|  }
  296|  2.50k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 0, False: 2.50k]
  ------------------
  297|      0|    return false;  // Draco cannot handle this many faces.
  298|      0|  }
  299|       |
  300|  2.50k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 2, False: 2.50k]
  ------------------
  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.50k|  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.50k|  const uint64_t num_encoded_vertices_64 =
  311|  2.50k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.50k|  const uint64_t max_num_vertex_edges =
  313|  2.50k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.50k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 0, False: 2.50k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      0|    return false;
  317|      0|  }
  318|       |
  319|  2.50k|  uint8_t num_attribute_data;
  320|  2.50k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 2.50k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  2.50k|  uint32_t num_encoded_symbols;
  325|  2.50k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.50k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.50k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 140, False: 2.36k]
  ------------------
  327|    140|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 140]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    140|  } else
  332|  2.36k|#endif
  333|  2.36k|  {
  334|  2.36k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 2.36k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  2.36k|  }
  338|       |
  339|  2.50k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 3, False: 2.50k]
  ------------------
  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.50k|  const uint32_t max_encoded_faces =
  346|  2.50k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.50k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 0, False: 2.50k]
  ------------------
  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|      0|    return false;
  352|      0|  }
  353|       |
  354|  2.50k|  uint32_t num_encoded_split_symbols;
  355|  2.50k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.50k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.50k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 137, False: 2.36k]
  ------------------
  357|    137|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 137]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    137|  } else
  362|  2.36k|#endif
  363|  2.36k|  {
  364|  2.36k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 2.36k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  2.36k|  }
  368|       |
  369|  2.50k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 4, False: 2.49k]
  ------------------
  370|      4|    return false;  // Split symbols are a sub-set of all symbols.
  371|      4|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.49k|  vertex_traversal_length_.clear();
  375|  2.49k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.49k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.49k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.49k|  processed_corner_ids_.clear();
  380|  2.49k|  processed_corner_ids_.reserve(num_faces);
  381|  2.49k|  processed_connectivity_corners_.clear();
  382|  2.49k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.49k|  topology_split_data_.clear();
  384|  2.49k|  hole_event_data_.clear();
  385|  2.49k|  init_face_configurations_.clear();
  386|  2.49k|  init_corners_.clear();
  387|       |
  388|  2.49k|  last_symbol_id_ = -1;
  389|  2.49k|  last_face_id_ = -1;
  390|  2.49k|  last_vert_id_ = -1;
  391|       |
  392|  2.49k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.49k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.49k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.49k]
  ------------------
  397|  2.49k|          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.49k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.49k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.49k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.49k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.49k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 198, False: 2.30k]
  ------------------
  411|    198|    uint32_t encoded_connectivity_size;
  412|    198|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    198|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 134, False: 64]
  ------------------
  413|    134|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 0, False: 134]
  ------------------
  414|      0|        return false;
  415|      0|      }
  416|    134|    } else {
  417|     64|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 64]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|     64|    }
  421|    198|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 197]
  ------------------
  422|    197|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 7, False: 190]
  ------------------
  423|      8|      return false;
  424|      8|    }
  425|    190|    DecoderBuffer event_buffer;
  426|    190|    event_buffer.Init(
  427|    190|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    190|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    190|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    190|    topology_split_decoded_bytes =
  432|    190|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    190|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 119, False: 71]
  ------------------
  434|    119|      return false;
  435|    119|    }
  436|       |
  437|    190|  } else
  438|  2.30k|#endif
  439|  2.30k|  {
  440|  2.30k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 15, False: 2.28k]
  ------------------
  441|     15|      return false;
  442|     15|    }
  443|  2.30k|  }
  444|       |
  445|  2.35k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.35k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.35k|                                           num_encoded_split_symbols);
  449|  2.35k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.35k|  DecoderBuffer traversal_end_buffer;
  452|  2.35k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 79, False: 2.27k]
  ------------------
  453|     79|    return false;
  454|     79|  }
  455|       |
  456|  2.27k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  2.27k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 136, False: 2.14k]
  ------------------
  458|    136|    return false;
  459|    136|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  2.14k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  2.14k|                           traversal_end_buffer.remaining_size(),
  464|  2.14k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  2.14k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  2.14k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.14k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 23, False: 2.11k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|     23|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|     23|  }
  471|  2.14k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  2.14k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 2.10k, False: 41]
  ------------------
  475|  2.10k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  2.10k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.10k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 23, False: 2.07k]
  ------------------
  477|  2.16k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 2.14k, False: 23]
  ------------------
  478|  2.14k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 2.14k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  2.14k|      }
  482|       |
  483|     23|    } else
  484|  2.07k|#endif
  485|  2.07k|    {
  486|  11.3M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 11.3M, False: 2.07k]
  ------------------
  487|  11.3M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 11.3M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  11.3M|      }
  491|  2.07k|    }
  492|  2.10k|  }
  493|  2.14k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  4.76k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 2.62k, False: 2.14k]
  ------------------
  498|  2.62k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  19.4M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 19.4M, False: 2.62k]
  ------------------
  501|  19.4M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  19.4M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  2.62k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 2.62k]
  ------------------
  505|  2.62k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  2.62k|  }
  509|       |
  510|  2.14k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  4.76k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 2.62k, False: 2.14k]
  ------------------
  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.62k|    int32_t att_connectivity_verts =
  517|  2.62k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  2.62k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 114, False: 2.50k]
  ------------------
  519|    114|      att_connectivity_verts = corner_table_->num_vertices();
  520|    114|    }
  521|  2.62k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  2.62k|  }
  523|  2.14k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 2, False: 2.14k]
  ------------------
  524|      2|    return false;
  525|      2|  }
  526|  2.14k|  return true;
  527|  2.14k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    653|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    653|  return true;
  532|    653|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  2.27k|    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.27k|  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.27k|  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.27k|  std::vector<VertexIndex> invalid_vertices;
  558|  2.27k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  2.27k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  2.27k|  int num_faces = 0;
  562|  59.8M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 59.8M, False: 2.21k]
  ------------------
  563|  59.8M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  59.8M|    bool check_topology_split = false;
  566|  59.8M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  59.8M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 29.3M, False: 30.4M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  29.3M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 0, False: 29.3M]
  ------------------
  588|      0|        return -1;
  589|      0|      }
  590|       |
  591|  29.3M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  29.3M|      const VertexIndex vertex_x =
  593|  29.3M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  29.3M|      const CornerIndex corner_b =
  595|  29.3M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  29.3M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 30, False: 29.3M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     30|        return -1;
  600|     30|      }
  601|  29.3M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 29.3M]
  |  Branch (601:11): [True: 0, False: 29.3M]
  ------------------
  602|  29.3M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 29.3M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  29.3M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  29.3M|      SetOppositeCorners(corner_a, corner + 1);
  612|  29.3M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  29.3M|      const VertexIndex vert_a_prev =
  616|  29.3M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  29.3M|      const VertexIndex vert_b_next =
  618|  29.3M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  29.3M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 29.3M]
  |  Branch (619:38): [True: 0, False: 29.3M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  29.3M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  29.3M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  29.3M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  29.3M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  29.3M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  29.3M|      active_corner_stack.back() = corner;
  631|  30.4M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 30.3M, False: 119k]
  |  Branch (631:40): [True: 25.6k, False: 94.0k]
  ------------------
  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|  30.3M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 30.3M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  30.3M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  30.3M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 30.3M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  30.3M|      const CornerIndex corner(3 * face.value());
  658|  30.3M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  30.3M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 30.3M, False: 25.6k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  30.3M|        opp_corner = corner + 2;
  662|  30.3M|        corner_l = corner + 1;
  663|  30.3M|        corner_r = corner;
  664|  30.3M|      } else {
  665|       |        // "l" is the new first corner.
  666|  25.6k|        opp_corner = corner + 1;
  667|  25.6k|        corner_l = corner;
  668|  25.6k|        corner_r = corner + 2;
  669|  25.6k|      }
  670|  30.3M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  30.3M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  30.3M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 6, False: 30.3M]
  ------------------
  675|      6|        return -1;  // Unexpected number of decoded vertices.
  676|      6|      }
  677|       |
  678|  30.3M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  30.3M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  30.3M|      const VertexIndex vertex_r =
  682|  30.3M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  30.3M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  30.3M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  30.3M|      corner_table_->MapCornerToVertex(
  688|  30.3M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  30.3M|      active_corner_stack.back() = corner;
  690|  30.3M|      check_topology_split = true;
  691|  30.3M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 22.8k, False: 71.1k]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  22.8k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 22.8k]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  22.8k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  22.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|  22.8k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  22.8k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 28, False: 22.8k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     28|        active_corner_stack.push_back(it->second);
  714|     28|      }
  715|  22.8k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 7, False: 22.8k]
  ------------------
  716|      7|        return -1;
  717|      7|      }
  718|  22.8k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  22.8k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 22.8k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  22.8k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 6, False: 22.8k]
  |  Branch (724:11): [True: 6, False: 22.8k]
  ------------------
  725|  22.8k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 22.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|      6|        return -1;
  729|      6|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  22.8k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  22.8k|      SetOppositeCorners(corner_a, corner + 2);
  735|  22.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|  22.8k|      const VertexIndex vertex_p =
  739|  22.8k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  22.8k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  22.8k|      corner_table_->MapCornerToVertex(
  742|  22.8k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  22.8k|      const VertexIndex vert_b_prev =
  744|  22.8k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  22.8k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  22.8k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  22.8k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  22.8k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  22.8k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  22.8k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  22.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|  22.8k|      const CornerIndex first_corner = corner_n;
  757|   116k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 93.4k, False: 22.8k]
  ------------------
  758|  93.4k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  93.4k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  93.4k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 93.4k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  93.4k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  22.8k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  22.8k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 4.59k, False: 18.2k]
  ------------------
  770|  4.59k|        invalid_vertices.push_back(vertex_n);
  771|  4.59k|      }
  772|  22.8k|      active_corner_stack.back() = corner;
  773|  71.1k|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 71.1k, False: 0]
  ------------------
  774|  71.1k|      const CornerIndex corner(3 * face.value());
  775|  71.1k|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  71.1k|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  71.1k|      corner_table_->MapCornerToVertex(corner + 1,
  779|  71.1k|                                       corner_table_->AddNewVertex());
  780|  71.1k|      corner_table_->MapCornerToVertex(corner + 2,
  781|  71.1k|                                       corner_table_->AddNewVertex());
  782|       |
  783|  71.1k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 2, False: 71.1k]
  ------------------
  784|      2|        return -1;  // Unexpected number of decoded vertices.
  785|      2|      }
  786|       |
  787|  71.1k|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  71.1k|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  71.1k|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  71.1k|      active_corner_stack.push_back(corner);
  792|  71.1k|      check_topology_split = true;
  793|  71.1k|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|      0|      return -1;
  796|      0|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  59.8M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  59.8M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 30.4M, False: 29.3M]
  ------------------
  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|  30.4M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  30.4M|      EdgeFaceName split_edge;
  812|  30.4M|      int encoder_split_symbol_id;
  813|  30.4M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.20k, False: 30.4M]
  ------------------
  814|  30.4M|                             &encoder_split_symbol_id)) {
  815|  1.20k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 11, False: 1.19k]
  ------------------
  816|     11|          return -1;  // Wrong split symbol id.
  817|     11|        }
  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.19k|        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.19k|        CornerIndex new_active_corner;
  831|  1.19k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 586, False: 606]
  ------------------
  832|    586|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    606|        } else {
  834|    606|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    606|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.19k|        const int decoder_split_symbol_id =
  839|  1.19k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.19k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.19k|            new_active_corner;
  842|  1.19k|      }
  843|  30.4M|    }
  844|  59.8M|  }
  845|  2.21k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 2.21k]
  ------------------
  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|  29.9k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 27.7k, False: 2.19k]
  ------------------
  850|  27.7k|    const CornerIndex corner = active_corner_stack.back();
  851|  27.7k|    active_corner_stack.pop_back();
  852|  27.7k|    const bool interior_face =
  853|  27.7k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  27.7k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 24.8k, False: 2.89k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  24.8k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 5, False: 24.8k]
  ------------------
  877|      5|        return -1;  // More faces than expected added to the mesh.
  878|      5|      }
  879|       |
  880|  24.8k|      const CornerIndex corner_a = corner;
  881|  24.8k|      const VertexIndex vert_n =
  882|  24.8k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  24.8k|      const CornerIndex corner_b =
  884|  24.8k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  24.8k|      const VertexIndex vert_x =
  887|  24.8k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  24.8k|      const CornerIndex corner_c =
  889|  24.8k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  24.8k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 3, False: 24.8k]
  |  Branch (891:33): [True: 12, False: 24.8k]
  |  Branch (891:55): [True: 0, False: 24.8k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     15|        return -1;
  894|     15|      }
  895|  24.8k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 24.8k]
  |  Branch (895:11): [True: 1, False: 24.8k]
  ------------------
  896|  24.8k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 24.8k]
  ------------------
  897|  24.8k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 24.8k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      1|        return -1;
  901|      1|      }
  902|       |
  903|  24.8k|      const VertexIndex vert_p =
  904|  24.8k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  24.8k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  24.8k|      const CornerIndex new_corner(3 * face.value());
  909|  24.8k|      SetOppositeCorners(new_corner, corner);
  910|  24.8k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  24.8k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  24.8k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  24.8k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  24.8k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  99.3k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 74.5k, False: 24.8k]
  ------------------
  920|  74.5k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  74.5k|      }
  922|       |
  923|  24.8k|      init_face_configurations_.push_back(true);
  924|  24.8k|      init_corners_.push_back(new_corner);
  925|  24.8k|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  2.89k|      init_face_configurations_.push_back(false);
  930|  2.89k|      init_corners_.push_back(corner);
  931|  2.89k|    }
  932|  27.7k|  }
  933|  2.19k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 51, False: 2.14k]
  ------------------
  934|     51|    return -1;  // Unexpected number of decoded faces.
  935|     51|  }
  936|       |
  937|  2.14k|  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.14k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 723, False: 2.14k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    723|    VertexIndex src_vert(num_vertices - 1);
  943|    768|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 45, False: 723]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|     45|      src_vert = VertexIndex(--num_vertices - 1);
  946|     45|    }
  947|    723|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 45, False: 678]
  ------------------
  948|     45|      continue;  // No need to swap anything.
  949|     45|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    678|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  3.48k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 2.81k, False: 677]
  ------------------
  954|  2.81k|      const CornerIndex cid = vcit.Corner();
  955|  2.81k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 1, False: 2.80k]
  ------------------
  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|  2.80k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  2.80k|    }
  962|    677|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    677|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    677|    corner_table_->MakeVertexIsolated(src_vert);
  967|    677|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    677|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    677|    num_vertices--;
  972|    677|  }
  973|  2.14k|  return num_vertices;
  974|  2.14k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.49k|    DecoderBuffer* decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.49k|  uint32_t num_topology_splits;
  982|  2.49k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.49k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.49k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 126, False: 2.36k]
  ------------------
  984|    126|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 126]
  ------------------
  985|      0|      return -1;
  986|      0|    }
  987|       |
  988|    126|  } else
  989|  2.36k|#endif
  990|  2.36k|  {
  991|  2.36k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 2.36k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  2.36k|  }
  995|  2.49k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 525, False: 1.96k]
  ------------------
  996|    525|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 31, False: 494]
  ------------------
  997|    525|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     31|      return -1;
  999|     31|    }
 1000|    494|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    494|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    494|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 63, False: 431]
  ------------------
 1002|  66.4k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 66.4k, False: 35]
  ------------------
 1003|  66.4k|        TopologySplitEventData event_data;
 1004|  66.4k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 21, False: 66.3k]
  ------------------
 1005|     21|          return -1;
 1006|     21|        }
 1007|  66.3k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 6, False: 66.3k]
  ------------------
 1008|      6|          return -1;
 1009|      6|        }
 1010|  66.3k|        uint8_t edge_data;
 1011|  66.3k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 1, False: 66.3k]
  ------------------
 1012|      1|          return -1;
 1013|      1|        }
 1014|  66.3k|        event_data.source_edge = edge_data & 1;
 1015|  66.3k|        topology_split_data_.push_back(event_data);
 1016|  66.3k|      }
 1017|       |
 1018|     63|    } else
 1019|    431|#endif
 1020|    431|    {
 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|    431|      int last_source_symbol_id = 0;
 1024|  3.17k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 2.75k, False: 418]
  ------------------
 1025|  2.75k|        TopologySplitEventData event_data;
 1026|  2.75k|        uint32_t delta;
 1027|  2.75k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 3, False: 2.74k]
  ------------------
 1028|      3|          return -1;
 1029|      3|        }
 1030|  2.74k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  2.74k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 2, False: 2.74k]
  ------------------
 1032|      2|          return -1;
 1033|      2|        }
 1034|  2.74k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 8, False: 2.73k]
  ------------------
 1035|      8|          return -1;
 1036|      8|        }
 1037|  2.73k|        event_data.split_symbol_id =
 1038|  2.73k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  2.73k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  2.73k|        topology_split_data_.push_back(event_data);
 1041|  2.73k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    418|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  2.62k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 2.21k, False: 418]
  ------------------
 1045|  2.21k|        uint32_t edge_data;
 1046|  2.21k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.21k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 365, False: 1.84k]
  ------------------
 1047|    365|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  1.84k|        } else {
 1049|  1.84k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  1.84k|        }
 1051|  2.21k|        TopologySplitEventData& event_data = topology_split_data_[i];
 1052|  2.21k|        event_data.source_edge = edge_data & 1;
 1053|  2.21k|      }
 1054|    418|      decoder_buffer->EndBitDecoding();
 1055|    418|    }
 1056|    494|  }
 1057|  2.41k|  uint32_t num_hole_events = 0;
 1058|  2.41k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.41k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.41k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 73, False: 2.34k]
  ------------------
 1060|     73|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 2, False: 71]
  ------------------
 1061|      2|      return -1;
 1062|      2|    }
 1063|  2.34k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.34k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 60, False: 2.28k]
  ------------------
 1064|     60|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 6, False: 54]
  ------------------
 1065|      6|      return -1;
 1066|      6|    }
 1067|     60|  }
 1068|  2.41k|#endif
 1069|  2.41k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 68, False: 2.34k]
  ------------------
 1070|     68|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     68|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     68|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 51, False: 17]
  ------------------
 1072|  1.70M|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 1.70M, False: 5]
  ------------------
 1073|  1.70M|        HoleEventData event_data;
 1074|  1.70M|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 46, False: 1.70M]
  ------------------
 1075|     46|          return -1;
 1076|     46|        }
 1077|  1.70M|        hole_event_data_.push_back(event_data);
 1078|  1.70M|      }
 1079|       |
 1080|     51|    } else
 1081|     17|#endif
 1082|     17|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     17|      int last_symbol_id = 0;
 1085|  9.15k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 9.14k, False: 9]
  ------------------
 1086|  9.14k|        HoleEventData event_data;
 1087|  9.14k|        uint32_t delta;
 1088|  9.14k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 8, False: 9.13k]
  ------------------
 1089|      8|          return -1;
 1090|      8|        }
 1091|  9.13k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  9.13k|        last_symbol_id = event_data.symbol_id;
 1093|  9.13k|        hole_event_data_.push_back(event_data);
 1094|  9.13k|      }
 1095|     17|    }
 1096|     68|  }
 1097|  2.35k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.41k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  2.14k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  2.14k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  2.14k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  8.58k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 6.43k, False: 2.14k]
  ------------------
 1109|  6.43k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  6.43k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 826, False: 5.61k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  1.78k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 957, False: 826]
  ------------------
 1114|    957|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|    957|      }
 1116|    826|      continue;
 1117|    826|    }
 1118|       |
 1119|  12.0k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 6.45k, False: 5.61k]
  ------------------
 1120|  6.45k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  6.45k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 5.21k, False: 1.24k]
  ------------------
 1122|  5.21k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  5.21k|      }
 1124|  6.45k|    }
 1125|  5.61k|  }
 1126|  2.14k|  return true;
 1127|  2.14k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  11.3M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  11.3M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  11.3M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  11.3M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  45.3M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 34.0M, False: 11.3M]
  ------------------
 1139|  34.0M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  34.0M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 163k, False: 33.8M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   358k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 194k, False: 163k]
  ------------------
 1144|   194k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   194k|      }
 1146|   163k|      continue;
 1147|   163k|    }
 1148|  33.8M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  33.8M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 16.9M, False: 16.9M]
  ------------------
 1151|  16.9M|      continue;
 1152|  16.9M|    }
 1153|       |
 1154|  38.3M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 21.3M, False: 16.9M]
  ------------------
 1155|  21.3M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  21.3M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 19.2M, False: 2.16M]
  ------------------
 1157|  19.2M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  19.2M|      }
 1159|  21.3M|    }
 1160|  16.9M|  }
 1161|  11.3M|  return true;
 1162|  11.3M|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|  2.14k|    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.14k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  2.14k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 41, False: 2.10k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|   146k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 146k, False: 41]
  ------------------
 1176|   146k|      Mesh::Face face;
 1177|   146k|      const CornerIndex start_corner(3 * f.value());
 1178|   585k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 439k, False: 146k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   439k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   439k|        face[c] = vert_id;
 1182|   439k|      }
 1183|   146k|      decoder_->mesh()->SetFace(f, face);
 1184|   146k|    }
 1185|     41|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     41|    return true;
 1187|     41|  }
 1188|       |  // Else we need to deduplicate multiple attributes.
 1189|       |
 1190|       |  // Map between point id and an associated corner id. Only one corner for
 1191|       |  // each point is stored. The corners are used to sample the attribute values
 1192|       |  // in the last stage of the deduplication.
 1193|  2.10k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  2.10k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  5.76M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 5.76M, False: 2.09k]
  ------------------
 1197|  5.76M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  5.76M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 2.89k, False: 5.75M]
  ------------------
 1199|  2.89k|      continue;  // Isolated vertex.
 1200|  2.89k|    }
 1201|  5.75M|    CornerIndex deduplication_first_corner = c;
 1202|  5.75M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 164k, False: 5.59M]
  ------------------
 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|   164k|      deduplication_first_corner = c;
 1206|  5.59M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  5.88M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 5.60M, False: 286k]
  ------------------
 1210|  5.60M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 280k, False: 5.32M]
  ------------------
 1211|   280k|          continue;  // No seam for this attribute, ignore it.
 1212|   280k|        }
 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|  5.32M|        const VertexIndex vert_id =
 1217|  5.32M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  5.32M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  5.32M|        bool seam_found = false;
 1220|  5.44M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 5.43M, False: 13.6k]
  ------------------
 1221|  5.43M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 2, False: 5.43M]
  ------------------
 1222|      2|            return false;
 1223|      2|          }
 1224|  5.43M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 5.30M, False: 126k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  5.30M|            deduplication_first_corner = act_c;
 1227|  5.30M|            seam_found = true;
 1228|  5.30M|            break;
 1229|  5.30M|          }
 1230|   126k|          act_c = corner_table_->SwingRight(act_c);
 1231|   126k|        }
 1232|  5.32M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 5.30M, False: 13.6k]
  ------------------
 1233|  5.30M|          break;  // No reason to process other attributes if we found a seam.
 1234|  5.30M|        }
 1235|  5.32M|      }
 1236|  5.59M|    }
 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.75M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  5.75M|    corner_to_point_map[c.value()] =
 1246|  5.75M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  5.75M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  5.75M|    CornerIndex prev_c = c;
 1250|  5.75M|    c = corner_table_->SwingRight(c);
 1251|  34.0M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 33.8M, False: 166k]
  |  Branch (1251:40): [True: 28.2M, False: 5.59M]
  ------------------
 1252|  28.2M|      bool attribute_seam = false;
 1253|  29.8M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 28.3M, False: 1.52M]
  ------------------
 1254|  28.3M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 26.7M, False: 1.56M]
  ------------------
 1255|  28.3M|            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|  26.7M|          attribute_seam = true;
 1259|  26.7M|          break;
 1260|  26.7M|        }
 1261|  28.3M|      }
 1262|  28.2M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 26.7M, False: 1.52M]
  ------------------
 1263|  26.7M|        corner_to_point_map[c.value()] =
 1264|  26.7M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  26.7M|        point_to_corner_map.push_back(c.value());
 1266|  26.7M|      } else {
 1267|  1.52M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  1.52M|      }
 1269|  28.2M|      prev_c = c;
 1270|  28.2M|      c = corner_table_->SwingRight(c);
 1271|  28.2M|    }
 1272|  5.75M|  }
 1273|       |  // Add faces.
 1274|  11.3M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 11.3M, False: 2.09k]
  ------------------
 1275|  11.3M|    Mesh::Face face;
 1276|  45.2M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 33.9M, False: 11.3M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  33.9M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  33.9M|    }
 1280|  11.3M|    decoder_->mesh()->SetFace(f, face);
 1281|  11.3M|  }
 1282|  2.09k|  decoder_->point_cloud()->set_num_points(
 1283|  2.09k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  2.09k|  return true;
 1285|  2.10k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  2.31k|    : decoder_(nullptr),
   49|  2.31k|      last_symbol_id_(-1),
   50|  2.31k|      last_vert_id_(-1),
   51|  2.31k|      last_face_id_(-1),
   52|  2.31k|      num_new_vertices_(0),
   53|  2.31k|      num_encoded_vertices_(0),
   54|  2.31k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.31k|    MeshEdgebreakerDecoder* decoder) {
   59|  2.31k|  decoder_ = decoder;
   60|  2.31k|  return true;
   61|  2.31k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    727|    int att_id) const {
   67|  1.03k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 901, False: 136]
  ------------------
   68|    901|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    901|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 291, False: 610]
  |  Branch (69:27): [True: 0, False: 610]
  ------------------
   70|    291|      continue;
   71|    291|    }
   72|    610|    const AttributesDecoderInterface* const dec =
   73|    610|        decoder_->attributes_decoder(decoder_id);
   74|  11.0k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 11.0k, False: 19]
  ------------------
   75|  11.0k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 591, False: 10.4k]
  ------------------
   76|    591|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 420, False: 171]
  ------------------
   77|    420|          return &attribute_data_[i].connectivity_data;
   78|    420|        }
   79|    171|        return nullptr;
   80|    591|      }
   81|  11.0k|    }
   82|    610|  }
   83|    136|  return nullptr;
   84|    727|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    727|    int att_id) const {
   90|  1.03k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 901, False: 136]
  ------------------
   91|    901|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    901|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 291, False: 610]
  |  Branch (92:27): [True: 0, False: 610]
  ------------------
   93|    291|      continue;
   94|    291|    }
   95|    610|    const AttributesDecoderInterface* const dec =
   96|    610|        decoder_->attributes_decoder(decoder_id);
   97|  11.0k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 11.0k, False: 19]
  ------------------
   98|  11.0k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 591, False: 10.4k]
  ------------------
   99|    591|        return &attribute_data_[i].encoding_data;
  100|    591|      }
  101|  11.0k|    }
  102|    610|  }
  103|    136|  return &pos_encoding_data_;
  104|    727|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    625|    int32_t att_decoder_id) {
  131|    625|  int8_t att_data_id;
  132|    625|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 10, False: 615]
  ------------------
  133|     10|    return false;
  134|     10|  }
  135|    615|  uint8_t decoder_type;
  136|    615|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 9, False: 606]
  ------------------
  137|      9|    return false;
  138|      9|  }
  139|       |
  140|    606|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 489, False: 117]
  ------------------
  141|    489|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 16, False: 473]
  ------------------
  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|    473|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 6, False: 467]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|       |
  151|    467|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|    467|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    117|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 116]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    116|    pos_data_decoder_id_ = att_decoder_id;
  158|    116|  }
  159|       |
  160|    583|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    583|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    583|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 583, False: 0]
  ------------------
  162|    583|    uint8_t traversal_method_encoded;
  163|    583|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 2, False: 581]
  ------------------
  164|      2|      return false;
  165|      2|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    581|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 23, False: 558]
  ------------------
  168|     23|      return false;
  169|     23|    }
  170|    558|    traversal_method =
  171|    558|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|    558|  }
  173|       |
  174|    558|  const Mesh* mesh = decoder_->mesh();
  175|    558|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|    558|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 279, False: 279]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    279|    MeshAttributeIndicesEncodingData* encoding_data = nullptr;
  181|    279|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 93, False: 186]
  ------------------
  182|     93|      encoding_data = &pos_encoding_data_;
  183|    186|    } else {
  184|    186|      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|    186|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    186|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    279|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 92, False: 187]
  ------------------
  191|     92|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     92|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     92|          AttTraverser;
  194|     92|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    187|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 187, False: 0]
  ------------------
  196|    187|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    187|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    187|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    187|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    279|  } else {
  203|    279|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 7, False: 272]
  ------------------
  204|      7|      return false;  // Unsupported method.
  205|      7|    }
  206|    272|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 270]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    270|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    270|        AttObserver;
  214|    270|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    270|        AttTraverser;
  216|       |
  217|    270|    MeshAttributeIndicesEncodingData* const encoding_data =
  218|    270|        &attribute_data_[att_data_id].encoding_data;
  219|    270|    const MeshAttributeCornerTable* const corner_table =
  220|    270|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    270|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    270|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    270|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    270|                             encoding_data);
  227|       |
  228|    270|    AttTraverser att_traverser;
  229|    270|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    270|    traversal_sequencer->SetTraverser(att_traverser);
  232|    270|    sequencer = std::move(traversal_sequencer);
  233|    270|  }
  234|       |
  235|    549|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 549]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|    549|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|    549|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|    549|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|    549|                                        std::move(att_controller));
  244|    549|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|  2.31k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.31k|  num_new_vertices_ = 0;
  249|  2.31k|  new_to_parent_vertex_map_.clear();
  250|  2.31k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.31k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.31k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 399, False: 1.91k]
  ------------------
  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: 328, False: 71]
  ------------------
  254|    328|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 328]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    328|    } else {
  258|     71|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 71]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|     71|    }
  262|    399|    num_new_vertices_ = num_new_verts;
  263|    399|  }
  264|  2.31k|#endif
  265|       |
  266|  2.31k|  uint32_t num_encoded_vertices;
  267|  2.31k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.31k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.31k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 328, False: 1.98k]
  ------------------
  269|    328|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 328]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    328|  } else
  274|  1.98k|#endif
  275|  1.98k|  {
  276|  1.98k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 1.98k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  1.98k|  }
  280|  2.31k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.31k|  uint32_t num_faces;
  283|  2.31k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.31k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.31k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 328, False: 1.98k]
  ------------------
  285|    328|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 328]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    328|  } else
  290|  1.98k|#endif
  291|  1.98k|  {
  292|  1.98k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 1.98k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  1.98k|  }
  296|  2.31k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 0, False: 2.31k]
  ------------------
  297|      0|    return false;  // Draco cannot handle this many faces.
  298|      0|  }
  299|       |
  300|  2.31k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 2, False: 2.31k]
  ------------------
  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.31k|  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.31k|  const uint64_t num_encoded_vertices_64 =
  311|  2.31k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.31k|  const uint64_t max_num_vertex_edges =
  313|  2.31k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.31k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 1, False: 2.30k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      1|    return false;
  317|      1|  }
  318|       |
  319|  2.30k|  uint8_t num_attribute_data;
  320|  2.30k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 2.30k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  2.30k|  uint32_t num_encoded_symbols;
  325|  2.30k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.30k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.30k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 326, False: 1.98k]
  ------------------
  327|    326|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 326]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    326|  } else
  332|  1.98k|#endif
  333|  1.98k|  {
  334|  1.98k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 1.98k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  1.98k|  }
  338|       |
  339|  2.30k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 0, False: 2.30k]
  ------------------
  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|      0|    return false;
  344|      0|  }
  345|  2.30k|  const uint32_t max_encoded_faces =
  346|  2.30k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.30k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 6, False: 2.30k]
  ------------------
  348|       |    // Faces can only be 1 1/3 times bigger than number of encoded symbols. This
  349|       |    // could only happen if all new encoded components started with interior
  350|       |    // triangles. E.g. A mesh with multiple tetrahedrons.
  351|      6|    return false;
  352|      6|  }
  353|       |
  354|  2.30k|  uint32_t num_encoded_split_symbols;
  355|  2.30k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.30k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.30k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 321, False: 1.98k]
  ------------------
  357|    321|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 321]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    321|  } else
  362|  1.98k|#endif
  363|  1.98k|  {
  364|  1.98k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 1.98k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  1.98k|  }
  368|       |
  369|  2.30k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 0, False: 2.30k]
  ------------------
  370|      0|    return false;  // Split symbols are a sub-set of all symbols.
  371|      0|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.30k|  vertex_traversal_length_.clear();
  375|  2.30k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.30k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.30k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.30k|  processed_corner_ids_.clear();
  380|  2.30k|  processed_corner_ids_.reserve(num_faces);
  381|  2.30k|  processed_connectivity_corners_.clear();
  382|  2.30k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.30k|  topology_split_data_.clear();
  384|  2.30k|  hole_event_data_.clear();
  385|  2.30k|  init_face_configurations_.clear();
  386|  2.30k|  init_corners_.clear();
  387|       |
  388|  2.30k|  last_symbol_id_ = -1;
  389|  2.30k|  last_face_id_ = -1;
  390|  2.30k|  last_vert_id_ = -1;
  391|       |
  392|  2.30k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.30k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.30k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.30k]
  ------------------
  397|  2.30k|          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.30k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.30k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.30k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.30k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.30k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 392, False: 1.91k]
  ------------------
  411|    392|    uint32_t encoded_connectivity_size;
  412|    392|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    392|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 321, False: 71]
  ------------------
  413|    321|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 0, False: 321]
  ------------------
  414|      0|        return false;
  415|      0|      }
  416|    321|    } else {
  417|     71|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 71]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|     71|    }
  421|    392|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 0, False: 392]
  ------------------
  422|    392|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 10, False: 382]
  ------------------
  423|     10|      return false;
  424|     10|    }
  425|    382|    DecoderBuffer event_buffer;
  426|    382|    event_buffer.Init(
  427|    382|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    382|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    382|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    382|    topology_split_decoded_bytes =
  432|    382|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    382|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 114, False: 268]
  ------------------
  434|    114|      return false;
  435|    114|    }
  436|       |
  437|    382|  } else
  438|  1.91k|#endif
  439|  1.91k|  {
  440|  1.91k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 15, False: 1.89k]
  ------------------
  441|     15|      return false;
  442|     15|    }
  443|  1.91k|  }
  444|       |
  445|  2.16k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.16k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.16k|                                           num_encoded_split_symbols);
  449|  2.16k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.16k|  DecoderBuffer traversal_end_buffer;
  452|  2.16k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 807, False: 1.35k]
  ------------------
  453|    807|    return false;
  454|    807|  }
  455|       |
  456|  1.35k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.35k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 777, False: 580]
  ------------------
  458|    777|    return false;
  459|    777|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    580|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    580|                           traversal_end_buffer.remaining_size(),
  464|    580|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    580|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    580|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    580|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 6, False: 574]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      6|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      6|  }
  471|    580|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    580|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 544, False: 36]
  ------------------
  475|    544|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    544|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    544|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 5, False: 539]
  ------------------
  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|    539|#endif
  485|    539|    {
  486|   374k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 373k, False: 539]
  ------------------
  487|   373k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 373k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   373k|      }
  491|    539|    }
  492|    544|  }
  493|    580|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  2.09k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 1.51k, False: 580]
  ------------------
  498|  1.51k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|   511k|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 511k, False: 1.51k]
  ------------------
  501|   511k|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|   511k|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  1.51k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 1.51k]
  ------------------
  505|  1.51k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  1.51k|  }
  509|       |
  510|    580|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  2.09k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 1.51k, False: 580]
  ------------------
  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.51k|    int32_t att_connectivity_verts =
  517|  1.51k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  1.51k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 4, False: 1.50k]
  ------------------
  519|      4|      att_connectivity_verts = corner_table_->num_vertices();
  520|      4|    }
  521|  1.51k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  1.51k|  }
  523|    580|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 13, False: 567]
  ------------------
  524|     13|    return false;
  525|     13|  }
  526|    567|  return true;
  527|    580|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     77|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     77|  return true;
  532|     77|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|  1.35k|    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.35k|  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.35k|  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.35k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.35k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.35k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.35k|  int num_faces = 0;
  562|  88.9M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 88.9M, False: 711]
  ------------------
  563|  88.9M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  88.9M|    bool check_topology_split = false;
  566|  88.9M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  88.9M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 1.35M, False: 87.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|  1.35M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 98, False: 1.35M]
  ------------------
  588|     98|        return -1;
  589|     98|      }
  590|       |
  591|  1.35M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  1.35M|      const VertexIndex vertex_x =
  593|  1.35M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  1.35M|      const CornerIndex corner_b =
  595|  1.35M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  1.35M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 244, False: 1.35M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    244|        return -1;
  600|    244|      }
  601|  1.35M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 1.35M]
  |  Branch (601:11): [True: 0, False: 1.35M]
  ------------------
  602|  1.35M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 1.35M]
  ------------------
  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|  1.35M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  1.35M|      SetOppositeCorners(corner_a, corner + 1);
  612|  1.35M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  1.35M|      const VertexIndex vert_a_prev =
  616|  1.35M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  1.35M|      const VertexIndex vert_b_next =
  618|  1.35M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  1.35M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 1.35M]
  |  Branch (619:38): [True: 0, False: 1.35M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  1.35M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  1.35M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  1.35M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  1.35M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  1.35M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  1.35M|      active_corner_stack.back() = corner;
  631|  87.5M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 2.32k, False: 87.5M]
  |  Branch (631:40): [True: 79.0M, False: 8.50M]
  ------------------
  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|  79.0M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 79.0M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  79.0M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  79.0M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 79.0M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  79.0M|      const CornerIndex corner(3 * face.value());
  658|  79.0M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  79.0M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 2.32k, False: 79.0M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  2.32k|        opp_corner = corner + 2;
  662|  2.32k|        corner_l = corner + 1;
  663|  2.32k|        corner_r = corner;
  664|  79.0M|      } else {
  665|       |        // "l" is the new first corner.
  666|  79.0M|        opp_corner = corner + 1;
  667|  79.0M|        corner_l = corner;
  668|  79.0M|        corner_r = corner + 2;
  669|  79.0M|      }
  670|  79.0M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  79.0M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  79.0M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 6, False: 79.0M]
  ------------------
  675|      6|        return -1;  // Unexpected number of decoded vertices.
  676|      6|      }
  677|       |
  678|  79.0M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  79.0M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  79.0M|      const VertexIndex vertex_r =
  682|  79.0M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  79.0M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  79.0M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  79.0M|      corner_table_->MapCornerToVertex(
  688|  79.0M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  79.0M|      active_corner_stack.back() = corner;
  690|  79.0M|      check_topology_split = true;
  691|  79.0M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 69.2k, False: 8.43M]
  ------------------
  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.2k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 69.2k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  69.2k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  69.2k|      active_corner_stack.pop_back();
  707|       |
  708|       |      // Corner "a" can correspond either to a normal active edge, or to an edge
  709|       |      // created from the topology split event.
  710|  69.2k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  69.2k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 59, False: 69.1k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     59|        active_corner_stack.push_back(it->second);
  714|     59|      }
  715|  69.2k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 64, False: 69.1k]
  ------------------
  716|     64|        return -1;
  717|     64|      }
  718|  69.1k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  69.1k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 69.1k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  69.1k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 2, False: 69.1k]
  |  Branch (724:11): [True: 2, False: 69.1k]
  ------------------
  725|  69.1k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 69.1k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      2|        return -1;
  729|      2|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  69.1k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  69.1k|      SetOppositeCorners(corner_a, corner + 2);
  735|  69.1k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  69.1k|      const VertexIndex vertex_p =
  739|  69.1k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  69.1k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  69.1k|      corner_table_->MapCornerToVertex(
  742|  69.1k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  69.1k|      const VertexIndex vert_b_prev =
  744|  69.1k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  69.1k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  69.1k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  69.1k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  69.1k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  69.1k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  69.1k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  69.1k|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  69.1k|      const CornerIndex first_corner = corner_n;
  757|   217k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 148k, False: 69.1k]
  ------------------
  758|   148k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|   148k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|   148k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 2, False: 148k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      2|          return -1;
  764|      2|        }
  765|   148k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  69.1k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  69.1k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 61.4k, False: 7.69k]
  ------------------
  770|  61.4k|        invalid_vertices.push_back(vertex_n);
  771|  61.4k|      }
  772|  69.1k|      active_corner_stack.back() = corner;
  773|  8.43M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 8.43M, False: 192]
  ------------------
  774|  8.43M|      const CornerIndex corner(3 * face.value());
  775|  8.43M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  8.43M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  8.43M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  8.43M|                                       corner_table_->AddNewVertex());
  780|  8.43M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  8.43M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  8.43M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 4, False: 8.43M]
  ------------------
  784|      4|        return -1;  // Unexpected number of decoded vertices.
  785|      4|      }
  786|       |
  787|  8.43M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  8.43M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  8.43M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  8.43M|      active_corner_stack.push_back(corner);
  792|  8.43M|      check_topology_split = true;
  793|  8.43M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    192|      return -1;
  796|    192|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  88.9M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  88.9M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 87.5M, False: 1.42M]
  ------------------
  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|  87.5M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  87.5M|      EdgeFaceName split_edge;
  812|  87.5M|      int encoder_split_symbol_id;
  813|  87.5M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.46k, False: 87.5M]
  ------------------
  814|  87.5M|                             &encoder_split_symbol_id)) {
  815|  1.46k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 32, False: 1.43k]
  ------------------
  816|     32|          return -1;  // Wrong split symbol id.
  817|     32|        }
  818|       |        // Symbol was part of a topology split. Now we need to determine which
  819|       |        // edge should be added to the active edges stack.
  820|  1.43k|        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.43k|        CornerIndex new_active_corner;
  831|  1.43k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 521, False: 913]
  ------------------
  832|    521|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    913|        } else {
  834|    913|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    913|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.43k|        const int decoder_split_symbol_id =
  839|  1.43k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.43k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.43k|            new_active_corner;
  842|  1.43k|      }
  843|  87.5M|    }
  844|  88.9M|  }
  845|    711|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 711]
  ------------------
  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|  6.35M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 6.35M, False: 673]
  ------------------
  850|  6.35M|    const CornerIndex corner = active_corner_stack.back();
  851|  6.35M|    active_corner_stack.pop_back();
  852|  6.35M|    const bool interior_face =
  853|  6.35M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  6.35M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 3.14M, False: 3.20M]
  ------------------
  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.14M|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 26, False: 3.14M]
  ------------------
  877|     26|        return -1;  // More faces than expected added to the mesh.
  878|     26|      }
  879|       |
  880|  3.14M|      const CornerIndex corner_a = corner;
  881|  3.14M|      const VertexIndex vert_n =
  882|  3.14M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  3.14M|      const CornerIndex corner_b =
  884|  3.14M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  3.14M|      const VertexIndex vert_x =
  887|  3.14M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  3.14M|      const CornerIndex corner_c =
  889|  3.14M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  3.14M|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 6, False: 3.14M]
  |  Branch (891:33): [True: 2, False: 3.14M]
  |  Branch (891:55): [True: 0, False: 3.14M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      8|        return -1;
  894|      8|      }
  895|  3.14M|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 3.14M]
  |  Branch (895:11): [True: 4, False: 3.14M]
  ------------------
  896|  3.14M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 1, False: 3.14M]
  ------------------
  897|  3.14M|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 2, False: 3.14M]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      4|        return -1;
  901|      4|      }
  902|       |
  903|  3.14M|      const VertexIndex vert_p =
  904|  3.14M|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  3.14M|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  3.14M|      const CornerIndex new_corner(3 * face.value());
  909|  3.14M|      SetOppositeCorners(new_corner, corner);
  910|  3.14M|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  3.14M|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  3.14M|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  3.14M|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  3.14M|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  12.5M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 9.43M, False: 3.14M]
  ------------------
  920|  9.43M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  9.43M|      }
  922|       |
  923|  3.14M|      init_face_configurations_.push_back(true);
  924|  3.14M|      init_corners_.push_back(new_corner);
  925|  3.20M|    } 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.20M|      init_face_configurations_.push_back(false);
  930|  3.20M|      init_corners_.push_back(corner);
  931|  3.20M|    }
  932|  6.35M|  }
  933|    673|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 93, False: 580]
  ------------------
  934|     93|    return -1;  // Unexpected number of decoded faces.
  935|     93|  }
  936|       |
  937|    580|  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|    580|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 32, False: 580]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|     32|    VertexIndex src_vert(num_vertices - 1);
  943|     35|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 3, False: 32]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|      3|      src_vert = VertexIndex(--num_vertices - 1);
  946|      3|    }
  947|     32|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 3, False: 29]
  ------------------
  948|      3|      continue;  // No need to swap anything.
  949|      3|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|     29|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|    152|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 123, False: 29]
  ------------------
  954|    123|      const CornerIndex cid = vcit.Corner();
  955|    123|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 0, False: 123]
  ------------------
  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|    123|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|    123|    }
  962|     29|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|     29|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|     29|    corner_table_->MakeVertexIsolated(src_vert);
  967|     29|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|     29|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|     29|    num_vertices--;
  972|     29|  }
  973|    580|  return num_vertices;
  974|    580|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.29k|    DecoderBuffer* decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.29k|  uint32_t num_topology_splits;
  982|  2.29k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.29k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 312, False: 1.98k]
  ------------------
  984|    312|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 312]
  ------------------
  985|      0|      return -1;
  986|      0|    }
  987|       |
  988|    312|  } else
  989|  1.98k|#endif
  990|  1.98k|  {
  991|  1.98k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 1.98k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  1.98k|  }
  995|  2.29k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 295, False: 1.99k]
  ------------------
  996|    295|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 18, False: 277]
  ------------------
  997|    295|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     18|      return -1;
  999|     18|    }
 1000|    277|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    277|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    277|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 54, False: 223]
  ------------------
 1002|   125k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 125k, False: 21]
  ------------------
 1003|   125k|        TopologySplitEventData event_data;
 1004|   125k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 19, False: 125k]
  ------------------
 1005|     19|          return -1;
 1006|     19|        }
 1007|   125k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 11, False: 125k]
  ------------------
 1008|     11|          return -1;
 1009|     11|        }
 1010|   125k|        uint8_t edge_data;
 1011|   125k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 3, False: 125k]
  ------------------
 1012|      3|          return -1;
 1013|      3|        }
 1014|   125k|        event_data.source_edge = edge_data & 1;
 1015|   125k|        topology_split_data_.push_back(event_data);
 1016|   125k|      }
 1017|       |
 1018|     54|    } else
 1019|    223|#endif
 1020|    223|    {
 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|    223|      int last_source_symbol_id = 0;
 1024|  55.1k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 54.9k, False: 208]
  ------------------
 1025|  54.9k|        TopologySplitEventData event_data;
 1026|  54.9k|        uint32_t delta;
 1027|  54.9k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 9, False: 54.9k]
  ------------------
 1028|      9|          return -1;
 1029|      9|        }
 1030|  54.9k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  54.9k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 3, False: 54.9k]
  ------------------
 1032|      3|          return -1;
 1033|      3|        }
 1034|  54.9k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 3, False: 54.9k]
  ------------------
 1035|      3|          return -1;
 1036|      3|        }
 1037|  54.9k|        event_data.split_symbol_id =
 1038|  54.9k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  54.9k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  54.9k|        topology_split_data_.push_back(event_data);
 1041|  54.9k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    208|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.18k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 2.97k, False: 208]
  ------------------
 1045|  2.97k|        uint32_t edge_data;
 1046|  2.97k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.97k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 521, False: 2.45k]
  ------------------
 1047|    521|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.45k|        } else {
 1049|  2.45k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.45k|        }
 1051|  2.97k|        TopologySplitEventData& event_data = topology_split_data_[i];
 1052|  2.97k|        event_data.source_edge = edge_data & 1;
 1053|  2.97k|      }
 1054|    208|      decoder_buffer->EndBitDecoding();
 1055|    208|    }
 1056|    277|  }
 1057|  2.22k|  uint32_t num_hole_events = 0;
 1058|  2.22k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.22k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.22k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 262, False: 1.96k]
  ------------------
 1060|    262|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 259]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  1.96k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.96k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 63, False: 1.90k]
  ------------------
 1064|     63|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 4, False: 59]
  ------------------
 1065|      4|      return -1;
 1066|      4|    }
 1067|     63|  }
 1068|  2.22k|#endif
 1069|  2.22k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 67, False: 2.15k]
  ------------------
 1070|     67|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     67|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     67|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 47, False: 20]
  ------------------
 1072|   420k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 420k, False: 5]
  ------------------
 1073|   420k|        HoleEventData event_data;
 1074|   420k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 42, False: 420k]
  ------------------
 1075|     42|          return -1;
 1076|     42|        }
 1077|   420k|        hole_event_data_.push_back(event_data);
 1078|   420k|      }
 1079|       |
 1080|     47|    } else
 1081|     20|#endif
 1082|     20|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     20|      int last_symbol_id = 0;
 1085|  21.1k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 21.1k, False: 6]
  ------------------
 1086|  21.1k|        HoleEventData event_data;
 1087|  21.1k|        uint32_t delta;
 1088|  21.1k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 14, False: 21.1k]
  ------------------
 1089|     14|          return -1;
 1090|     14|        }
 1091|  21.1k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  21.1k|        last_symbol_id = event_data.symbol_id;
 1093|  21.1k|        hole_event_data_.push_back(event_data);
 1094|  21.1k|      }
 1095|     20|    }
 1096|     67|  }
 1097|  2.16k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.22k|}
_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|   373k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   373k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   373k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   373k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.49M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 1.12M, False: 373k]
  ------------------
 1139|  1.12M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  1.12M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 243k, False: 878k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   487k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 244k, False: 243k]
  ------------------
 1144|   244k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   244k|      }
 1146|   243k|      continue;
 1147|   243k|    }
 1148|   878k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   878k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 439k, False: 439k]
  ------------------
 1151|   439k|      continue;
 1152|   439k|    }
 1153|       |
 1154|   880k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 441k, False: 439k]
  ------------------
 1155|   441k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|   441k|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 267k, False: 173k]
  ------------------
 1157|   267k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   267k|      }
 1159|   441k|    }
 1160|   439k|  }
 1161|   373k|  return true;
 1162|   373k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    580|    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|    580|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    580|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 36, False: 544]
  ------------------
 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: 36]
  ------------------
 1176|  16.1k|      Mesh::Face face;
 1177|  16.1k|      const CornerIndex start_corner(3 * f.value());
 1178|  64.4k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 48.3k, False: 16.1k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  48.3k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  48.3k|        face[c] = vert_id;
 1182|  48.3k|      }
 1183|  16.1k|      decoder_->mesh()->SetFace(f, face);
 1184|  16.1k|    }
 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|    544|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    544|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   394k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 393k, False: 531]
  ------------------
 1197|   393k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   393k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 2.57k, False: 391k]
  ------------------
 1199|  2.57k|      continue;  // Isolated vertex.
 1200|  2.57k|    }
 1201|   391k|    CornerIndex deduplication_first_corner = c;
 1202|   391k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 241k, False: 149k]
  ------------------
 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|   241k|      deduplication_first_corner = c;
 1206|   241k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   154k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 149k, False: 4.51k]
  ------------------
 1210|   149k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 4.12k, False: 145k]
  ------------------
 1211|  4.12k|          continue;  // No seam for this attribute, ignore it.
 1212|  4.12k|        }
 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|   148k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 147k, False: 423]
  ------------------
 1221|   147k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 13, False: 147k]
  ------------------
 1222|     13|            return false;
 1223|     13|          }
 1224|   147k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 145k, False: 2.77k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   145k|            deduplication_first_corner = act_c;
 1227|   145k|            seam_found = true;
 1228|   145k|            break;
 1229|   145k|          }
 1230|  2.77k|          act_c = corner_table_->SwingRight(act_c);
 1231|  2.77k|        }
 1232|   145k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 145k, False: 423]
  ------------------
 1233|   145k|          break;  // No reason to process other attributes if we found a seam.
 1234|   145k|        }
 1235|   145k|      }
 1236|   149k|    }
 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|   391k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   391k|    corner_to_point_map[c.value()] =
 1246|   391k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   391k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   391k|    CornerIndex prev_c = c;
 1250|   391k|    c = corner_table_->SwingRight(c);
 1251|  1.14M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 905k, False: 242k]
  |  Branch (1251:40): [True: 757k, False: 148k]
  ------------------
 1252|   757k|      bool attribute_seam = false;
 1253|  1.17M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 757k, False: 417k]
  ------------------
 1254|   757k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 339k, False: 417k]
  ------------------
 1255|   757k|            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|   339k|          attribute_seam = true;
 1259|   339k|          break;
 1260|   339k|        }
 1261|   757k|      }
 1262|   757k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 339k, False: 417k]
  ------------------
 1263|   339k|        corner_to_point_map[c.value()] =
 1264|   339k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   339k|        point_to_corner_map.push_back(c.value());
 1266|   417k|      } else {
 1267|   417k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   417k|      }
 1269|   757k|      prev_c = c;
 1270|   757k|      c = corner_table_->SwingRight(c);
 1271|   757k|    }
 1272|   391k|  }
 1273|       |  // Add faces.
 1274|   234k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 234k, False: 531]
  ------------------
 1275|   234k|    Mesh::Face face;
 1276|   936k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 702k, False: 234k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   702k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   702k|    }
 1280|   234k|    decoder_->mesh()->SetFace(f, face);
 1281|   234k|  }
 1282|    531|  decoder_->point_cloud()->set_num_points(
 1283|    531|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    531|  return true;
 1285|    544|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    378|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    378|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    378|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    378|  const Mesh* mesh = decoder_->mesh();
  115|    378|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    378|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    378|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    378|                           encoding_data);
  120|       |
  121|    378|  TraverserT att_traverser;
  122|    378|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    378|  traversal_sequencer->SetTraverser(att_traverser);
  125|    378|  return std::move(traversal_sequencer);
  126|    378|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    665|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    665|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    665|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    665|  const Mesh* mesh = decoder_->mesh();
  115|    665|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    665|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    665|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    665|                           encoding_data);
  120|       |
  121|    665|  TraverserT att_traverser;
  122|    665|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    665|  traversal_sequencer->SetTraverser(att_traverser);
  125|    665|  return std::move(traversal_sequencer);
  126|    665|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    467|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    467|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    467|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    467|  const Mesh* mesh = decoder_->mesh();
  115|    467|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    467|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    467|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    467|                           encoding_data);
  120|       |
  121|    467|  TraverserT att_traverser;
  122|    467|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    467|  traversal_sequencer->SetTraverser(att_traverser);
  125|    467|  return std::move(traversal_sequencer);
  126|    467|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    703|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    703|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    703|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    703|  const Mesh* mesh = decoder_->mesh();
  115|    703|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    703|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    703|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    703|                           encoding_data);
  120|       |
  121|    703|  TraverserT att_traverser;
  122|    703|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    703|  traversal_sequencer->SetTraverser(att_traverser);
  125|    703|  return std::move(traversal_sequencer);
  126|    703|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     92|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|     92|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     92|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     92|  const Mesh* mesh = decoder_->mesh();
  115|     92|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     92|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     92|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     92|                           encoding_data);
  120|       |
  121|     92|  TraverserT att_traverser;
  122|     92|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     92|  traversal_sequencer->SetTraverser(att_traverser);
  125|     92|  return std::move(traversal_sequencer);
  126|     92|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    187|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    187|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    187|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    187|  const Mesh* mesh = decoder_->mesh();
  115|    187|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    187|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    187|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    187|                           encoding_data);
  120|       |
  121|    187|  TraverserT att_traverser;
  122|    187|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    187|  traversal_sequencer->SetTraverser(att_traverser);
  125|    187|  return std::move(traversal_sequencer);
  126|    187|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  7.18k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  3.17k|  const CornerTable* GetCornerTable() const override {
   67|  3.17k|    return corner_table_.get();
   68|  3.17k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  10.9M|                       int* out_encoder_split_symbol_id) {
   87|  10.9M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 95.7k, False: 10.8M]
  ------------------
   88|  95.7k|      return false;
   89|  95.7k|    }
   90|  10.8M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 25, False: 10.8M]
  ------------------
   91|  10.8M|        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|     25|      *out_encoder_split_symbol_id = -1;
   98|     25|      return true;
   99|     25|    }
  100|  10.8M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 10.8M, False: 2.27k]
  ------------------
  101|  10.8M|      return false;
  102|  10.8M|    }
  103|  2.27k|    *out_face_edge =
  104|  2.27k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  2.27k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  2.27k|    topology_split_data_.pop_back();
  108|  2.27k|    return true;
  109|  10.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  38.2M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  38.2M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  38.2M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  38.2M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  22.1k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  7.07k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  5.05k|  const CornerTable* GetCornerTable() const override {
   67|  5.05k|    return corner_table_.get();
   68|  5.05k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  30.4M|                       int* out_encoder_split_symbol_id) {
   87|  30.4M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 30.4M, False: 44.9k]
  ------------------
   88|  30.4M|      return false;
   89|  30.4M|    }
   90|  44.9k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 11, False: 44.9k]
  ------------------
   91|  44.9k|        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|     11|      *out_encoder_split_symbol_id = -1;
   98|     11|      return true;
   99|     11|    }
  100|  44.9k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 43.7k, False: 1.19k]
  ------------------
  101|  43.7k|      return false;
  102|  43.7k|    }
  103|  1.19k|    *out_face_edge =
  104|  1.19k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.19k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.19k|    topology_split_data_.pop_back();
  108|  1.19k|    return true;
  109|  44.9k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  89.1M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  89.1M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  89.1M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  89.1M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  12.6k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  12.2k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.89k|  const CornerTable* GetCornerTable() const override {
   67|  2.89k|    return corner_table_.get();
   68|  2.89k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  87.5M|                       int* out_encoder_split_symbol_id) {
   87|  87.5M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 82.1M, False: 5.37M]
  ------------------
   88|  82.1M|      return false;
   89|  82.1M|    }
   90|  5.37M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 32, False: 5.37M]
  ------------------
   91|  5.37M|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     32|      *out_encoder_split_symbol_id = -1;
   98|     32|      return true;
   99|     32|    }
  100|  5.37M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 5.36M, False: 1.43k]
  ------------------
  101|  5.36M|      return false;
  102|  5.36M|    }
  103|  1.43k|    *out_face_edge =
  104|  1.43k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.43k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.43k|    topology_split_data_.pop_back();
  108|  1.43k|    return true;
  109|  5.37M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  91.3M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  91.3M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  91.3M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  91.3M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  6.91k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  7.40k|      : attribute_connectivity_decoders_(nullptr),
   34|  7.40k|        num_attribute_data_(0),
   35|  7.40k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  6.91k|  void Init(MeshEdgebreakerDecoderImplInterface* decoder) {
   37|  6.91k|    decoder_impl_ = decoder;
   38|  6.91k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  6.91k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  6.91k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  6.91k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  5.79k|  uint16_t BitstreamVersion() const {
   45|  5.79k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  5.79k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  2.39k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  6.91k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  4.75k|  bool Start(DecoderBuffer* out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  4.75k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 51, False: 4.70k]
  ------------------
   63|     51|      return false;
   64|     51|    }
   65|       |
   66|  4.70k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 80, False: 4.62k]
  ------------------
   67|     80|      return false;
   68|     80|    }
   69|       |
   70|  4.62k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 17, False: 4.60k]
  ------------------
   71|     17|      return false;
   72|     17|    }
   73|  4.60k|    *out_buffer = buffer_;
   74|  4.60k|    return true;
   75|  4.62k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  6.41M|  inline bool DecodeStartFaceConfiguration() {
   79|  6.41M|    uint32_t face_configuration;
   80|  6.41M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  6.41M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  6.41M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 953, False: 6.40M]
  ------------------
   82|    953|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    953|    } else
   85|  6.40M|#endif
   86|  6.40M|    {
   87|  6.40M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  6.40M|    }
   89|  6.41M|    return face_configuration;
   90|  6.41M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  27.0M|  inline uint32_t DecodeSymbol() {
   94|  27.0M|    uint32_t symbol;
   95|  27.0M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  27.0M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 11.7M, False: 15.3M]
  ------------------
   97|  11.7M|      return symbol;
   98|  11.7M|    }
   99|       |    // Else decode two additional bits.
  100|  15.3M|    uint32_t symbol_suffix;
  101|  15.3M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  15.3M|    symbol |= (symbol_suffix << 1);
  103|  15.3M|    return symbol;
  104|  27.0M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  26.7M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  4.26M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  25.9M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  25.9M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  25.9M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  4.80k|  void Done() {
  123|  4.80k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 4.23k, False: 574]
  ------------------
  124|  4.23k|      symbol_buffer_.EndBitDecoding();
  125|  4.23k|    }
  126|  4.80k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  4.80k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.80k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 502, False: 4.30k]
  ------------------
  128|    502|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    502|    } else
  131|  4.30k|#endif
  132|  4.30k|    {
  133|  4.30k|      start_face_decoder_.EndDecoding();
  134|  4.30k|    }
  135|  4.80k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  2.08k|  DecoderBuffer* buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  5.02k|  bool DecodeTraversalSymbols() {
  141|  5.02k|    uint64_t traversal_size;
  142|  5.02k|    symbol_buffer_ = buffer_;
  143|  5.02k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 13, False: 5.00k]
  ------------------
  144|     13|      return false;
  145|     13|    }
  146|  5.00k|    buffer_ = symbol_buffer_;
  147|  5.00k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 65, False: 4.94k]
  ------------------
  148|     65|      return false;
  149|     65|    }
  150|  4.94k|    buffer_.Advance(traversal_size);
  151|  4.94k|    return true;
  152|  5.00k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  6.83k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  6.83k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  6.83k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  6.83k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 870, False: 5.96k]
  ------------------
  158|    870|      start_face_buffer_ = buffer_;
  159|    870|      uint64_t traversal_size;
  160|    870|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 0, False: 870]
  ------------------
  161|      0|        return false;
  162|      0|      }
  163|    870|      buffer_ = start_face_buffer_;
  164|    870|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 117, False: 753]
  ------------------
  165|    117|        return false;
  166|    117|      }
  167|    753|      buffer_.Advance(traversal_size);
  168|    753|      return true;
  169|    870|    }
  170|  5.96k|#endif
  171|  5.96k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  6.83k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  6.71k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  6.71k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 4.94k, False: 1.76k]
  ------------------
  177|  4.94k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  4.94k|          new BinaryDecoder[num_attribute_data_]);
  179|  16.1k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 11.2k, False: 4.92k]
  ------------------
  180|  11.2k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 25, False: 11.1k]
  ------------------
  181|     25|          return false;
  182|     25|        }
  183|  11.2k|      }
  184|  4.94k|    }
  185|  6.68k|    return true;
  186|  6.71k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  2.33k|MeshSequentialDecoder::MeshSequentialDecoder() = default;
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  2.14k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  2.14k|  uint32_t num_faces;
   31|  2.14k|  uint32_t num_points;
   32|  2.14k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  2.14k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.14k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 446, False: 1.69k]
  ------------------
   34|    446|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 0, False: 446]
  ------------------
   35|      0|      return false;
   36|      0|    }
   37|    446|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 0, False: 446]
  ------------------
   38|      0|      return false;
   39|      0|    }
   40|       |
   41|    446|  } else
   42|  1.69k|#endif
   43|  1.69k|  {
   44|  1.69k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 0, False: 1.69k]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|  1.69k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 0, False: 1.69k]
  ------------------
   48|      0|      return false;
   49|      0|    }
   50|  1.69k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  2.14k|  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.14k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 0, False: 2.14k]
  ------------------
   56|      0|    return false;
   57|      0|  }
   58|  2.14k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 1, False: 2.14k]
  ------------------
   59|       |    // The number of faces is unreasonably high, because face indices do not
   60|       |    // fit in the remaining size of the buffer.
   61|      1|    return false;
   62|      1|  }
   63|  2.14k|  uint8_t connectivity_method;
   64|  2.14k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 0, False: 2.14k]
  ------------------
   65|      0|    return false;
   66|      0|  }
   67|  2.14k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 1.48k, False: 655]
  ------------------
   68|  1.48k|    if (!DecodeAndDecompressIndices(num_faces, num_points)) {
  ------------------
  |  Branch (68:9): [True: 1.43k, False: 54]
  ------------------
   69|  1.43k|      return false;
   70|  1.43k|    }
   71|  1.48k|  } else {
   72|    655|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 498, False: 157]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|  1.62k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 1.13k, False: 491]
  ------------------
   75|  1.13k|        Mesh::Face face;
   76|  4.53k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 3.40k, False: 1.12k]
  ------------------
   77|  3.40k|          uint8_t val;
   78|  3.40k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 0, False: 3.40k]
  ------------------
   79|      0|            return false;
   80|      0|          }
   81|  3.40k|          if (val >= num_points) {
  ------------------
  |  Branch (81:15): [True: 7, False: 3.39k]
  ------------------
   82|      7|            return false;
   83|      7|          }
   84|  3.39k|          face[j] = val;
   85|  3.39k|        }
   86|  1.12k|        mesh()->AddFace(face);
   87|  1.12k|      }
   88|    498|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (88:16): [True: 53, False: 104]
  ------------------
   89|       |      // Decode indices as uint16_t.
   90|    587|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:28): [True: 565, False: 22]
  ------------------
   91|    565|        Mesh::Face face;
   92|  2.19k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (92:25): [True: 1.65k, False: 534]
  ------------------
   93|  1.65k|          uint16_t val;
   94|  1.65k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (94:15): [True: 9, False: 1.64k]
  ------------------
   95|      9|            return false;
   96|      9|          }
   97|  1.64k|          if (val >= num_points) {
  ------------------
  |  Branch (97:15): [True: 22, False: 1.62k]
  ------------------
   98|     22|            return false;
   99|     22|          }
  100|  1.62k|          face[j] = val;
  101|  1.62k|        }
  102|    534|        mesh()->AddFace(face);
  103|    534|      }
  104|    104|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (104:16): [True: 31, False: 73]
  ------------------
  105|     31|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     31|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (105:16): [True: 30, False: 1]
  ------------------
  106|       |      // Decode indices as uint32_t.
  107|    741|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (107:28): [True: 731, False: 10]
  ------------------
  108|    731|        Mesh::Face face;
  109|  2.88k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (109:25): [True: 2.17k, False: 711]
  ------------------
  110|  2.17k|          uint32_t val;
  111|  2.17k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (111:15): [True: 4, False: 2.17k]
  ------------------
  112|      4|            return false;
  113|      4|          }
  114|  2.17k|          if (val >= num_points) {
  ------------------
  |  Branch (114:15): [True: 16, False: 2.15k]
  ------------------
  115|     16|            return false;
  116|     16|          }
  117|  2.15k|          face[j] = val;
  118|  2.15k|        }
  119|    711|        mesh()->AddFace(face);
  120|    711|      }
  121|     74|    } else {
  122|       |      // Decode faces as uint32_t (default).
  123|  30.6k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (123:28): [True: 30.6k, False: 25]
  ------------------
  124|  30.6k|        Mesh::Face face;
  125|   122k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (125:25): [True: 91.7k, False: 30.5k]
  ------------------
  126|  91.7k|          uint32_t val;
  127|  91.7k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (127:15): [True: 21, False: 91.7k]
  ------------------
  128|     21|            return false;
  129|     21|          }
  130|  91.7k|          if (val >= num_points) {
  ------------------
  |  Branch (130:15): [True: 28, False: 91.7k]
  ------------------
  131|     28|            return false;
  132|     28|          }
  133|  91.7k|          face[j] = val;
  134|  91.7k|        }
  135|  30.5k|        mesh()->AddFace(face);
  136|  30.5k|      }
  137|     74|    }
  138|    655|  }
  139|    602|  point_cloud()->set_num_points(num_points);
  140|    602|  return true;
  141|  2.14k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  143|  13.3k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  144|       |  // Always create the basic attribute decoder.
  145|  13.3k|  return SetAttributesDecoder(
  146|  13.3k|      att_decoder_id,
  147|  13.3k|      std::unique_ptr<AttributesDecoder>(
  148|  13.3k|          new SequentialAttributeDecodersController(
  149|  13.3k|              std::unique_ptr<PointsSequencer>(
  150|  13.3k|                  new LinearSequencer(point_cloud()->num_points())))));
  151|  13.3k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEjj:
  154|  1.48k|                                                       uint32_t num_points) {
  155|       |  // Get decoded indices differences that were encoded with an entropy code.
  156|  1.48k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  157|  1.48k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (157:7): [True: 1.31k, False: 168]
  ------------------
  158|  1.31k|    return false;
  159|  1.31k|  }
  160|       |  // Reconstruct the indices from the differences.
  161|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  162|    168|  int32_t last_index_value = 0;  // This will always be >= 0.
  163|    168|  int vertex_index = 0;
  164|  1.26k|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (164:24): [True: 1.20k, False: 54]
  ------------------
  165|  1.20k|    Mesh::Face face;
  166|  4.59k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (166:21): [True: 3.50k, False: 1.09k]
  ------------------
  167|  3.50k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  168|  3.50k|      int32_t index_diff = (encoded_val >> 1);
  169|  3.50k|      if (encoded_val & 1) {
  ------------------
  |  Branch (169:11): [True: 629, False: 2.87k]
  ------------------
  170|    629|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (170:13): [True: 41, False: 588]
  ------------------
  171|       |          // Subtracting index_diff would result in a negative index.
  172|     41|          return false;
  173|     41|        }
  174|    588|        index_diff = -index_diff;
  175|  2.87k|      } else {
  176|  2.87k|        if (index_diff >
  ------------------
  |  Branch (176:13): [True: 35, False: 2.83k]
  ------------------
  177|  2.87k|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  178|       |          // Adding index_diff to last_index_value would overflow.
  179|     35|          return false;
  180|     35|        }
  181|  2.87k|      }
  182|  3.42k|      const int32_t index_value = index_diff + last_index_value;
  183|  3.42k|      if (index_value < 0 || static_cast<uint32_t>(index_value) >= num_points) {
  ------------------
  |  Branch (183:11): [True: 0, False: 3.42k]
  |  Branch (183:30): [True: 38, False: 3.38k]
  ------------------
  184|     38|        return false;
  185|     38|      }
  186|  3.38k|      face[j] = index_value;
  187|  3.38k|      last_index_value = index_value;
  188|  3.38k|    }
  189|  1.09k|    mesh()->AddFace(face);
  190|  1.09k|  }
  191|     54|  return true;
  192|    168|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.49k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.66M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.66M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 2.63M, False: 28.6k]
  ------------------
   61|  2.63M|      return true;  // Already traversed.
   62|  2.63M|    }
   63|       |
   64|  28.6k|    corner_traversal_stack_.clear();
   65|  28.6k|    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|  28.6k|    const VertexIndex next_vert =
   69|  28.6k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  28.6k|    const VertexIndex prev_vert =
   71|  28.6k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  28.6k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 28.6k]
  |  Branch (72:45): [True: 0, False: 28.6k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  28.6k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 28.0k, False: 532]
  ------------------
   76|  28.0k|      this->MarkVertexVisited(next_vert);
   77|  28.0k|      this->traversal_observer().OnNewVertexVisited(
   78|  28.0k|          next_vert, this->corner_table()->Next(corner_id));
   79|  28.0k|    }
   80|  28.6k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 15.0k, False: 13.5k]
  ------------------
   81|  15.0k|      this->MarkVertexVisited(prev_vert);
   82|  15.0k|      this->traversal_observer().OnNewVertexVisited(
   83|  15.0k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  15.0k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  70.5k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 41.9k, False: 28.6k]
  ------------------
   88|       |      // Currently processed corner.
   89|  41.9k|      corner_id = corner_traversal_stack_.back();
   90|  41.9k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  41.9k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 41.9k]
  |  Branch (92:47): [True: 799, False: 41.1k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    799|        corner_traversal_stack_.pop_back();
   95|    799|        continue;
   96|    799|      }
   97|  2.66M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.66M, Folded]
  ------------------
   98|  2.66M|        this->MarkFaceVisited(face_id);
   99|  2.66M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.66M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.66M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.66M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.66M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.34M, False: 1.31M]
  ------------------
  105|  1.34M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.34M|          this->MarkVertexVisited(vert_id);
  107|  1.34M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.34M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.30M, False: 41.6k]
  ------------------
  109|  1.30M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.30M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.30M|            continue;
  112|  1.30M|          }
  113|  1.34M|        }
  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.36M|        const CornerIndex right_corner_id =
  118|  1.36M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.36M|        const CornerIndex left_corner_id =
  120|  1.36M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.36M|        const FaceIndex right_face_id(
  122|  1.36M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 28.4k, False: 1.33M]
  ------------------
  123|  1.36M|                 ? kInvalidFaceIndex
  124|  1.36M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.36M|        const FaceIndex left_face_id(
  126|  1.36M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 34.5k, False: 1.32M]
  ------------------
  127|  1.36M|                 ? kInvalidFaceIndex
  128|  1.36M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.36M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.32M, False: 38.1k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.32M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 34.4k, False: 1.28M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  34.4k|            corner_traversal_stack_.pop_back();
  134|  34.4k|            break;  // Break from the while (true) loop.
  135|  1.28M|          } else {
  136|       |            // Go to the left face.
  137|  1.28M|            corner_id = left_corner_id;
  138|  1.28M|            face_id = left_face_id;
  139|  1.28M|          }
  140|  1.32M|        } else {
  141|       |          // Right face was not visited.
  142|  38.1k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 31.5k, False: 6.63k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  31.5k|            corner_id = right_corner_id;
  145|  31.5k|            face_id = right_face_id;
  146|  31.5k|          } 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.63k|            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.63k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  6.63k|            break;
  159|  6.63k|          }
  160|  38.1k|        }
  161|  1.36M|      }
  162|  41.1k|    }
  163|  28.6k|    return true;
  164|  28.6k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.49k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.11k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  2.01k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.50M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.50M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 525k, False: 2.97M]
  ------------------
   61|   525k|      return true;  // Already traversed.
   62|   525k|    }
   63|       |
   64|  2.97M|    corner_traversal_stack_.clear();
   65|  2.97M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  2.97M|    const VertexIndex next_vert =
   69|  2.97M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.97M|    const VertexIndex prev_vert =
   71|  2.97M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.97M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.97M]
  |  Branch (72:45): [True: 0, False: 2.97M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.97M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.97M, False: 1.18k]
  ------------------
   76|  2.97M|      this->MarkVertexVisited(next_vert);
   77|  2.97M|      this->traversal_observer().OnNewVertexVisited(
   78|  2.97M|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.97M|    }
   80|  2.97M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.97M, False: 935]
  ------------------
   81|  2.97M|      this->MarkVertexVisited(prev_vert);
   82|  2.97M|      this->traversal_observer().OnNewVertexVisited(
   83|  2.97M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.97M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  6.00M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 3.02M, False: 2.97M]
  ------------------
   88|       |      // Currently processed corner.
   89|  3.02M|      corner_id = corner_traversal_stack_.back();
   90|  3.02M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  3.02M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 3.02M]
  |  Branch (92:47): [True: 4.52k, False: 3.02M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  4.52k|        corner_traversal_stack_.pop_back();
   95|  4.52k|        continue;
   96|  4.52k|      }
   97|  3.50M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.50M, Folded]
  ------------------
   98|  3.50M|        this->MarkFaceVisited(face_id);
   99|  3.50M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.50M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.50M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.50M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.50M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 3.25M, False: 245k]
  ------------------
  105|  3.25M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  3.25M|          this->MarkVertexVisited(vert_id);
  107|  3.25M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  3.25M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 233k, False: 3.02M]
  ------------------
  109|   233k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   233k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   233k|            continue;
  112|   233k|          }
  113|  3.25M|        }
  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.26M|        const CornerIndex right_corner_id =
  118|  3.26M|            this->corner_table()->GetRightCorner(corner_id);
  119|  3.26M|        const CornerIndex left_corner_id =
  120|  3.26M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  3.26M|        const FaceIndex right_face_id(
  122|  3.26M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 3.00M, False: 266k]
  ------------------
  123|  3.26M|                 ? kInvalidFaceIndex
  124|  3.26M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  3.26M|        const FaceIndex left_face_id(
  126|  3.26M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.99M, False: 271k]
  ------------------
  127|  3.26M|                 ? kInvalidFaceIndex
  128|  3.26M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  3.26M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 3.22M, False: 42.2k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  3.22M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.99M, False: 227k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.99M|            corner_traversal_stack_.pop_back();
  134|  2.99M|            break;  // Break from the while (true) loop.
  135|  2.99M|          } else {
  136|       |            // Go to the left face.
  137|   227k|            corner_id = left_corner_id;
  138|   227k|            face_id = left_face_id;
  139|   227k|          }
  140|  3.22M|        } else {
  141|       |          // Right face was not visited.
  142|  42.2k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 15.5k, False: 26.6k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  15.5k|            corner_id = right_corner_id;
  145|  15.5k|            face_id = right_face_id;
  146|  26.6k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  26.6k|            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|  26.6k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  26.6k|            break;
  159|  26.6k|          }
  160|  42.2k|        }
  161|  3.26M|      }
  162|  3.02M|    }
  163|  2.97M|    return true;
  164|  2.97M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  2.01k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  4.12k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    937|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  2.02k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  2.02k|    const auto* corner_table = traverser_.corner_table();
   50|  2.02k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  2.02k|    const size_t num_faces = mesh_->num_faces();
   52|  2.02k|    const size_t num_points = mesh_->num_points();
   53|  6.63M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 6.63M, False: 2.02k]
  ------------------
   54|  6.63M|      const auto& face = mesh_->face(f);
   55|  26.5M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 19.9M, False: 6.63M]
  ------------------
   56|  19.9M|        const PointIndex point_id = face[p];
   57|  19.9M|        const VertexIndex vert_id =
   58|  19.9M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  19.9M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 19.9M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  19.9M|        const AttributeValueIndex att_entry_id(
   63|  19.9M|            encoding_data_
   64|  19.9M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  19.9M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 19.9M]
  |  Branch (65:13): [True: 0, False: 19.9M]
  |  Branch (65:39): [True: 0, False: 19.9M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  19.9M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  19.9M|      }
   71|  6.63M|    }
   72|  2.02k|    return true;
   73|  2.02k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    901|  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|    901|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    901|    traverser_.OnTraversalStart();
   82|    901|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 901]
  ------------------
   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|    901|    } else {
   89|    901|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  4.32M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 4.32M, False: 901]
  ------------------
   91|  4.32M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 4.32M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  4.32M|      }
   95|    901|    }
   96|    901|    traverser_.OnTraversalEnd();
   97|    901|    return true;
   98|    901|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  4.32M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  4.32M|    return traverser_.TraverseFromCorner(corner_id);
  103|  4.32M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    937|  void SetTraverser(const TraverserT& t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.55k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  8.91k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  8.91k|    const auto* corner_table = traverser_.corner_table();
   50|  8.91k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  8.91k|    const size_t num_faces = mesh_->num_faces();
   52|  8.91k|    const size_t num_points = mesh_->num_points();
   53|  5.02M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.01M, False: 8.91k]
  ------------------
   54|  5.01M|      const auto& face = mesh_->face(f);
   55|  20.0M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 15.0M, False: 5.01M]
  ------------------
   56|  15.0M|        const PointIndex point_id = face[p];
   57|  15.0M|        const VertexIndex vert_id =
   58|  15.0M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  15.0M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 15.0M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  15.0M|        const AttributeValueIndex att_entry_id(
   63|  15.0M|            encoding_data_
   64|  15.0M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  15.0M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 15.0M]
  |  Branch (65:13): [True: 0, False: 15.0M]
  |  Branch (65:39): [True: 0, False: 15.0M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  15.0M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  15.0M|      }
   71|  5.01M|    }
   72|  8.91k|    return true;
   73|  8.91k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.49k|  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.49k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.49k|    traverser_.OnTraversalStart();
   82|  1.49k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.49k]
  ------------------
   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.49k|    } else {
   89|  1.49k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.66M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.66M, False: 1.49k]
  ------------------
   91|  2.66M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.66M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.66M|      }
   95|  1.49k|    }
   96|  1.49k|    traverser_.OnTraversalEnd();
   97|  1.49k|    return true;
   98|  1.49k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.66M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.66M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.66M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.55k|  void SetTraverser(const TraverserT& t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  2.06k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  13.2k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  13.2k|    const auto* corner_table = traverser_.corner_table();
   50|  13.2k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  13.2k|    const size_t num_faces = mesh_->num_faces();
   52|  13.2k|    const size_t num_points = mesh_->num_points();
   53|  6.02M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 6.01M, False: 13.2k]
  ------------------
   54|  6.01M|      const auto& face = mesh_->face(f);
   55|  24.0M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 18.0M, False: 6.01M]
  ------------------
   56|  18.0M|        const PointIndex point_id = face[p];
   57|  18.0M|        const VertexIndex vert_id =
   58|  18.0M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  18.0M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 18.0M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  18.0M|        const AttributeValueIndex att_entry_id(
   63|  18.0M|            encoding_data_
   64|  18.0M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  18.0M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 18.0M]
  |  Branch (65:13): [True: 3, False: 18.0M]
  |  Branch (65:39): [True: 3, False: 18.0M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      3|          return false;
   68|      3|        }
   69|  18.0M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  18.0M|      }
   71|  6.01M|    }
   72|  13.2k|    return true;
   73|  13.2k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  2.01k|  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.01k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  2.01k|    traverser_.OnTraversalStart();
   82|  2.01k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 2.01k]
  ------------------
   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.01k|    } else {
   89|  2.01k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.50M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.50M, False: 2.01k]
  ------------------
   91|  3.50M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.50M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.50M|      }
   95|  2.01k|    }
   96|  2.01k|    traverser_.OnTraversalEnd();
   97|  2.01k|    return true;
   98|  2.01k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.50M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.50M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.50M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  2.06k|  void SetTraverser(const TraverserT& t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  4.12k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  49.2M|  inline const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  26.4M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  26.4M|    return is_vertex_visited_[vert_id.value()];
   65|  26.4M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  3.61M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  3.61M|    is_vertex_visited_[vert_id.value()] = true;
   68|  3.61M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  10.5M|  inline TraversalObserverT& traversal_observer() {
   75|  10.5M|    return traversal_observer_;
   76|  10.5M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  19.7M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  19.7M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 146k, False: 19.6M]
  ------------------
   47|   146k|      return true;  // Invalid faces are always considered as visited.
   48|   146k|    }
   49|  19.6M|    return is_face_visited_[face_id.value()];
   50|  19.7M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  6.98M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  6.98M|    is_face_visited_[face_id.value()] = true;
   62|  6.98M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  4.98k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  4.98k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.49k|                    TraversalObserver traversal_observer) {
   37|  2.49k|    corner_table_ = corner_table;
   38|  2.49k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.49k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.49k|    traversal_observer_ = traversal_observer;
   41|  2.49k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.66M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.66M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.66M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.66M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.66M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  31.3M|  inline const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.50M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.50M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.50M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.50M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.50M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  9.45M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  9.45M|    return is_vertex_visited_[vert_id.value()];
   65|  9.45M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  9.20M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  9.20M|    is_vertex_visited_[vert_id.value()] = true;
   68|  9.20M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  12.7M|  inline TraversalObserverT& traversal_observer() {
   75|  12.7M|    return traversal_observer_;
   76|  12.7M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  9.56M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  9.56M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 5.99M, False: 3.56M]
  ------------------
   47|  5.99M|      return true;  // Invalid faces are always considered as visited.
   48|  5.99M|    }
   49|  3.56M|    return is_face_visited_[face_id.value()];
   50|  9.56M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.50M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.50M|    is_face_visited_[face_id.value()] = true;
   62|  3.50M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  4.12k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.06k|                    TraversalObserver traversal_observer) {
   37|  2.06k|    corner_table_ = corner_table;
   38|  2.06k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.06k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.06k|    traversal_observer_ = traversal_observer;
   41|  2.06k|  }

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

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

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

_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.49G|    IntTypeT val) {
  128|  1.49G|  static_assert(std::is_integral<IntTypeT>::value, "IntTypeT is not integral.");
  129|  1.49G|  typedef typename std::make_signed<IntTypeT>::type SignedType;
  130|  1.49G|  const bool is_positive = !static_cast<bool>(val & 1);
  131|  1.49G|  val >>= 1;
  132|  1.49G|  if (is_positive) {
  ------------------
  |  Branch (132:7): [True: 1.48G, False: 3.45M]
  ------------------
  133|  1.48G|    return static_cast<SignedType>(val);
  134|  1.48G|  }
  135|  3.45M|  SignedType ret = static_cast<SignedType>(val);
  136|  3.45M|  ret = -ret - 1;
  137|  3.45M|  return ret;
  138|  1.49G|}

_ZN5draco10DataBufferC2Ev:
   21|  25.1k|DataBuffer::DataBuffer() = default;
_ZN5draco10DataBuffer6UpdateEPKvl:
   23|  24.5k|bool DataBuffer::Update(const void* data, int64_t size) {
   24|  24.5k|  const int64_t offset = 0;
   25|  24.5k|  return this->Update(data, size, offset);
   26|  24.5k|}
_ZN5draco10DataBuffer6UpdateEPKvll:
   28|  24.5k|bool DataBuffer::Update(const void* data, int64_t size, int64_t offset) {
   29|  24.5k|  if (data == nullptr) {
  ------------------
  |  Branch (29:7): [True: 24.5k, False: 0]
  ------------------
   30|  24.5k|    if (size + offset < 0) {
  ------------------
  |  Branch (30:9): [True: 0, False: 24.5k]
  ------------------
   31|      0|      return false;
   32|      0|    }
   33|       |    // If no data is provided, just resize the buffer.
   34|  24.5k|    data_.resize(size + offset);
   35|  24.5k|  } 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|  24.5k|  descriptor_.buffer_update_count++;
   46|  24.5k|  return true;
   47|  24.5k|}
_ZN5draco10DataBuffer6ResizeEl:
   49|  2.25k|void DataBuffer::Resize(int64_t size) {
   50|  2.25k|  data_.resize(size);
   51|  2.25k|  descriptor_.buffer_update_count++;
   52|  2.25k|}

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  52.8M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t* out_value) {
   58|  52.8M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 52.8M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  52.8M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  52.8M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  1.48G|  bool Decode(void* out_data, size_t size_to_decode) {
   77|  1.48G|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 383, False: 1.48G]
  ------------------
   78|    383|      return false;  // Buffer overflow.
   79|    383|    }
   80|  1.48G|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  1.48G|    pos_ += size_to_decode;
   82|  1.48G|    return true;
   83|  1.48G|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  31.8k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  10.1k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  47.2k|  const char* data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   190k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  6.91k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  52.8M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  6.47M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  8.46k|    void reset(const void* b, size_t s) {
  131|  8.46k|      bit_offset_ = 0;
  132|  8.46k|      bit_buffer_ = static_cast<const uint8_t*>(b);
  133|  8.46k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  8.46k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  7.31k|    uint64_t BitsDecoded() const { return static_cast<uint64_t>(bit_offset_); }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  158|  52.8M|    bool GetBits(uint32_t nbits, uint32_t* x) {
  159|  52.8M|      if (nbits > 32) {
  ------------------
  |  Branch (159:11): [True: 3, False: 52.8M]
  ------------------
  160|      3|        return false;
  161|      3|      }
  162|  52.8M|      uint32_t value = 0;
  163|   114M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (163:30): [True: 61.3M, False: 52.8M]
  ------------------
  164|  61.3M|        value |= GetBit() << bit;
  165|  61.3M|      }
  166|  52.8M|      *x = value;
  167|  52.8M|      return true;
  168|  52.8M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  173|  61.3M|    int GetBit() {
  174|  61.3M|      const size_t off = bit_offset_;
  175|  61.3M|      const size_t byte_offset = off >> 3;
  176|  61.3M|      const int bit_shift = static_cast<int>(off & 0x7);
  177|  61.3M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (177:11): [True: 56.3M, False: 5.02M]
  ------------------
  178|  56.3M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  179|  56.3M|        bit_offset_ = off + 1;
  180|  56.3M|        return bit;
  181|  56.3M|      }
  182|  5.02M|      return 0;
  183|  61.3M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  22.5M|  bool Decode(T* out_val) {
   69|  22.5M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2.71k, False: 22.5M]
  ------------------
   70|  2.71k|      return false;
   71|  2.71k|    }
   72|  22.5M|    pos_ += sizeof(T);
   73|  22.5M|    return true;
   74|  22.5M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  22.5M|  bool Peek(T* out_val) {
   88|  22.5M|    const size_t size_to_decode = sizeof(T);
   89|  22.5M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2.71k, False: 22.5M]
  ------------------
   90|  2.71k|      return false;  // Buffer overflow.
   91|  2.71k|    }
   92|  22.5M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  22.5M|    return true;
   94|  22.5M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  15.3k|  bool Decode(T* out_val) {
   69|  15.3k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 144, False: 15.2k]
  ------------------
   70|    144|      return false;
   71|    144|    }
   72|  15.2k|    pos_ += sizeof(T);
   73|  15.2k|    return true;
   74|  15.3k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  15.3k|  bool Peek(T* out_val) {
   88|  15.3k|    const size_t size_to_decode = sizeof(T);
   89|  15.3k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 144, False: 15.2k]
  ------------------
   90|    144|      return false;  // Buffer overflow.
   91|    144|    }
   92|  15.2k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  15.2k|    return true;
   94|  15.3k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   946k|  bool Decode(T* out_val) {
   69|   946k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 166, False: 945k]
  ------------------
   70|    166|      return false;
   71|    166|    }
   72|   945k|    pos_ += sizeof(T);
   73|   945k|    return true;
   74|   946k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   946k|  bool Peek(T* out_val) {
   88|   946k|    const size_t size_to_decode = sizeof(T);
   89|   946k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 166, False: 945k]
  ------------------
   90|    166|      return false;  // Buffer overflow.
   91|    166|    }
   92|   945k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   945k|    return true;
   94|   946k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  29.0k|  bool Decode(T* out_val) {
   69|  29.0k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 132, False: 28.8k]
  ------------------
   70|    132|      return false;
   71|    132|    }
   72|  28.8k|    pos_ += sizeof(T);
   73|  28.8k|    return true;
   74|  29.0k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  29.0k|  bool Peek(T* out_val) {
   88|  29.0k|    const size_t size_to_decode = sizeof(T);
   89|  29.0k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 132, False: 28.8k]
  ------------------
   90|    132|      return false;  // Buffer overflow.
   91|    132|    }
   92|  28.8k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  28.8k|    return true;
   94|  29.0k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|  3.31M|  bool Decode(T* out_val) {
   69|  3.31M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 147, False: 3.31M]
  ------------------
   70|    147|      return false;
   71|    147|    }
   72|  3.31M|    pos_ += sizeof(T);
   73|  3.31M|    return true;
   74|  3.31M|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|  3.31M|  bool Peek(T* out_val) {
   88|  3.31M|    const size_t size_to_decode = sizeof(T);
   89|  3.31M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 147, False: 3.31M]
  ------------------
   90|    147|      return false;  // Buffer overflow.
   91|    147|    }
   92|  3.31M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  3.31M|    return true;
   94|  3.31M|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  22.1k|  bool Decode(T* out_val) {
   69|  22.1k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 10, False: 22.0k]
  ------------------
   70|     10|      return false;
   71|     10|    }
   72|  22.0k|    pos_ += sizeof(T);
   73|  22.0k|    return true;
   74|  22.1k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  22.1k|  bool Peek(T* out_val) {
   88|  22.1k|    const size_t size_to_decode = sizeof(T);
   89|  22.1k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 10, False: 22.0k]
  ------------------
   90|     10|      return false;  // Buffer overflow.
   91|     10|    }
   92|  22.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  22.0k|    return true;
   94|  22.1k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  2.21k|  bool Decode(T* out_val) {
   69|  2.21k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 15, False: 2.20k]
  ------------------
   70|     15|      return false;
   71|     15|    }
   72|  2.20k|    pos_ += sizeof(T);
   73|  2.20k|    return true;
   74|  2.21k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  2.21k|  bool Peek(T* out_val) {
   88|  2.21k|    const size_t size_to_decode = sizeof(T);
   89|  2.21k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 15, False: 2.20k]
  ------------------
   90|     15|      return false;  // Buffer overflow.
   91|     15|    }
   92|  2.20k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.20k|    return true;
   94|  2.21k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    177|  bool Decode(T* out_val) {
   69|    177|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 19, False: 158]
  ------------------
   70|     19|      return false;
   71|     19|    }
   72|    158|    pos_ += sizeof(T);
   73|    158|    return true;
   74|    177|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    177|  bool Peek(T* out_val) {
   88|    177|    const size_t size_to_decode = sizeof(T);
   89|    177|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 19, False: 158]
  ------------------
   90|     19|      return false;  // Buffer overflow.
   91|     19|    }
   92|    158|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    158|    return true;
   94|    177|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   123M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   135M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  12.0M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|  12.0M|    return value_ >= val;
  100|  12.0M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   343M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  4.35G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  29.7M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   125M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|   125M|    value_ = i.value_;
  153|   125M|    return *this;
  154|   125M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   249M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|   249M|    value_ = i.value_;
  153|   249M|    return *this;
  154|   249M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  29.7M|  inline ThisIndexType& operator++() {
  103|  29.7M|    ++value_;
  104|  29.7M|    return *this;
  105|  29.7M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  3.20G|  constexpr bool operator==(const IndexType& i) const {
   76|  3.20G|    return value_ == i.value_;
   77|  3.20G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|  1.29G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  3.97k|  constexpr bool operator<(const IndexType& i) const {
   88|  3.97k|    return value_ < i.value_;
   89|  3.97k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   149M|  constexpr bool operator==(const IndexType& i) const {
   76|   149M|    return value_ == i.value_;
   77|   149M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   247M|  constexpr ThisIndexType operator-(const ValueTypeT& val) const {
  132|   247M|    return ThisIndexType(value_ - val);
  133|   247M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   983M|  constexpr ThisIndexType operator+(const ValueTypeT& val) const {
  126|   983M|    return ThisIndexType(value_ + val);
  127|   983M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  29.3M|  constexpr bool operator==(const IndexType& i) const {
   76|  29.3M|    return value_ == i.value_;
   77|  29.3M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   357M|  constexpr bool operator!=(const IndexType& i) const {
   82|   357M|    return value_ != i.value_;
   83|   357M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   481M|  constexpr bool operator!=(const IndexType& i) const {
   82|   481M|    return value_ != i.value_;
   83|   481M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   662M|  inline ThisIndexType& operator++() {
  103|   662M|    ++value_;
  104|   662M|    return *this;
  105|   662M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   599M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|   599M|    value_ = i.value_;
  153|   599M|    return *this;
  154|   599M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|  1.48G|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  1.48G|    value_ = i.value_;
  153|  1.48G|    return *this;
  154|  1.48G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  52.9M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|  52.9M|    return value_ >= val;
  100|  52.9M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  11.9M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.49G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  21.2G|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   268M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  14.6G|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   364M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  26.0M|  constexpr ThisIndexType operator+(const ValueTypeT& val) const {
  126|  26.0M|    return ThisIndexType(value_ + val);
  127|  26.0M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   240M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  35.4M|  constexpr bool operator<(const IndexType& i) const {
   88|  35.4M|    return value_ < i.value_;
   89|  35.4M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   281M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   249M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  86.1M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   102M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   378M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  7.42M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  7.42M|    value_ = i.value_;
  153|  7.42M|    return *this;
  154|  7.42M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  11.9M|  inline ThisIndexType operator+=(const ValueTypeT& val) {
  140|  11.9M|    value_ += val;
  141|  11.9M|    return *this;
  142|  11.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  36.2M|  inline ThisIndexType& operator=(const ValueTypeT& val) {
  156|  36.2M|    value_ = val;
  157|  36.2M|    return *this;
  158|  36.2M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   212M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  9.35M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  9.34M|  inline ThisIndexType& operator++() {
  103|  9.34M|    ++value_;
  104|  9.34M|    return *this;
  105|  9.34M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  32.6M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  32.6M|  inline ThisIndexType& operator++() {
  103|  32.6M|    ++value_;
  104|  32.6M|    return *this;
  105|  32.6M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  49.8M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  49.8M|    return vector_[index.value()];
   75|  49.8M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  32.6M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  12.6k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  29.2k|  void resize(size_t size, const ValueTypeT& val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  85.6M|  inline reference operator[](const IndexTypeT& index) {
   71|  85.6M|    return vector_[index.value()];
   72|  85.6M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  34.0k|  void push_back(const ValueTypeT& val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  24.1M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  4.80k|  void resize(size_t size, const ValueTypeT& val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   70|  12.0M|  inline reference operator[](const IndexTypeT& index) {
   71|  12.0M|    return vector_[index.value()];
   72|  12.0M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  30.4M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  30.4M|    return vector_[index.value()];
   75|  30.4M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   299M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  15.2M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   423M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|   423M|    return vector_[index.value()];
   75|   423M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|  1.15G|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  1.15G|    return vector_[index.value()];
   75|  1.15G|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   546M|  inline reference operator[](const IndexTypeT& index) {
   71|   546M|    return vector_[index.value()];
   72|   546M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  70.0M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  70.0M|    return vector_[index.value()];
   75|  70.0M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   437M|  inline reference operator[](const IndexTypeT& index) {
   71|   437M|    return vector_[index.value()];
   72|   437M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   154M|  void push_back(const ValueTypeT& val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   326M|  inline reference operator[](const IndexTypeT& index) {
   71|   326M|    return vector_[index.value()];
   72|   326M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.97k|  void resize(size_t size, const ValueTypeT& val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   358M|  inline reference operator[](const IndexTypeT& index) {
   71|   358M|    return vector_[index.value()];
   72|   358M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  71.3k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  4.32M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  67.1k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  7.37k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  7.37k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  7.37k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  7.37k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  18.0k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  18.0k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT>& arg) {
   56|  18.0k|    vector_.swap(arg.vector_);
   57|  18.0k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  18.0k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  18.0k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT>& arg) {
   56|  18.0k|    vector_.swap(arg.vector_);
   57|  18.0k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  7.37k|  void assign(size_t size, const ValueTypeT& val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  7.37k|  void assign(size_t size, const ValueTypeT& val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  7.37k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  10.1k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  99.5k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|   135k|int32_t DataTypeLength(DataType dt) {
   20|   135k|  switch (dt) {
   21|  88.0k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 88.0k, False: 47.0k]
  ------------------
   22|  90.4k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 2.43k, False: 132k]
  ------------------
   23|  90.4k|      return 1;
   24|  1.63k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 1.63k, False: 133k]
  ------------------
   25|  2.08k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 453, False: 134k]
  ------------------
   26|  2.08k|      return 2;
   27|  36.4k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 36.4k, False: 98.6k]
  ------------------
   28|  36.9k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 507, False: 134k]
  ------------------
   29|  36.9k|      return 4;
   30|    648|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 648, False: 134k]
  ------------------
   31|  1.31k|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 668, False: 134k]
  ------------------
   32|  1.31k|      return 8;
   33|  3.76k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.76k, False: 131k]
  ------------------
   34|  3.76k|      return 4;
   35|    415|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 415, False: 134k]
  ------------------
   36|    415|      return 8;
   37|    146|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 146, False: 134k]
  ------------------
   38|    146|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 135k]
  ------------------
   40|      0|      return -1;
   41|   135k|  }
   42|   135k|}

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

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

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

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

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

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

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

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

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   590k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|   590k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 590k, Folded]
  ------------------
   65|   590k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 983, False: 589k]
  ------------------
   66|    983|      return false;
   67|    983|    }
   68|   590k|  } 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|   589k|  return true;
   77|   590k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   298k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|   298k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   298k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 84, False: 298k]
  ------------------
   33|     84|    return false;
   34|     84|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   298k|  uint8_t in;
   39|   298k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 591, False: 297k]
  ------------------
   40|    591|    return false;
   41|    591|  }
   42|   297k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 18.0k, False: 279k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  18.0k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 481, False: 17.6k]
  ------------------
   45|    481|      return false;
   46|    481|    }
   47|       |    // Append decoded info from this byte.
   48|  17.6k|    *out_val <<= 7;
   49|  17.6k|    *out_val |= in & ((1 << 7) - 1);
   50|   279k|  } else {
   51|       |    // Last byte reached
   52|   279k|    *out_val = in;
   53|   279k|  }
   54|   297k|  return true;
   55|   297k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  6.54k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  6.54k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.54k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 6.54k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.54k|  uint8_t in;
   39|  6.54k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 4, False: 6.53k]
  ------------------
   40|      4|    return false;
   41|      4|  }
   42|  6.53k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 973, False: 5.56k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    973|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 973]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    973|    *out_val <<= 7;
   49|    973|    *out_val |= in & ((1 << 7) - 1);
   50|  5.56k|  } else {
   51|       |    // Last byte reached
   52|  5.56k|    *out_val = in;
   53|  5.56k|  }
   54|  6.53k|  return true;
   55|  6.53k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  7.06k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|  7.06k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 7.06k, Folded]
  ------------------
   65|  7.06k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 139, False: 6.92k]
  ------------------
   66|    139|      return false;
   67|    139|    }
   68|  7.06k|  } 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|  6.92k|  return true;
   77|  7.06k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.18k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  4.18k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.18k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 4.18k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.18k|  uint8_t in;
   39|  4.18k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 13, False: 4.17k]
  ------------------
   40|     13|    return false;
   41|     13|  }
   42|  4.17k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 90, False: 4.08k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     90|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 90]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     90|    *out_val <<= 7;
   49|     90|    *out_val |= in & ((1 << 7) - 1);
   50|  4.08k|  } else {
   51|       |    // Last byte reached
   52|  4.08k|    *out_val = in;
   53|  4.08k|  }
   54|  4.17k|  return true;
   55|  4.17k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   178k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|   178k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   178k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 13, False: 178k]
  ------------------
   33|     13|    return false;
   34|     13|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   178k|  uint8_t in;
   39|   178k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 81, False: 177k]
  ------------------
   40|     81|    return false;
   41|     81|  }
   42|   177k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.19k, False: 176k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.19k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 68, False: 1.12k]
  ------------------
   45|     68|      return false;
   46|     68|    }
   47|       |    // Append decoded info from this byte.
   48|  1.12k|    *out_val <<= 7;
   49|  1.12k|    *out_val |= in & ((1 << 7) - 1);
   50|   176k|  } else {
   51|       |    // Last byte reached
   52|   176k|    *out_val = in;
   53|   176k|  }
   54|   177k|  return true;
   55|   177k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  5.90k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  5.90k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  5.90k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 8, False: 5.89k]
  ------------------
   33|      8|    return false;
   34|      8|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  5.89k|  uint8_t in;
   39|  5.89k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 29, False: 5.86k]
  ------------------
   40|     29|    return false;
   41|     29|  }
   42|  5.86k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 817, False: 5.04k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    817|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 48, False: 769]
  ------------------
   45|     48|      return false;
   46|     48|    }
   47|       |    // Append decoded info from this byte.
   48|    769|    *out_val <<= 7;
   49|    769|    *out_val |= in & ((1 << 7) - 1);
   50|  5.04k|  } else {
   51|       |    // Last byte reached
   52|  5.04k|    *out_val = in;
   53|  5.04k|  }
   54|  5.81k|  return true;
   55|  5.86k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  22.4k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  22.4k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  22.4k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 22.3k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  22.3k|  uint8_t in;
   39|  22.3k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 24, False: 22.3k]
  ------------------
   40|     24|    return false;
   41|     24|  }
   42|  22.3k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 287, False: 22.0k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    287|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 30, False: 257]
  ------------------
   45|     30|      return false;
   46|     30|    }
   47|       |    // Append decoded info from this byte.
   48|    257|    *out_val <<= 7;
   49|    257|    *out_val |= in & ((1 << 7) - 1);
   50|  22.0k|  } else {
   51|       |    // Last byte reached
   52|  22.0k|    *out_val = in;
   53|  22.0k|  }
   54|  22.3k|  return true;
   55|  22.3k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  7.19k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  7.19k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.19k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 83, False: 7.11k]
  ------------------
   33|     83|    return false;
   34|     83|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.11k|  uint8_t in;
   39|  7.11k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 49, False: 7.06k]
  ------------------
   40|     49|    return false;
   41|     49|  }
   42|  7.06k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.81k, False: 5.24k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.81k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 446, False: 1.37k]
  ------------------
   45|    446|      return false;
   46|    446|    }
   47|       |    // Append decoded info from this byte.
   48|  1.37k|    *out_val <<= 7;
   49|  1.37k|    *out_val |= in & ((1 << 7) - 1);
   50|  5.24k|  } else {
   51|       |    // Last byte reached
   52|  5.24k|    *out_val = in;
   53|  5.24k|  }
   54|  6.62k|  return true;
   55|  7.06k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.95k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  4.95k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.95k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 97, False: 4.85k]
  ------------------
   33|     97|    return false;
   34|     97|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.85k|  uint8_t in;
   39|  4.85k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 29, False: 4.82k]
  ------------------
   40|     29|    return false;
   41|     29|  }
   42|  4.82k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.98k, False: 2.83k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.98k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 1.01k, False: 970]
  ------------------
   45|  1.01k|      return false;
   46|  1.01k|    }
   47|       |    // Append decoded info from this byte.
   48|    970|    *out_val <<= 7;
   49|    970|    *out_val |= in & ((1 << 7) - 1);
   50|  2.83k|  } else {
   51|       |    // Last byte reached
   52|  2.83k|    *out_val = in;
   53|  2.83k|  }
   54|  3.80k|  return true;
   55|  4.82k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  97.2k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  97.2k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  97.2k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 97.2k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  97.2k|  uint8_t in;
   39|  97.2k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 10, False: 97.2k]
  ------------------
   40|     10|    return false;
   41|     10|  }
   42|  97.2k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.18k, False: 95.0k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.18k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 18, False: 2.16k]
  ------------------
   45|     18|      return false;
   46|     18|    }
   47|       |    // Append decoded info from this byte.
   48|  2.16k|    *out_val <<= 7;
   49|  2.16k|    *out_val |= in & ((1 << 7) - 1);
   50|  95.0k|  } else {
   51|       |    // Last byte reached
   52|  95.0k|    *out_val = in;
   53|  95.0k|  }
   54|  97.1k|  return true;
   55|  97.2k|}

_ZN5draco7VectorDIfLi3EEC2Ev:
   42|  42.3k|  VectorD() {
   43|   169k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 127k, False: 42.3k]
  ------------------
   44|   127k|      (*this)[i] = Scalar(0);
   45|   127k|    }
   46|  42.3k|  }
_ZN5draco7VectorDIfLi3EEixEi:
  114|   205k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEixEi:
  115|   165k|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEixEi:
  115|   124M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  139|  13.7M|  Self operator-(const Self& o) const {
  140|  13.7M|    Self ret;
  141|  55.0M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 41.2M, False: 13.7M]
  ------------------
  142|  41.2M|      ret[i] = (*this)[i] - o[i];
  143|  41.2M|    }
  144|  13.7M|    return ret;
  145|  13.7M|  }
_ZN5draco12CrossProductIlTnPNSt3__19enable_ifIXaasr3std11is_integralIT_EE5valuesr3std9is_signedIS3_EE5valueEvE4typeELPv0EEENS_7VectorDIS3_Li3EEERKS9_SB_:
  325|  6.87M|                                 const VectorD<ScalarT, 3>& v) {
  326|       |  // Preventing accidental use with uint32_t and the like.
  327|  6.87M|  static_assert(std::is_signed<ScalarT>::value,
  328|  6.87M|                "ScalarT must be a signed type. ");
  329|  6.87M|  VectorD<ScalarT, 3> r;
  330|  6.87M|  typedef typename std::make_unsigned<ScalarT>::type ScalarUT;
  331|  6.87M|  const ScalarUT u0 = static_cast<ScalarUT>(u[0]);
  332|  6.87M|  const ScalarUT u1 = static_cast<ScalarUT>(u[1]);
  333|  6.87M|  const ScalarUT u2 = static_cast<ScalarUT>(u[2]);
  334|  6.87M|  const ScalarUT v0 = static_cast<ScalarUT>(v[0]);
  335|  6.87M|  const ScalarUT v1 = static_cast<ScalarUT>(v[1]);
  336|  6.87M|  const ScalarUT v2 = static_cast<ScalarUT>(v[2]);
  337|  6.87M|  r[0] = static_cast<ScalarT>((u1 * v2) - (u2 * v1));
  338|  6.87M|  r[1] = static_cast<ScalarT>((u2 * v0) - (u0 * v2));
  339|  6.87M|  r[2] = static_cast<ScalarT>((u0 * v1) - (u1 * v0));
  340|  6.87M|  return r;
  341|  6.87M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  284|  6.87M|  Scalar* data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  285|  6.87M|  const Scalar* data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  239|  3.45M|  Scalar AbsSum() const {
  240|  3.45M|    Scalar result(0);
  241|  13.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (241:21): [True: 10.3M, False: 3.44M]
  ------------------
  242|  10.3M|      Scalar next_value = std::abs(v_[i]);
  243|  10.3M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (243:11): [True: 8.24k, False: 10.3M]
  ------------------
  244|       |        // Return the max if adding would have caused an overflow.
  245|  8.24k|        return std::numeric_limits<Scalar>::max();
  246|  8.24k|      }
  247|  10.3M|      result += next_value;
  248|  10.3M|    }
  249|  3.44M|    return result;
  250|  3.45M|  }
_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|   214M|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  114|  15.9M|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  284|  10.3M|  Scalar* data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  122|  2.66M|  Self operator-() const {
  123|  2.66M|    Self ret;
  124|  10.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (124:21): [True: 7.99M, False: 2.66M]
  ------------------
  125|  7.99M|      ret[i] = -(*this)[i];
  126|  7.99M|    }
  127|  2.66M|    return ret;
  128|  2.66M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  115|  7.99M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  139|  1.15M|  Self operator-(const Self& o) const {
  140|  1.15M|    Self ret;
  141|  3.45M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 2.30M, False: 1.15M]
  ------------------
  142|  2.30M|      ret[i] = (*this)[i] - o[i];
  143|  2.30M|    }
  144|  1.15M|    return ret;
  145|  1.15M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  114|  13.8M|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  115|  20.7M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  114|  49.3M|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  131|  2.30M|  Self operator+(const Self& o) const {
  132|  2.30M|    Self ret;
  133|  6.90M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 4.60M, False: 2.30M]
  ------------------
  134|  4.60M|      ret[i] = (*this)[i] + o[i];
  135|  4.60M|    }
  136|  2.30M|    return ret;
  137|  2.30M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  115|  44.9M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  139|  1.46M|  Self operator-(const Self& o) const {
  140|  1.46M|    Self ret;
  141|  4.38M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 2.92M, False: 1.46M]
  ------------------
  142|  2.92M|      ret[i] = (*this)[i] - o[i];
  143|  2.92M|    }
  144|  1.46M|    return ret;
  145|  1.46M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  131|  1.46M|  Self operator+(const Self& o) const {
  132|  1.46M|    Self ret;
  133|  4.38M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 2.92M, False: 1.46M]
  ------------------
  134|  2.92M|      ret[i] = (*this)[i] + o[i];
  135|  2.92M|    }
  136|  1.46M|    return ret;
  137|  1.46M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  208|   326k|  bool operator==(const Self& o) const {
  209|   965k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (209:21): [True: 646k, False: 318k]
  ------------------
  210|   646k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (210:11): [True: 8.09k, False: 638k]
  ------------------
  211|  8.09k|        return false;
  212|  8.09k|      }
  213|   646k|    }
  214|   318k|    return true;
  215|   326k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  115|  3.92M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  139|  17.1k|  Self operator-(const Self& o) const {
  140|  17.1k|    Self ret;
  141|  68.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 51.3k, False: 17.1k]
  ------------------
  142|  51.3k|      ret[i] = (*this)[i] - o[i];
  143|  51.3k|    }
  144|  17.1k|    return ret;
  145|  17.1k|  }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  236|  9.02k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  252|  9.96k|  Scalar Dot(const Self& o) const {
  253|  9.96k|    Scalar ret(0);
  254|  39.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (254:21): [True: 29.8k, False: 9.96k]
  ------------------
  255|  29.8k|      ret += (*this)[i] * o[i];
  256|  29.8k|    }
  257|  9.96k|    return ret;
  258|  9.96k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  176|    932|  Self operator*(const Scalar& o) const {
  177|    932|    Self ret;
  178|  3.72k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 2.79k, False: 932]
  ------------------
  179|  2.79k|      ret[i] = (*this)[i] * o;
  180|  2.79k|    }
  181|    932|    return ret;
  182|    932|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  139|  8.09k|  Self operator-(const Self& o) const {
  140|  8.09k|    Self ret;
  141|  24.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 16.1k, False: 8.09k]
  ------------------
  142|  16.1k|      ret[i] = (*this)[i] - o[i];
  143|  16.1k|    }
  144|  8.09k|    return ret;
  145|  8.09k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   42|  16.1k|  VectorD() {
   43|  48.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 32.3k, False: 16.1k]
  ------------------
   44|  32.3k|      (*this)[i] = Scalar(0);
   45|  32.3k|    }
   46|  16.1k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   54|   661k|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|   661k|    DRACO_DCHECK_EQ(dimension, 2);
   56|   661k|    v_[0] = c0;
   57|   661k|    v_[1] = c1;
   58|   661k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  114|  64.6k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  208|   250k|  bool operator==(const Self& o) const {
  209|   741k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (209:21): [True: 496k, False: 245k]
  ------------------
  210|   496k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (210:11): [True: 5.71k, False: 490k]
  ------------------
  211|  5.71k|        return false;
  212|  5.71k|      }
  213|   496k|    }
  214|   245k|    return true;
  215|   250k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  115|  1.48M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   42|  41.4M|  VectorD() {
   43|   165M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 124M, False: 41.4M]
  ------------------
   44|   124M|      (*this)[i] = Scalar(0);
   45|   124M|    }
   46|  41.4M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  236|  5.74k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  252|  5.79k|  Scalar Dot(const Self& o) const {
  253|  5.79k|    Scalar ret(0);
  254|  23.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (254:21): [True: 17.3k, False: 5.79k]
  ------------------
  255|  17.3k|      ret += (*this)[i] * o[i];
  256|  17.3k|    }
  257|  5.79k|    return ret;
  258|  5.79k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  139|     50|  Self operator-(const Self& o) const {
  140|     50|    Self ret;
  141|    150|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 100, False: 50]
  ------------------
  142|    100|      ret[i] = (*this)[i] - o[i];
  143|    100|    }
  144|     50|    return ret;
  145|     50|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  104|     72|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|    216|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 144, False: 72]
  ------------------
  106|    144|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 144, False: 0]
  ------------------
  107|    144|        v_[i] = Scalar(src_vector[i]);
  108|    144|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|    144|    }
  112|     72|  }
_ZNK5draco7VectorDImLi2EEmlERKm:
  176|     72|  Self operator*(const Scalar& o) const {
  177|     72|    Self ret;
  178|    216|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 144, False: 72]
  ------------------
  179|    144|      ret[i] = (*this)[i] * o;
  180|    144|    }
  181|     72|    return ret;
  182|     72|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   42|    108|  VectorD() {
   43|    324|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 216, False: 108]
  ------------------
   44|    216|      (*this)[i] = Scalar(0);
   45|    216|    }
   46|    108|  }
_ZNK5draco7VectorDImLi2EEixEi:
  115|    360|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  114|    432|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  131|     36|  Self operator+(const Self& o) const {
  132|     36|    Self ret;
  133|    108|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 72, False: 36]
  ------------------
  134|     72|      ret[i] = (*this)[i] + o[i];
  135|     72|    }
  136|     36|    return ret;
  137|     36|  }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  104|     36|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|    108|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 72, False: 36]
  ------------------
  106|     72|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 72, False: 0]
  ------------------
  107|     72|        v_[i] = Scalar(src_vector[i]);
  108|     72|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|     72|    }
  112|     36|  }
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  131|     33|  Self operator+(const Self& o) const {
  132|     33|    Self ret;
  133|    132|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 99, False: 33]
  ------------------
  134|     99|      ret[i] = (*this)[i] + o[i];
  135|     99|    }
  136|     33|    return ret;
  137|     33|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  294|     33|    const ScalarT& o, const VectorD<ScalarT, dimension_t>& v) {
  295|     33|  return v * o;
  296|     33|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  176|     33|  Self operator*(const Scalar& o) const {
  177|     33|    Self ret;
  178|    132|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 99, False: 33]
  ------------------
  179|     99|      ret[i] = (*this)[i] * o;
  180|     99|    }
  181|     33|    return ret;
  182|     33|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   54|   501k|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|   501k|    DRACO_DCHECK_EQ(dimension, 2);
   56|   501k|    v_[0] = c0;
   57|   501k|    v_[1] = c1;
   58|   501k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  176|     33|  Self operator*(const Scalar& o) const {
  177|     33|    Self ret;
  178|     99|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 66, False: 33]
  ------------------
  179|     66|      ret[i] = (*this)[i] * o;
  180|     66|    }
  181|     33|    return ret;
  182|     33|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   42|    116|  VectorD() {
   43|    348|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 232, False: 116]
  ------------------
   44|    232|      (*this)[i] = Scalar(0);
   45|    232|    }
   46|    116|  }
_ZN5draco7VectorDIlLi2EEixEi:
  114|    398|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   42|  2.66M|  VectorD() {
   43|  10.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 8.00M, False: 2.66M]
  ------------------
   44|  8.00M|      (*this)[i] = Scalar(0);
   45|  8.00M|    }
   46|  2.66M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   54|  9.40M|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|  9.40M|    DRACO_DCHECK_EQ(dimension, 2);
   56|  9.40M|    v_[0] = c0;
   57|  9.40M|    v_[1] = c1;
   58|  9.40M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  104|  6.90M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  20.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 13.8M, False: 6.90M]
  ------------------
  106|  13.8M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 13.8M, False: 0]
  ------------------
  107|  13.8M|        v_[i] = Scalar(src_vector[i]);
  108|  13.8M|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|  13.8M|    }
  112|  6.90M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   42|  3.45M|  VectorD() {
   43|  10.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 6.90M, False: 3.45M]
  ------------------
   44|  6.90M|      (*this)[i] = Scalar(0);
   45|  6.90M|    }
   46|  3.45M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  104|  3.45M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  10.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 6.90M, False: 3.45M]
  ------------------
  106|  6.90M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 6.90M, False: 0]
  ------------------
  107|  6.90M|        v_[i] = Scalar(src_vector[i]);
  108|  6.90M|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|  6.90M|    }
  112|  3.45M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   90|  5.63M|  VectorD(const Self& o) {
   91|  16.9M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (91:21): [True: 11.2M, False: 5.63M]
  ------------------
   92|  11.2M|      (*this)[i] = o[i];
   93|  11.2M|    }
   94|  5.63M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   42|  2.92M|  VectorD() {
   43|  8.76M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 5.84M, False: 2.92M]
  ------------------
   44|  5.84M|      (*this)[i] = Scalar(0);
   45|  5.84M|    }
   46|  2.92M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|   144M|  inline int num_vertices() const {
   74|   144M|    return static_cast<int>(vertex_corners_.size());
   75|   144M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  12.0M|  inline int num_corners() const {
   77|  12.0M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  12.0M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  3.22M|  inline int num_faces() const {
   80|  3.22M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  3.22M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   423M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   423M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 423M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   423M|    return opposite_corners_[corner];
   88|   423M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   681M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   681M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 19.4M, False: 662M]
  ------------------
   91|  19.4M|      return corner;
   92|  19.4M|    }
   93|   662M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 596M, False: 65.3M]
  ------------------
   94|   681M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   633M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   633M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 7.59M, False: 626M]
  ------------------
   97|  7.59M|      return corner;
   98|  7.59M|    }
   99|   626M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 182M, False: 443M]
  ------------------
  100|   633M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.15G|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|  1.15G|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1.15G]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|  1.15G|    return ConfidentVertex(corner);
  106|  1.15G|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  1.15G|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|  1.15G|    DRACO_DCHECK_GE(corner.value(), 0);
  109|  1.15G|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|  1.15G|    return corner_to_vertex_map_[corner];
  111|  1.15G|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  47.4M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  47.4M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 47.4M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  47.4M|    return FaceIndex(corner.value() / 3);
  117|  47.4M|  }
_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|  70.0M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  70.0M|    return vertex_corners_[v];
  152|  70.0M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.34M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.34M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.34M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 41.6k, False: 1.30M]
  ------------------
  188|  41.6k|      return true;
  189|  41.6k|    }
  190|  1.30M|    return false;
  191|  1.34M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|   103M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|   103M|    return Previous(Opposite(Previous(corner)));
  202|   103M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  15.8M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  15.8M|    return Next(Opposite(Next(corner)));
  207|  15.8M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  5.68M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  5.68M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 5.68M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  5.68M|    return Opposite(Previous(corner_id));
  222|  5.68M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  6.98M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  6.98M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 6.98M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  6.98M|    return Opposite(Next(corner_id));
  228|  6.98M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   437M|                                CornerIndex opp_corner_id) {
  249|   437M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   437M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   437M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   546M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   546M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   546M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   546M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|   154M|  VertexIndex AddNewVertex() {
  271|   154M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|   154M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|   154M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|   154M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   321M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   321M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   321M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 321M, False: 0]
  ------------------
  295|   321M|      vertex_corners_[vert] = corner;
  296|   321M|    }
  297|   321M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  4.36M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  4.36M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  4.36M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  4.36M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  3.58k|      : corner_table_(table),
  229|  3.58k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  3.58k|        corner_(start_corner_),
  231|  3.58k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  4.44M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  35.0k|  VertexCornersIterator& operator++() {
  268|  35.0k|    Next();
  269|  35.0k|    return *this;
  270|  35.0k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.79M|  void Next() {
  248|  3.79M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.75M, False: 45.5k]
  ------------------
  249|  3.75M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.75M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 24.0k, False: 3.73M]
  ------------------
  251|       |        // Open boundary reached.
  252|  24.0k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  24.0k|        left_traversal_ = false;
  254|  3.73M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 622k, False: 3.10M]
  ------------------
  255|       |        // End reached.
  256|   622k|        corner_ = kInvalidCornerIndex;
  257|   622k|      }
  258|  3.75M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  45.5k|      corner_ = corner_table_->SwingRight(corner_);
  262|  45.5k|    }
  263|  3.79M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  7.56M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  5.91M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  6.21M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  3.11M|  void Next() {
  248|  3.11M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.09M, False: 18.8k]
  ------------------
  249|  3.09M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.09M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 2.75M, False: 335k]
  ------------------
  251|       |        // Open boundary reached.
  252|  2.75M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  2.75M|        left_traversal_ = false;
  254|  2.75M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 53.9k, False: 281k]
  ------------------
  255|       |        // End reached.
  256|  53.9k|        corner_ = kInvalidCornerIndex;
  257|  53.9k|      }
  258|  3.09M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  18.8k|      corner_ = corner_table_->SwingRight(corner_);
  262|  18.8k|    }
  263|  3.11M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  2.80M|      : corner_table_(table),
  236|  2.80M|        start_corner_(corner_id),
  237|  2.80M|        corner_(start_corner_),
  238|  2.80M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   642k|      : corner_table_(table),
  236|   642k|        start_corner_(corner_id),
  237|   642k|        corner_(start_corner_),
  238|   642k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  82.0M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  82.0M|    return is_edge_on_seam_[corner.value()];
   47|  82.0M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  37.8M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  37.8M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 37.8M]
  |  Branch (50:42): [True: 34.4M, False: 3.41M]
  ------------------
   51|  34.4M|      return kInvalidCornerIndex;
   52|  34.4M|    }
   53|  3.41M|    return corner_table_->Opposite(corner);
   54|  37.8M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  45.4M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  45.4M|    return corner_table_->Next(corner);
   58|  45.4M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  28.0M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  28.0M|    return corner_table_->Previous(corner);
   62|  28.0M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  5.87M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  5.87M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  5.87M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.26M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  3.26M|    return Opposite(Previous(corner));
   73|  3.26M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  3.50M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  3.50M|    return Opposite(Next(corner));
   76|  3.50M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  7.26M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  7.26M|    return Previous(Opposite(Previous(corner)));
   81|  7.26M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  15.8M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  15.8M|    return Next(Opposite(Next(corner)));
   86|  15.8M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  14.7k|  int num_vertices() const {
   89|  14.7k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  14.7k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  4.08k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  2.54k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|   110M|  VertexIndex Vertex(CornerIndex corner) const {
   95|   110M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|   110M|    return ConfidentVertex(corner);
   97|   110M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|   110M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|   110M|    return corner_to_vertex_map_[corner.value()];
  100|   110M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  3.25M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  3.25M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  3.25M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  3.25M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  3.25M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  3.25M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 3.25M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  3.25M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 3.02M, False: 233k]
  ------------------
  128|  3.02M|      return true;
  129|  3.02M|    }
  130|   233k|    return false;
  131|  3.25M|  }

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

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

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

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

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

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

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

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

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

