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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  3.53k|      : quantization_bits_(-1),
   54|  3.53k|        max_quantized_value_(-1),
   55|  3.53k|        max_value_(-1),
   56|  3.53k|        dequantization_scale_(1.f),
   57|  3.53k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  3.21k|  bool SetQuantizationBits(int32_t q) {
   60|  3.21k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 1.16k, False: 2.05k]
  |  Branch (60:18): [True: 119, False: 1.93k]
  ------------------
   61|  1.28k|      return false;
   62|  1.28k|    }
   63|  1.93k|    quantization_bits_ = q;
   64|  1.93k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.93k|    max_value_ = max_quantized_value_ - 1;
   66|  1.93k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.93k|    center_value_ = max_value_ / 2;
   68|  1.93k|    return true;
   69|  3.21k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  4.18M|                                           int32_t *out_t) const {
   77|  4.18M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 3.21k, False: 4.18M]
  |  Branch (77:20): [True: 0, False: 3.21k]
  |  Branch (77:32): [True: 3.21k, False: 4.18M]
  |  Branch (77:42): [True: 0, False: 3.21k]
  ------------------
   78|  4.18M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 3.61M, False: 571k]
  |  Branch (78:29): [True: 4.69k, False: 3.60M]
  ------------------
   79|  4.69k|      s = max_value_;
   80|  4.69k|      t = max_value_;
   81|  4.17M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 3.21k, False: 4.17M]
  |  Branch (81:26): [True: 962, False: 2.25k]
  ------------------
   82|    962|      t = center_value_ - (t - center_value_);
   83|  4.17M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 3.60M, False: 570k]
  |  Branch (83:35): [True: 5.84k, False: 3.60M]
  ------------------
   84|  5.84k|      t = center_value_ + (center_value_ - t);
   85|  4.17M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 3.60M, False: 568k]
  |  Branch (85:35): [True: 501, False: 3.60M]
  ------------------
   86|    501|      s = center_value_ + (center_value_ - s);
   87|  4.17M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 4.35k, False: 4.16M]
  |  Branch (87:26): [True: 1.54k, False: 2.80k]
  ------------------
   88|  1.54k|      s = center_value_ - (s - center_value_);
   89|  1.54k|    }
   90|       |
   91|  4.18M|    *out_s = s;
   92|  4.18M|    *out_t = t;
   93|  4.18M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  4.18M|                                                       int32_t *out_t) const {
  100|  4.18M|    DRACO_DCHECK_EQ(
  101|  4.18M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  4.18M|        center_value_);
  103|  4.18M|    int32_t s, t;
  104|  4.18M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.90M, False: 2.27M]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.90M|      s = (int_vec[1] + center_value_);
  107|  1.90M|      t = (int_vec[2] + center_value_);
  108|  2.27M|    } else {
  109|       |      // Left hemisphere.
  110|  2.27M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 27.2k, False: 2.25M]
  ------------------
  111|  27.2k|        s = std::abs(int_vec[2]);
  112|  2.25M|      } else {
  113|  2.25M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  2.25M|      }
  115|  2.27M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 32.4k, False: 2.24M]
  ------------------
  116|  32.4k|        t = std::abs(int_vec[1]);
  117|  2.24M|      } else {
  118|  2.24M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  2.24M|      }
  120|  2.27M|    }
  121|  4.18M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  4.18M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  15.5M|                                                    float *out_vector) const {
  199|  15.5M|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  15.5M|                                 in_t * dequantization_scale_ - 1.f,
  201|  15.5M|                                 out_vector);
  202|  15.5M|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  2.91M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  2.91M|    DRACO_DCHECK_LE(s, center_value_);
  208|  2.91M|    DRACO_DCHECK_LE(t, center_value_);
  209|  2.91M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  2.91M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  2.91M|    const uint32_t st =
  212|  2.91M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  2.91M|    return st <= center_value_;
  214|  2.91M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  4.80M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  4.80M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  4.80M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  4.80M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  4.80M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  4.80M|    int32_t sign_s = 0;
  223|  4.80M|    int32_t sign_t = 0;
  224|  4.80M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 4.74M, False: 64.5k]
  |  Branch (224:20): [True: 4.70M, False: 42.5k]
  ------------------
  225|  4.70M|      sign_s = 1;
  226|  4.70M|      sign_t = 1;
  227|  4.70M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 66.6k, False: 40.4k]
  |  Branch (227:27): [True: 33.6k, False: 33.0k]
  ------------------
  228|  33.6k|      sign_s = -1;
  229|  33.6k|      sign_t = -1;
  230|  73.4k|    } else {
  231|  73.4k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 40.4k, False: 33.0k]
  ------------------
  232|  73.4k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 33.0k, False: 40.4k]
  ------------------
  233|  73.4k|    }
  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|  4.80M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  4.80M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  4.80M|    uint32_t us = *s;
  241|  4.80M|    uint32_t ut = *t;
  242|  4.80M|    us = us + us - corner_point_s;
  243|  4.80M|    ut = ut + ut - corner_point_t;
  244|  4.80M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 4.73M, False: 73.4k]
  ------------------
  245|  4.73M|      uint32_t temp = us;
  246|  4.73M|      us = -ut;
  247|  4.73M|      ut = -temp;
  248|  4.73M|    } else {
  249|  73.4k|      std::swap(us, ut);
  250|  73.4k|    }
  251|  4.80M|    us = us + corner_point_s;
  252|  4.80M|    ut = ut + corner_point_t;
  253|       |
  254|  4.80M|    *s = us;
  255|  4.80M|    *t = ut;
  256|  4.80M|    *s /= 2;
  257|  4.80M|    *t /= 2;
  258|  4.80M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  5.82M|  int32_t ModMax(int32_t x) const {
  273|  5.82M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 5.28k, False: 5.81M]
  ------------------
  274|  5.28k|      return x - this->max_quantized_value();
  275|  5.28k|    }
  276|  5.81M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 3.95k, False: 5.81M]
  ------------------
  277|  3.95k|      return x + this->max_quantized_value();
  278|  3.95k|    }
  279|  5.81M|    return x;
  280|  5.81M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.82k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  9.24k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  17.4M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  15.5M|                                           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.5M|    float y = in_s_scaled;
  329|  15.5M|    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.5M|    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.5M|    float x_offset = -x;
  342|  15.5M|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 141k, 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.5M|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 15.1M, False: 352k]
  ------------------
  348|  15.5M|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 15.1M, False: 352k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  15.5M|    const float norm_squared = x * x + y * y + z * z;
  352|  15.5M|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 15.5M]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  15.5M|    } else {
  357|  15.5M|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  15.5M|      out_vector[0] = x * d;
  359|  15.5M|      out_vector[1] = y * d;
  360|  15.5M|      out_vector[2] = z * d;
  361|  15.5M|    }
  362|  15.5M|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  4.18M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  4.18M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  4.18M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  4.18M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  4.18M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  4.18M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  4.18M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 4.01M, False: 166k]
  ------------------
  181|  4.01M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  4.01M|    } else {
  183|   166k|      vec[0] =
  184|   166k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   166k|          abs_sum;
  186|   166k|      vec[1] =
  187|   166k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   166k|          abs_sum;
  189|   166k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 93.3k, False: 72.7k]
  ------------------
  190|  93.3k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|  93.3k|      } else {
  192|  72.7k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|  72.7k|      }
  194|   166k|    }
  195|  4.18M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    740|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    740|            attribute, transform, mesh_data),
   52|    740|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    734|                                                                *buffer) {
  197|    734|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    734|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    734|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 25, False: 709]
  ------------------
  199|       |    // Decode prediction mode.
  200|     25|    uint8_t mode;
  201|     25|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 1, False: 24]
  ------------------
  202|      1|      return false;
  203|      1|    }
  204|       |
  205|     24|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 22, False: 2]
  ------------------
  206|       |      // Unsupported mode.
  207|     22|      return false;
  208|     22|    }
  209|     24|  }
  210|    711|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  3.23k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 2.64k, False: 589]
  ------------------
  214|  2.64k|    uint32_t num_flags;
  215|  2.64k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 12, False: 2.63k]
  ------------------
  216|     12|      return false;
  217|     12|    }
  218|  2.63k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 84, False: 2.54k]
  ------------------
  219|     84|      return false;
  220|     84|    }
  221|  2.54k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 695, False: 1.85k]
  ------------------
  222|    695|      is_crease_edge_[i].resize(num_flags);
  223|    695|      RAnsBitDecoder decoder;
  224|    695|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 26, False: 669]
  ------------------
  225|     26|        return false;
  226|     26|      }
  227|  1.21M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 1.21M, False: 669]
  ------------------
  228|  1.21M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  1.21M|      }
  230|    669|      decoder.EndDecoding();
  231|    669|    }
  232|  2.54k|  }
  233|    589|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    589|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    711|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    537|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    537|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    537|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  2.68k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 2.14k, False: 537]
  ------------------
   93|  2.14k|    pred_vals[i].resize(num_components, 0);
   94|  2.14k|  }
   95|    537|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    537|                                         out_data);
   97|       |
   98|    537|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    537|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    537|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    537|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    537|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    537|  const int corner_map_size =
  109|    537|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    537|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 537]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   690k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 689k, False: 348]
  ------------------
  114|   689k|    const CornerIndex start_corner_id =
  115|   689k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   689k|    CornerIndex corner_id(start_corner_id);
  118|   689k|    int num_parallelograms = 0;
  119|   689k|    bool first_pass = true;
  120|  1.49M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 824k, False: 665k]
  ------------------
  121|   824k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 51.8k, False: 772k]
  ------------------
  122|   824k|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|   824k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|  51.8k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|  51.8k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 364, False: 51.4k]
  ------------------
  130|    364|          break;
  131|    364|        }
  132|  51.8k|      }
  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|   824k|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 815k, False: 8.27k]
  ------------------
  137|   815k|        corner_id = table->SwingLeft(corner_id);
  138|   815k|      } else {
  139|  8.27k|        corner_id = table->SwingRight(corner_id);
  140|  8.27k|      }
  141|   824k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 23.8k, False: 800k]
  ------------------
  142|  23.8k|        break;
  143|  23.8k|      }
  144|   800k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 669k, False: 130k]
  |  Branch (144:47): [True: 665k, False: 3.51k]
  ------------------
  145|   665k|        first_pass = false;
  146|   665k|        corner_id = table->SwingRight(start_corner_id);
  147|   665k|      }
  148|   800k|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   689k|    int num_used_parallelograms = 0;
  153|   689k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 29.2k, False: 660k]
  ------------------
  154|  1.11M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 1.08M, False: 29.2k]
  ------------------
  155|  1.08M|        multi_pred_vals[i] = 0;
  156|  1.08M|      }
  157|       |      // Check which parallelograms are actually used.
  158|  80.7k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 51.7k, False: 29.0k]
  ------------------
  159|  51.7k|        const int context = num_parallelograms - 1;
  160|  51.7k|        const int pos = is_crease_edge_pos[context]++;
  161|  51.7k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 189, False: 51.5k]
  ------------------
  162|    189|          return false;
  163|    189|        }
  164|  51.5k|        const bool is_crease = is_crease_edge_[context][pos];
  165|  51.5k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 24.2k, False: 27.3k]
  ------------------
  166|  24.2k|          ++num_used_parallelograms;
  167|  1.19M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 1.17M, False: 24.2k]
  ------------------
  168|  1.17M|            multi_pred_vals[j] =
  169|  1.17M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|  1.17M|          }
  171|  24.2k|        }
  172|  51.5k|      }
  173|  29.2k|    }
  174|   689k|    const int dst_offset = p * num_components;
  175|   689k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 677k, False: 12.5k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|   677k|      const int src_offset = (p - 1) * num_components;
  179|   677k|      this->transform().ComputeOriginalValue(
  180|   677k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|   677k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|   623k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 611k, False: 12.5k]
  ------------------
  184|   611k|        multi_pred_vals[c] /= num_used_parallelograms;
  185|   611k|      }
  186|  12.5k|      this->transform().ComputeOriginalValue(
  187|  12.5k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  12.5k|    }
  189|   689k|  }
  190|    348|  return true;
  191|    537|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    622|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    622|            attribute, transform, mesh_data),
   52|    622|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    608|                                                                *buffer) {
  197|    608|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    608|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    608|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 3, False: 605]
  ------------------
  199|       |    // Decode prediction mode.
  200|      3|    uint8_t mode;
  201|      3|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 1, False: 2]
  ------------------
  202|      1|      return false;
  203|      1|    }
  204|       |
  205|      2|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 1, False: 1]
  ------------------
  206|       |      // Unsupported mode.
  207|      1|      return false;
  208|      1|    }
  209|      2|  }
  210|    606|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  2.65k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 2.17k, False: 475]
  ------------------
  214|  2.17k|    uint32_t num_flags;
  215|  2.17k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 16, False: 2.16k]
  ------------------
  216|     16|      return false;
  217|     16|    }
  218|  2.16k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 81, False: 2.08k]
  ------------------
  219|     81|      return false;
  220|     81|    }
  221|  2.08k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 865, False: 1.21k]
  ------------------
  222|    865|      is_crease_edge_[i].resize(num_flags);
  223|    865|      RAnsBitDecoder decoder;
  224|    865|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 34, False: 831]
  ------------------
  225|     34|        return false;
  226|     34|      }
  227|  1.70M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 1.70M, False: 831]
  ------------------
  228|  1.70M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  1.70M|      }
  230|    831|      decoder.EndDecoding();
  231|    831|    }
  232|  2.08k|  }
  233|    475|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    475|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    606|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    424|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    424|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    424|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  2.12k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.69k, False: 424]
  ------------------
   93|  1.69k|    pred_vals[i].resize(num_components, 0);
   94|  1.69k|  }
   95|    424|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    424|                                         out_data);
   97|       |
   98|    424|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    424|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    424|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    424|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    424|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    424|  const int corner_map_size =
  109|    424|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    424|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 424]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   150k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 150k, False: 177]
  ------------------
  114|   150k|    const CornerIndex start_corner_id =
  115|   150k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   150k|    CornerIndex corner_id(start_corner_id);
  118|   150k|    int num_parallelograms = 0;
  119|   150k|    bool first_pass = true;
  120|   875k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 867k, False: 8.16k]
  ------------------
  121|   867k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 280k, False: 586k]
  ------------------
  122|   867k|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|   867k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|   280k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|   280k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 642, False: 280k]
  ------------------
  130|    642|          break;
  131|    642|        }
  132|   280k|      }
  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|   866k|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 859k, False: 7.12k]
  ------------------
  137|   859k|        corner_id = table->SwingLeft(corner_id);
  138|   859k|      } else {
  139|  7.12k|        corner_id = table->SwingRight(corner_id);
  140|  7.12k|      }
  141|   866k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 141k, False: 724k]
  ------------------
  142|   141k|        break;
  143|   141k|      }
  144|   724k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 11.8k, False: 712k]
  |  Branch (144:47): [True: 8.16k, False: 3.71k]
  ------------------
  145|  8.16k|        first_pass = false;
  146|  8.16k|        corner_id = table->SwingRight(start_corner_id);
  147|  8.16k|      }
  148|   724k|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   150k|    int num_used_parallelograms = 0;
  153|   150k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 144k, False: 6.15k]
  ------------------
  154|  19.8M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 19.7M, False: 144k]
  ------------------
  155|  19.7M|        multi_pred_vals[i] = 0;
  156|  19.7M|      }
  157|       |      // Check which parallelograms are actually used.
  158|   424k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 280k, False: 144k]
  ------------------
  159|   280k|        const int context = num_parallelograms - 1;
  160|   280k|        const int pos = is_crease_edge_pos[context]++;
  161|   280k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 247, False: 280k]
  ------------------
  162|    247|          return false;
  163|    247|        }
  164|   280k|        const bool is_crease = is_crease_edge_[context][pos];
  165|   280k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 176k, False: 104k]
  ------------------
  166|   176k|          ++num_used_parallelograms;
  167|  33.2M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 33.0M, False: 176k]
  ------------------
  168|  33.0M|            multi_pred_vals[j] =
  169|  33.0M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|  33.0M|          }
  171|   176k|        }
  172|   280k|      }
  173|   144k|    }
  174|   150k|    const int dst_offset = p * num_components;
  175|   150k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 61.3k, False: 88.9k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|  61.3k|      const int src_offset = (p - 1) * num_components;
  179|  61.3k|      this->transform().ComputeOriginalValue(
  180|  61.3k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|  88.9k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|  16.6M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 16.5M, False: 88.9k]
  ------------------
  184|  16.5M|        multi_pred_vals[c] /= num_used_parallelograms;
  185|  16.5M|      }
  186|  88.9k|      this->transform().ComputeOriginalValue(
  187|  88.9k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  88.9k|    }
  189|   150k|  }
  190|    177|  return true;
  191|    424|}

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

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   721k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   176k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  1.55M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   198k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  3.41k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  3.41k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  11.1M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  3.11k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  3.11k|        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|    199|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    199|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    210|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    210|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    224|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    224|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    226|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    226|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    395|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    199|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    199|    DRACO_DCHECK_EQ(i, 0);
   70|    199|    (void)i;
   71|    199|    return GeometryAttribute::POSITION;
   72|    199|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    198|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    198|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 198]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    198|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 196]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    196|    predictor_.SetPositionAttribute(*att);
   82|    196|    return true;
   83|    198|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    196|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    196|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 6, False: 190]
  ------------------
  148|      6|    return false;
  149|      6|  }
  150|       |
  151|    190|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    190|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    190|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 53, False: 137]
  ------------------
  153|     53|    uint8_t prediction_mode;
  154|     53|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 52]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     52|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 51]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     51|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 51]
  ------------------
  163|     51|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     51|  }
  167|    188|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    188|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 12, False: 176]
  ------------------
  171|     12|    return false;
  172|     12|  }
  173|       |
  174|    176|  return true;
  175|    188|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    176|                                      const PointIndex *entry_to_point_id_map) {
  103|    176|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    176|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    176|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    176|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    176|  const int corner_map_size =
  111|    176|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    176|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 176]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    176|  VectorD<int32_t, 3> pred_normal_3d;
  117|    176|  int32_t pred_normal_oct[2];
  118|       |
  119|   721k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 721k, False: 176]
  ------------------
  120|   721k|    const CornerIndex corner_id =
  121|   721k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   721k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   721k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   721k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   721k|                    octahedron_tool_box_.center_value());
  128|   721k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 672k, False: 49.2k]
  ------------------
  129|   672k|      pred_normal_3d = -pred_normal_3d;
  130|   672k|    }
  131|   721k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   721k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   721k|    const int data_offset = data_id * 2;
  135|   721k|    this->transform().ComputeOriginalValue(
  136|   721k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   721k|  }
  138|    176|  flip_normal_bit_decoder_.EndDecoding();
  139|    176|  return true;
  140|    176|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    176|  void SetQuantizationBits(int q) {
   85|    176|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    176|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    417|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    210|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    210|    DRACO_DCHECK_EQ(i, 0);
   70|    210|    (void)i;
   71|    210|    return GeometryAttribute::POSITION;
   72|    210|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    210|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    210|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 210]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    210|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 207]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    207|    predictor_.SetPositionAttribute(*att);
   82|    207|    return true;
   83|    210|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    207|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    207|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 6, False: 201]
  ------------------
  148|      6|    return false;
  149|      6|  }
  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: 64, False: 137]
  ------------------
  153|     64|    uint8_t prediction_mode;
  154|     64|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 63]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     63|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 62]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     62|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 62]
  ------------------
  163|     62|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     62|  }
  167|    199|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    199|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 5, False: 194]
  ------------------
  171|      5|    return false;
  172|      5|  }
  173|       |
  174|    194|  return true;
  175|    199|}
_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|   176k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 176k, False: 194]
  ------------------
  120|   176k|    const CornerIndex corner_id =
  121|   176k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   176k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   176k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   176k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   176k|                    octahedron_tool_box_.center_value());
  128|   176k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 134k, False: 41.5k]
  ------------------
  129|   134k|      pred_normal_3d = -pred_normal_3d;
  130|   134k|    }
  131|   176k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   176k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   176k|    const int data_offset = data_id * 2;
  135|   176k|    this->transform().ComputeOriginalValue(
  136|   176k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   176k|  }
  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|    445|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    224|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    224|    DRACO_DCHECK_EQ(i, 0);
   70|    224|    (void)i;
   71|    224|    return GeometryAttribute::POSITION;
   72|    224|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    224|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    224|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 224]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    224|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 221]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    221|    predictor_.SetPositionAttribute(*att);
   82|    221|    return true;
   83|    224|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    221|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    221|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 10, False: 211]
  ------------------
  148|     10|    return false;
  149|     10|  }
  150|       |
  151|    211|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    211|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    211|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 59, False: 152]
  ------------------
  153|     59|    uint8_t prediction_mode;
  154|     59|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 58]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     58|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 56]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     56|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 56]
  ------------------
  163|     56|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     56|  }
  167|    208|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    208|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 22, False: 186]
  ------------------
  171|     22|    return false;
  172|     22|  }
  173|       |
  174|    186|  return true;
  175|    208|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    186|                                      const PointIndex *entry_to_point_id_map) {
  103|    186|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    186|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    186|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    186|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    186|  const int corner_map_size =
  111|    186|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    186|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 186]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    186|  VectorD<int32_t, 3> pred_normal_3d;
  117|    186|  int32_t pred_normal_oct[2];
  118|       |
  119|  1.55M|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 1.55M, False: 186]
  ------------------
  120|  1.55M|    const CornerIndex corner_id =
  121|  1.55M|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|  1.55M|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|  1.55M|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|  1.55M|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|  1.55M|                    octahedron_tool_box_.center_value());
  128|  1.55M|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 1.24M, False: 308k]
  ------------------
  129|  1.24M|      pred_normal_3d = -pred_normal_3d;
  130|  1.24M|    }
  131|  1.55M|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|  1.55M|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|  1.55M|    const int data_offset = data_id * 2;
  135|  1.55M|    this->transform().ComputeOriginalValue(
  136|  1.55M|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|  1.55M|  }
  138|    186|  flip_normal_bit_decoder_.EndDecoding();
  139|    186|  return true;
  140|    186|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    186|  void SetQuantizationBits(int q) {
   85|    186|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    186|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    448|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    226|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    226|    DRACO_DCHECK_EQ(i, 0);
   70|    226|    (void)i;
   71|    226|    return GeometryAttribute::POSITION;
   72|    226|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    226|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    226|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 226]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    226|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 4, False: 222]
  ------------------
   79|      4|      return false;  // Currently works only for 3 component positions.
   80|      4|    }
   81|    222|    predictor_.SetPositionAttribute(*att);
   82|    222|    return true;
   83|    226|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    222|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    222|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 6, False: 216]
  ------------------
  148|      6|    return false;
  149|      6|  }
  150|       |
  151|    216|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    216|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    216|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 53, False: 163]
  ------------------
  153|     53|    uint8_t prediction_mode;
  154|     53|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 52]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     52|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 6, False: 46]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      6|      return false;
  160|      6|    }
  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|    209|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    209|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 5, False: 204]
  ------------------
  171|      5|    return false;
  172|      5|  }
  173|       |
  174|    204|  return true;
  175|    209|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    204|                                      const PointIndex *entry_to_point_id_map) {
  103|    204|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    204|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    204|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    204|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    204|  const int corner_map_size =
  111|    204|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    204|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 204]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    204|  VectorD<int32_t, 3> pred_normal_3d;
  117|    204|  int32_t pred_normal_oct[2];
  118|       |
  119|   198k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 198k, False: 204]
  ------------------
  120|   198k|    const CornerIndex corner_id =
  121|   198k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   198k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   198k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   198k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   198k|                    octahedron_tool_box_.center_value());
  128|   198k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 169k, False: 29.1k]
  ------------------
  129|   169k|      pred_normal_3d = -pred_normal_3d;
  130|   169k|    }
  131|   198k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   198k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   198k|    const int data_offset = data_id * 2;
  135|   198k|    this->transform().ComputeOriginalValue(
  136|   198k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   198k|  }
  138|    204|  flip_normal_bit_decoder_.EndDecoding();
  139|    204|  return true;
  140|    204|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    204|  void SetQuantizationBits(int q) {
   85|    204|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    204|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    507|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    507|            attribute, transform, mesh_data),
   37|    507|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|  1.00k|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    507|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    507|    DRACO_DCHECK_EQ(i, 0);
   70|    507|    (void)i;
   71|    507|    return GeometryAttribute::POSITION;
   72|    507|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    505|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    505|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 505]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    505|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 502]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    502|    predictor_.SetPositionAttribute(*att);
   82|    502|    return true;
   83|    505|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    498|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    498|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 25, False: 473]
  ------------------
  148|     25|    return false;
  149|     25|  }
  150|       |
  151|    473|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    473|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    473|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 264, False: 209]
  ------------------
  153|    264|    uint8_t prediction_mode;
  154|    264|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 263]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|    263|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 3, False: 260]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      3|      return false;
  160|      3|    }
  161|       |
  162|    260|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 260]
  ------------------
  163|    260|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|    260|  }
  167|    469|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    469|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 40, False: 429]
  ------------------
  171|     40|    return false;
  172|     40|  }
  173|       |
  174|    429|  return true;
  175|    469|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    429|                                      const PointIndex *entry_to_point_id_map) {
  103|    429|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    429|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    429|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    429|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    429|  const int corner_map_size =
  111|    429|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    429|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 429]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    429|  VectorD<int32_t, 3> pred_normal_3d;
  117|    429|  int32_t pred_normal_oct[2];
  118|       |
  119|  1.31M|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 1.31M, False: 429]
  ------------------
  120|  1.31M|    const CornerIndex corner_id =
  121|  1.31M|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|  1.31M|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|  1.31M|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|  1.31M|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|  1.31M|                    octahedron_tool_box_.center_value());
  128|  1.31M|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 1.18M, False: 126k]
  ------------------
  129|  1.18M|      pred_normal_3d = -pred_normal_3d;
  130|  1.18M|    }
  131|  1.31M|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|  1.31M|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|  1.31M|    const int data_offset = data_id * 2;
  135|  1.31M|    this->transform().ComputeOriginalValue(
  136|  1.31M|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|  1.31M|  }
  138|    429|  flip_normal_bit_decoder_.EndDecoding();
  139|    429|  return true;
  140|    429|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    429|  void SetQuantizationBits(int q) {
   85|    429|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    429|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    607|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    607|            attribute, transform, mesh_data),
   37|    607|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|  1.21k|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    607|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    607|    DRACO_DCHECK_EQ(i, 0);
   70|    607|    (void)i;
   71|    607|    return GeometryAttribute::POSITION;
   72|    607|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    606|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    606|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 606]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    606|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 604]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    604|    predictor_.SetPositionAttribute(*att);
   82|    604|    return true;
   83|    606|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    599|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    599|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 16, False: 583]
  ------------------
  148|     16|    return false;
  149|     16|  }
  150|       |
  151|    583|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    583|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    583|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 238, False: 345]
  ------------------
  153|    238|    uint8_t prediction_mode;
  154|    238|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 237]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|    237|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 235]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|    235|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 235]
  ------------------
  163|    235|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|    235|  }
  167|    580|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    580|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 45, False: 535]
  ------------------
  171|     45|    return false;
  172|     45|  }
  173|       |
  174|    535|  return true;
  175|    580|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    535|                                      const PointIndex *entry_to_point_id_map) {
  103|    535|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    535|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    535|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    535|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    535|  const int corner_map_size =
  111|    535|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    535|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 535]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    535|  VectorD<int32_t, 3> pred_normal_3d;
  117|    535|  int32_t pred_normal_oct[2];
  118|       |
  119|   224k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 223k, False: 535]
  ------------------
  120|   223k|    const CornerIndex corner_id =
  121|   223k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   223k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   223k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   223k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   223k|                    octahedron_tool_box_.center_value());
  128|   223k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 211k, False: 12.3k]
  ------------------
  129|   211k|      pred_normal_3d = -pred_normal_3d;
  130|   211k|    }
  131|   223k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   223k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   223k|    const int data_offset = data_id * 2;
  135|   223k|    this->transform().ComputeOriginalValue(
  136|   223k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   223k|  }
  138|    535|  flip_normal_bit_decoder_.EndDecoding();
  139|    535|  return true;
  140|    535|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    535|  void SetQuantizationBits(int q) {
   85|    535|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    535|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    199|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    199|            attribute, transform, mesh_data),
   37|    199|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    210|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    210|            attribute, transform, mesh_data),
   37|    210|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    224|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    224|            attribute, transform, mesh_data),
   37|    224|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    226|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    226|            attribute, transform, mesh_data),
   37|    226|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    250|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    250|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 49, False: 201]
  ------------------
  105|     49|      this->normal_prediction_mode_ = mode;
  106|     49|      return true;
  107|    201|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 201, False: 0]
  ------------------
  108|    201|      this->normal_prediction_mode_ = mode;
  109|    201|      return true;
  110|    201|    }
  111|      0|    return false;
  112|    250|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   721k|                             DataTypeT *prediction) override {
   42|   721k|    DRACO_DCHECK(this->IsInitialized());
   43|   721k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   721k|    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|   721k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   721k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   721k|    VectorD<int64_t, 3> normal;
   53|   721k|    CornerIndex c_next, c_prev;
   54|  1.46M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 739k, False: 721k]
  ------------------
   55|       |      // Getting corners.
   56|   739k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 240, False: 739k]
  ------------------
   57|    240|        c_next = corner_table->Next(corner_id);
   58|    240|        c_prev = corner_table->Previous(corner_id);
   59|   739k|      } else {
   60|   739k|        c_next = corner_table->Next(cit.Corner());
   61|   739k|        c_prev = corner_table->Previous(cit.Corner());
   62|   739k|      }
   63|   739k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   739k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   739k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   739k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   739k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   739k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   739k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   739k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   739k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   739k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   739k|      cit.Next();
   81|   739k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   721k|    constexpr int64_t upper_bound = 1 << 29;
   85|   721k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 162, False: 721k]
  ------------------
   86|    162|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    162|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 49, False: 113]
  ------------------
   88|     49|        const int64_t quotient = abs_sum / upper_bound;
   89|     49|        normal = normal / quotient;
   90|     49|      }
   91|   721k|    } else {
   92|   721k|      const int64_t abs_sum = normal.AbsSum();
   93|   721k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.18k, False: 717k]
  ------------------
   94|  3.18k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.18k|        normal = normal / quotient;
   96|  3.18k|      }
   97|   721k|    }
   98|   721k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   721k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   721k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   721k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   721k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    272|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    272|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 60, False: 212]
  ------------------
  105|     60|      this->normal_prediction_mode_ = mode;
  106|     60|      return true;
  107|    212|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 212, False: 0]
  ------------------
  108|    212|      this->normal_prediction_mode_ = mode;
  109|    212|      return true;
  110|    212|    }
  111|      0|    return false;
  112|    272|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   176k|                             DataTypeT *prediction) override {
   42|   176k|    DRACO_DCHECK(this->IsInitialized());
   43|   176k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   176k|    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|   176k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   176k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   176k|    VectorD<int64_t, 3> normal;
   53|   176k|    CornerIndex c_next, c_prev;
   54|  1.22M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.04M, False: 176k]
  ------------------
   55|       |      // Getting corners.
   56|  1.04M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 342, False: 1.04M]
  ------------------
   57|    342|        c_next = corner_table->Next(corner_id);
   58|    342|        c_prev = corner_table->Previous(corner_id);
   59|  1.04M|      } else {
   60|  1.04M|        c_next = corner_table->Next(cit.Corner());
   61|  1.04M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.04M|      }
   63|  1.04M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.04M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.04M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.04M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.04M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.04M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.04M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.04M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.04M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.04M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.04M|      cit.Next();
   81|  1.04M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   176k|    constexpr int64_t upper_bound = 1 << 29;
   85|   176k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 228, False: 176k]
  ------------------
   86|    228|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    228|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 68, False: 160]
  ------------------
   88|     68|        const int64_t quotient = abs_sum / upper_bound;
   89|     68|        normal = normal / quotient;
   90|     68|      }
   91|   176k|    } else {
   92|   176k|      const int64_t abs_sum = normal.AbsSum();
   93|   176k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 66.8k, False: 109k]
  ------------------
   94|  66.8k|        const int64_t quotient = abs_sum / upper_bound;
   95|  66.8k|        normal = normal / quotient;
   96|  66.8k|      }
   97|   176k|    }
   98|   176k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   176k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   176k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   176k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   176k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    280|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    280|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 54, False: 226]
  ------------------
  105|     54|      this->normal_prediction_mode_ = mode;
  106|     54|      return true;
  107|    226|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 226, False: 0]
  ------------------
  108|    226|      this->normal_prediction_mode_ = mode;
  109|    226|      return true;
  110|    226|    }
  111|      0|    return false;
  112|    280|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  1.55M|                             DataTypeT *prediction) override {
   42|  1.55M|    DRACO_DCHECK(this->IsInitialized());
   43|  1.55M|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  1.55M|    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.55M|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  1.55M|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  1.55M|    VectorD<int64_t, 3> normal;
   53|  1.55M|    CornerIndex c_next, c_prev;
   54|  3.49M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.94M, False: 1.55M]
  ------------------
   55|       |      // Getting corners.
   56|  1.94M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 240, False: 1.94M]
  ------------------
   57|    240|        c_next = corner_table->Next(corner_id);
   58|    240|        c_prev = corner_table->Previous(corner_id);
   59|  1.94M|      } else {
   60|  1.94M|        c_next = corner_table->Next(cit.Corner());
   61|  1.94M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.94M|      }
   63|  1.94M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.94M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.94M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.94M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.94M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.94M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.94M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.94M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.94M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.94M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.94M|      cit.Next();
   81|  1.94M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  1.55M|    constexpr int64_t upper_bound = 1 << 29;
   85|  1.55M|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 160, False: 1.55M]
  ------------------
   86|    160|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    160|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 48, False: 112]
  ------------------
   88|     48|        const int64_t quotient = abs_sum / upper_bound;
   89|     48|        normal = normal / quotient;
   90|     48|      }
   91|  1.55M|    } else {
   92|  1.55M|      const int64_t abs_sum = normal.AbsSum();
   93|  1.55M|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.74k, False: 1.55M]
  ------------------
   94|  1.74k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.74k|        normal = normal / quotient;
   96|  1.74k|      }
   97|  1.55M|    }
   98|  1.55M|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  1.55M|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  1.55M|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  1.55M|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  1.55M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    272|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    272|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 44, False: 228]
  ------------------
  105|     44|      this->normal_prediction_mode_ = mode;
  106|     44|      return true;
  107|    228|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 228, False: 0]
  ------------------
  108|    228|      this->normal_prediction_mode_ = mode;
  109|    228|      return true;
  110|    228|    }
  111|      0|    return false;
  112|    272|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   198k|                             DataTypeT *prediction) override {
   42|   198k|    DRACO_DCHECK(this->IsInitialized());
   43|   198k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   198k|    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|   198k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   198k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   198k|    VectorD<int64_t, 3> normal;
   53|   198k|    CornerIndex c_next, c_prev;
   54|  1.37M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.17M, False: 198k]
  ------------------
   55|       |      // Getting corners.
   56|  1.17M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 258, False: 1.17M]
  ------------------
   57|    258|        c_next = corner_table->Next(corner_id);
   58|    258|        c_prev = corner_table->Previous(corner_id);
   59|  1.17M|      } else {
   60|  1.17M|        c_next = corner_table->Next(cit.Corner());
   61|  1.17M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.17M|      }
   63|  1.17M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.17M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.17M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.17M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.17M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.17M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.17M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.17M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.17M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.17M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.17M|      cit.Next();
   81|  1.17M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   198k|    constexpr int64_t upper_bound = 1 << 29;
   85|   198k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 172, False: 198k]
  ------------------
   86|    172|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    172|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 45, False: 127]
  ------------------
   88|     45|        const int64_t quotient = abs_sum / upper_bound;
   89|     45|        normal = normal / quotient;
   90|     45|      }
   91|   198k|    } else {
   92|   198k|      const int64_t abs_sum = normal.AbsSum();
   93|   198k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 68.8k, False: 129k]
  ------------------
   94|  68.8k|        const int64_t quotient = abs_sum / upper_bound;
   95|  68.8k|        normal = normal / quotient;
   96|  68.8k|      }
   97|   198k|    }
   98|   198k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   198k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   198k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   198k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   198k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    507|      : Base(md) {
   35|    507|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    507|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    767|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    767|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 249, False: 518]
  ------------------
  105|    249|      this->normal_prediction_mode_ = mode;
  106|    249|      return true;
  107|    518|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 518, False: 0]
  ------------------
  108|    518|      this->normal_prediction_mode_ = mode;
  109|    518|      return true;
  110|    518|    }
  111|      0|    return false;
  112|    767|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  1.31M|                             DataTypeT *prediction) override {
   42|  1.31M|    DRACO_DCHECK(this->IsInitialized());
   43|  1.31M|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  1.31M|    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.31M|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  1.31M|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  1.31M|    VectorD<int64_t, 3> normal;
   53|  1.31M|    CornerIndex c_next, c_prev;
   54|  2.66M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.35M, False: 1.31M]
  ------------------
   55|       |      // Getting corners.
   56|  1.35M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 1.41k, False: 1.35M]
  ------------------
   57|  1.41k|        c_next = corner_table->Next(corner_id);
   58|  1.41k|        c_prev = corner_table->Previous(corner_id);
   59|  1.35M|      } else {
   60|  1.35M|        c_next = corner_table->Next(cit.Corner());
   61|  1.35M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.35M|      }
   63|  1.35M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.35M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.35M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.35M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.35M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.35M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.35M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.35M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.35M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.35M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.35M|      cit.Next();
   81|  1.35M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  1.31M|    constexpr int64_t upper_bound = 1 << 29;
   85|  1.31M|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 938, False: 1.31M]
  ------------------
   86|    938|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    938|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 298, False: 640]
  ------------------
   88|    298|        const int64_t quotient = abs_sum / upper_bound;
   89|    298|        normal = normal / quotient;
   90|    298|      }
   91|  1.31M|    } else {
   92|  1.31M|      const int64_t abs_sum = normal.AbsSum();
   93|  1.31M|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.91k, False: 1.30M]
  ------------------
   94|  1.91k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.91k|        normal = normal / quotient;
   96|  1.91k|      }
   97|  1.31M|    }
   98|  1.31M|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  1.31M|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  1.31M|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  1.31M|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  1.31M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    607|      : Base(md) {
   35|    607|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    607|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    842|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    842|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 231, False: 611]
  ------------------
  105|    231|      this->normal_prediction_mode_ = mode;
  106|    231|      return true;
  107|    611|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 611, False: 0]
  ------------------
  108|    611|      this->normal_prediction_mode_ = mode;
  109|    611|      return true;
  110|    611|    }
  111|      0|    return false;
  112|    842|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   223k|                             DataTypeT *prediction) override {
   42|   223k|    DRACO_DCHECK(this->IsInitialized());
   43|   223k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   223k|    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|   223k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   223k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   223k|    VectorD<int64_t, 3> normal;
   53|   223k|    CornerIndex c_next, c_prev;
   54|  1.49M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.27M, False: 223k]
  ------------------
   55|       |      // Getting corners.
   56|  1.27M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 1.33k, False: 1.26M]
  ------------------
   57|  1.33k|        c_next = corner_table->Next(corner_id);
   58|  1.33k|        c_prev = corner_table->Previous(corner_id);
   59|  1.26M|      } else {
   60|  1.26M|        c_next = corner_table->Next(cit.Corner());
   61|  1.26M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.26M|      }
   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|   223k|    constexpr int64_t upper_bound = 1 << 29;
   85|   223k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 887, False: 222k]
  ------------------
   86|    887|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    887|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 233, False: 654]
  ------------------
   88|    233|        const int64_t quotient = abs_sum / upper_bound;
   89|    233|        normal = normal / quotient;
   90|    233|      }
   91|   222k|    } else {
   92|   222k|      const int64_t abs_sum = normal.AbsSum();
   93|   222k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.79k, False: 220k]
  ------------------
   94|  2.79k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.79k|        normal = normal / quotient;
   96|  2.79k|      }
   97|   222k|    }
   98|   223k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   223k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   223k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   223k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   223k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    199|      : Base(md) {
   35|    199|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    199|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    210|      : Base(md) {
   35|    210|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    210|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    224|      : Base(md) {
   35|    224|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    224|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    226|      : Base(md) {
   35|    226|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    226|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.20M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.20M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.20M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.20M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.20M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.20M|    return GetPositionForDataId(data_id);
   77|  2.20M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.20M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.20M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.20M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.20M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.20M|    VectorD<int64_t, 3> pos;
   68|  2.20M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.20M|    return pos;
   70|  2.20M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    196|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    196|    pos_attribute_ = &position_attribute;
   43|    196|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    176|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    176|    entry_to_point_id_map_ = map;
   46|    176|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.27M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.27M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.27M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.27M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.27M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.27M|    return GetPositionForDataId(data_id);
   77|  2.27M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.27M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.27M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.27M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.27M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.27M|    VectorD<int64_t, 3> pos;
   68|  2.27M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.27M|    return pos;
   70|  2.27M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    207|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    207|    pos_attribute_ = &position_attribute;
   43|    207|  }
_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|  5.44M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  5.44M|    DRACO_DCHECK(this->IsInitialized());
   73|  5.44M|    const auto corner_table = mesh_data_.corner_table();
   74|  5.44M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  5.44M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  5.44M|    return GetPositionForDataId(data_id);
   77|  5.44M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  5.44M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  5.44M|    DRACO_DCHECK(this->IsInitialized());
   65|  5.44M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  5.44M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  5.44M|    VectorD<int64_t, 3> pos;
   68|  5.44M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  5.44M|    return pos;
   70|  5.44M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    221|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    221|    pos_attribute_ = &position_attribute;
   43|    221|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    186|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    186|    entry_to_point_id_map_ = map;
   46|    186|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.55M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.55M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.55M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.55M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.55M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.55M|    return GetPositionForDataId(data_id);
   77|  2.55M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.55M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.55M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.55M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.55M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.55M|    VectorD<int64_t, 3> pos;
   68|  2.55M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.55M|    return pos;
   70|  2.55M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    222|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    222|    pos_attribute_ = &position_attribute;
   43|    222|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    204|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    204|    entry_to_point_id_map_ = map;
   46|    204|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    507|      : pos_attribute_(nullptr),
   36|    507|        entry_to_point_id_map_(nullptr),
   37|    507|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    507|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  4.01M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  4.01M|    DRACO_DCHECK(this->IsInitialized());
   73|  4.01M|    const auto corner_table = mesh_data_.corner_table();
   74|  4.01M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  4.01M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  4.01M|    return GetPositionForDataId(data_id);
   77|  4.01M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  4.01M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  4.01M|    DRACO_DCHECK(this->IsInitialized());
   65|  4.01M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  4.01M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  4.01M|    VectorD<int64_t, 3> pos;
   68|  4.01M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  4.01M|    return pos;
   70|  4.01M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    502|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    502|    pos_attribute_ = &position_attribute;
   43|    502|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    429|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    429|    entry_to_point_id_map_ = map;
   46|    429|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    607|      : pos_attribute_(nullptr),
   36|    607|        entry_to_point_id_map_(nullptr),
   37|    607|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    607|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_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_37PredictionSchemeWrapDecodingTransformIiiEENS_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_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    604|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    604|    pos_attribute_ = &position_attribute;
   43|    604|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    535|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    535|    entry_to_point_id_map_ = map;
   46|    535|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    199|      : pos_attribute_(nullptr),
   36|    199|        entry_to_point_id_map_(nullptr),
   37|    199|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    199|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    210|      : pos_attribute_(nullptr),
   36|    210|        entry_to_point_id_map_(nullptr),
   37|    210|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    210|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    224|      : pos_attribute_(nullptr),
   36|    224|        entry_to_point_id_map_(nullptr),
   37|    224|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    224|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    226|      : pos_attribute_(nullptr),
   36|    226|        entry_to_point_id_map_(nullptr),
   37|    226|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    226|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    550|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    550|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    530|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    530|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    530|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    530|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    530|      new DataTypeT[num_components]());
   70|       |
   71|    530|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    530|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    530|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    530|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    530|  const int corner_map_size =
   78|    530|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    530|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 530]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|  3.51M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 3.51M, False: 530]
  ------------------
   83|  3.51M|    const CornerIndex start_corner_id =
   84|  3.51M|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|  3.51M|    CornerIndex corner_id(start_corner_id);
   87|  3.51M|    int num_parallelograms = 0;
   88|   101M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 98.2M, False: 3.51M]
  ------------------
   89|  98.2M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  98.2M|    }
   91|  7.63M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 4.12M, False: 3.51M]
  ------------------
   92|  4.12M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 249k, False: 3.87M]
  ------------------
   93|  4.12M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  4.12M|              num_components, parallelogram_pred_vals.get())) {
   95|  24.8M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 24.6M, False: 249k]
  ------------------
   96|  24.6M|          pred_vals[c] =
   97|  24.6M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  24.6M|        }
   99|   249k|        ++num_parallelograms;
  100|   249k|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  4.12M|      corner_id = table->SwingRight(corner_id);
  104|  4.12M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 115k, False: 4.00M]
  ------------------
  105|   115k|        corner_id = kInvalidCornerIndex;
  106|   115k|      }
  107|  4.12M|    }
  108|       |
  109|  3.51M|    const int dst_offset = p * num_components;
  110|  3.51M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 3.37M, False: 136k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  3.37M|      const int src_offset = (p - 1) * num_components;
  114|  3.37M|      this->transform().ComputeOriginalValue(
  115|  3.37M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|  3.37M|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  13.1M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 12.9M, False: 136k]
  ------------------
  119|  12.9M|        pred_vals[c] /= num_parallelograms;
  120|  12.9M|      }
  121|   136k|      this->transform().ComputeOriginalValue(
  122|   136k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|   136k|    }
  124|  3.51M|  }
  125|    530|  return true;
  126|    530|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    583|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    583|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    548|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    548|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    548|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    548|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    548|      new DataTypeT[num_components]());
   70|       |
   71|    548|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    548|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    548|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    548|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    548|  const int corner_map_size =
   78|    548|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    548|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 548]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|  1.38M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 1.38M, False: 548]
  ------------------
   83|  1.38M|    const CornerIndex start_corner_id =
   84|  1.38M|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|  1.38M|    CornerIndex corner_id(start_corner_id);
   87|  1.38M|    int num_parallelograms = 0;
   88|  53.0M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 51.6M, False: 1.38M]
  ------------------
   89|  51.6M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  51.6M|    }
   91|  9.44M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 8.06M, False: 1.38M]
  ------------------
   92|  8.06M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 2.66M, False: 5.40M]
  ------------------
   93|  8.06M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  8.06M|              num_components, parallelogram_pred_vals.get())) {
   95|  96.2M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 93.6M, False: 2.66M]
  ------------------
   96|  93.6M|          pred_vals[c] =
   97|  93.6M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  93.6M|        }
   99|  2.66M|        ++num_parallelograms;
  100|  2.66M|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  8.06M|      corner_id = table->SwingRight(corner_id);
  104|  8.06M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 1.33M, False: 6.73M]
  ------------------
  105|  1.33M|        corner_id = kInvalidCornerIndex;
  106|  1.33M|      }
  107|  8.06M|    }
  108|       |
  109|  1.38M|    const int dst_offset = p * num_components;
  110|  1.38M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 19.1k, False: 1.36M]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  19.1k|      const int src_offset = (p - 1) * num_components;
  114|  19.1k|      this->transform().ComputeOriginalValue(
  115|  19.1k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|  1.36M|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  49.6M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 48.3M, False: 1.36M]
  ------------------
  119|  48.3M|        pred_vals[c] /= num_parallelograms;
  120|  48.3M|      }
  121|  1.36M|      this->transform().ComputeOriginalValue(
  122|  1.36M|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|  1.36M|    }
  124|  1.38M|  }
  125|    548|  return true;
  126|    548|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  9.17M|    int num_components, DataTypeT *out_prediction) {
   49|  9.17M|  const CornerIndex oci = table->Opposite(ci);
   50|  9.17M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 8.20M, False: 970k]
  ------------------
   51|  8.20M|    return false;
   52|  8.20M|  }
   53|   970k|  int vert_opp, vert_next, vert_prev;
   54|   970k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   970k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   970k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 517k, False: 452k]
  |  Branch (56:35): [True: 402k, False: 114k]
  ------------------
   57|   402k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 380k, False: 22.3k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   380k|    const int v_opp_off = vert_opp * num_components;
   60|   380k|    const int v_next_off = vert_next * num_components;
   61|   380k|    const int v_prev_off = vert_prev * num_components;
   62|  28.5M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 28.1M, False: 380k]
  ------------------
   63|  28.1M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  28.1M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  28.1M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  28.1M|      const int64_t result =
   67|  28.1M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  28.1M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  28.1M|    }
   71|   380k|    return true;
   72|   380k|  }
   73|   589k|  return false;  // Not all data is available for prediction
   74|   970k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   970k|    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|   970k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   970k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   970k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   970k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  9.50M|    int num_components, DataTypeT *out_prediction) {
   49|  9.50M|  const CornerIndex oci = table->Opposite(ci);
   50|  9.50M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 52.6k, False: 9.45M]
  ------------------
   51|  52.6k|    return false;
   52|  52.6k|  }
   53|  9.45M|  int vert_opp, vert_next, vert_prev;
   54|  9.45M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  9.45M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  9.45M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 4.97M, False: 4.47M]
  |  Branch (56:35): [True: 3.86M, False: 1.11M]
  ------------------
   57|  3.86M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 3.51M, False: 350k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  3.51M|    const int v_opp_off = vert_opp * num_components;
   60|  3.51M|    const int v_next_off = vert_next * num_components;
   61|  3.51M|    const int v_prev_off = vert_prev * num_components;
   62|   205M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 202M, False: 3.51M]
  ------------------
   63|   202M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|   202M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|   202M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|   202M|      const int64_t result =
   67|   202M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|   202M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|   202M|    }
   71|  3.51M|    return true;
   72|  3.51M|  }
   73|  5.94M|  return false;  // Not all data is available for prediction
   74|  9.45M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  9.45M|    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.45M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  9.45M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  9.45M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  9.45M|}

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

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    312|      : pos_attribute_(nullptr),
   39|    312|        entry_to_point_id_map_(nullptr),
   40|    312|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    308|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    308|    pos_attribute_ = &position_attribute;
   43|    308|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    295|  void ResizeOrientations(int num_orientations) {
   74|    295|    orientations_.resize(num_orientations);
   75|    295|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  6.09G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    251|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    251|    entry_to_point_id_map_ = map;
   46|    251|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   169k|                                                 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|   169k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   169k|  const CornerIndex prev_corner_id =
   99|   169k|      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|   169k|  int next_data_id, prev_data_id;
  103|       |
  104|   169k|  int next_vert_id, prev_vert_id;
  105|   169k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   169k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   169k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   169k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   169k|  typedef VectorD<int64_t, 2> Vec2;
  112|   169k|  typedef VectorD<int64_t, 3> Vec3;
  113|   169k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   169k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 114k, False: 55.3k]
  |  Branch (115:33): [True: 58.9k, False: 55.3k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|  58.9k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|  58.9k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|  58.9k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 55.0k, False: 3.96k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|  55.0k|      predicted_value_[0] = p_uv[0];
  122|  55.0k|      predicted_value_[1] = p_uv[1];
  123|  55.0k|      return true;
  124|  55.0k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  3.96k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  3.96k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  3.96k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  3.96k|    const Vec3 pn = prev_pos - next_pos;
  146|  3.96k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  3.96k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.47k, False: 2.48k]
  ------------------
  148|       |      // Compute the projection of C onto PN by computing dot product of CN with
  149|       |      // PN and normalizing it by length of PN. This gives us a factor |s| where
  150|       |      // |s = PN.Dot(CN) / PN.SquaredNorm2()|. This factor can be used to
  151|       |      // compute X in UV space |X_UV| as |X_UV = N_UV + s * PN_UV|.
  152|  1.47k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.47k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.47k|      const Vec2 pn_uv = p_uv - n_uv;
  156|       |      // Because we perform all computations with integers, we don't explicitly
  157|       |      // compute the normalized factor |s|, but rather we perform all operations
  158|       |      // over UV vectors in a non-normalized coordinate system scaled with a
  159|       |      // scaling factor |pn_norm2_squared|:
  160|       |      //
  161|       |      //      x_uv = X_UV * PN.Norm2Squared()
  162|       |      //
  163|  1.47k|      const int64_t n_uv_absmax_element =
  164|  1.47k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.47k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 39, False: 1.43k]
  ------------------
  166|  1.47k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     39|        return false;
  169|     39|      }
  170|  1.43k|      const int64_t pn_uv_absmax_element =
  171|  1.43k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.43k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 32, False: 1.40k]
  ------------------
  173|  1.43k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     32|        return false;
  176|     32|      }
  177|       |      // Keep the scaled prediction arithmetic in the unsigned domain.  The
  178|       |      // decoder accepts untrusted deltas, so intermediate values may exceed
  179|       |      // the signed range even though the final wrapped value is valid for the
  180|       |      // bitstream.  Performing the addition as signed arithmetic invokes
  181|       |      // undefined behaviour on malformed input.
  182|  1.40k|      const Vec2 x_uv =
  183|  1.40k|          Vec2(Vec2u(n_uv) * pn_norm2_squared +
  184|  1.40k|               Vec2u(static_cast<uint64_t>(cn_dot_pn),
  185|  1.40k|                     static_cast<uint64_t>(cn_dot_pn)) * Vec2u(pn_uv));
  186|  1.40k|      const int64_t pn_absmax_element =
  187|  1.40k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  188|  1.40k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (188:11): [True: 36, False: 1.37k]
  ------------------
  189|  1.40k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  190|       |        // Return false if squared length calculation would overflow.
  191|     36|        return false;
  192|     36|      }
  193|       |
  194|       |      // Compute squared length of vector CX in position coordinate system:
  195|  1.37k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  196|  1.37k|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  197|       |
  198|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  199|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  200|       |      //
  201|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  202|       |      //
  203|       |      // To preserve precision, we perform all operations in scaled space as
  204|       |      // explained above, so we want the final vector to be:
  205|       |      //
  206|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  207|       |      //
  208|       |      // We can then rewrite the formula as:
  209|       |      //
  210|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  211|       |      //
  212|  1.37k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  213|       |      // Compute CX.Norm2() * PN.Norm2()
  214|  1.37k|      const uint64_t norm_squared =
  215|  1.37k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  216|       |      // Final cx_uv in the scaled coordinate space.
  217|  1.37k|      cx_uv = cx_uv * norm_squared;
  218|       |
  219|       |      // Predicted uv coordinate is then computed by either adding or
  220|       |      // subtracting CX_UV to/from X_UV.
  221|  1.37k|      Vec2 predicted_uv;
  222|  1.37k|      if (is_encoder_t) {
  ------------------
  |  Branch (222:11): [Folded, False: 1.37k]
  ------------------
  223|       |        // When encoding, compute both possible vectors and determine which one
  224|       |        // results in a better prediction.
  225|       |        // Both vectors need to be transformed back from the scaled space to
  226|       |        // the real UV coordinate space.
  227|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  228|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  229|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  230|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (230:13): [True: 0, False: 0]
  ------------------
  231|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  232|      0|          predicted_uv = predicted_uv_0;
  233|      0|          orientations_.push_back(true);
  234|      0|        } else {
  235|      0|          predicted_uv = predicted_uv_1;
  236|      0|          orientations_.push_back(false);
  237|      0|        }
  238|  1.37k|      } else {
  239|       |        // When decoding the data, we already know which orientation to use.
  240|  1.37k|        if (orientations_.empty()) {
  ------------------
  |  Branch (240:13): [True: 7, False: 1.36k]
  ------------------
  241|      7|          return false;
  242|      7|        }
  243|  1.36k|        const bool orientation = orientations_.back();
  244|  1.36k|        orientations_.pop_back();
  245|       |        // Perform operations in unsigned type to avoid signed integer overflow.
  246|       |        // Note that the result will be the same (for non-overflowing values).
  247|  1.36k|        if (orientation) {
  ------------------
  |  Branch (247:13): [True: 512, False: 852]
  ------------------
  248|    512|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  249|    852|        } else {
  250|    852|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  251|    852|        }
  252|  1.36k|      }
  253|  1.36k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  254|  1.36k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  255|  1.36k|      return true;
  256|  1.37k|    }
  257|  3.96k|  }
  258|       |  // Else we don't have available textures on both corners or the position data
  259|       |  // is invalid. For such cases we can't use positions for predicting the uv
  260|       |  // value and we resort to delta coding.
  261|   113k|  int data_offset = 0;
  262|   113k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (262:7): [True: 57.8k, False: 55.3k]
  ------------------
  263|       |    // Use the value on the previous corner as the prediction.
  264|  57.8k|    data_offset = prev_data_id * kNumComponents;
  265|  57.8k|  }
  266|   113k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (266:7): [True: 2.48k, False: 110k]
  ------------------
  267|       |    // Use the value on the next corner as the prediction.
  268|  2.48k|    data_offset = next_data_id * kNumComponents;
  269|   110k|  } else {
  270|       |    // None of the other corners have a valid value. Use the last encoded value
  271|       |    // as the prediction if possible.
  272|   110k|    if (data_id > 0) {
  ------------------
  |  Branch (272:9): [True: 110k, False: 251]
  ------------------
  273|   110k|      data_offset = (data_id - 1) * kNumComponents;
  274|   110k|    } else {
  275|       |      // We are encoding the first value. Predict 0.
  276|    753|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (276:23): [True: 502, False: 251]
  ------------------
  277|    502|        predicted_value_[i] = 0;
  278|    502|      }
  279|    251|      return true;
  280|    251|    }
  281|   110k|  }
  282|   338k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (282:19): [True: 225k, False: 112k]
  ------------------
  283|   225k|    predicted_value_[i] = data[data_offset + i];
  284|   225k|  }
  285|   112k|  return true;
  286|   113k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   117k|                                            const DataTypeT *data) const {
   59|   117k|    const int data_offset = entry_id * kNumComponents;
   60|   117k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   117k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  11.8k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  11.8k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  11.8k|    VectorD<int64_t, 3> pos;
   52|  11.8k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  11.8k|                                 &pos[0]);
   54|  11.8k|    return pos;
   55|  11.8k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   169k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    267|      : pos_attribute_(nullptr),
   39|    267|        entry_to_point_id_map_(nullptr),
   40|    267|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    263|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    263|    pos_attribute_ = &position_attribute;
   43|    263|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    252|  void ResizeOrientations(int num_orientations) {
   74|    252|    orientations_.resize(num_orientations);
   75|    252|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  13.0G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    215|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    215|    entry_to_point_id_map_ = map;
   46|    215|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   204k|                                                 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|   204k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   204k|  const CornerIndex prev_corner_id =
   99|   204k|      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|   204k|  int next_data_id, prev_data_id;
  103|       |
  104|   204k|  int next_vert_id, prev_vert_id;
  105|   204k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   204k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   204k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   204k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   204k|  typedef VectorD<int64_t, 2> Vec2;
  112|   204k|  typedef VectorD<int64_t, 3> Vec3;
  113|   204k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   204k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 204k, False: 294]
  |  Branch (115:33): [True: 203k, False: 356]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   203k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   203k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   203k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 200k, False: 2.94k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   200k|      predicted_value_[0] = p_uv[0];
  122|   200k|      predicted_value_[1] = p_uv[1];
  123|   200k|      return true;
  124|   200k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  2.94k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  2.94k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  2.94k|    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.94k|    const Vec3 pn = prev_pos - next_pos;
  146|  2.94k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  2.94k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 2.00k, False: 941]
  ------------------
  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|  2.00k|      const Vec3 cn = tip_pos - next_pos;
  153|  2.00k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  2.00k|      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|  2.00k|      const int64_t n_uv_absmax_element =
  164|  2.00k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  2.00k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 25, False: 1.98k]
  ------------------
  166|  2.00k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     25|        return false;
  169|     25|      }
  170|  1.98k|      const int64_t pn_uv_absmax_element =
  171|  1.98k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.98k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 5, False: 1.97k]
  ------------------
  173|  1.98k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      5|        return false;
  176|      5|      }
  177|       |      // Keep the scaled prediction arithmetic in the unsigned domain.  The
  178|       |      // decoder accepts untrusted deltas, so intermediate values may exceed
  179|       |      // the signed range even though the final wrapped value is valid for the
  180|       |      // bitstream.  Performing the addition as signed arithmetic invokes
  181|       |      // undefined behaviour on malformed input.
  182|  1.97k|      const Vec2 x_uv =
  183|  1.97k|          Vec2(Vec2u(n_uv) * pn_norm2_squared +
  184|  1.97k|               Vec2u(static_cast<uint64_t>(cn_dot_pn),
  185|  1.97k|                     static_cast<uint64_t>(cn_dot_pn)) * Vec2u(pn_uv));
  186|  1.97k|      const int64_t pn_absmax_element =
  187|  1.97k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  188|  1.97k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (188:11): [True: 19, False: 1.95k]
  ------------------
  189|  1.97k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  190|       |        // Return false if squared length calculation would overflow.
  191|     19|        return false;
  192|     19|      }
  193|       |
  194|       |      // Compute squared length of vector CX in position coordinate system:
  195|  1.95k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  196|  1.95k|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  197|       |
  198|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  199|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  200|       |      //
  201|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  202|       |      //
  203|       |      // To preserve precision, we perform all operations in scaled space as
  204|       |      // explained above, so we want the final vector to be:
  205|       |      //
  206|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  207|       |      //
  208|       |      // We can then rewrite the formula as:
  209|       |      //
  210|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  211|       |      //
  212|  1.95k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  213|       |      // Compute CX.Norm2() * PN.Norm2()
  214|  1.95k|      const uint64_t norm_squared =
  215|  1.95k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  216|       |      // Final cx_uv in the scaled coordinate space.
  217|  1.95k|      cx_uv = cx_uv * norm_squared;
  218|       |
  219|       |      // Predicted uv coordinate is then computed by either adding or
  220|       |      // subtracting CX_UV to/from X_UV.
  221|  1.95k|      Vec2 predicted_uv;
  222|  1.95k|      if (is_encoder_t) {
  ------------------
  |  Branch (222:11): [Folded, False: 1.95k]
  ------------------
  223|       |        // When encoding, compute both possible vectors and determine which one
  224|       |        // results in a better prediction.
  225|       |        // Both vectors need to be transformed back from the scaled space to
  226|       |        // the real UV coordinate space.
  227|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  228|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  229|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  230|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (230:13): [True: 0, False: 0]
  ------------------
  231|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  232|      0|          predicted_uv = predicted_uv_0;
  233|      0|          orientations_.push_back(true);
  234|      0|        } else {
  235|      0|          predicted_uv = predicted_uv_1;
  236|      0|          orientations_.push_back(false);
  237|      0|        }
  238|  1.95k|      } else {
  239|       |        // When decoding the data, we already know which orientation to use.
  240|  1.95k|        if (orientations_.empty()) {
  ------------------
  |  Branch (240:13): [True: 4, False: 1.95k]
  ------------------
  241|      4|          return false;
  242|      4|        }
  243|  1.95k|        const bool orientation = orientations_.back();
  244|  1.95k|        orientations_.pop_back();
  245|       |        // Perform operations in unsigned type to avoid signed integer overflow.
  246|       |        // Note that the result will be the same (for non-overflowing values).
  247|  1.95k|        if (orientation) {
  ------------------
  |  Branch (247:13): [True: 512, False: 1.44k]
  ------------------
  248|    512|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  249|  1.44k|        } else {
  250|  1.44k|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  251|  1.44k|        }
  252|  1.95k|      }
  253|  1.95k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  254|  1.95k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  255|  1.95k|      return true;
  256|  1.95k|    }
  257|  2.94k|  }
  258|       |  // Else we don't have available textures on both corners or the position data
  259|       |  // is invalid. For such cases we can't use positions for predicting the uv
  260|       |  // value and we resort to delta coding.
  261|  1.59k|  int data_offset = 0;
  262|  1.59k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (262:7): [True: 1.29k, False: 294]
  ------------------
  263|       |    // Use the value on the previous corner as the prediction.
  264|  1.29k|    data_offset = prev_data_id * kNumComponents;
  265|  1.29k|  }
  266|  1.59k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (266:7): [True: 953, False: 638]
  ------------------
  267|       |    // Use the value on the next corner as the prediction.
  268|    953|    data_offset = next_data_id * kNumComponents;
  269|    953|  } else {
  270|       |    // None of the other corners have a valid value. Use the last encoded value
  271|       |    // as the prediction if possible.
  272|    638|    if (data_id > 0) {
  ------------------
  |  Branch (272:9): [True: 423, False: 215]
  ------------------
  273|    423|      data_offset = (data_id - 1) * kNumComponents;
  274|    423|    } else {
  275|       |      // We are encoding the first value. Predict 0.
  276|    645|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (276:23): [True: 430, False: 215]
  ------------------
  277|    430|        predicted_value_[i] = 0;
  278|    430|      }
  279|    215|      return true;
  280|    215|    }
  281|    638|  }
  282|  4.12k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (282:19): [True: 2.75k, False: 1.37k]
  ------------------
  283|  2.75k|    predicted_value_[i] = data[data_offset + i];
  284|  2.75k|  }
  285|  1.37k|  return true;
  286|  1.59k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   407k|                                            const DataTypeT *data) const {
   59|   407k|    const int data_offset = entry_id * kNumComponents;
   60|   407k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   407k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  8.84k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  8.84k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  8.84k|    VectorD<int64_t, 3> pos;
   52|  8.84k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  8.84k|                                 &pos[0]);
   54|  8.84k|    return pos;
   55|  8.84k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   204k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    141|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    531|  bool AreCorrectionsPositive() override {
   71|    531|    return transform_.AreCorrectionsPositive();
   72|    531|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    128|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    128|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 12, False: 116]
  ------------------
   50|     12|      return false;
   51|     12|    }
   52|    116|    return true;
   53|    128|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   919k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    123|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    558|  bool AreCorrectionsPositive() override {
   71|    558|    return transform_.AreCorrectionsPositive();
   72|    558|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    115|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    115|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 11, False: 104]
  ------------------
   50|     11|      return false;
   51|     11|    }
   52|    104|    return true;
   53|    115|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  1.99M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  6.87k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  4.71k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  6.66k|  bool AreCorrectionsPositive() override {
   71|  6.66k|    return transform_.AreCorrectionsPositive();
   72|  6.66k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  5.14k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  5.14k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 307, False: 4.84k]
  ------------------
   50|    307|      return false;
   51|    307|    }
   52|  4.84k|    return true;
   53|  5.14k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  13.0M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    550|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    573|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    550|                                 const PointCloudDecoder *decoder) {
  188|    550|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    550|      method, att_id, decoder, TransformT());
  190|    550|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    550|                                 const TransformT &transform) {
  156|    550|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 550]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    550|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    550|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 550, 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|    550|    const MeshDecoder *const mesh_decoder =
  167|    550|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    550|    auto ret = CreateMeshPredictionScheme<
  170|    550|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    550|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    550|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    550|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 409, False: 141]
  ------------------
  174|    409|      return ret;
  175|    409|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    550|  }
  178|       |  // Create delta decoder.
  179|    141|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    141|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    550|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__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_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    229|        uint16_t bitstream_version) {
  127|    229|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 199, False: 30]
  ------------------
  128|    199|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    199|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    199|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    199|                                                  mesh_data));
  132|    199|      }
  133|     30|      return nullptr;
  134|    229|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    217|      uint16_t bitstream_version) {
  143|    217|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    217|        method, attribute, transform, mesh_data, bitstream_version);
  145|    217|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    217|        uint16_t bitstream_version) {
  127|    217|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 210, False: 7]
  ------------------
  128|    210|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    210|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    210|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    210|                                                  mesh_data));
  132|    210|      }
  133|      7|      return nullptr;
  134|    217|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    573|                                 const PointCloudDecoder *decoder) {
  188|    573|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    573|      method, att_id, decoder, TransformT());
  190|    573|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    573|                                 const TransformT &transform) {
  156|    573|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 573]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    573|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    573|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 573, 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|    573|    const MeshDecoder *const mesh_decoder =
  167|    573|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    573|    auto ret = CreateMeshPredictionScheme<
  170|    573|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    573|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    573|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    573|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 450, False: 123]
  ------------------
  174|    450|      return ret;
  175|    450|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    573|  }
  178|       |  // Create delta decoder.
  179|    123|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    123|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    573|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    236|      uint16_t bitstream_version) {
  143|    236|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    236|        method, attribute, transform, mesh_data, bitstream_version);
  145|    236|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    236|        uint16_t bitstream_version) {
  111|    236|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 224, False: 12]
  ------------------
  112|    224|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    224|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    224|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    224|                                                  mesh_data));
  116|    224|      }
  117|     12|      return nullptr;
  118|    236|    }
_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: 226, False: 3]
  ------------------
  112|    226|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    226|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    226|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    226|                                                  mesh_data));
  116|    226|      }
  117|      3|      return nullptr;
  118|    229|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  6.87k|                                 const PointCloudDecoder *decoder) {
  188|  6.87k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  6.87k|      method, att_id, decoder, TransformT());
  190|  6.87k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  6.87k|                                 const TransformT &transform) {
  156|  6.87k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 6.87k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  6.87k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  6.87k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 6.87k, 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.87k|    const MeshDecoder *const mesh_decoder =
  167|  6.87k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  6.87k|    auto ret = CreateMeshPredictionScheme<
  170|  6.87k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  6.87k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  6.87k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  6.87k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 6.53k, False: 344]
  ------------------
  174|  6.53k|      return ret;
  175|  6.53k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  6.87k|  }
  178|       |  // Create delta decoder.
  179|    344|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    344|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  6.87k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  3.41k|      uint16_t bitstream_version) {
  143|  3.41k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  3.41k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  3.41k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  3.41k|        uint16_t bitstream_version) {
   53|  3.41k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 1.05k, False: 2.35k]
  ------------------
   54|  1.05k|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|  1.05k|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|  1.05k|                                                         MeshDataT>(
   57|  1.05k|                attribute, transform, mesh_data));
   58|  1.05k|      }
   59|  2.35k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  2.35k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 550, False: 1.80k]
  ------------------
   61|    550|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    550|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    550|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    550|                                                  mesh_data));
   65|    550|      }
   66|  1.80k|#endif
   67|  1.80k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 740, False: 1.06k]
  ------------------
   68|    740|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    740|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    740|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    740|                                                  mesh_data));
   72|    740|      }
   73|  1.06k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|  1.06k|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 245, False: 819]
  ------------------
   75|    245|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    245|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    245|                                                     MeshDataT>(
   78|    245|                attribute, transform, mesh_data, bitstream_version));
   79|    245|      }
   80|    819|#endif
   81|    819|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 312, False: 507]
  ------------------
   82|    312|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    312|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    312|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    312|                                                  mesh_data));
   86|    312|      }
   87|    507|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    507|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 507, False: 0]
  ------------------
   89|    507|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    507|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    507|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    507|                                                  mesh_data));
   93|    507|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  3.41k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  3.11k|      uint16_t bitstream_version) {
  143|  3.11k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  3.11k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  3.11k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  3.11k|        uint16_t bitstream_version) {
   53|  3.11k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 818, False: 2.29k]
  ------------------
   54|    818|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    818|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    818|                                                         MeshDataT>(
   57|    818|                attribute, transform, mesh_data));
   58|    818|      }
   59|  2.29k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  2.29k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 583, False: 1.71k]
  ------------------
   61|    583|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    583|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    583|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    583|                                                  mesh_data));
   65|    583|      }
   66|  1.71k|#endif
   67|  1.71k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 622, False: 1.09k]
  ------------------
   68|    622|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    622|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    622|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    622|                                                  mesh_data));
   72|    622|      }
   73|  1.09k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|  1.09k|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 220, False: 874]
  ------------------
   75|    220|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    220|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    220|                                                     MeshDataT>(
   78|    220|                attribute, transform, mesh_data, bitstream_version));
   79|    220|      }
   80|    874|#endif
   81|    874|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 267, False: 607]
  ------------------
   82|    267|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    267|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    267|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    267|                                                  mesh_data));
   86|    267|      }
   87|    607|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    607|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 607, False: 0]
  ------------------
   89|    607|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    607|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    607|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    607|                                                  mesh_data));
   93|    607|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  3.11k|    }

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    550|    uint16_t bitstream_version) {
   38|    550|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    550|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 550, False: 0]
  ------------------
   40|    550|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 36, False: 514]
  ------------------
   41|    514|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 19, False: 495]
  ------------------
   42|    495|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 75, False: 420]
  ------------------
   43|    420|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 419]
  ------------------
   44|    419|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 409, False: 10]
  ------------------
   45|    542|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 2, False: 8]
  ------------------
   46|    542|    const CornerTable *const ct = source->GetCornerTable();
   47|    542|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    542|        source->GetAttributeEncodingData(att_id);
   49|    542|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 96, False: 446]
  |  Branch (49:26): [True: 0, False: 446]
  ------------------
   50|       |      // No connectivity data found.
   51|     96|      return nullptr;
   52|     96|    }
   53|       |    // Connectivity data exists.
   54|    446|    const MeshAttributeCornerTable *const att_ct =
   55|    446|        source->GetAttributeCornerTable(att_id);
   56|    446|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 229, False: 217]
  ------------------
   57|    229|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    229|      MeshData md;
   59|    229|      md.Set(source->mesh(), att_ct,
   60|    229|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    229|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    229|      MeshPredictionSchemeFactoryT factory;
   63|    229|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    229|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 199, False: 30]
  ------------------
   65|    199|        return ret;
   66|    199|      }
   67|    229|    } else {
   68|    217|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    217|      MeshData md;
   70|    217|      md.Set(source->mesh(), ct,
   71|    217|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    217|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    217|      MeshPredictionSchemeFactoryT factory;
   74|    217|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    217|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 210, False: 7]
  ------------------
   76|    210|        return ret;
   77|    210|      }
   78|    217|    }
   79|    446|  }
   80|     45|  return nullptr;
   81|    550|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    573|    uint16_t bitstream_version) {
   38|    573|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    573|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 573, False: 0]
  ------------------
   40|    573|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 5, False: 568]
  ------------------
   41|    568|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 5, False: 563]
  ------------------
   42|    563|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 79, False: 484]
  ------------------
   43|    484|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 3, False: 481]
  ------------------
   44|    481|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 451, False: 30]
  ------------------
   45|    552|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 9, False: 21]
  ------------------
   46|    552|    const CornerTable *const ct = source->GetCornerTable();
   47|    552|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    552|        source->GetAttributeEncodingData(att_id);
   49|    552|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 87, False: 465]
  |  Branch (49:26): [True: 0, False: 465]
  ------------------
   50|       |      // No connectivity data found.
   51|     87|      return nullptr;
   52|     87|    }
   53|       |    // Connectivity data exists.
   54|    465|    const MeshAttributeCornerTable *const att_ct =
   55|    465|        source->GetAttributeCornerTable(att_id);
   56|    465|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 236, False: 229]
  ------------------
   57|    236|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    236|      MeshData md;
   59|    236|      md.Set(source->mesh(), att_ct,
   60|    236|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    236|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    236|      MeshPredictionSchemeFactoryT factory;
   63|    236|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    236|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 224, False: 12]
  ------------------
   65|    224|        return ret;
   66|    224|      }
   67|    236|    } 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: 226, False: 3]
  ------------------
   76|    226|        return ret;
   77|    226|      }
   78|    229|    }
   79|    465|  }
   80|     36|  return nullptr;
   81|    573|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  6.87k|    uint16_t bitstream_version) {
   38|  6.87k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  6.87k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 6.87k, False: 0]
  ------------------
   40|  6.87k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.96k, False: 4.91k]
  ------------------
   41|  4.91k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1.13k, False: 3.78k]
  ------------------
   42|  3.78k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 1.38k, False: 2.39k]
  ------------------
   43|  2.39k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 580, False: 1.81k]
  ------------------
   44|  1.81k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 1.11k, False: 705]
  ------------------
   45|  6.63k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 466, False: 239]
  ------------------
   46|  6.63k|    const CornerTable *const ct = source->GetCornerTable();
   47|  6.63k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  6.63k|        source->GetAttributeEncodingData(att_id);
   49|  6.63k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 105, False: 6.53k]
  |  Branch (49:26): [True: 0, False: 6.53k]
  ------------------
   50|       |      // No connectivity data found.
   51|    105|      return nullptr;
   52|    105|    }
   53|       |    // Connectivity data exists.
   54|  6.53k|    const MeshAttributeCornerTable *const att_ct =
   55|  6.53k|        source->GetAttributeCornerTable(att_id);
   56|  6.53k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 3.41k, False: 3.11k]
  ------------------
   57|  3.41k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  3.41k|      MeshData md;
   59|  3.41k|      md.Set(source->mesh(), att_ct,
   60|  3.41k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  3.41k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  3.41k|      MeshPredictionSchemeFactoryT factory;
   63|  3.41k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  3.41k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 3.41k, False: 0]
  ------------------
   65|  3.41k|        return ret;
   66|  3.41k|      }
   67|  3.41k|    } else {
   68|  3.11k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  3.11k|      MeshData md;
   70|  3.11k|      md.Set(source->mesh(), ct,
   71|  3.11k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  3.11k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  3.11k|      MeshPredictionSchemeFactoryT factory;
   74|  3.11k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  3.11k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 3.11k, False: 0]
  ------------------
   76|  3.11k|        return ret;
   77|  3.11k|      }
   78|  3.11k|    }
   79|  6.53k|  }
   80|    239|  return nullptr;
   81|  6.87k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  1.99M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  1.99M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 1.91M, False: 76.6k]
  |  Branch (93:22): [True: 1.90M, False: 6.17k]
  ------------------
   94|  1.90M|      return true;
   95|  1.90M|    }
   96|  82.8k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 38.1k, False: 44.6k]
  |  Branch (96:25): [True: 19.5k, False: 18.6k]
  ------------------
   97|  1.99M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  1.99M|  int32_t GetRotationCount(Point2 pred) const {
   51|  1.99M|    const DataType sign_x = pred[0];
   52|  1.99M|    const DataType sign_y = pred[1];
   53|       |
   54|  1.99M|    int32_t rotation_count = 0;
   55|  1.99M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 1.91M, False: 76.6k]
  ------------------
   56|  1.91M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 1.90M, False: 6.17k]
  ------------------
   57|  1.90M|        rotation_count = 0;
   58|  1.90M|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 3.23k, False: 2.94k]
  ------------------
   59|  3.23k|        rotation_count = 3;
   60|  3.23k|      } else {
   61|  2.94k|        rotation_count = 1;
   62|  2.94k|      }
   63|  1.91M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 38.4k, False: 38.1k]
  ------------------
   64|  38.4k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 18.9k, False: 19.5k]
  ------------------
   65|  18.9k|        rotation_count = 2;
   66|  19.5k|      } else {
   67|  19.5k|        rotation_count = 1;
   68|  19.5k|      }
   69|  38.4k|    } else {
   70|  38.1k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 19.5k, False: 18.6k]
  ------------------
   71|  19.5k|        rotation_count = 0;
   72|  19.5k|      } else {
   73|  18.6k|        rotation_count = 3;
   74|  18.6k|      }
   75|  38.1k|    }
   76|  1.99M|    return rotation_count;
   77|  1.99M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   126k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   126k|    switch (rotation_count) {
   81|  44.3k|      case 1:
  ------------------
  |  Branch (81:7): [True: 44.3k, False: 82.2k]
  ------------------
   82|  44.3k|        return Point2(p[1], -p[0]);
   83|  37.8k|      case 2:
  ------------------
  |  Branch (83:7): [True: 37.8k, False: 88.7k]
  ------------------
   84|  37.8k|        return Point2(-p[0], -p[1]);
   85|  44.3k|      case 3:
  ------------------
  |  Branch (85:7): [True: 44.3k, False: 82.2k]
  ------------------
   86|  44.3k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 126k]
  ------------------
   88|      0|        return p;
   89|   126k|    }
   90|   126k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    573|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

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

_ZN5draco26SequentialAttributeDecoderC2Ev:
   20|  51.3k|    : decoder_(nullptr), attribute_(nullptr), attribute_id_(-1) {}
_ZN5draco26SequentialAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   23|  51.3k|                                      int attribute_id) {
   24|  51.3k|  decoder_ = decoder;
   25|  51.3k|  attribute_ = decoder->point_cloud()->attribute(attribute_id);
   26|  51.3k|  attribute_id_ = attribute_id;
   27|  51.3k|  return true;
   28|  51.3k|}
_ZN5draco26SequentialAttributeDecoder23DecodePortableAttributeERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   38|  13.2k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   39|  13.2k|  if (attribute_->num_components() <= 0 ||
  ------------------
  |  Branch (39:7): [True: 0, False: 13.2k]
  ------------------
   40|  13.2k|      !attribute_->Reset(point_ids.size())) {
  ------------------
  |  Branch (40:7): [True: 0, False: 13.2k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  13.2k|  if (!DecodeValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (43:7): [True: 2.57k, False: 10.6k]
  ------------------
   44|  2.57k|    return false;
   45|  2.57k|  }
   46|  10.6k|  return true;
   47|  13.2k|}
_ZN5draco26SequentialAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   50|  3.88k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   51|       |  // Default implementation does not apply any transform.
   52|  3.88k|  return true;
   53|  3.88k|}
_ZN5draco26SequentialAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   56|    353|    const std::vector<PointIndex> &point_ids) {
   57|       |  // Default implementation does not apply any transform.
   58|    353|  return true;
   59|    353|}
_ZN5draco26SequentialAttributeDecoder20GetPortableAttributeEv:
   61|  8.38k|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.38k|  if (!attribute_->is_mapping_identity() && portable_attribute_ &&
  ------------------
  |  Branch (64:7): [True: 7.63k, False: 750]
  |  Branch (64:45): [True: 7.28k, False: 343]
  ------------------
   65|  7.28k|      portable_attribute_->is_mapping_identity()) {
  ------------------
  |  Branch (65:7): [True: 5.20k, False: 2.07k]
  ------------------
   66|  5.20k|    portable_attribute_->SetExplicitMapping(attribute_->indices_map_size());
   67|  5.20k|    for (PointIndex i(0);
   68|  33.3M|         i < static_cast<uint32_t>(attribute_->indices_map_size()); ++i) {
  ------------------
  |  Branch (68:10): [True: 33.3M, False: 5.20k]
  ------------------
   69|  33.3M|      portable_attribute_->SetPointMapEntry(i, attribute_->mapped_index(i));
   70|  33.3M|    }
   71|  5.20k|  }
   72|  8.38k|  return portable_attribute_.get();
   73|  8.38k|}
_ZN5draco26SequentialAttributeDecoder20InitPredictionSchemeEPNS_25PredictionSchemeInterfaceE:
   76|  7.99k|    PredictionSchemeInterface *ps) {
   77|  10.9k|  for (int i = 0; i < ps->GetNumParentAttributes(); ++i) {
  ------------------
  |  Branch (77:19): [True: 3.01k, False: 7.95k]
  ------------------
   78|  3.01k|    const int att_id = decoder_->point_cloud()->GetNamedAttributeId(
   79|  3.01k|        ps->GetParentAttributeType(i));
   80|  3.01k|    if (att_id == -1) {
  ------------------
  |  Branch (80:9): [True: 10, False: 3.00k]
  ------------------
   81|     10|      return false;  // Requested attribute does not exist.
   82|     10|    }
   83|  3.00k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   84|  3.00k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.00k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:9): [True: 0, False: 3.00k]
  ------------------
   85|      0|      if (!ps->SetParentAttribute(decoder_->point_cloud()->attribute(att_id))) {
  ------------------
  |  Branch (85:11): [True: 0, False: 0]
  ------------------
   86|      0|        return false;
   87|      0|      }
   88|      0|    } else
   89|  3.00k|#endif
   90|  3.00k|    {
   91|  3.00k|      const PointAttribute *const pa = decoder_->GetPortableAttribute(att_id);
   92|  3.00k|      if (pa == nullptr || !ps->SetParentAttribute(pa)) {
  ------------------
  |  Branch (92:11): [True: 5, False: 3.00k]
  |  Branch (92:28): [True: 27, False: 2.97k]
  ------------------
   93|     32|        return false;
   94|     32|      }
   95|  3.00k|    }
   96|  3.00k|  }
   97|  7.95k|  return true;
   98|  7.99k|}
_ZN5draco26SequentialAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  101|    569|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  102|    569|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
  103|    569|  const int entry_size = static_cast<int>(attribute_->byte_stride());
  104|    569|  std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
  105|    569|  uint8_t *const value_data = value_data_ptr.get();
  106|    569|  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: 3.01k, False: 502]
  ------------------
  109|  3.01k|    if (!in_buffer->Decode(value_data, entry_size)) {
  ------------------
  |  Branch (109:9): [True: 67, False: 2.94k]
  ------------------
  110|     67|      return false;
  111|     67|    }
  112|  2.94k|    attribute_->buffer()->Write(out_byte_pos, value_data, entry_size);
  113|  2.94k|    out_byte_pos += entry_size;
  114|  2.94k|  }
  115|    502|  return true;
  116|    569|}

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  10.9k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|   178M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  7.99k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  37.7k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  12.1k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  12.1k|    portable_attribute_ = std::move(att);
   71|  12.1k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  41.1k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  51.3k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  16.0k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  6.79k|    DecoderBuffer *buffer) {
   30|  6.79k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 129, False: 6.67k]
  ------------------
   31|    129|    return false;
   32|    129|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  6.67k|  const int32_t num_attributes = GetNumAttributes();
   35|  6.67k|  sequential_decoders_.resize(num_attributes);
   36|  57.9k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 51.3k, False: 6.64k]
  ------------------
   37|  51.3k|    uint8_t decoder_type;
   38|  51.3k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 9, False: 51.3k]
  ------------------
   39|      9|      return false;
   40|      9|    }
   41|       |    // Create the decoder from the id.
   42|  51.3k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  51.3k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 15, False: 51.3k]
  ------------------
   44|     15|      return false;
   45|     15|    }
   46|  51.3k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 4, False: 51.3k]
  ------------------
   47|      4|      return false;
   48|      4|    }
   49|  51.3k|  }
   50|  6.64k|  return true;
   51|  6.67k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  5.28k|    DecoderBuffer *buffer) {
   55|  5.28k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 5.28k]
  |  Branch (55:22): [True: 1, False: 5.28k]
  ------------------
   56|      1|    return false;
   57|      1|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  5.28k|  const int32_t num_attributes = GetNumAttributes();
   60|  30.4k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 25.2k, False: 5.27k]
  ------------------
   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.27k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  5.28k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  5.27k|    DecoderBuffer *in_buffer) {
   72|  5.27k|  const int32_t num_attributes = GetNumAttributes();
   73|  15.9k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 13.2k, False: 2.70k]
  ------------------
   74|  13.2k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 2.57k, False: 10.6k]
  ------------------
   75|  13.2k|                                                          in_buffer)) {
   76|  2.57k|      return false;
   77|  2.57k|    }
   78|  13.2k|  }
   79|  2.70k|  return true;
   80|  5.27k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  2.70k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  2.70k|  const int32_t num_attributes = GetNumAttributes();
   85|  7.14k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 5.13k, False: 2.01k]
  ------------------
   86|  5.13k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 684, False: 4.44k]
  ------------------
   87|  5.13k|            point_ids_, in_buffer)) {
   88|    684|      return false;
   89|    684|    }
   90|  5.13k|  }
   91|  2.01k|  return true;
   92|  2.70k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  2.01k|    TransformAttributesToOriginalFormat() {
   96|  2.01k|  const int32_t num_attributes = GetNumAttributes();
   97|  4.99k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 3.61k, False: 1.37k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  3.61k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 3.61k, False: 0]
  ------------------
  100|  3.61k|      const PointAttribute *const attribute =
  101|  3.61k|          sequential_decoders_[i]->attribute();
  102|  3.61k|      const PointAttribute *const portable_attribute =
  103|  3.61k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  3.61k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 3.26k, False: 353]
  |  Branch (104:11): [True: 0, False: 3.61k]
  ------------------
  105|  3.26k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 0, False: 3.26k]
  ------------------
  106|  3.26k|              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.61k|    }
  116|  3.61k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 638, False: 2.97k]
  ------------------
  117|  3.61k|            point_ids_)) {
  118|    638|      return false;
  119|    638|    }
  120|  3.61k|  }
  121|  1.37k|  return true;
  122|  2.01k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  51.3k|    uint8_t decoder_type) {
  127|  51.3k|  switch (decoder_type) {
  128|  2.97k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 2.97k, False: 48.3k]
  ------------------
  129|  2.97k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  2.97k|          new SequentialAttributeDecoder());
  131|  46.6k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 46.6k, False: 4.67k]
  ------------------
  132|  46.6k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  46.6k|          new SequentialIntegerAttributeDecoder());
  134|    348|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 348, False: 50.9k]
  ------------------
  135|    348|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    348|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.33k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.33k, False: 50.0k]
  ------------------
  139|  1.33k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.33k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     15|    default:
  ------------------
  |  Branch (142:5): [True: 15, False: 51.3k]
  ------------------
  143|     15|      break;
  144|  51.3k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     15|  return nullptr;
  147|  51.3k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  48.3k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  48.3k|                                             int attribute_id) {
   27|  48.3k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 48.3k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  48.3k|  return true;
   31|  48.3k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  3.26k|    const std::vector<PointIndex> &point_ids) {
   35|  3.26k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  3.26k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 3.26k, False: 0]
  ------------------
   37|  3.26k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.26k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 7, False: 3.25k]
  ------------------
   38|      7|    return true;  // Don't revert the transform here for older files.
   39|      7|  }
   40|  3.25k|#endif
   41|  3.25k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  3.26k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  12.6k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  12.6k|  int8_t prediction_scheme_method;
   48|  12.6k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 42, False: 12.6k]
  ------------------
   49|     42|    return false;
   50|     42|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  12.6k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 76, False: 12.5k]
  ------------------
   53|  12.5k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 155, False: 12.3k]
  ------------------
   54|    231|    return false;
   55|    231|  }
   56|  12.3k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 12.3k, False: 13]
  ------------------
   57|  12.3k|    int8_t prediction_transform_type;
   58|  12.3k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 24, False: 12.3k]
  ------------------
   59|     24|      return false;
   60|     24|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  12.3k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 20, False: 12.3k]
  ------------------
   63|  12.3k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 125, False: 12.1k]
  ------------------
   64|    145|      return false;
   65|    145|    }
   66|  12.1k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  12.1k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  12.1k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  12.1k|  }
   70|       |
   71|  12.2k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 7.99k, False: 4.21k]
  ------------------
   72|  7.99k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 42, False: 7.95k]
  ------------------
   73|     42|      return false;
   74|     42|    }
   75|  7.99k|  }
   76|       |
   77|  12.1k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 2.02k, False: 10.1k]
  ------------------
   78|  2.02k|    return false;
   79|  2.02k|  }
   80|       |
   81|  10.1k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  10.1k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  10.1k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 10.1k, False: 0]
  ------------------
   84|  10.1k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  10.1k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 12, False: 10.1k]
  ------------------
   85|       |    // For older files, revert the transform right after we decode the data.
   86|     12|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 12]
  ------------------
   87|      0|      return false;
   88|      0|    }
   89|     12|  }
   90|  10.1k|#endif
   91|  10.1k|  return true;
   92|  10.1k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  11.0k|    PredictionSchemeTransformType transform_type) {
   98|  11.0k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 4.14k, False: 6.87k]
  ------------------
   99|  4.14k|    return nullptr;  // For now we support only wrap transform.
  100|  4.14k|  }
  101|  6.87k|  return CreatePredictionSchemeForDecoder<
  102|  6.87k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  6.87k|      method, attribute_id(), decoder());
  104|  11.0k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  12.1k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  12.1k|  const int num_components = GetNumValueComponents();
  109|  12.1k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 12.1k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  12.1k|  const size_t num_entries = point_ids.size();
  113|  12.1k|  const size_t num_values = num_entries * num_components;
  114|  12.1k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  12.1k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  12.1k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 11, False: 12.1k]
  ------------------
  117|     11|    return false;
  118|     11|  }
  119|  12.1k|  uint8_t compressed;
  120|  12.1k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 19, False: 12.1k]
  ------------------
  121|     19|    return false;
  122|     19|  }
  123|  12.1k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 730, False: 11.4k]
  ------------------
  124|       |    // Decode compressed values.
  125|    730|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 253, False: 477]
  ------------------
  126|    730|                       in_buffer,
  127|    730|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    253|      return false;
  129|    253|    }
  130|  11.4k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  11.4k|    uint8_t num_bytes;
  134|  11.4k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 8, False: 11.3k]
  ------------------
  135|      8|      return false;
  136|      8|    }
  137|  11.3k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 612, False: 10.7k]
  ------------------
  138|    612|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 612]
  ------------------
  139|    612|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    612|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 10, False: 602]
  ------------------
  143|    612|                             sizeof(int32_t) * num_values)) {
  144|     10|        return false;
  145|     10|      }
  146|  10.7k|    } else {
  147|  10.7k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 61, False: 10.7k]
  ------------------
  148|  10.7k|          num_bytes * num_values) {
  149|     61|        return false;
  150|     61|      }
  151|  10.7k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 22, False: 10.7k]
  ------------------
  152|  10.7k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     22|        return false;
  154|     22|      }
  155|  1.42G|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 1.42G, False: 10.7k]
  ------------------
  156|  1.42G|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 1.42G]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|  1.42G|      }
  160|  10.7k|    }
  161|  11.3k|  }
  162|       |
  163|  11.7k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 11.7k, False: 0]
  |  Branch (163:26): [True: 4.02k, False: 7.75k]
  ------------------
  164|  10.6k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 6.66k, False: 1.08k]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  10.6k|    ConvertSymbolsToSignedInts(
  167|  10.6k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  10.6k|        static_cast<int>(num_values), portable_attribute_data);
  169|  10.6k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  11.7k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 7.75k, False: 4.02k]
  ------------------
  173|  7.75k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 971, False: 6.78k]
  ------------------
  174|    971|      return false;
  175|    971|    }
  176|       |
  177|  6.78k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 6.78k, False: 0]
  ------------------
  178|  6.78k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 672, False: 6.11k]
  ------------------
  179|  6.78k|              portable_attribute_data, portable_attribute_data,
  180|  6.78k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    672|        return false;
  182|    672|      }
  183|  6.78k|    }
  184|  6.78k|  }
  185|  10.1k|  return true;
  186|  11.7k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  2.75k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  2.75k|  switch (attribute()->data_type()) {
  190|    566|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 566, False: 2.19k]
  ------------------
  191|    566|      StoreTypedValues<uint8_t>(num_values);
  192|    566|      break;
  193|    879|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 879, False: 1.88k]
  ------------------
  194|    879|      StoreTypedValues<int8_t>(num_values);
  195|    879|      break;
  196|    116|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 116, False: 2.64k]
  ------------------
  197|    116|      StoreTypedValues<uint16_t>(num_values);
  198|    116|      break;
  199|    208|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 208, False: 2.55k]
  ------------------
  200|    208|      StoreTypedValues<int16_t>(num_values);
  201|    208|      break;
  202|    188|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 188, False: 2.57k]
  ------------------
  203|    188|      StoreTypedValues<uint32_t>(num_values);
  204|    188|      break;
  205|    465|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 465, False: 2.29k]
  ------------------
  206|    465|      StoreTypedValues<int32_t>(num_values);
  207|    465|      break;
  208|    337|    default:
  ------------------
  |  Branch (208:5): [True: 337, False: 2.42k]
  ------------------
  209|    337|      return false;
  210|  2.75k|  }
  211|  2.42k|  return true;
  212|  2.75k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  12.1k|    int num_entries, int num_components) {
  237|  12.1k|  GeometryAttribute ga;
  238|  12.1k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  12.1k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  12.1k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  12.1k|  port_att->SetIdentityMapping();
  242|  12.1k|  port_att->Reset(num_entries);
  243|  12.1k|  port_att->set_unique_id(attribute()->unique_id());
  244|  12.1k|  SetPortableAttribute(std::move(port_att));
  245|  12.1k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    566|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    566|  const int num_components = attribute()->num_components();
  217|    566|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    566|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    566|      new AttributeTypeT[num_components]);
  220|    566|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    566|  int val_id = 0;
  222|    566|  int out_byte_pos = 0;
  223|  17.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 17.9M, False: 566]
  ------------------
  224|   128M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 110M, False: 17.9M]
  ------------------
  225|   110M|      const AttributeTypeT value =
  226|   110M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   110M|      att_val[c] = value;
  228|   110M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  17.9M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  17.9M|    out_byte_pos += entry_size;
  232|  17.9M|  }
  233|    566|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|    879|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    879|  const int num_components = attribute()->num_components();
  217|    879|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    879|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    879|      new AttributeTypeT[num_components]);
  220|    879|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    879|  int val_id = 0;
  222|    879|  int out_byte_pos = 0;
  223|   153M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 153M, False: 879]
  ------------------
  224|   613M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 459M, False: 153M]
  ------------------
  225|   459M|      const AttributeTypeT value =
  226|   459M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   459M|      att_val[c] = value;
  228|   459M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   153M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   153M|    out_byte_pos += entry_size;
  232|   153M|  }
  233|    879|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|    116|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    116|  const int num_components = attribute()->num_components();
  217|    116|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    116|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    116|      new AttributeTypeT[num_components]);
  220|    116|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    116|  int val_id = 0;
  222|    116|  int out_byte_pos = 0;
  223|  1.78M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.78M, False: 116]
  ------------------
  224|  62.2M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 60.4M, False: 1.78M]
  ------------------
  225|  60.4M|      const AttributeTypeT value =
  226|  60.4M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  60.4M|      att_val[c] = value;
  228|  60.4M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.78M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.78M|    out_byte_pos += entry_size;
  232|  1.78M|  }
  233|    116|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    208|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    208|  const int num_components = attribute()->num_components();
  217|    208|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    208|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    208|      new AttributeTypeT[num_components]);
  220|    208|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    208|  int val_id = 0;
  222|    208|  int out_byte_pos = 0;
  223|   365k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 365k, False: 208]
  ------------------
  224|  36.1M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 35.8M, False: 365k]
  ------------------
  225|  35.8M|      const AttributeTypeT value =
  226|  35.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  35.8M|      att_val[c] = value;
  228|  35.8M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   365k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   365k|    out_byte_pos += entry_size;
  232|   365k|  }
  233|    208|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    188|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    188|  const int num_components = attribute()->num_components();
  217|    188|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    188|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    188|      new AttributeTypeT[num_components]);
  220|    188|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    188|  int val_id = 0;
  222|    188|  int out_byte_pos = 0;
  223|   812k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 812k, False: 188]
  ------------------
  224|  78.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 77.9M, False: 812k]
  ------------------
  225|  77.9M|      const AttributeTypeT value =
  226|  77.9M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  77.9M|      att_val[c] = value;
  228|  77.9M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   812k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   812k|    out_byte_pos += entry_size;
  232|   812k|  }
  233|    188|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|    465|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    465|  const int num_components = attribute()->num_components();
  217|    465|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    465|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    465|      new AttributeTypeT[num_components]);
  220|    465|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    465|  int val_id = 0;
  222|    465|  int out_byte_pos = 0;
  223|  4.40M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 4.40M, False: 465]
  ------------------
  224|   184M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 180M, False: 4.40M]
  ------------------
  225|   180M|      const AttributeTypeT value =
  226|   180M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   180M|      att_val[c] = value;
  228|   180M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  4.40M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  4.40M|    out_byte_pos += entry_size;
  232|  4.40M|  }
  233|    465|}

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

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

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

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

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  35.2k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  25.6k|                                const uint8_t *const buf, int offset) {
  301|  25.6k|  unsigned x;
  302|  25.6k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 42, False: 25.6k]
  ------------------
  303|     42|    return 1;
  304|     42|  }
  305|  25.6k|  ans->buf = buf;
  306|  25.6k|  x = buf[offset - 1] >> 6;
  307|  25.6k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 20.7k, False: 4.88k]
  ------------------
  308|  20.7k|    ans->buf_offset = offset - 1;
  309|  20.7k|    ans->state = buf[offset - 1] & 0x3F;
  310|  20.7k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 4.36k, False: 514]
  ------------------
  311|  4.36k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 2, False: 4.36k]
  ------------------
  312|      2|      return 1;
  313|      2|    }
  314|  4.36k|    ans->buf_offset = offset - 2;
  315|  4.36k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  4.36k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 495, False: 19]
  ------------------
  317|    495|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 0, False: 495]
  ------------------
  318|      0|      return 1;
  319|      0|    }
  320|    495|    ans->buf_offset = offset - 3;
  321|    495|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    495|  } else {
  323|     19|    return 1;
  324|     19|  }
  325|  25.5k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  25.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  25.5k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  25.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  25.5k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 8, False: 25.5k]
  ------------------
  327|      8|    return 1;
  328|      8|  }
  329|  25.5k|  return 0;
  330|  25.5k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  4.36k|static uint32_t mem_get_le16(const void *vmem) {
   68|  4.36k|  uint32_t val;
   69|  4.36k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  4.36k|  val = mem[1] << 8;
   72|  4.36k|  val |= mem[0];
   73|  4.36k|  return val;
   74|  4.36k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    495|static uint32_t mem_get_le24(const void *vmem) {
   77|    495|  uint32_t val;
   78|    495|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    495|  val = mem[2] << 16;
   81|    495|  val |= mem[1] << 8;
   82|    495|  val |= mem[0];
   83|    495|  return val;
   84|    495|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  19.2G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  19.2G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  19.2G|  unsigned quot, rem, x, xn;
  172|  19.2G|#endif
  173|  19.2G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  19.2G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  19.2G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  38.4G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 18.3G, False: 890M]
  |  Branch (174:40): [True: 280k, False: 18.3G]
  ------------------
  175|   280k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   280k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   280k|  }
  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|  19.2G|  x = ans->state;
  184|  19.2G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  19.2G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  19.2G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  19.2G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  19.2G|  xn = quot * p;
  187|  19.2G|  val = rem < p;
  188|  19.2G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  38.4G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 18.3G, False: 860M]
  |  |  ------------------
  ------------------
  189|  18.3G|    ans->state = xn + rem;
  190|  18.3G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   860M|    ans->state = x - xn - p;
  193|   860M|  }
  194|  19.2G|#endif
  195|  19.2G|  return val;
  196|  19.2G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  54.7k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  54.7k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  54.7k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  54.7k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  3.44k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  484|  2.18k|                                       uint32_t num_symbols) {
  485|  2.18k|    lut_table_.resize(rans_precision);
  486|  2.18k|    probability_table_.resize(num_symbols);
  487|  2.18k|    uint32_t cum_prob = 0;
  488|  2.18k|    uint32_t act_prob = 0;
  489|  19.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 17.8k, False: 2.01k]
  ------------------
  490|  17.8k|      probability_table_[i].prob = token_probs[i];
  491|  17.8k|      probability_table_[i].cum_prob = cum_prob;
  492|  17.8k|      cum_prob += token_probs[i];
  493|  17.8k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 174, False: 17.6k]
  ------------------
  494|    174|        return false;
  495|    174|      }
  496|  7.43M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 7.41M, False: 17.6k]
  ------------------
  497|  7.41M|        lut_table_[j] = i;
  498|  7.41M|      }
  499|  17.6k|      act_prob = cum_prob;
  500|  17.6k|    }
  501|  2.01k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 235, False: 1.77k]
  ------------------
  502|    235|      return false;
  503|    235|    }
  504|  1.77k|    return true;
  505|  2.01k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.69k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.69k|    unsigned x;
  423|  1.69k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 145, False: 1.54k]
  ------------------
  424|    145|      return 1;
  425|    145|    }
  426|  1.54k|    ans_.buf = buf;
  427|  1.54k|    x = buf[offset - 1] >> 6;
  428|  1.54k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 951, False: 597]
  ------------------
  429|    951|      ans_.buf_offset = offset - 1;
  430|    951|      ans_.state = buf[offset - 1] & 0x3F;
  431|    951|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 267, False: 330]
  ------------------
  432|    267|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 46, False: 221]
  ------------------
  433|     46|        return 1;
  434|     46|      }
  435|    221|      ans_.buf_offset = offset - 2;
  436|    221|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    330|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 227, False: 103]
  ------------------
  438|    227|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 44, False: 183]
  ------------------
  439|     44|        return 1;
  440|     44|      }
  441|    183|      ans_.buf_offset = offset - 3;
  442|    183|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    183|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 103, False: 0]
  ------------------
  444|    103|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 29, False: 74]
  ------------------
  445|     29|        return 1;
  446|     29|      }
  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.42k|    ans_.state += l_rans_base;
  453|  1.42k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.42k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 86, False: 1.34k]
  ------------------
  454|     86|      return 1;
  455|     86|    }
  456|  1.34k|    return 0;
  457|  1.42k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    336|static uint32_t mem_get_le16(const void *vmem) {
   68|    336|  uint32_t val;
   69|    336|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    336|  val = mem[1] << 8;
   72|    336|  val |= mem[0];
   73|    336|  return val;
   74|    336|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    296|static uint32_t mem_get_le24(const void *vmem) {
   77|    296|  uint32_t val;
   78|    296|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    296|  val = mem[2] << 16;
   81|    296|  val |= mem[1] << 8;
   82|    296|  val |= mem[0];
   83|    296|  return val;
   84|    296|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    243|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    243|  uint32_t val;
   88|    243|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    243|  val = mem[3] << 24;
   91|    243|  val |= mem[2] << 16;
   92|    243|  val |= mem[1] << 8;
   93|    243|  val |= mem[0];
   94|    243|  return val;
   95|    243|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  465|   169M|  inline int rans_read() {
  466|   169M|    unsigned rem;
  467|   169M|    unsigned quo;
  468|   169M|    struct rans_dec_sym sym;
  469|   169M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 148M, False: 20.8M]
  |  Branch (469:40): [True: 27.7k, False: 148M]
  ------------------
  470|  27.7k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  27.7k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  27.7k|    }
  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|   169M|    quo = ans_.state / rans_precision;
  475|   169M|    rem = ans_.state % rans_precision;
  476|   169M|    fetch_sym(&sym, rem);
  477|   169M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   169M|    return sym.val;
  479|   169M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  508|   169M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   169M|    uint32_t symbol = lut_table_[rem];
  510|   169M|    out->val = symbol;
  511|   169M|    out->prob = probability_table_[symbol].prob;
  512|   169M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   169M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  459|  1.30k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    224|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  484|    144|                                       uint32_t num_symbols) {
  485|    144|    lut_table_.resize(rans_precision);
  486|    144|    probability_table_.resize(num_symbols);
  487|    144|    uint32_t cum_prob = 0;
  488|    144|    uint32_t act_prob = 0;
  489|  1.73k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 1.60k, False: 134]
  ------------------
  490|  1.60k|      probability_table_[i].prob = token_probs[i];
  491|  1.60k|      probability_table_[i].cum_prob = cum_prob;
  492|  1.60k|      cum_prob += token_probs[i];
  493|  1.60k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 10, False: 1.59k]
  ------------------
  494|     10|        return false;
  495|     10|      }
  496|  1.04M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 1.04M, False: 1.59k]
  ------------------
  497|  1.04M|        lut_table_[j] = i;
  498|  1.04M|      }
  499|  1.59k|      act_prob = cum_prob;
  500|  1.59k|    }
  501|    134|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 11, False: 123]
  ------------------
  502|     11|      return false;
  503|     11|    }
  504|    123|    return true;
  505|    134|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     98|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     98|    unsigned x;
  423|     98|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 95]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|     95|    ans_.buf = buf;
  427|     95|    x = buf[offset - 1] >> 6;
  428|     95|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 35, False: 60]
  ------------------
  429|     35|      ans_.buf_offset = offset - 1;
  430|     35|      ans_.state = buf[offset - 1] & 0x3F;
  431|     60|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 31, False: 29]
  ------------------
  432|     31|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 12, False: 19]
  ------------------
  433|     12|        return 1;
  434|     12|      }
  435|     19|      ans_.buf_offset = offset - 2;
  436|     19|      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: 10, False: 5]
  ------------------
  445|     10|        return 1;
  446|     10|      }
  447|      5|      ans_.buf_offset = offset - 4;
  448|      5|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|      5|    } 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: 2, False: 64]
  ------------------
  454|      2|      return 1;
  455|      2|    }
  456|     64|    return 0;
  457|     66|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  465|   441k|  inline int rans_read() {
  466|   441k|    unsigned rem;
  467|   441k|    unsigned quo;
  468|   441k|    struct rans_dec_sym sym;
  469|   442k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 295k, False: 147k]
  |  Branch (469:40): [True: 1.50k, False: 294k]
  ------------------
  470|  1.50k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.50k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  1.50k|    }
  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|   441k|    quo = ans_.state / rans_precision;
  475|   441k|    rem = ans_.state % rans_precision;
  476|   441k|    fetch_sym(&sym, rem);
  477|   441k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   441k|    return sym.val;
  479|   441k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  508|   441k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   441k|    uint32_t symbol = lut_table_[rem];
  510|   441k|    out->val = symbol;
  511|   441k|    out->prob = probability_table_[symbol].prob;
  512|   441k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   441k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  459|     64|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    258|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  484|    160|                                       uint32_t num_symbols) {
  485|    160|    lut_table_.resize(rans_precision);
  486|    160|    probability_table_.resize(num_symbols);
  487|    160|    uint32_t cum_prob = 0;
  488|    160|    uint32_t act_prob = 0;
  489|  3.96k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 3.83k, False: 135]
  ------------------
  490|  3.83k|      probability_table_[i].prob = token_probs[i];
  491|  3.83k|      probability_table_[i].cum_prob = cum_prob;
  492|  3.83k|      cum_prob += token_probs[i];
  493|  3.83k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 25, False: 3.80k]
  ------------------
  494|     25|        return false;
  495|     25|      }
  496|  4.03M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 4.02M, False: 3.80k]
  ------------------
  497|  4.02M|        lut_table_[j] = i;
  498|  4.02M|      }
  499|  3.80k|      act_prob = cum_prob;
  500|  3.80k|    }
  501|    135|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 21, False: 114]
  ------------------
  502|     21|      return false;
  503|     21|    }
  504|    114|    return true;
  505|    135|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     94|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     94|    unsigned x;
  423|     94|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 11, False: 83]
  ------------------
  424|     11|      return 1;
  425|     11|    }
  426|     83|    ans_.buf = buf;
  427|     83|    x = buf[offset - 1] >> 6;
  428|     83|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 31, False: 52]
  ------------------
  429|     31|      ans_.buf_offset = offset - 1;
  430|     31|      ans_.state = buf[offset - 1] & 0x3F;
  431|     52|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 19, False: 33]
  ------------------
  432|     19|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 10]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     10|      ans_.buf_offset = offset - 2;
  436|     10|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     33|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 12, False: 21]
  ------------------
  438|     12|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 5, False: 7]
  ------------------
  439|      5|        return 1;
  440|      5|      }
  441|      7|      ans_.buf_offset = offset - 3;
  442|      7|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     21|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 21, False: 0]
  ------------------
  444|     21|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 9, False: 12]
  ------------------
  445|      9|        return 1;
  446|      9|      }
  447|     12|      ans_.buf_offset = offset - 4;
  448|     12|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     12|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     60|    ans_.state += l_rans_base;
  453|     60|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     60|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 7, False: 53]
  ------------------
  454|      7|      return 1;
  455|      7|    }
  456|     53|    return 0;
  457|     60|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  465|   398k|  inline int rans_read() {
  466|   398k|    unsigned rem;
  467|   398k|    unsigned quo;
  468|   398k|    struct rans_dec_sym sym;
  469|   399k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 116k, False: 283k]
  |  Branch (469:40): [True: 1.12k, False: 115k]
  ------------------
  470|  1.12k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.12k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  1.12k|    }
  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|   398k|    quo = ans_.state / rans_precision;
  475|   398k|    rem = ans_.state % rans_precision;
  476|   398k|    fetch_sym(&sym, rem);
  477|   398k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   398k|    return sym.val;
  479|   398k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  508|   398k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   398k|    uint32_t symbol = lut_table_[rem];
  510|   398k|    out->val = symbol;
  511|   398k|    out->prob = probability_table_[symbol].prob;
  512|   398k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   398k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  459|     53|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    305|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  484|    203|                                       uint32_t num_symbols) {
  485|    203|    lut_table_.resize(rans_precision);
  486|    203|    probability_table_.resize(num_symbols);
  487|    203|    uint32_t cum_prob = 0;
  488|    203|    uint32_t act_prob = 0;
  489|  9.84k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 9.66k, False: 179]
  ------------------
  490|  9.66k|      probability_table_[i].prob = token_probs[i];
  491|  9.66k|      probability_table_[i].cum_prob = cum_prob;
  492|  9.66k|      cum_prob += token_probs[i];
  493|  9.66k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 24, False: 9.63k]
  ------------------
  494|     24|        return false;
  495|     24|      }
  496|  11.1M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 11.1M, False: 9.63k]
  ------------------
  497|  11.1M|        lut_table_[j] = i;
  498|  11.1M|      }
  499|  9.63k|      act_prob = cum_prob;
  500|  9.63k|    }
  501|    179|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 21, False: 158]
  ------------------
  502|     21|      return false;
  503|     21|    }
  504|    158|    return true;
  505|    179|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     98|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     98|    unsigned x;
  423|     98|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 11, False: 87]
  ------------------
  424|     11|      return 1;
  425|     11|    }
  426|     87|    ans_.buf = buf;
  427|     87|    x = buf[offset - 1] >> 6;
  428|     87|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 27, False: 60]
  ------------------
  429|     27|      ans_.buf_offset = offset - 1;
  430|     27|      ans_.state = buf[offset - 1] & 0x3F;
  431|     60|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 23, False: 37]
  ------------------
  432|     23|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 14]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     14|      ans_.buf_offset = offset - 2;
  436|     14|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     37|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 19, False: 18]
  ------------------
  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|     18|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 18, False: 0]
  ------------------
  444|     18|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 3, False: 15]
  ------------------
  445|      3|        return 1;
  446|      3|      }
  447|     15|      ans_.buf_offset = offset - 4;
  448|     15|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     15|    } 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: 4, False: 62]
  ------------------
  454|      4|      return 1;
  455|      4|    }
  456|     62|    return 0;
  457|     66|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  465|   293k|  inline int rans_read() {
  466|   293k|    unsigned rem;
  467|   293k|    unsigned quo;
  468|   293k|    struct rans_dec_sym sym;
  469|   294k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 192k, False: 101k]
  |  Branch (469:40): [True: 664, False: 191k]
  ------------------
  470|    664|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    664|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    664|    }
  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|   293k|    quo = ans_.state / rans_precision;
  475|   293k|    rem = ans_.state % rans_precision;
  476|   293k|    fetch_sym(&sym, rem);
  477|   293k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   293k|    return sym.val;
  479|   293k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  508|   293k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   293k|    uint32_t symbol = lut_table_[rem];
  510|   293k|    out->val = symbol;
  511|   293k|    out->prob = probability_table_[symbol].prob;
  512|   293k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   293k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  459|     62|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    283|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_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|  9.61k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 9.44k, False: 174]
  ------------------
  490|  9.44k|      probability_table_[i].prob = token_probs[i];
  491|  9.44k|      probability_table_[i].cum_prob = cum_prob;
  492|  9.44k|      cum_prob += token_probs[i];
  493|  9.44k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 17, False: 9.42k]
  ------------------
  494|     17|        return false;
  495|     17|      }
  496|  43.7M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 43.7M, False: 9.42k]
  ------------------
  497|  43.7M|        lut_table_[j] = i;
  498|  43.7M|      }
  499|  9.42k|      act_prob = cum_prob;
  500|  9.42k|    }
  501|    174|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 19, False: 155]
  ------------------
  502|     19|      return false;
  503|     19|    }
  504|    155|    return true;
  505|    174|  }
_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: 9, False: 81]
  ------------------
  424|      9|      return 1;
  425|      9|    }
  426|     81|    ans_.buf = buf;
  427|     81|    x = buf[offset - 1] >> 6;
  428|     81|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 24, False: 57]
  ------------------
  429|     24|      ans_.buf_offset = offset - 1;
  430|     24|      ans_.state = buf[offset - 1] & 0x3F;
  431|     57|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 16, False: 41]
  ------------------
  432|     16|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 8, False: 8]
  ------------------
  433|      8|        return 1;
  434|      8|      }
  435|      8|      ans_.buf_offset = offset - 2;
  436|      8|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     41|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 20, False: 21]
  ------------------
  438|     20|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 17]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     17|      ans_.buf_offset = offset - 3;
  442|     17|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     21|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 21, False: 0]
  ------------------
  444|     21|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 9, False: 12]
  ------------------
  445|      9|        return 1;
  446|      9|      }
  447|     12|      ans_.buf_offset = offset - 4;
  448|     12|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     12|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     61|    ans_.state += l_rans_base;
  453|     61|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     61|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 11, False: 50]
  ------------------
  454|     11|      return 1;
  455|     11|    }
  456|     50|    return 0;
  457|     61|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  465|   265k|  inline int rans_read() {
  466|   265k|    unsigned rem;
  467|   265k|    unsigned quo;
  468|   265k|    struct rans_dec_sym sym;
  469|   266k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 173k, False: 92.7k]
  |  Branch (469:40): [True: 643, False: 173k]
  ------------------
  470|    643|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    643|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    643|    }
  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|   265k|    quo = ans_.state / rans_precision;
  475|   265k|    rem = ans_.state % rans_precision;
  476|   265k|    fetch_sym(&sym, rem);
  477|   265k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   265k|    return sym.val;
  479|   265k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  508|   265k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   265k|    uint32_t symbol = lut_table_[rem];
  510|   265k|    out->val = symbol;
  511|   265k|    out->prob = probability_table_[symbol].prob;
  512|   265k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   265k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  459|     50|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    373|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  484|    235|                                       uint32_t num_symbols) {
  485|    235|    lut_table_.resize(rans_precision);
  486|    235|    probability_table_.resize(num_symbols);
  487|    235|    uint32_t cum_prob = 0;
  488|    235|    uint32_t act_prob = 0;
  489|  5.73k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 5.51k, False: 219]
  ------------------
  490|  5.51k|      probability_table_[i].prob = token_probs[i];
  491|  5.51k|      probability_table_[i].cum_prob = cum_prob;
  492|  5.51k|      cum_prob += token_probs[i];
  493|  5.51k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 16, False: 5.49k]
  ------------------
  494|     16|        return false;
  495|     16|      }
  496|   108M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 108M, False: 5.49k]
  ------------------
  497|   108M|        lut_table_[j] = i;
  498|   108M|      }
  499|  5.49k|      act_prob = cum_prob;
  500|  5.49k|    }
  501|    219|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 21, False: 198]
  ------------------
  502|     21|      return false;
  503|     21|    }
  504|    198|    return true;
  505|    219|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|    114|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    114|    unsigned x;
  423|    114|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 9, False: 105]
  ------------------
  424|      9|      return 1;
  425|      9|    }
  426|    105|    ans_.buf = buf;
  427|    105|    x = buf[offset - 1] >> 6;
  428|    105|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 24, False: 81]
  ------------------
  429|     24|      ans_.buf_offset = offset - 1;
  430|     24|      ans_.state = buf[offset - 1] & 0x3F;
  431|     81|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 22, False: 59]
  ------------------
  432|     22|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 10, False: 12]
  ------------------
  433|     10|        return 1;
  434|     10|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     59|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 25, False: 34]
  ------------------
  438|     25|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 11, False: 14]
  ------------------
  439|     11|        return 1;
  440|     11|      }
  441|     14|      ans_.buf_offset = offset - 3;
  442|     14|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     34|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 34, False: 0]
  ------------------
  444|     34|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 10, False: 24]
  ------------------
  445|     10|        return 1;
  446|     10|      }
  447|     24|      ans_.buf_offset = offset - 4;
  448|     24|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     24|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     74|    ans_.state += l_rans_base;
  453|     74|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     74|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 10, False: 64]
  ------------------
  454|     10|      return 1;
  455|     10|    }
  456|     64|    return 0;
  457|     74|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  465|   486k|  inline int rans_read() {
  466|   486k|    unsigned rem;
  467|   486k|    unsigned quo;
  468|   486k|    struct rans_dec_sym sym;
  469|   487k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 99.0k, False: 388k]
  |  Branch (469:40): [True: 1.01k, False: 98.0k]
  ------------------
  470|  1.01k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.01k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  1.01k|    }
  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|   486k|    quo = ans_.state / rans_precision;
  475|   486k|    rem = ans_.state % rans_precision;
  476|   486k|    fetch_sym(&sym, rem);
  477|   486k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   486k|    return sym.val;
  479|   486k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  508|   486k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   486k|    uint32_t symbol = lut_table_[rem];
  510|   486k|    out->val = symbol;
  511|   486k|    out->prob = probability_table_[symbol].prob;
  512|   486k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   486k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  459|     64|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.43k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  484|    901|                                       uint32_t num_symbols) {
  485|    901|    lut_table_.resize(rans_precision);
  486|    901|    probability_table_.resize(num_symbols);
  487|    901|    uint32_t cum_prob = 0;
  488|    901|    uint32_t act_prob = 0;
  489|  9.37k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 8.51k, False: 861]
  ------------------
  490|  8.51k|      probability_table_[i].prob = token_probs[i];
  491|  8.51k|      probability_table_[i].cum_prob = cum_prob;
  492|  8.51k|      cum_prob += token_probs[i];
  493|  8.51k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 40, False: 8.47k]
  ------------------
  494|     40|        return false;
  495|     40|      }
  496|   851M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 851M, False: 8.47k]
  ------------------
  497|   851M|        lut_table_[j] = i;
  498|   851M|      }
  499|  8.47k|      act_prob = cum_prob;
  500|  8.47k|    }
  501|    861|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 67, False: 794]
  ------------------
  502|     67|      return false;
  503|     67|    }
  504|    794|    return true;
  505|    861|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    450|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    450|    unsigned x;
  423|    450|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 30, False: 420]
  ------------------
  424|     30|      return 1;
  425|     30|    }
  426|    420|    ans_.buf = buf;
  427|    420|    x = buf[offset - 1] >> 6;
  428|    420|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 107, False: 313]
  ------------------
  429|    107|      ans_.buf_offset = offset - 1;
  430|    107|      ans_.state = buf[offset - 1] & 0x3F;
  431|    313|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 85, False: 228]
  ------------------
  432|     85|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 33, False: 52]
  ------------------
  433|     33|        return 1;
  434|     33|      }
  435|     52|      ans_.buf_offset = offset - 2;
  436|     52|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    228|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 93, False: 135]
  ------------------
  438|     93|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 35, False: 58]
  ------------------
  439|     35|        return 1;
  440|     35|      }
  441|     58|      ans_.buf_offset = offset - 3;
  442|     58|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    135|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 135, False: 0]
  ------------------
  444|    135|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 34, False: 101]
  ------------------
  445|     34|        return 1;
  446|     34|      }
  447|    101|      ans_.buf_offset = offset - 4;
  448|    101|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|    101|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|    318|    ans_.state += l_rans_base;
  453|    318|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    318|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 26, False: 292]
  ------------------
  454|     26|      return 1;
  455|     26|    }
  456|    292|    return 0;
  457|    318|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  465|  97.0M|  inline int rans_read() {
  466|  97.0M|    unsigned rem;
  467|  97.0M|    unsigned quo;
  468|  97.0M|    struct rans_dec_sym sym;
  469|  97.0M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 81.5M, False: 15.5M]
  |  Branch (469:40): [True: 7.01k, False: 81.4M]
  ------------------
  470|  7.01k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  7.01k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  7.01k|    }
  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|  97.0M|    quo = ans_.state / rans_precision;
  475|  97.0M|    rem = ans_.state % rans_precision;
  476|  97.0M|    fetch_sym(&sym, rem);
  477|  97.0M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|  97.0M|    return sym.val;
  479|  97.0M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  508|  97.0M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|  97.0M|    uint32_t symbol = lut_table_[rem];
  510|  97.0M|    out->val = symbol;
  511|  97.0M|    out->prob = probability_table_[symbol].prob;
  512|  97.0M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|  97.0M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  459|    292|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.25k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.25k|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.25k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.25k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.25k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.25k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.25k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 121, False: 1.13k]
  ------------------
   67|    121|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 119]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|    121|  } else
   72|  1.13k|#endif
   73|  1.13k|  {
   74|  1.13k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 26, False: 1.11k]
  ------------------
   75|     26|      return false;
   76|     26|    }
   77|  1.13k|  }
   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.22k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 83, False: 1.14k]
  ------------------
   83|     83|    return false;
   84|     83|  }
   85|  1.14k|  probability_table_.resize(num_symbols_);
   86|  1.14k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 334, False: 812]
  ------------------
   87|    334|    return true;
   88|    334|  }
   89|       |  // Decode the table.
   90|  2.40M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.40M, False: 649]
  ------------------
   91|  2.40M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  2.40M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 69, False: 2.40M]
  ------------------
   95|     69|      return false;
   96|     69|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  2.40M|    const int token = prob_data & 3;
  102|  2.40M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.50M, False: 903k]
  ------------------
  103|  1.50M|      const uint32_t offset = prob_data >> 2;
  104|  1.50M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 78, False: 1.50M]
  ------------------
  105|     78|        return false;
  106|     78|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  87.9M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 86.4M, False: 1.50M]
  ------------------
  109|  86.4M|        probability_table_[i + j] = 0;
  110|  86.4M|      }
  111|  1.50M|      i += offset;
  112|  1.50M|    } else {
  113|   903k|      const int extra_bytes = token;
  114|   903k|      uint32_t prob = prob_data >> 2;
  115|  2.58M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.68M, False: 903k]
  ------------------
  116|  1.68M|        uint8_t eb;
  117|  1.68M|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 1.68M]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.68M|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.68M|      }
  124|   903k|      probability_table_[i] = prob;
  125|   903k|    }
  126|  2.40M|  }
  127|    649|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 146, False: 503]
  ------------------
  128|    146|    return false;
  129|    146|  }
  130|    503|  return true;
  131|    649|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    726|    DecoderBuffer *buffer) {
  136|    726|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    726|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    726|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    726|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 36, False: 690]
  ------------------
  140|     36|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 32]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     36|  } else
  145|    690|#endif
  146|    690|  {
  147|    690|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 684]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|    690|  }
  151|    716|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 56, False: 660]
  ------------------
  152|     56|    return false;
  153|     56|  }
  154|    660|  const uint8_t *const data_head =
  155|    660|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    660|  buffer->Advance(bytes_encoded);
  158|    660|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 139, False: 521]
  ------------------
  159|    139|    return false;
  160|    139|  }
  161|    521|  return true;
  162|    660|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    643|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  16.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    479|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    479|  ans_.read_end();
  167|    479|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    374|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    374|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    374|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 374]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    374|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    374|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    374|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 23, False: 351]
  ------------------
   67|     23|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 20]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     23|  } else
   72|    351|#endif
   73|    351|  {
   74|    351|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 343]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    351|  }
   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|    363|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 347]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    347|  probability_table_.resize(num_symbols_);
   86|    347|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 15, False: 332]
  ------------------
   87|     15|    return true;
   88|     15|  }
   89|       |  // Decode the table.
   90|  1.13M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.13M, False: 263]
  ------------------
   91|  1.13M|    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.13M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 32, False: 1.13M]
  ------------------
   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|  1.13M|    const int token = prob_data & 3;
  102|  1.13M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 448k, False: 690k]
  ------------------
  103|   448k|      const uint32_t offset = prob_data >> 2;
  104|   448k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 448k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  15.6M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 15.1M, False: 448k]
  ------------------
  109|  15.1M|        probability_table_[i + j] = 0;
  110|  15.1M|      }
  111|   448k|      i += offset;
  112|   690k|    } else {
  113|   690k|      const int extra_bytes = token;
  114|   690k|      uint32_t prob = prob_data >> 2;
  115|  1.02M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 329k, False: 690k]
  ------------------
  116|   329k|        uint8_t eb;
  117|   329k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 329k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   329k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   329k|      }
  124|   690k|      probability_table_[i] = prob;
  125|   690k|    }
  126|  1.13M|  }
  127|    263|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 132, False: 131]
  ------------------
  128|    132|    return false;
  129|    132|  }
  130|    131|  return true;
  131|    263|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    146|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    131|    DecoderBuffer *buffer) {
  136|    131|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    131|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    131|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    131|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 128]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 3]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      3|  } else
  145|    128|#endif
  146|    128|  {
  147|    128|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 119]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    128|  }
  151|    122|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 12, False: 110]
  ------------------
  152|     12|    return false;
  153|     12|  }
  154|    110|  const uint8_t *const data_head =
  155|    110|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    110|  buffer->Advance(bytes_encoded);
  158|    110|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 19, False: 91]
  ------------------
  159|     19|    return false;
  160|     19|  }
  161|     91|  return true;
  162|    110|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  8.19M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|     91|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     91|  ans_.read_end();
  167|     91|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    392|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    392|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    392|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 392]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    392|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    392|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    392|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 38, False: 354]
  ------------------
   67|     38|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 37]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     38|  } else
   72|    354|#endif
   73|    354|  {
   74|    354|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 344]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    354|  }
   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|    381|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 360]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    360|  probability_table_.resize(num_symbols_);
   86|    360|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 14, False: 346]
  ------------------
   87|     14|    return true;
   88|     14|  }
   89|       |  // Decode the table.
   90|   927k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 927k, False: 262]
  ------------------
   91|   927k|    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|   927k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 41, False: 927k]
  ------------------
   95|     41|      return false;
   96|     41|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   927k|    const int token = prob_data & 3;
  102|   927k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 785k, False: 142k]
  ------------------
  103|   785k|      const uint32_t offset = prob_data >> 2;
  104|   785k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 785k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  34.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 33.9M, False: 785k]
  ------------------
  109|  33.9M|        probability_table_[i + j] = 0;
  110|  33.9M|      }
  111|   785k|      i += offset;
  112|   785k|    } else {
  113|   142k|      const int extra_bytes = token;
  114|   142k|      uint32_t prob = prob_data >> 2;
  115|   284k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 142k, False: 142k]
  ------------------
  116|   142k|        uint8_t eb;
  117|   142k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 142k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   142k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   142k|      }
  124|   142k|      probability_table_[i] = prob;
  125|   142k|    }
  126|   927k|  }
  127|    262|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 50, False: 212]
  ------------------
  128|     50|    return false;
  129|     50|  }
  130|    212|  return true;
  131|    262|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    226|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    212|    DecoderBuffer *buffer) {
  136|    212|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    212|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    212|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    212|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 192]
  ------------------
  140|     20|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 20]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     20|  } else
  145|    192|#endif
  146|    192|  {
  147|    192|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 183]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    192|  }
  151|    203|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 31, False: 172]
  ------------------
  152|     31|    return false;
  153|     31|  }
  154|    172|  const uint8_t *const data_head =
  155|    172|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    172|  buffer->Advance(bytes_encoded);
  158|    172|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 37, False: 135]
  ------------------
  159|     37|    return false;
  160|     37|  }
  161|    135|  return true;
  162|    172|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  21.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    135|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    135|  ans_.read_end();
  167|    135|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    335|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    335|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    335|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 335]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    335|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    335|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    335|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 25, False: 310]
  ------------------
   67|     25|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 25]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     25|  } else
   72|    310|#endif
   73|    310|  {
   74|    310|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 299]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    310|  }
   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|    324|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 315]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    315|  probability_table_.resize(num_symbols_);
   86|    315|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 314]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  67.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 67.2k, False: 252]
  ------------------
   91|  67.2k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  67.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 27, False: 67.2k]
  ------------------
   95|     27|      return false;
   96|     27|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  67.2k|    const int token = prob_data & 3;
  102|  67.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.0k, False: 57.2k]
  ------------------
  103|  10.0k|      const uint32_t offset = prob_data >> 2;
  104|  10.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 9.97k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   383k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 373k, False: 9.97k]
  ------------------
  109|   373k|        probability_table_[i + j] = 0;
  110|   373k|      }
  111|  9.97k|      i += offset;
  112|  57.2k|    } else {
  113|  57.2k|      const int extra_bytes = token;
  114|  57.2k|      uint32_t prob = prob_data >> 2;
  115|   107k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 50.3k, False: 57.1k]
  ------------------
  116|  50.3k|        uint8_t eb;
  117|  50.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 50.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|  50.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  50.3k|      }
  124|  57.1k|      probability_table_[i] = prob;
  125|  57.1k|    }
  126|  67.2k|  }
  127|    252|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 229]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    229|  return true;
  131|    252|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    230|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    229|    DecoderBuffer *buffer) {
  136|    229|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    229|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    229|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    229|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 22, False: 207]
  ------------------
  140|     22|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 18]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     22|  } else
  145|    207|#endif
  146|    207|  {
  147|    207|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 198]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    207|  }
  151|    216|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 28, False: 188]
  ------------------
  152|     28|    return false;
  153|     28|  }
  154|    188|  const uint8_t *const data_head =
  155|    188|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    188|  buffer->Advance(bytes_encoded);
  158|    188|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 32, False: 156]
  ------------------
  159|     32|    return false;
  160|     32|  }
  161|    156|  return true;
  162|    188|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  29.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    156|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    156|  ans_.read_end();
  167|    156|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    197|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    197|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    197|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 197]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    197|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    197|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    197|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 22, False: 175]
  ------------------
   67|     22|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 22]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     22|  } else
   72|    175|#endif
   73|    175|  {
   74|    175|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 167]
  ------------------
   75|      8|      return false;
   76|      8|    }
   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|    189|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 184]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    184|  probability_table_.resize(num_symbols_);
   86|    184|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 183]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  5.75k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 5.62k, False: 128]
  ------------------
   91|  5.62k|    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|  5.62k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 26, False: 5.60k]
  ------------------
   95|     26|      return false;
   96|     26|    }
   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|  5.60k|    const int token = prob_data & 3;
  102|  5.60k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.99k, False: 2.60k]
  ------------------
  103|  2.99k|      const uint32_t offset = prob_data >> 2;
  104|  2.99k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 2.98k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  91.7k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 88.7k, False: 2.98k]
  ------------------
  109|  88.7k|        probability_table_[i + j] = 0;
  110|  88.7k|      }
  111|  2.98k|      i += offset;
  112|  2.98k|    } else {
  113|  2.60k|      const int extra_bytes = token;
  114|  2.60k|      uint32_t prob = prob_data >> 2;
  115|  4.19k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.60k, False: 2.59k]
  ------------------
  116|  1.60k|        uint8_t eb;
  117|  1.60k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 1.59k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.59k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.59k|      }
  124|  2.59k|      probability_table_[i] = prob;
  125|  2.59k|    }
  126|  5.60k|  }
  127|    128|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 10, False: 118]
  ------------------
  128|     10|    return false;
  129|     10|  }
  130|    118|  return true;
  131|    128|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    119|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    118|    DecoderBuffer *buffer) {
  136|    118|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    118|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    118|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    118|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 17, False: 101]
  ------------------
  140|     17|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 14]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     17|  } else
  145|    101|#endif
  146|    101|  {
  147|    101|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 99]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    101|  }
  151|    113|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 16, False: 97]
  ------------------
  152|     16|    return false;
  153|     16|  }
  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: 25, False: 72]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     72|  return true;
  162|     97|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  1.40M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     72|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     72|  ans_.read_end();
  167|     72|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    317|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    317|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    317|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 317]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    317|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    317|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    317|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 38, False: 279]
  ------------------
   67|     38|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 38]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     38|  } else
   72|    279|#endif
   73|    279|  {
   74|    279|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 277]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    279|  }
   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|    315|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 305]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    305|  probability_table_.resize(num_symbols_);
   86|    305|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 305]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  83.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 82.8k, False: 242]
  ------------------
   91|  82.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|  82.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 32, False: 82.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|  82.8k|    const int token = prob_data & 3;
  102|  82.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 71.2k, False: 11.5k]
  ------------------
  103|  71.2k|      const uint32_t offset = prob_data >> 2;
  104|  71.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 19, False: 71.2k]
  ------------------
  105|     19|        return false;
  106|     19|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.21M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.14M, False: 71.2k]
  ------------------
  109|  2.14M|        probability_table_[i + j] = 0;
  110|  2.14M|      }
  111|  71.2k|      i += offset;
  112|  71.2k|    } else {
  113|  11.5k|      const int extra_bytes = token;
  114|  11.5k|      uint32_t prob = prob_data >> 2;
  115|  21.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 9.48k, False: 11.5k]
  ------------------
  116|  9.48k|        uint8_t eb;
  117|  9.48k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 9.47k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  9.47k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  9.47k|      }
  124|  11.5k|      probability_table_[i] = prob;
  125|  11.5k|    }
  126|  82.8k|  }
  127|    242|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 229]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|    229|  return true;
  131|    242|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    229|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    229|    DecoderBuffer *buffer) {
  136|    229|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    229|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    229|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    229|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 33, False: 196]
  ------------------
  140|     33|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 30]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     33|  } 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|    217|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 33, False: 184]
  ------------------
  152|     33|    return false;
  153|     33|  }
  154|    184|  const uint8_t *const data_head =
  155|    184|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    184|  buffer->Advance(bytes_encoded);
  158|    184|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 30, False: 154]
  ------------------
  159|     30|    return false;
  160|     30|  }
  161|    154|  return true;
  162|    184|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  1.60M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    154|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    154|  ans_.read_end();
  167|    154|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    329|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    329|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    329|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 329]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    329|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    329|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    329|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 43, False: 286]
  ------------------
   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|    286|#endif
   73|    286|  {
   74|    286|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 278]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    286|  }
   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: 4, False: 315]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|    315|  probability_table_.resize(num_symbols_);
   86|    315|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 313]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  1.01M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.01M, False: 233]
  ------------------
   91|  1.01M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.01M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 38, False: 1.01M]
  ------------------
   95|     38|      return false;
   96|     38|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.01M|    const int token = prob_data & 3;
  102|  1.01M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 208k, False: 806k]
  ------------------
  103|   208k|      const uint32_t offset = prob_data >> 2;
  104|   208k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 23, False: 208k]
  ------------------
  105|     23|        return false;
  106|     23|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.67M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.46M, False: 208k]
  ------------------
  109|  5.46M|        probability_table_[i + j] = 0;
  110|  5.46M|      }
  111|   208k|      i += offset;
  112|   806k|    } else {
  113|   806k|      const int extra_bytes = token;
  114|   806k|      uint32_t prob = prob_data >> 2;
  115|  1.47M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 673k, False: 806k]
  ------------------
  116|   673k|        uint8_t eb;
  117|   673k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 673k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   673k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   673k|      }
  124|   806k|      probability_table_[i] = prob;
  125|   806k|    }
  126|  1.01M|  }
  127|    233|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 213]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|    213|  return true;
  131|    233|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    215|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    213|    DecoderBuffer *buffer) {
  136|    213|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    213|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    213|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    213|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 18, False: 195]
  ------------------
  140|     18|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 17]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     18|  } else
  145|    195|#endif
  146|    195|  {
  147|    195|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 192]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    195|  }
  151|    209|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 36, False: 173]
  ------------------
  152|     36|    return false;
  153|     36|  }
  154|    173|  const uint8_t *const data_head =
  155|    173|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    173|  buffer->Advance(bytes_encoded);
  158|    173|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 29, False: 144]
  ------------------
  159|     29|    return false;
  160|     29|  }
  161|    144|  return true;
  162|    173|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  46.2M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    144|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    144|  ans_.read_end();
  167|    144|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    246|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    246|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    246|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 246]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    246|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    246|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    246|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 41, False: 205]
  ------------------
   67|     41|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 39]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     41|  } else
   72|    205|#endif
   73|    205|  {
   74|    205|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 199]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    205|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    238|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 225]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    225|  probability_table_.resize(num_symbols_);
   86|    225|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 222]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   385k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 385k, False: 155]
  ------------------
   91|   385k|    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|   385k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 23, False: 385k]
  ------------------
   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|   385k|    const int token = prob_data & 3;
  102|   385k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 340k, False: 45.5k]
  ------------------
  103|   340k|      const uint32_t offset = prob_data >> 2;
  104|   340k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 340k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  17.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 17.5M, False: 340k]
  ------------------
  109|  17.5M|        probability_table_[i + j] = 0;
  110|  17.5M|      }
  111|   340k|      i += offset;
  112|   340k|    } else {
  113|  45.5k|      const int extra_bytes = token;
  114|  45.5k|      uint32_t prob = prob_data >> 2;
  115|  85.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 39.6k, False: 45.5k]
  ------------------
  116|  39.6k|        uint8_t eb;
  117|  39.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 39.6k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  39.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  39.6k|      }
  124|  45.5k|      probability_table_[i] = prob;
  125|  45.5k|    }
  126|   385k|  }
  127|    155|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 15, False: 140]
  ------------------
  128|     15|    return false;
  129|     15|  }
  130|    140|  return true;
  131|    155|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    143|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    140|    DecoderBuffer *buffer) {
  136|    140|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    140|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    140|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    140|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 22, False: 118]
  ------------------
  140|     22|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 21]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     22|  } else
  145|    118|#endif
  146|    118|  {
  147|    118|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 118]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    118|  }
  151|    139|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 30, False: 109]
  ------------------
  152|     30|    return false;
  153|     30|  }
  154|    109|  const uint8_t *const data_head =
  155|    109|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    109|  buffer->Advance(bytes_encoded);
  158|    109|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 39, False: 70]
  ------------------
  159|     39|    return false;
  160|     39|  }
  161|     70|  return true;
  162|    109|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  44.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     70|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     70|  ans_.read_end();
  167|     70|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    224|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_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: 16, False: 208]
  ------------------
   67|     16|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 16]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     16|  } else
   72|    208|#endif
   73|    208|  {
   74|    208|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 199]
  ------------------
   75|      9|      return false;
   76|      9|    }
   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|    215|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 206]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    206|  probability_table_.resize(num_symbols_);
   86|    206|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 202]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  23.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 23.1k, False: 144]
  ------------------
   91|  23.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  23.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 23.1k]
  ------------------
   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|  23.1k|    const int token = prob_data & 3;
  102|  23.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.20k, False: 17.9k]
  ------------------
  103|  5.20k|      const uint32_t offset = prob_data >> 2;
  104|  5.20k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 5.19k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   204k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 199k, False: 5.19k]
  ------------------
  109|   199k|        probability_table_[i + j] = 0;
  110|   199k|      }
  111|  5.19k|      i += offset;
  112|  17.9k|    } else {
  113|  17.9k|      const int extra_bytes = token;
  114|  17.9k|      uint32_t prob = prob_data >> 2;
  115|  28.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.1k, False: 17.9k]
  ------------------
  116|  10.1k|        uint8_t eb;
  117|  10.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 10.0k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.0k|      }
  124|  17.9k|      probability_table_[i] = prob;
  125|  17.9k|    }
  126|  23.1k|  }
  127|    144|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 123]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    123|  return true;
  131|    144|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    127|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    123|    DecoderBuffer *buffer) {
  136|    123|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    123|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    123|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    123|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 120]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 3]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      3|  } else
  145|    120|#endif
  146|    120|  {
  147|    120|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 111]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    120|  }
  151|    114|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 16, False: 98]
  ------------------
  152|     16|    return false;
  153|     16|  }
  154|     98|  const uint8_t *const data_head =
  155|     98|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     98|  buffer->Advance(bytes_encoded);
  158|     98|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 64]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|     64|  return true;
  162|     98|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   441k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     64|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     64|  ans_.read_end();
  167|     64|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    258|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    258|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    258|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 258]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    258|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    258|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    258|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 22, False: 236]
  ------------------
   67|     22|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 22]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     22|  } else
   72|    236|#endif
   73|    236|  {
   74|    236|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 234]
  ------------------
   75|      2|      return false;
   76|      2|    }
   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|    256|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 245]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    245|  probability_table_.resize(num_symbols_);
   86|    245|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 236]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|   333k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 333k, False: 160]
  ------------------
   91|   333k|    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|   333k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 35, False: 333k]
  ------------------
   95|     35|      return false;
   96|     35|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   333k|    const int token = prob_data & 3;
  102|   333k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 209k, False: 124k]
  ------------------
  103|   209k|      const uint32_t offset = prob_data >> 2;
  104|   209k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 31, False: 209k]
  ------------------
  105|     31|        return false;
  106|     31|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.30M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.09M, False: 209k]
  ------------------
  109|  5.09M|        probability_table_[i + j] = 0;
  110|  5.09M|      }
  111|   209k|      i += offset;
  112|   209k|    } else {
  113|   124k|      const int extra_bytes = token;
  114|   124k|      uint32_t prob = prob_data >> 2;
  115|   238k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 113k, False: 124k]
  ------------------
  116|   113k|        uint8_t eb;
  117|   113k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 113k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   113k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   113k|      }
  124|   124k|      probability_table_[i] = prob;
  125|   124k|    }
  126|   333k|  }
  127|    160|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 46, False: 114]
  ------------------
  128|     46|    return false;
  129|     46|  }
  130|    114|  return true;
  131|    160|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    123|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    114|    DecoderBuffer *buffer) {
  136|    114|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    114|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    114|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    114|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 112]
  ------------------
  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|    112|#endif
  146|    112|  {
  147|    112|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 110]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    112|  }
  151|    112|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 18, False: 94]
  ------------------
  152|     18|    return false;
  153|     18|  }
  154|     94|  const uint8_t *const data_head =
  155|     94|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     94|  buffer->Advance(bytes_encoded);
  158|     94|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 41, False: 53]
  ------------------
  159|     41|    return false;
  160|     41|  }
  161|     53|  return true;
  162|     94|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   398k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     53|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     53|  ans_.read_end();
  167|     53|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    305|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    305|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    305|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 305]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    305|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    305|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    305|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 263]
  ------------------
   67|     42|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 40]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     42|  } else
   72|    263|#endif
   73|    263|  {
   74|    263|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 257]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    263|  }
   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|    297|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 285]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    285|  probability_table_.resize(num_symbols_);
   86|    285|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 281]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  72.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 72.1k, False: 203]
  ------------------
   91|  72.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  72.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 27, False: 72.1k]
  ------------------
   95|     27|      return false;
   96|     27|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  72.1k|    const int token = prob_data & 3;
  102|  72.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 18.8k, False: 53.2k]
  ------------------
  103|  18.8k|      const uint32_t offset = prob_data >> 2;
  104|  18.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 18.8k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   637k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 619k, False: 18.8k]
  ------------------
  109|   619k|        probability_table_[i + j] = 0;
  110|   619k|      }
  111|  18.8k|      i += offset;
  112|  53.2k|    } else {
  113|  53.2k|      const int extra_bytes = token;
  114|  53.2k|      uint32_t prob = prob_data >> 2;
  115|  68.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 15.6k, False: 53.2k]
  ------------------
  116|  15.6k|        uint8_t eb;
  117|  15.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 15.6k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  15.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  15.6k|      }
  124|  53.2k|      probability_table_[i] = prob;
  125|  53.2k|    }
  126|  72.1k|  }
  127|    203|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 45, False: 158]
  ------------------
  128|     45|    return false;
  129|     45|  }
  130|    158|  return true;
  131|    203|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    162|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    158|    DecoderBuffer *buffer) {
  136|    158|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    158|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    158|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    158|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 142]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 16]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     16|  } else
  145|    142|#endif
  146|    142|  {
  147|    142|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 141]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    142|  }
  151|    157|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 59, False: 98]
  ------------------
  152|     59|    return false;
  153|     59|  }
  154|     98|  const uint8_t *const data_head =
  155|     98|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     98|  buffer->Advance(bytes_encoded);
  158|     98|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 36, False: 62]
  ------------------
  159|     36|    return false;
  160|     36|  }
  161|     62|  return true;
  162|     98|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   293k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     62|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     62|  ans_.read_end();
  167|     62|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    283|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_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: 54, False: 229]
  ------------------
   67|     54|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 52]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     54|  } else
   72|    229|#endif
   73|    229|  {
   74|    229|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 225]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    229|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    277|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 264]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    264|  probability_table_.resize(num_symbols_);
   86|    264|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 264]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   927k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 926k, False: 191]
  ------------------
   91|   926k|    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|   926k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 926k]
  ------------------
   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|   926k|    const int token = prob_data & 3;
  102|   926k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 523k, False: 403k]
  ------------------
  103|   523k|      const uint32_t offset = prob_data >> 2;
  104|   523k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 523k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  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.4M, False: 523k]
  ------------------
  109|  14.4M|        probability_table_[i + j] = 0;
  110|  14.4M|      }
  111|   523k|      i += offset;
  112|   523k|    } else {
  113|   403k|      const int extra_bytes = token;
  114|   403k|      uint32_t prob = prob_data >> 2;
  115|   769k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 366k, False: 403k]
  ------------------
  116|   366k|        uint8_t eb;
  117|   366k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 366k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   366k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   366k|      }
  124|   403k|      probability_table_[i] = prob;
  125|   403k|    }
  126|   926k|  }
  127|    191|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 36, False: 155]
  ------------------
  128|     36|    return false;
  129|     36|  }
  130|    155|  return true;
  131|    191|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    155|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    155|    DecoderBuffer *buffer) {
  136|    155|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    155|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    155|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    155|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 128]
  ------------------
  140|     27|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 27]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     27|  } else
  145|    128|#endif
  146|    128|  {
  147|    128|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 121]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    128|  }
  151|    148|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 58, False: 90]
  ------------------
  152|     58|    return false;
  153|     58|  }
  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|   265k|  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|    373|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    373|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    373|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 373]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    373|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    373|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    373|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 78, False: 295]
  ------------------
   67|     78|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 78]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     78|  } else
   72|    295|#endif
   73|    295|  {
   74|    295|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 282]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    295|  }
   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|    360|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 17, False: 343]
  ------------------
   83|     17|    return false;
   84|     17|  }
   85|    343|  probability_table_.resize(num_symbols_);
   86|    343|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 28, False: 315]
  ------------------
   87|     28|    return true;
   88|     28|  }
   89|       |  // Decode the table.
   90|   396k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 395k, False: 235]
  ------------------
   91|   395k|    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|   395k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 40, False: 395k]
  ------------------
   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|   395k|    const int token = prob_data & 3;
  102|   395k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 157k, False: 238k]
  ------------------
  103|   157k|      const uint32_t offset = prob_data >> 2;
  104|   157k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 157k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.31M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.15M, False: 157k]
  ------------------
  109|  4.15M|        probability_table_[i + j] = 0;
  110|  4.15M|      }
  111|   157k|      i += offset;
  112|   238k|    } else {
  113|   238k|      const int extra_bytes = token;
  114|   238k|      uint32_t prob = prob_data >> 2;
  115|   481k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 243k, False: 238k]
  ------------------
  116|   243k|        uint8_t eb;
  117|   243k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 243k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   243k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   243k|      }
  124|   238k|      probability_table_[i] = prob;
  125|   238k|    }
  126|   395k|  }
  127|    235|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 37, False: 198]
  ------------------
  128|     37|    return false;
  129|     37|  }
  130|    198|  return true;
  131|    235|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    226|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    198|    DecoderBuffer *buffer) {
  136|    198|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    198|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    198|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    198|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 50, False: 148]
  ------------------
  140|     50|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 50]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     50|  } else
  145|    148|#endif
  146|    148|  {
  147|    148|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 13, False: 135]
  ------------------
  148|     13|      return false;
  149|     13|    }
  150|    148|  }
  151|    185|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 71, False: 114]
  ------------------
  152|     71|    return false;
  153|     71|  }
  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: 50, False: 64]
  ------------------
  159|     50|    return false;
  160|     50|  }
  161|     64|  return true;
  162|    114|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   486k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     64|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     64|  ans_.read_end();
  167|     64|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    305|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    305|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    305|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 305]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    305|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    305|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    305|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 79, False: 226]
  ------------------
   67|     79|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 76]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     79|  } else
   72|    226|#endif
   73|    226|  {
   74|    226|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 223]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    226|  }
   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|    299|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 280]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    280|  probability_table_.resize(num_symbols_);
   86|    280|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 275]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|   239k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 239k, False: 179]
  ------------------
   91|   239k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   239k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 34, False: 239k]
  ------------------
   95|     34|      return false;
   96|     34|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   239k|    const int token = prob_data & 3;
  102|   239k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 151k, False: 87.2k]
  ------------------
  103|   151k|      const uint32_t offset = prob_data >> 2;
  104|   151k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 39, False: 151k]
  ------------------
  105|     39|        return false;
  106|     39|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  8.41M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.26M, False: 151k]
  ------------------
  109|  8.26M|        probability_table_[i + j] = 0;
  110|  8.26M|      }
  111|   151k|      i += offset;
  112|   151k|    } else {
  113|  87.2k|      const int extra_bytes = token;
  114|  87.2k|      uint32_t prob = prob_data >> 2;
  115|   172k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 85.7k, False: 87.2k]
  ------------------
  116|  85.7k|        uint8_t eb;
  117|  85.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 85.7k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  85.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  85.7k|      }
  124|  87.2k|      probability_table_[i] = prob;
  125|  87.2k|    }
  126|   239k|  }
  127|    179|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 159]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|    159|  return true;
  131|    179|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    164|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    159|    DecoderBuffer *buffer) {
  136|    159|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    159|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    159|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    159|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 42, False: 117]
  ------------------
  140|     42|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 42]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     42|  } else
  145|    117|#endif
  146|    117|  {
  147|    117|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 13, False: 104]
  ------------------
  148|     13|      return false;
  149|     13|    }
  150|    117|  }
  151|    146|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 63, False: 83]
  ------------------
  152|     63|    return false;
  153|     63|  }
  154|     83|  const uint8_t *const data_head =
  155|     83|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     83|  buffer->Advance(bytes_encoded);
  158|     83|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 24, False: 59]
  ------------------
  159|     24|    return false;
  160|     24|  }
  161|     59|  return true;
  162|     83|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  6.40M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     59|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     59|  ans_.read_end();
  167|     59|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    310|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    310|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    310|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 310]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    310|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    310|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    310|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 48, False: 262]
  ------------------
   67|     48|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 46]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     48|  } else
   72|    262|#endif
   73|    262|  {
   74|    262|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 257]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    262|  }
   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|    303|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 282]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    282|  probability_table_.resize(num_symbols_);
   86|    282|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 282]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   325k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 325k, False: 191]
  ------------------
   91|   325k|    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|   325k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 28, False: 324k]
  ------------------
   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|   324k|    const int token = prob_data & 3;
  102|   324k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 205k, False: 119k]
  ------------------
  103|   205k|      const uint32_t offset = prob_data >> 2;
  104|   205k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 205k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  6.88M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 6.67M, False: 205k]
  ------------------
  109|  6.67M|        probability_table_[i + j] = 0;
  110|  6.67M|      }
  111|   205k|      i += offset;
  112|   205k|    } else {
  113|   119k|      const int extra_bytes = token;
  114|   119k|      uint32_t prob = prob_data >> 2;
  115|   239k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 120k, False: 119k]
  ------------------
  116|   120k|        uint8_t eb;
  117|   120k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 34, False: 120k]
  ------------------
  118|     34|          return false;
  119|     34|        }
  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|   119k|      probability_table_[i] = prob;
  125|   119k|    }
  126|   324k|  }
  127|    191|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 24, False: 167]
  ------------------
  128|     24|    return false;
  129|     24|  }
  130|    167|  return true;
  131|    191|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    167|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    167|    DecoderBuffer *buffer) {
  136|    167|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    167|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    167|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    167|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 147]
  ------------------
  140|     20|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 20]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     20|  } else
  145|    147|#endif
  146|    147|  {
  147|    147|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 141]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|    147|  }
  151|    161|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 69, False: 92]
  ------------------
  152|     69|    return false;
  153|     69|  }
  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: 38, False: 54]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|     54|  return true;
  162|     92|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  15.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     54|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     54|  ans_.read_end();
  167|     54|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    273|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_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: 76, False: 197]
  ------------------
   67|     76|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 75]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     76|  } else
   72|    197|#endif
   73|    197|  {
   74|    197|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 184]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    197|  }
   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|    259|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 248]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    248|  probability_table_.resize(num_symbols_);
   86|    248|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 247]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   510k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 509k, False: 175]
  ------------------
   91|   509k|    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|   509k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 30, False: 509k]
  ------------------
   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|   509k|    const int token = prob_data & 3;
  102|   509k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 240k, False: 269k]
  ------------------
  103|   240k|      const uint32_t offset = prob_data >> 2;
  104|   240k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 34, False: 240k]
  ------------------
  105|     34|        return false;
  106|     34|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  7.76M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.52M, False: 240k]
  ------------------
  109|  7.52M|        probability_table_[i + j] = 0;
  110|  7.52M|      }
  111|   240k|      i += offset;
  112|   269k|    } else {
  113|   269k|      const int extra_bytes = token;
  114|   269k|      uint32_t prob = prob_data >> 2;
  115|   531k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 261k, False: 269k]
  ------------------
  116|   261k|        uint8_t eb;
  117|   261k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 261k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   261k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   261k|      }
  124|   269k|      probability_table_[i] = prob;
  125|   269k|    }
  126|   509k|  }
  127|    175|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 154]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    154|  return true;
  131|    175|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    155|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    154|    DecoderBuffer *buffer) {
  136|    154|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    154|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    154|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    154|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 45, False: 109]
  ------------------
  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|    109|#endif
  146|    109|  {
  147|    109|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 109]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    109|  }
  151|    154|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 61, False: 93]
  ------------------
  152|     61|    return false;
  153|     61|  }
  154|     93|  const uint8_t *const data_head =
  155|     93|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     93|  buffer->Advance(bytes_encoded);
  158|     93|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 55]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|     55|  return true;
  162|     93|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  24.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     55|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     55|  ans_.read_end();
  167|     55|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    289|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    289|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    289|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 289]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    289|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    289|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    289|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 64, False: 225]
  ------------------
   67|     64|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 62]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     64|  } else
   72|    225|#endif
   73|    225|  {
   74|    225|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 221]
  ------------------
   75|      4|      return false;
   76|      4|    }
   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|    283|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 277]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|    277|  probability_table_.resize(num_symbols_);
   86|    277|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 277]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   310k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 310k, False: 182]
  ------------------
   91|   310k|    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|   310k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 37, False: 310k]
  ------------------
   95|     37|      return false;
   96|     37|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   310k|    const int token = prob_data & 3;
  102|   310k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 189k, False: 120k]
  ------------------
  103|   189k|      const uint32_t offset = prob_data >> 2;
  104|   189k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 189k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  6.45M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 6.27M, False: 189k]
  ------------------
  109|  6.27M|        probability_table_[i + j] = 0;
  110|  6.27M|      }
  111|   189k|      i += offset;
  112|   189k|    } else {
  113|   120k|      const int extra_bytes = token;
  114|   120k|      uint32_t prob = prob_data >> 2;
  115|   207k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 86.5k, False: 120k]
  ------------------
  116|  86.5k|        uint8_t eb;
  117|  86.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 86.5k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  86.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  86.5k|      }
  124|   120k|      probability_table_[i] = prob;
  125|   120k|    }
  126|   310k|  }
  127|    182|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 30, False: 152]
  ------------------
  128|     30|    return false;
  129|     30|  }
  130|    152|  return true;
  131|    182|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    152|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    152|    DecoderBuffer *buffer) {
  136|    152|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    152|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    152|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    152|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 37, False: 115]
  ------------------
  140|     37|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 37]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     37|  } else
  145|    115|#endif
  146|    115|  {
  147|    115|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 115]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    115|  }
  151|    152|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 53, False: 99]
  ------------------
  152|     53|    return false;
  153|     53|  }
  154|     99|  const uint8_t *const data_head =
  155|     99|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     99|  buffer->Advance(bytes_encoded);
  158|     99|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 41, False: 58]
  ------------------
  159|     41|    return false;
  160|     41|  }
  161|     58|  return true;
  162|     99|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  9.52M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    261|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    261|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    261|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 261]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    261|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    261|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    261|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 56, False: 205]
  ------------------
   67|     56|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 56]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     56|  } else
   72|    205|#endif
   73|    205|  {
   74|    205|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 201]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    205|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    257|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 256]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|    256|  probability_table_.resize(num_symbols_);
   86|    256|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 249]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|   430k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 430k, False: 174]
  ------------------
   91|   430k|    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|   430k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 38, False: 430k]
  ------------------
   95|     38|      return false;
   96|     38|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   430k|    const int token = prob_data & 3;
  102|   430k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 258k, False: 171k]
  ------------------
  103|   258k|      const uint32_t offset = prob_data >> 2;
  104|   258k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 258k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  6.76M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 6.50M, False: 258k]
  ------------------
  109|  6.50M|        probability_table_[i + j] = 0;
  110|  6.50M|      }
  111|   258k|      i += offset;
  112|   258k|    } else {
  113|   171k|      const int extra_bytes = token;
  114|   171k|      uint32_t prob = prob_data >> 2;
  115|   314k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 142k, False: 171k]
  ------------------
  116|   142k|        uint8_t eb;
  117|   142k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 142k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   142k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   142k|      }
  124|   171k|      probability_table_[i] = prob;
  125|   171k|    }
  126|   430k|  }
  127|    174|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 162]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|    162|  return true;
  131|    174|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    169|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_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: 43, False: 119]
  ------------------
  140|     43|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 43]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     43|  } else
  145|    119|#endif
  146|    119|  {
  147|    119|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 110]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    119|  }
  151|    153|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 70, False: 83]
  ------------------
  152|     70|    return false;
  153|     70|  }
  154|     83|  const uint8_t *const data_head =
  155|     83|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     83|  buffer->Advance(bytes_encoded);
  158|     83|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 17, False: 66]
  ------------------
  159|     17|    return false;
  160|     17|  }
  161|     66|  return true;
  162|     83|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  40.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     66|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     66|  ans_.read_end();
  167|     66|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  10.5k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  10.5k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 21, False: 10.4k]
  ------------------
   35|     21|    return true;
   36|     21|  }
   37|       |  // Decode which scheme to use.
   38|  10.4k|  uint8_t scheme;
   39|  10.4k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 190, False: 10.3k]
  ------------------
   40|    190|    return false;
   41|    190|  }
   42|  10.3k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.00k, False: 9.30k]
  ------------------
   43|  1.00k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.00k|                                                  src_buffer, out_values);
   45|  9.30k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 5.59k, False: 3.71k]
  ------------------
   46|  5.59k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  5.59k|                                               out_values);
   48|  5.59k|  }
   49|  3.71k|  return false;
   50|  10.3k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.00k|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|  1.00k|  SymbolDecoderT<5> tag_decoder;
   57|  1.00k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 382, False: 618]
  ------------------
   58|    382|    return false;
   59|    382|  }
   60|       |
   61|    618|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 194, False: 424]
  ------------------
   62|    194|    return false;
   63|    194|  }
   64|       |
   65|    424|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 424, False: 0]
  |  Branch (65:25): [True: 40, False: 384]
  ------------------
   66|     40|    return false;  // Wrong number of symbols.
   67|     40|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    384|  src_buffer->StartBitDecoding(false, nullptr);
   72|    384|  int value_id = 0;
   73|  4.00M|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 4.00M, False: 382]
  ------------------
   74|       |    // Decode the tag.
   75|  4.00M|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  8.35M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 4.35M, False: 4.00M]
  ------------------
   78|  4.35M|      uint32_t val;
   79|  4.35M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 2, False: 4.35M]
  ------------------
   80|      2|        return false;
   81|      2|      }
   82|  4.35M|      out_values[value_id++] = val;
   83|  4.35M|    }
   84|  4.00M|  }
   85|    382|  tag_decoder.EndDecoding();
   86|    382|  src_buffer->EndBitDecoding();
   87|    382|  return true;
   88|    384|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  5.59k|                      uint32_t *out_values) {
  117|  5.59k|  uint8_t max_bit_length;
  118|  5.59k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 22, False: 5.57k]
  ------------------
  119|     22|    return false;
  120|     22|  }
  121|  5.57k|  switch (max_bit_length) {
  122|    374|    case 1:
  ------------------
  |  Branch (122:5): [True: 374, False: 5.19k]
  ------------------
  123|    374|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    374|                                                         out_values);
  125|    392|    case 2:
  ------------------
  |  Branch (125:5): [True: 392, False: 5.18k]
  ------------------
  126|    392|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    392|                                                         out_values);
  128|    335|    case 3:
  ------------------
  |  Branch (128:5): [True: 335, False: 5.23k]
  ------------------
  129|    335|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    335|                                                         out_values);
  131|    197|    case 4:
  ------------------
  |  Branch (131:5): [True: 197, False: 5.37k]
  ------------------
  132|    197|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    197|                                                         out_values);
  134|    257|    case 5:
  ------------------
  |  Branch (134:5): [True: 257, False: 5.31k]
  ------------------
  135|    257|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    257|                                                         out_values);
  137|    317|    case 6:
  ------------------
  |  Branch (137:5): [True: 317, False: 5.25k]
  ------------------
  138|    317|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    317|                                                         out_values);
  140|    329|    case 7:
  ------------------
  |  Branch (140:5): [True: 329, False: 5.24k]
  ------------------
  141|    329|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    329|                                                         out_values);
  143|    246|    case 8:
  ------------------
  |  Branch (143:5): [True: 246, False: 5.32k]
  ------------------
  144|    246|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    246|                                                         out_values);
  146|    224|    case 9:
  ------------------
  |  Branch (146:5): [True: 224, False: 5.34k]
  ------------------
  147|    224|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    224|                                                         out_values);
  149|    258|    case 10:
  ------------------
  |  Branch (149:5): [True: 258, False: 5.31k]
  ------------------
  150|    258|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    258|          num_values, src_buffer, out_values);
  152|    305|    case 11:
  ------------------
  |  Branch (152:5): [True: 305, False: 5.26k]
  ------------------
  153|    305|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    305|          num_values, src_buffer, out_values);
  155|    283|    case 12:
  ------------------
  |  Branch (155:5): [True: 283, False: 5.28k]
  ------------------
  156|    283|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    283|          num_values, src_buffer, out_values);
  158|    373|    case 13:
  ------------------
  |  Branch (158:5): [True: 373, False: 5.19k]
  ------------------
  159|    373|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    373|          num_values, src_buffer, out_values);
  161|    305|    case 14:
  ------------------
  |  Branch (161:5): [True: 305, False: 5.26k]
  ------------------
  162|    305|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    305|          num_values, src_buffer, out_values);
  164|    310|    case 15:
  ------------------
  |  Branch (164:5): [True: 310, False: 5.26k]
  ------------------
  165|    310|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    310|          num_values, src_buffer, out_values);
  167|    273|    case 16:
  ------------------
  |  Branch (167:5): [True: 273, False: 5.29k]
  ------------------
  168|    273|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    273|          num_values, src_buffer, out_values);
  170|    289|    case 17:
  ------------------
  |  Branch (170:5): [True: 289, False: 5.28k]
  ------------------
  171|    289|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    289|          num_values, src_buffer, out_values);
  173|    261|    case 18:
  ------------------
  |  Branch (173:5): [True: 261, False: 5.31k]
  ------------------
  174|    261|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    261|          num_values, src_buffer, out_values);
  176|    244|    default:
  ------------------
  |  Branch (176:5): [True: 244, False: 5.32k]
  ------------------
  177|    244|      return false;
  178|  5.57k|  }
  179|  5.57k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    374|                              uint32_t *out_values) {
   93|    374|  SymbolDecoderT decoder;
   94|    374|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 228, False: 146]
  ------------------
   95|    228|    return false;
   96|    228|  }
   97|       |
   98|    146|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 146, False: 0]
  |  Branch (98:25): [True: 15, False: 131]
  ------------------
   99|     15|    return false;  // Wrong number of symbols.
  100|     15|  }
  101|       |
  102|    131|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 40, False: 91]
  ------------------
  103|     40|    return false;
  104|     40|  }
  105|  8.19M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.19M, False: 91]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.19M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.19M|    out_values[i] = value;
  109|  8.19M|  }
  110|     91|  decoder.EndDecoding();
  111|     91|  return true;
  112|    131|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    392|                              uint32_t *out_values) {
   93|    392|  SymbolDecoderT decoder;
   94|    392|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 166, False: 226]
  ------------------
   95|    166|    return false;
   96|    166|  }
   97|       |
   98|    226|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 226, False: 0]
  |  Branch (98:25): [True: 14, False: 212]
  ------------------
   99|     14|    return false;  // Wrong number of symbols.
  100|     14|  }
  101|       |
  102|    212|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 77, False: 135]
  ------------------
  103|     77|    return false;
  104|     77|  }
  105|  21.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 21.1M, False: 135]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  21.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  21.1M|    out_values[i] = value;
  109|  21.1M|  }
  110|    135|  decoder.EndDecoding();
  111|    135|  return true;
  112|    212|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    335|                              uint32_t *out_values) {
   93|    335|  SymbolDecoderT decoder;
   94|    335|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 105, False: 230]
  ------------------
   95|    105|    return false;
   96|    105|  }
   97|       |
   98|    230|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 230, False: 0]
  |  Branch (98:25): [True: 1, False: 229]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    229|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 73, False: 156]
  ------------------
  103|     73|    return false;
  104|     73|  }
  105|  29.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 29.6M, False: 156]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  29.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  29.6M|    out_values[i] = value;
  109|  29.6M|  }
  110|    156|  decoder.EndDecoding();
  111|    156|  return true;
  112|    229|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    197|                              uint32_t *out_values) {
   93|    197|  SymbolDecoderT decoder;
   94|    197|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 78, False: 119]
  ------------------
   95|     78|    return false;
   96|     78|  }
   97|       |
   98|    119|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 119, False: 0]
  |  Branch (98:25): [True: 1, False: 118]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    118|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 46, False: 72]
  ------------------
  103|     46|    return false;
  104|     46|  }
  105|  1.40M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.40M, False: 72]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.40M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.40M|    out_values[i] = value;
  109|  1.40M|  }
  110|     72|  decoder.EndDecoding();
  111|     72|  return true;
  112|    118|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    257|                              uint32_t *out_values) {
   93|    257|  SymbolDecoderT decoder;
   94|    257|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 38, False: 219]
  ------------------
   95|     38|    return false;
   96|     38|  }
   97|       |
   98|    219|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 219, False: 0]
  |  Branch (98:25): [True: 111, False: 108]
  ------------------
   99|    111|    return false;  // Wrong number of symbols.
  100|    111|  }
  101|       |
  102|    108|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 11, False: 97]
  ------------------
  103|     11|    return false;
  104|     11|  }
  105|  12.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.6M, False: 97]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.6M|    out_values[i] = value;
  109|  12.6M|  }
  110|     97|  decoder.EndDecoding();
  111|     97|  return true;
  112|    108|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    317|                              uint32_t *out_values) {
   93|    317|  SymbolDecoderT decoder;
   94|    317|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 88, False: 229]
  ------------------
   95|     88|    return false;
   96|     88|  }
   97|       |
   98|    229|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 229, False: 0]
  |  Branch (98:25): [True: 0, False: 229]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    229|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 75, False: 154]
  ------------------
  103|     75|    return false;
  104|     75|  }
  105|  1.60M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.60M, False: 154]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.60M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.60M|    out_values[i] = value;
  109|  1.60M|  }
  110|    154|  decoder.EndDecoding();
  111|    154|  return true;
  112|    229|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    329|                              uint32_t *out_values) {
   93|    329|  SymbolDecoderT decoder;
   94|    329|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 114, False: 215]
  ------------------
   95|    114|    return false;
   96|    114|  }
   97|       |
   98|    215|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 215, False: 0]
  |  Branch (98:25): [True: 2, False: 213]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    213|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 69, False: 144]
  ------------------
  103|     69|    return false;
  104|     69|  }
  105|  46.2M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 46.2M, False: 144]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  46.2M|    const uint32_t value = decoder.DecodeSymbol();
  108|  46.2M|    out_values[i] = value;
  109|  46.2M|  }
  110|    144|  decoder.EndDecoding();
  111|    144|  return true;
  112|    213|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    246|                              uint32_t *out_values) {
   93|    246|  SymbolDecoderT decoder;
   94|    246|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 103, False: 143]
  ------------------
   95|    103|    return false;
   96|    103|  }
   97|       |
   98|    143|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 143, False: 0]
  |  Branch (98:25): [True: 3, False: 140]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    140|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 70, False: 70]
  ------------------
  103|     70|    return false;
  104|     70|  }
  105|  44.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 44.6M, False: 70]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  44.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  44.6M|    out_values[i] = value;
  109|  44.6M|  }
  110|     70|  decoder.EndDecoding();
  111|     70|  return true;
  112|    140|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    224|                              uint32_t *out_values) {
   93|    224|  SymbolDecoderT decoder;
   94|    224|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 97, False: 127]
  ------------------
   95|     97|    return false;
   96|     97|  }
   97|       |
   98|    127|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 127, False: 0]
  |  Branch (98:25): [True: 4, False: 123]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    123|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 59, False: 64]
  ------------------
  103|     59|    return false;
  104|     59|  }
  105|   441k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 441k, False: 64]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   441k|    const uint32_t value = decoder.DecodeSymbol();
  108|   441k|    out_values[i] = value;
  109|   441k|  }
  110|     64|  decoder.EndDecoding();
  111|     64|  return true;
  112|    123|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    258|                              uint32_t *out_values) {
   93|    258|  SymbolDecoderT decoder;
   94|    258|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 135, False: 123]
  ------------------
   95|    135|    return false;
   96|    135|  }
   97|       |
   98|    123|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 123, False: 0]
  |  Branch (98:25): [True: 9, False: 114]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    114|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 61, False: 53]
  ------------------
  103|     61|    return false;
  104|     61|  }
  105|   398k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 398k, False: 53]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   398k|    const uint32_t value = decoder.DecodeSymbol();
  108|   398k|    out_values[i] = value;
  109|   398k|  }
  110|     53|  decoder.EndDecoding();
  111|     53|  return true;
  112|    114|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    305|                              uint32_t *out_values) {
   93|    305|  SymbolDecoderT decoder;
   94|    305|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 143, False: 162]
  ------------------
   95|    143|    return false;
   96|    143|  }
   97|       |
   98|    162|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 162, False: 0]
  |  Branch (98:25): [True: 4, False: 158]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    158|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 96, False: 62]
  ------------------
  103|     96|    return false;
  104|     96|  }
  105|   293k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 293k, False: 62]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   293k|    const uint32_t value = decoder.DecodeSymbol();
  108|   293k|    out_values[i] = value;
  109|   293k|  }
  110|     62|  decoder.EndDecoding();
  111|     62|  return true;
  112|    158|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    283|                              uint32_t *out_values) {
   93|    283|  SymbolDecoderT decoder;
   94|    283|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 128, False: 155]
  ------------------
   95|    128|    return false;
   96|    128|  }
   97|       |
   98|    155|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 155, False: 0]
  |  Branch (98:25): [True: 0, False: 155]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    155|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 105, False: 50]
  ------------------
  103|    105|    return false;
  104|    105|  }
  105|   266k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 265k, False: 50]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   265k|    const uint32_t value = decoder.DecodeSymbol();
  108|   265k|    out_values[i] = value;
  109|   265k|  }
  110|     50|  decoder.EndDecoding();
  111|     50|  return true;
  112|    155|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    373|                              uint32_t *out_values) {
   93|    373|  SymbolDecoderT decoder;
   94|    373|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 147, False: 226]
  ------------------
   95|    147|    return false;
   96|    147|  }
   97|       |
   98|    226|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 226, False: 0]
  |  Branch (98:25): [True: 28, False: 198]
  ------------------
   99|     28|    return false;  // Wrong number of symbols.
  100|     28|  }
  101|       |
  102|    198|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 134, False: 64]
  ------------------
  103|    134|    return false;
  104|    134|  }
  105|   486k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 486k, False: 64]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   486k|    const uint32_t value = decoder.DecodeSymbol();
  108|   486k|    out_values[i] = value;
  109|   486k|  }
  110|     64|  decoder.EndDecoding();
  111|     64|  return true;
  112|    198|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    305|                              uint32_t *out_values) {
   93|    305|  SymbolDecoderT decoder;
   94|    305|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 141, False: 164]
  ------------------
   95|    141|    return false;
   96|    141|  }
   97|       |
   98|    164|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 164, False: 0]
  |  Branch (98:25): [True: 5, False: 159]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    159|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 100, False: 59]
  ------------------
  103|    100|    return false;
  104|    100|  }
  105|  6.40M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.40M, False: 59]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.40M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.40M|    out_values[i] = value;
  109|  6.40M|  }
  110|     59|  decoder.EndDecoding();
  111|     59|  return true;
  112|    159|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    310|                              uint32_t *out_values) {
   93|    310|  SymbolDecoderT decoder;
   94|    310|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 143, False: 167]
  ------------------
   95|    143|    return false;
   96|    143|  }
   97|       |
   98|    167|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 167, False: 0]
  |  Branch (98:25): [True: 0, False: 167]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    167|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 113, False: 54]
  ------------------
  103|    113|    return false;
  104|    113|  }
  105|  15.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 15.6M, False: 54]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  15.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  15.6M|    out_values[i] = value;
  109|  15.6M|  }
  110|     54|  decoder.EndDecoding();
  111|     54|  return true;
  112|    167|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    273|                              uint32_t *out_values) {
   93|    273|  SymbolDecoderT decoder;
   94|    273|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 118, False: 155]
  ------------------
   95|    118|    return false;
   96|    118|  }
   97|       |
   98|    155|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 155, False: 0]
  |  Branch (98:25): [True: 1, False: 154]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    154|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 99, False: 55]
  ------------------
  103|     99|    return false;
  104|     99|  }
  105|  24.8M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 24.8M, False: 55]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  24.8M|    const uint32_t value = decoder.DecodeSymbol();
  108|  24.8M|    out_values[i] = value;
  109|  24.8M|  }
  110|     55|  decoder.EndDecoding();
  111|     55|  return true;
  112|    154|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    289|                              uint32_t *out_values) {
   93|    289|  SymbolDecoderT decoder;
   94|    289|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 137, False: 152]
  ------------------
   95|    137|    return false;
   96|    137|  }
   97|       |
   98|    152|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 152, False: 0]
  |  Branch (98:25): [True: 0, False: 152]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    152|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 94, False: 58]
  ------------------
  103|     94|    return false;
  104|     94|  }
  105|  9.52M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.52M, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.52M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.52M|    out_values[i] = value;
  109|  9.52M|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|    152|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    261|                              uint32_t *out_values) {
   93|    261|  SymbolDecoderT decoder;
   94|    261|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 92, False: 169]
  ------------------
   95|     92|    return false;
   96|     92|  }
   97|       |
   98|    169|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 169, False: 0]
  |  Branch (98:25): [True: 7, False: 162]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    162|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 96, False: 66]
  ------------------
  103|     96|    return false;
  104|     96|  }
  105|  40.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 40.5M, False: 66]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  40.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  40.5M|    out_values[i] = value;
  109|  40.5M|  }
  110|     66|  decoder.EndDecoding();
  111|     66|  return true;
  112|    162|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  8.22k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  3.73k|  const CornerTable *GetCornerTable() const override {
   67|  3.73k|    return corner_table_.get();
   68|  3.73k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  13.6M|                       int *out_encoder_split_symbol_id) {
   87|  13.6M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 114k, False: 13.5M]
  ------------------
   88|   114k|      return false;
   89|   114k|    }
   90|  13.5M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 18, False: 13.5M]
  ------------------
   91|  13.5M|        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|     18|      *out_encoder_split_symbol_id = -1;
   98|     18|      return true;
   99|     18|    }
  100|  13.5M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 13.5M, False: 2.69k]
  ------------------
  101|  13.5M|      return false;
  102|  13.5M|    }
  103|  2.69k|    *out_face_edge =
  104|  2.69k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  2.69k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  2.69k|    topology_split_data_.pop_back();
  108|  2.69k|    return true;
  109|  13.5M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  42.3M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  42.3M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  42.3M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  42.3M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  27.7k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  7.39k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  5.41k|  const CornerTable *GetCornerTable() const override {
   67|  5.41k|    return corner_table_.get();
   68|  5.41k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  42.1M|                       int *out_encoder_split_symbol_id) {
   87|  42.1M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 42.0M, False: 59.1k]
  ------------------
   88|  42.0M|      return false;
   89|  42.0M|    }
   90|  59.1k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 28, False: 59.0k]
  ------------------
   91|  59.1k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     28|      *out_encoder_split_symbol_id = -1;
   98|     28|      return true;
   99|     28|    }
  100|  59.0k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 57.5k, False: 1.55k]
  ------------------
  101|  57.5k|      return false;
  102|  57.5k|    }
  103|  1.55k|    *out_face_edge =
  104|  1.55k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.55k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.55k|    topology_split_data_.pop_back();
  108|  1.55k|    return true;
  109|  59.0k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|   123M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|   123M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|   123M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|   123M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  23.6k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  12.2k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.90k|  const CornerTable *GetCornerTable() const override {
   67|  2.90k|    return corner_table_.get();
   68|  2.90k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|   105M|                       int *out_encoder_split_symbol_id) {
   87|   105M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 93.4M, False: 11.7M]
  ------------------
   88|  93.4M|      return false;
   89|  93.4M|    }
   90|  11.7M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 31, False: 11.7M]
  ------------------
   91|  11.7M|        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|     31|      *out_encoder_split_symbol_id = -1;
   98|     31|      return true;
   99|     31|    }
  100|  11.7M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 11.7M, False: 1.70k]
  ------------------
  101|  11.7M|      return false;
  102|  11.7M|    }
  103|  1.70k|    *out_face_edge =
  104|  1.70k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.70k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.70k|    topology_split_data_.pop_back();
  108|  1.70k|    return true;
  109|  11.7M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|   109M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|   109M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|   109M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|   109M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  7.64k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

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

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  2.32k|MeshSequentialDecoder::MeshSequentialDecoder() {}
_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: 548, False: 1.59k]
  ------------------
   34|    548|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 0, False: 548]
  ------------------
   35|      0|      return false;
   36|      0|    }
   37|    548|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 0, False: 548]
  ------------------
   38|      0|      return false;
   39|      0|    }
   40|       |
   41|    548|  } else
   42|  1.59k|#endif
   43|  1.59k|  {
   44|  1.59k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 0, False: 1.59k]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|  1.59k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 0, False: 1.59k]
  ------------------
   48|      0|      return false;
   49|      0|    }
   50|  1.59k|  }
   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: 5, 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|      5|    return false;
   62|      5|  }
   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.63k, False: 502]
  ------------------
   68|  1.63k|    if (!DecodeAndDecompressIndices(num_faces, num_points)) {
  ------------------
  |  Branch (68:9): [True: 1.58k, False: 56]
  ------------------
   69|  1.58k|      return false;
   70|  1.58k|    }
   71|  1.63k|  } else {
   72|    502|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 380, False: 122]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|    806|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 437, False: 369]
  ------------------
   75|    437|        Mesh::Face face;
   76|  1.72k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 1.30k, False: 426]
  ------------------
   77|  1.30k|          uint8_t val;
   78|  1.30k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 0, False: 1.30k]
  ------------------
   79|      0|            return false;
   80|      0|          }
   81|  1.30k|          if (val >= num_points) {
  ------------------
  |  Branch (81:15): [True: 11, False: 1.29k]
  ------------------
   82|     11|            return false;
   83|     11|          }
   84|  1.29k|          face[j] = val;
   85|  1.29k|        }
   86|    426|        mesh()->AddFace(face);
   87|    426|      }
   88|    380|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (88:16): [True: 40, False: 82]
  ------------------
   89|       |      // Decode indices as uint16_t.
   90|    288|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:28): [True: 271, False: 17]
  ------------------
   91|    271|        Mesh::Face face;
   92|  1.03k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (92:25): [True: 790, False: 248]
  ------------------
   93|    790|          uint16_t val;
   94|    790|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (94:15): [True: 6, False: 784]
  ------------------
   95|      6|            return false;
   96|      6|          }
   97|    784|          if (val >= num_points) {
  ------------------
  |  Branch (97:15): [True: 17, False: 767]
  ------------------
   98|     17|            return false;
   99|     17|          }
  100|    767|          face[j] = val;
  101|    767|        }
  102|    248|        mesh()->AddFace(face);
  103|    248|      }
  104|     82|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (104:16): [True: 27, False: 55]
  ------------------
  105|     27|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     27|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (105:16): [True: 25, False: 2]
  ------------------
  106|       |      // Decode indices as uint32_t.
  107|    374|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (107:28): [True: 365, False: 9]
  ------------------
  108|    365|        Mesh::Face face;
  109|  1.42k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (109:25): [True: 1.07k, False: 349]
  ------------------
  110|  1.07k|          uint32_t val;
  111|  1.07k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (111:15): [True: 2, False: 1.07k]
  ------------------
  112|      2|            return false;
  113|      2|          }
  114|  1.07k|          if (val >= num_points) {
  ------------------
  |  Branch (114:15): [True: 14, False: 1.06k]
  ------------------
  115|     14|            return false;
  116|     14|          }
  117|  1.06k|          face[j] = val;
  118|  1.06k|        }
  119|    349|        mesh()->AddFace(face);
  120|    349|      }
  121|     57|    } else {
  122|       |      // Decode faces as uint32_t (default).
  123|    370|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (123:28): [True: 342, False: 28]
  ------------------
  124|    342|        Mesh::Face face;
  125|  1.30k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (125:25): [True: 987, False: 313]
  ------------------
  126|    987|          uint32_t val;
  127|    987|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (127:15): [True: 13, False: 974]
  ------------------
  128|     13|            return false;
  129|     13|          }
  130|    974|          if (val >= num_points) {
  ------------------
  |  Branch (130:15): [True: 16, False: 958]
  ------------------
  131|     16|            return false;
  132|     16|          }
  133|    958|          face[j] = val;
  134|    958|        }
  135|    313|        mesh()->AddFace(face);
  136|    313|      }
  137|     57|    }
  138|    502|  }
  139|    479|  point_cloud()->set_num_points(num_points);
  140|    479|  return true;
  141|  2.14k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  143|  11.0k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  144|       |  // Always create the basic attribute decoder.
  145|  11.0k|  return SetAttributesDecoder(
  146|  11.0k|      att_decoder_id,
  147|  11.0k|      std::unique_ptr<AttributesDecoder>(
  148|  11.0k|          new SequentialAttributeDecodersController(
  149|  11.0k|              std::unique_ptr<PointsSequencer>(
  150|  11.0k|                  new LinearSequencer(point_cloud()->num_points())))));
  151|  11.0k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEjj:
  154|  1.63k|                                                       uint32_t num_points) {
  155|       |  // Get decoded indices differences that were encoded with an entropy code.
  156|  1.63k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  157|  1.63k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (157:7): [True: 1.48k, False: 152]
  ------------------
  158|  1.48k|    return false;
  159|  1.48k|  }
  160|       |  // Reconstruct the indices from the differences.
  161|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  162|    152|  int32_t last_index_value = 0;  // This will always be >= 0.
  163|    152|  int vertex_index = 0;
  164|    974|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (164:24): [True: 918, False: 56]
  ------------------
  165|    918|    Mesh::Face face;
  166|  3.47k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (166:21): [True: 2.65k, False: 822]
  ------------------
  167|  2.65k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  168|  2.65k|      int32_t index_diff = (encoded_val >> 1);
  169|  2.65k|      if (encoded_val & 1) {
  ------------------
  |  Branch (169:11): [True: 452, False: 2.20k]
  ------------------
  170|    452|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (170:13): [True: 15, False: 437]
  ------------------
  171|       |          // Subtracting index_diff would result in a negative index.
  172|     15|          return false;
  173|     15|        }
  174|    437|        index_diff = -index_diff;
  175|  2.20k|      } else {
  176|  2.20k|        if (index_diff >
  ------------------
  |  Branch (176:13): [True: 0, False: 2.20k]
  ------------------
  177|  2.20k|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  178|       |          // Adding index_diff to last_index_value would overflow.
  179|      0|          return false;
  180|      0|        }
  181|  2.20k|      }
  182|  2.64k|      const int32_t index_value = index_diff + last_index_value;
  183|  2.64k|      if (index_value < 0 ||
  ------------------
  |  Branch (183:11): [True: 0, False: 2.64k]
  ------------------
  184|  2.64k|          static_cast<uint32_t>(index_value) >= num_points) {
  ------------------
  |  Branch (184:11): [True: 81, False: 2.56k]
  ------------------
  185|     81|        return false;
  186|     81|      }
  187|  2.56k|      face[j] = index_value;
  188|  2.56k|      last_index_value = index_value;
  189|  2.56k|    }
  190|    822|    mesh()->AddFace(face);
  191|    822|  }
  192|     56|  return true;
  193|    152|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.53k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.12M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.12M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 3.08M, False: 41.0k]
  ------------------
   61|  3.08M|      return true;  // Already traversed.
   62|  3.08M|    }
   63|       |
   64|  41.0k|    corner_traversal_stack_.clear();
   65|  41.0k|    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|  41.0k|    const VertexIndex next_vert =
   69|  41.0k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  41.0k|    const VertexIndex prev_vert =
   71|  41.0k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  41.0k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 41.0k]
  |  Branch (72:45): [True: 0, False: 41.0k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  41.0k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 40.3k, False: 707]
  ------------------
   76|  40.3k|      this->MarkVertexVisited(next_vert);
   77|  40.3k|      this->traversal_observer().OnNewVertexVisited(
   78|  40.3k|          next_vert, this->corner_table()->Next(corner_id));
   79|  40.3k|    }
   80|  41.0k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 20.7k, False: 20.2k]
  ------------------
   81|  20.7k|      this->MarkVertexVisited(prev_vert);
   82|  20.7k|      this->traversal_observer().OnNewVertexVisited(
   83|  20.7k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  20.7k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  97.4k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 56.4k, False: 41.0k]
  ------------------
   88|       |      // Currently processed corner.
   89|  56.4k|      corner_id = corner_traversal_stack_.back();
   90|  56.4k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  56.4k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 56.4k]
  |  Branch (92:47): [True: 722, False: 55.7k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    722|        corner_traversal_stack_.pop_back();
   95|    722|        continue;
   96|    722|      }
   97|  3.12M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.12M, Folded]
  ------------------
   98|  3.12M|        this->MarkFaceVisited(face_id);
   99|  3.12M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.12M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.12M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.12M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.12M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.57M, False: 1.55M]
  ------------------
  105|  1.57M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.57M|          this->MarkVertexVisited(vert_id);
  107|  1.57M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.57M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.52M, False: 48.2k]
  ------------------
  109|  1.52M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.52M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.52M|            continue;
  112|  1.52M|          }
  113|  1.57M|        }
  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.60M|        const CornerIndex right_corner_id =
  118|  1.60M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.60M|        const CornerIndex left_corner_id =
  120|  1.60M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.60M|        const FaceIndex right_face_id(
  122|  1.60M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 34.9k, False: 1.56M]
  ------------------
  123|  1.60M|                 ? kInvalidFaceIndex
  124|  1.60M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.60M|        const FaceIndex left_face_id(
  126|  1.60M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 43.8k, False: 1.55M]
  ------------------
  127|  1.60M|                 ? kInvalidFaceIndex
  128|  1.60M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.60M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.55M, False: 41.1k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.55M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 48.0k, False: 1.51M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  48.0k|            corner_traversal_stack_.pop_back();
  134|  48.0k|            break;  // Break from the while (true) loop.
  135|  1.51M|          } else {
  136|       |            // Go to the left face.
  137|  1.51M|            corner_id = left_corner_id;
  138|  1.51M|            face_id = left_face_id;
  139|  1.51M|          }
  140|  1.55M|        } else {
  141|       |          // Right face was not visited.
  142|  41.1k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 33.4k, False: 7.73k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  33.4k|            corner_id = right_corner_id;
  145|  33.4k|            face_id = right_face_id;
  146|  33.4k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  7.73k|            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|  7.73k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  7.73k|            break;
  159|  7.73k|          }
  160|  41.1k|        }
  161|  1.60M|      }
  162|  55.7k|    }
  163|  41.0k|    return true;
  164|  41.0k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.53k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.23k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  2.38k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  4.04M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  4.04M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 557k, False: 3.48M]
  ------------------
   61|   557k|      return true;  // Already traversed.
   62|   557k|    }
   63|       |
   64|  3.48M|    corner_traversal_stack_.clear();
   65|  3.48M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  3.48M|    const VertexIndex next_vert =
   69|  3.48M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  3.48M|    const VertexIndex prev_vert =
   71|  3.48M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  3.48M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3.48M]
  |  Branch (72:45): [True: 0, False: 3.48M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  3.48M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 3.48M, False: 1.57k]
  ------------------
   76|  3.48M|      this->MarkVertexVisited(next_vert);
   77|  3.48M|      this->traversal_observer().OnNewVertexVisited(
   78|  3.48M|          next_vert, this->corner_table()->Next(corner_id));
   79|  3.48M|    }
   80|  3.48M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.48M, False: 1.34k]
  ------------------
   81|  3.48M|      this->MarkVertexVisited(prev_vert);
   82|  3.48M|      this->traversal_observer().OnNewVertexVisited(
   83|  3.48M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.48M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  7.02M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 3.54M, False: 3.48M]
  ------------------
   88|       |      // Currently processed corner.
   89|  3.54M|      corner_id = corner_traversal_stack_.back();
   90|  3.54M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  3.54M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 3.54M]
  |  Branch (92:47): [True: 4.64k, False: 3.53M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  4.64k|        corner_traversal_stack_.pop_back();
   95|  4.64k|        continue;
   96|  4.64k|      }
   97|  4.04M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 4.04M, Folded]
  ------------------
   98|  4.04M|        this->MarkFaceVisited(face_id);
   99|  4.04M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  4.04M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  4.04M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 4.04M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  4.04M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 3.78M, False: 261k]
  ------------------
  105|  3.78M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  3.78M|          this->MarkVertexVisited(vert_id);
  107|  3.78M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  3.78M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 247k, False: 3.53M]
  ------------------
  109|   247k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   247k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   247k|            continue;
  112|   247k|          }
  113|  3.78M|        }
  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.79M|        const CornerIndex right_corner_id =
  118|  3.79M|            this->corner_table()->GetRightCorner(corner_id);
  119|  3.79M|        const CornerIndex left_corner_id =
  120|  3.79M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  3.79M|        const FaceIndex right_face_id(
  122|  3.79M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 3.51M, False: 282k]
  ------------------
  123|  3.79M|                 ? kInvalidFaceIndex
  124|  3.79M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  3.79M|        const FaceIndex left_face_id(
  126|  3.79M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 3.50M, False: 287k]
  ------------------
  127|  3.79M|                 ? kInvalidFaceIndex
  128|  3.79M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  3.79M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 3.75M, False: 44.2k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  3.75M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 3.50M, False: 242k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  3.50M|            corner_traversal_stack_.pop_back();
  134|  3.50M|            break;  // Break from the while (true) loop.
  135|  3.50M|          } else {
  136|       |            // Go to the left face.
  137|   242k|            corner_id = left_corner_id;
  138|   242k|            face_id = left_face_id;
  139|   242k|          }
  140|  3.75M|        } else {
  141|       |          // Right face was not visited.
  142|  44.2k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 16.9k, False: 27.3k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  16.9k|            corner_id = right_corner_id;
  145|  16.9k|            face_id = right_face_id;
  146|  27.3k|          } 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|  27.3k|            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|  27.3k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  27.3k|            break;
  159|  27.3k|          }
  160|  44.2k|        }
  161|  3.79M|      }
  162|  3.53M|    }
  163|  3.48M|    return true;
  164|  3.48M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  2.38k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  4.89k|  DepthFirstTraverser() {}

_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   58|    890|  void OnTraversalStart() {
   59|    890|    prediction_degree_.resize(this->corner_table()->num_vertices(), 0);
   60|    890|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  3.58M|  bool TraverseFromCorner(CornerIndex corner_id) {
   66|  3.58M|    if (prediction_degree_.size() == 0) {
  ------------------
  |  Branch (66:9): [True: 0, False: 3.58M]
  ------------------
   67|      0|      return true;
   68|      0|    }
   69|       |
   70|       |    // Traversal starts from the |corner_id|. It's going to follow either the
   71|       |    // right or the left neighboring faces to |corner_id| based on their
   72|       |    // prediction degree.
   73|  3.58M|    traversal_stacks_[0].push_back(corner_id);
   74|  3.58M|    best_priority_ = 0;
   75|       |    // For the first face, check the remaining corners as they may not be
   76|       |    // processed yet.
   77|  3.58M|    const VertexIndex next_vert =
   78|  3.58M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   79|  3.58M|    const VertexIndex prev_vert =
   80|  3.58M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   81|  3.58M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (81:9): [True: 14.2k, False: 3.57M]
  ------------------
   82|  14.2k|      this->MarkVertexVisited(next_vert);
   83|  14.2k|      this->traversal_observer().OnNewVertexVisited(
   84|  14.2k|          next_vert, this->corner_table()->Next(corner_id));
   85|  14.2k|    }
   86|  3.58M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (86:9): [True: 7.80k, False: 3.57M]
  ------------------
   87|  7.80k|      this->MarkVertexVisited(prev_vert);
   88|  7.80k|      this->traversal_observer().OnNewVertexVisited(
   89|  7.80k|          prev_vert, this->corner_table()->Previous(corner_id));
   90|  7.80k|    }
   91|  3.58M|    const VertexIndex tip_vertex = this->corner_table()->Vertex(corner_id);
   92|  3.58M|    if (!this->IsVertexVisited(tip_vertex)) {
  ------------------
  |  Branch (92:9): [True: 7.39k, False: 3.57M]
  ------------------
   93|  7.39k|      this->MarkVertexVisited(tip_vertex);
   94|  7.39k|      this->traversal_observer().OnNewVertexVisited(tip_vertex, corner_id);
   95|  7.39k|    }
   96|       |    // Start the actual traversal.
   97|  10.5M|    while ((corner_id = PopNextCornerToTraverse()) != kInvalidCornerIndex) {
  ------------------
  |  Branch (97:12): [True: 6.92M, False: 3.58M]
  ------------------
   98|  6.92M|      FaceIndex face_id(corner_id.value() / 3);
   99|       |      // Make sure the face hasn't been visited yet.
  100|  6.92M|      if (this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (100:11): [True: 5.33M, False: 1.58M]
  ------------------
  101|       |        // This face has been already traversed.
  102|  5.33M|        continue;
  103|  5.33M|      }
  104|       |
  105|  3.58M|      while (true) {
  ------------------
  |  Branch (105:14): [True: 3.58M, Folded]
  ------------------
  106|  3.58M|        face_id = FaceIndex(corner_id.value() / 3);
  107|  3.58M|        this->MarkFaceVisited(face_id);
  108|  3.58M|        this->traversal_observer().OnNewFaceVisited(face_id);
  109|       |
  110|       |        // If the newly reached vertex hasn't been visited, mark it and notify
  111|       |        // the observer.
  112|  3.58M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  113|  3.58M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (113:13): [True: 1.80M, False: 1.77M]
  ------------------
  114|  1.80M|          this->MarkVertexVisited(vert_id);
  115|  1.80M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  116|  1.80M|        }
  117|       |
  118|       |        // Check whether we can traverse to the right and left neighboring
  119|       |        // faces.
  120|  3.58M|        const CornerIndex right_corner_id =
  121|  3.58M|            this->corner_table()->GetRightCorner(corner_id);
  122|  3.58M|        const CornerIndex left_corner_id =
  123|  3.58M|            this->corner_table()->GetLeftCorner(corner_id);
  124|  3.58M|        const FaceIndex right_face_id(
  125|  3.58M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (125:14): [True: 27.6k, False: 3.55M]
  ------------------
  126|  3.58M|                 ? kInvalidFaceIndex
  127|  3.58M|                 : FaceIndex(right_corner_id.value() / 3)));
  128|  3.58M|        const FaceIndex left_face_id(
  129|  3.58M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (129:14): [True: 36.3k, False: 3.54M]
  ------------------
  130|  3.58M|                 ? kInvalidFaceIndex
  131|  3.58M|                 : FaceIndex(left_corner_id.value() / 3)));
  132|  3.58M|        const bool is_right_face_visited = this->IsFaceVisited(right_face_id);
  133|  3.58M|        const bool is_left_face_visited = this->IsFaceVisited(left_face_id);
  134|       |
  135|  3.58M|        if (!is_left_face_visited) {
  ------------------
  |  Branch (135:13): [True: 2.76M, False: 820k]
  ------------------
  136|       |          // We can go to the left face.
  137|  2.76M|          const int priority = ComputePriority(left_corner_id);
  138|  2.76M|          if (is_right_face_visited && priority <= best_priority_) {
  ------------------
  |  Branch (138:15): [True: 994k, False: 1.76M]
  |  Branch (138:40): [True: 957k, False: 36.7k]
  ------------------
  139|       |            // Right face has been already visited and the priority is equal or
  140|       |            // better than the best priority. We are sure that the left face
  141|       |            // would be traversed next so there is no need to put it onto the
  142|       |            // stack.
  143|   957k|            corner_id = left_corner_id;
  144|   957k|            continue;
  145|  1.80M|          } else {
  146|  1.80M|            AddCornerToTraversalStack(left_corner_id, priority);
  147|  1.80M|          }
  148|  2.76M|        }
  149|  2.62M|        if (!is_right_face_visited) {
  ------------------
  |  Branch (149:13): [True: 2.56M, False: 58.7k]
  ------------------
  150|       |          // Go to the right face.
  151|  2.56M|          const int priority = ComputePriority(right_corner_id);
  152|  2.56M|          if (priority <= best_priority_) {
  ------------------
  |  Branch (152:15): [True: 1.04M, False: 1.52M]
  ------------------
  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.04M|            corner_id = right_corner_id;
  156|  1.04M|            continue;
  157|  1.52M|          } else {
  158|  1.52M|            AddCornerToTraversalStack(right_corner_id, priority);
  159|  1.52M|          }
  160|  2.56M|        }
  161|       |
  162|       |        // Couldn't proceed directly to the next corner
  163|  1.58M|        break;
  164|  2.62M|      }
  165|  1.58M|    }
  166|  3.58M|    return true;
  167|  3.58M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE23PopNextCornerToTraverseEv:
  173|  10.5M|  CornerIndex PopNextCornerToTraverse() {
  174|  22.0M|    for (int i = best_priority_; i < kMaxPriority; ++i) {
  ------------------
  |  Branch (174:34): [True: 18.4M, False: 3.58M]
  ------------------
  175|  18.4M|      if (!traversal_stacks_[i].empty()) {
  ------------------
  |  Branch (175:11): [True: 6.92M, False: 11.5M]
  ------------------
  176|  6.92M|        const CornerIndex ret = traversal_stacks_[i].back();
  177|  6.92M|        traversal_stacks_[i].pop_back();
  178|  6.92M|        best_priority_ = i;
  179|  6.92M|        return ret;
  180|  6.92M|      }
  181|  18.4M|    }
  182|  3.58M|    return kInvalidCornerIndex;
  183|  10.5M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15ComputePriorityENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  194|  5.33M|  inline int ComputePriority(CornerIndex corner_id) {
  195|  5.33M|    const VertexIndex v_tip = this->corner_table()->Vertex(corner_id);
  196|       |    // Priority 0 when traversing to already visited vertices.
  197|  5.33M|    int priority = 0;
  198|  5.33M|    if (!this->IsVertexVisited(v_tip)) {
  ------------------
  |  Branch (198:9): [True: 3.55M, False: 1.77M]
  ------------------
  199|  3.55M|      const int degree = ++prediction_degree_[v_tip];
  200|       |      // Priority 1 when prediction degree > 1, otherwise 2.
  201|  3.55M|      priority = (degree > 1 ? 1 : 2);
  ------------------
  |  Branch (201:19): [True: 1.74M, False: 1.80M]
  ------------------
  202|  3.55M|    }
  203|       |    // Clamp the priority to the maximum number of buckets.
  204|  5.33M|    if (priority >= kMaxPriority) {
  ------------------
  |  Branch (204:9): [True: 0, False: 5.33M]
  ------------------
  205|      0|      priority = kMaxPriority - 1;
  206|      0|    }
  207|  5.33M|    return priority;
  208|  5.33M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE25AddCornerToTraversalStackENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEi:
  185|  3.33M|  inline void AddCornerToTraversalStack(CornerIndex ci, int priority) {
  186|  3.33M|    traversal_stacks_[priority].push_back(ci);
  187|       |    // Make sure that the best available priority is up to date.
  188|  3.33M|    if (priority < best_priority_) {
  ------------------
  |  Branch (188:9): [True: 793k, False: 2.54M]
  ------------------
  189|   793k|      best_priority_ = priority;
  190|   793k|    }
  191|  3.33M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   63|    890|  void OnTraversalEnd() {}
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   55|  1.84k|  MaxPredictionDegreeTraverser() {}

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    924|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.79k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  1.79k|    const auto *corner_table = traverser_.corner_table();
   50|  1.79k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.79k|    const size_t num_faces = mesh_->num_faces();
   52|  1.79k|    const size_t num_points = mesh_->num_points();
   53|  5.29M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.29M, False: 1.79k]
  ------------------
   54|  5.29M|      const auto &face = mesh_->face(f);
   55|  21.1M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 15.8M, False: 5.29M]
  ------------------
   56|  15.8M|        const PointIndex point_id = face[p];
   57|  15.8M|        const VertexIndex vert_id =
   58|  15.8M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  15.8M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 15.8M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  15.8M|        const AttributeValueIndex att_entry_id(
   63|  15.8M|            encoding_data_
   64|  15.8M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  15.8M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 15.8M]
  |  Branch (65:13): [True: 0, False: 15.8M]
  |  Branch (65:39): [True: 0, False: 15.8M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  15.8M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  15.8M|      }
   71|  5.29M|    }
   72|  1.79k|    return true;
   73|  1.79k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    890|  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|    890|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    890|    traverser_.OnTraversalStart();
   82|    890|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 890]
  ------------------
   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|    890|    } else {
   89|    890|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.58M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.58M, False: 890]
  ------------------
   91|  3.58M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.58M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.58M|      }
   95|    890|    }
   96|    890|    traverser_.OnTraversalEnd();
   97|    890|    return true;
   98|    890|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.58M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.58M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.58M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    924|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.61k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  9.72k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  9.72k|    const auto *corner_table = traverser_.corner_table();
   50|  9.72k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  9.72k|    const size_t num_faces = mesh_->num_faces();
   52|  9.72k|    const size_t num_points = mesh_->num_points();
   53|  6.03M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 6.02M, False: 9.72k]
  ------------------
   54|  6.02M|      const auto &face = mesh_->face(f);
   55|  24.1M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 18.0M, False: 6.02M]
  ------------------
   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: 0, False: 18.0M]
  |  Branch (65:39): [True: 0, False: 18.0M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  18.0M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  18.0M|      }
   71|  6.02M|    }
   72|  9.72k|    return true;
   73|  9.72k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.53k|  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.53k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.53k|    traverser_.OnTraversalStart();
   82|  1.53k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.53k]
  ------------------
   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.53k|    } else {
   89|  1.53k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.13M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.12M, False: 1.53k]
  ------------------
   91|  3.12M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.12M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.12M|      }
   95|  1.53k|    }
   96|  1.53k|    traverser_.OnTraversalEnd();
   97|  1.53k|    return true;
   98|  1.53k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.12M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.12M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.12M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.61k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  2.44k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  13.0k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  13.0k|    const auto *corner_table = traverser_.corner_table();
   50|  13.0k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  13.0k|    const size_t num_faces = mesh_->num_faces();
   52|  13.0k|    const size_t num_points = mesh_->num_points();
   53|  7.09M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 7.07M, False: 13.0k]
  ------------------
   54|  7.07M|      const auto &face = mesh_->face(f);
   55|  28.3M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 21.2M, False: 7.07M]
  ------------------
   56|  21.2M|        const PointIndex point_id = face[p];
   57|  21.2M|        const VertexIndex vert_id =
   58|  21.2M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  21.2M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 21.2M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  21.2M|        const AttributeValueIndex att_entry_id(
   63|  21.2M|            encoding_data_
   64|  21.2M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  21.2M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 21.2M]
  |  Branch (65:13): [True: 3, False: 21.2M]
  |  Branch (65:39): [True: 3, False: 21.2M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      3|          return false;
   68|      3|        }
   69|  21.2M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  21.2M|      }
   71|  7.07M|    }
   72|  13.0k|    return true;
   73|  13.0k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  2.38k|  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.38k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  2.38k|    traverser_.OnTraversalStart();
   82|  2.38k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 2.38k]
  ------------------
   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.38k|    } else {
   89|  2.38k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  4.04M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 4.04M, False: 2.38k]
  ------------------
   91|  4.04M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 4.04M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  4.04M|      }
   95|  2.38k|    }
   96|  2.38k|    traverser_.OnTraversalEnd();
   97|  2.38k|    return true;
   98|  2.38k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  4.04M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  4.04M|    return traverser_.TraverseFromCorner(corner_id);
  103|  4.04M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  2.44k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  4.89k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  43.7M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  22.8M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  22.8M|    return is_vertex_visited_[vert_id.value()];
   65|  22.8M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  3.47M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  3.47M|    is_vertex_visited_[vert_id.value()] = true;
   68|  3.47M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  10.1M|  inline TraversalObserverT &traversal_observer() {
   75|  10.1M|    return traversal_observer_;
   76|  10.1M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  17.3M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  17.3M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 142k, False: 17.2M]
  ------------------
   47|   142k|      return true;  // Invalid faces are always considered as visited.
   48|   142k|    }
   49|  17.2M|    return is_face_visited_[face_id.value()];
   50|  17.3M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  6.71M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  6.71M|    is_face_visited_[face_id.value()] = true;
   62|  6.71M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  5.08k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  5.08k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.54k|                    TraversalObserver traversal_observer) {
   37|  2.54k|    corner_table_ = corner_table;
   38|  2.54k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.54k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.54k|    traversal_observer_ = traversal_observer;
   41|  2.54k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.12M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.12M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.12M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.12M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.12M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  36.5M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  4.04M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  4.04M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 4.04M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  4.04M|    return is_face_visited_[corner_id.value() / 3];
   58|  4.04M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  11.0M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  11.0M|    return is_vertex_visited_[vert_id.value()];
   65|  11.0M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  10.7M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  10.7M|    is_vertex_visited_[vert_id.value()] = true;
   68|  10.7M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  14.7M|  inline TraversalObserverT &traversal_observer() {
   75|  14.7M|    return traversal_observer_;
   76|  14.7M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  11.1M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  11.1M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 7.01M, False: 4.11M]
  ------------------
   47|  7.01M|      return true;  // Invalid faces are always considered as visited.
   48|  7.01M|    }
   49|  4.11M|    return is_face_visited_[face_id.value()];
   50|  11.1M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  4.04M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  4.04M|    is_face_visited_[face_id.value()] = true;
   62|  4.04M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  4.89k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.44k|                    TraversalObserver traversal_observer) {
   37|  2.44k|    corner_table_ = corner_table;
   38|  2.44k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.44k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.44k|    traversal_observer_ = traversal_observer;
   41|  2.44k|  }

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

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

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

_ZN5draco18MostSignificantBitEj:
   58|  1.05k|inline int MostSignificantBit(uint32_t n) {
   59|  1.05k|#if defined(__GNUC__)
   60|  1.05k|  return 31 ^ __builtin_clz(n);
   61|       |#elif defined(_MSC_VER)
   62|       |  unsigned long where;
   63|       |  _BitScanReverse(&where, n);
   64|       |  return (int)where;
   65|       |#else
   66|       |  uint32_t msb = 0;
   67|       |  if (n) {
   68|       |    if (0xFFFF0000 & n) { n >>= (1 << 4); msb |= (1 << 4); }
   69|       |    if (0x0000FF00 & n) { n >>= (1 << 3); msb |= (1 << 3); }
   70|       |    if (0x000000F0 & n) { n >>= (1 << 2); msb |= (1 << 2); }
   71|       |    if (0x0000000C & n) { n >>= (1 << 1); msb |= (1 << 1); }
   72|       |    if (0x00000002 & n) { msb |= (1 << 0); }
   73|       |  } else {
   74|       |    msb = -1;
   75|       |  }
   76|       |  return msb;
   77|       |#endif
   78|  1.05k|}
_ZN5draco24ConvertSymbolToSignedIntIjEENSt3__111make_signedIT_E4typeES3_:
  112|  1.42G|    IntTypeT val) {
  113|  1.42G|  static_assert(std::is_integral<IntTypeT>::value, "IntTypeT is not integral.");
  114|  1.42G|  typedef typename std::make_signed<IntTypeT>::type SignedType;
  115|  1.42G|  const bool is_positive = !static_cast<bool>(val & 1);
  116|  1.42G|  val >>= 1;
  117|  1.42G|  if (is_positive) {
  ------------------
  |  Branch (117:7): [True: 1.42G, False: 2.98M]
  ------------------
  118|  1.42G|    return static_cast<SignedType>(val);
  119|  1.42G|  }
  120|  2.98M|  SignedType ret = static_cast<SignedType>(val);
  121|  2.98M|  ret = -ret - 1;
  122|  2.98M|  return ret;
  123|  1.42G|}

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  53.0M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  53.0M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 53.0M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  53.0M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  53.0M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  1.42G|  bool Decode(void *out_data, size_t size_to_decode) {
   77|  1.42G|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 367, False: 1.42G]
  ------------------
   78|    367|      return false;  // Buffer overflow.
   79|    367|    }
   80|  1.42G|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  1.42G|    pos_ += size_to_decode;
   82|  1.42G|    return true;
   83|  1.42G|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  34.8k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  10.7k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  51.7k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   209k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  7.35k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  53.0M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  8.36M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  9.45k|    inline void reset(const void *b, size_t s) {
  131|  9.45k|      bit_offset_ = 0;
  132|  9.45k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  9.45k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  9.45k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  8.35k|    inline uint64_t BitsDecoded() const {
  138|  8.35k|      return static_cast<uint64_t>(bit_offset_);
  139|  8.35k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  53.0M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  53.0M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 2, False: 53.0M]
  ------------------
  162|      2|        return false;
  163|      2|      }
  164|  53.0M|      uint32_t value = 0;
  165|   120M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 67.3M, False: 53.0M]
  ------------------
  166|  67.3M|        value |= GetBit() << bit;
  167|  67.3M|      }
  168|  53.0M|      *x = value;
  169|  53.0M|      return true;
  170|  53.0M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  67.3M|    inline int GetBit() {
  176|  67.3M|      const size_t off = bit_offset_;
  177|  67.3M|      const size_t byte_offset = off >> 3;
  178|  67.3M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  67.3M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 65.0M, False: 2.26M]
  ------------------
  180|  65.0M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  65.0M|        bit_offset_ = off + 1;
  182|  65.0M|        return bit;
  183|  65.0M|      }
  184|  2.26M|      return 0;
  185|  67.3M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  15.9M|  bool Decode(T *out_val) {
   69|  15.9M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2.72k, False: 15.9M]
  ------------------
   70|  2.72k|      return false;
   71|  2.72k|    }
   72|  15.9M|    pos_ += sizeof(T);
   73|  15.9M|    return true;
   74|  15.9M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  15.9M|  bool Peek(T *out_val) {
   88|  15.9M|    const size_t size_to_decode = sizeof(T);
   89|  15.9M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2.72k, False: 15.9M]
  ------------------
   90|  2.72k|      return false;  // Buffer overflow.
   91|  2.72k|    }
   92|  15.9M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  15.9M|    return true;
   94|  15.9M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  17.1k|  bool Decode(T *out_val) {
   69|  17.1k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 134, False: 17.0k]
  ------------------
   70|    134|      return false;
   71|    134|    }
   72|  17.0k|    pos_ += sizeof(T);
   73|  17.0k|    return true;
   74|  17.1k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  17.1k|  bool Peek(T *out_val) {
   88|  17.1k|    const size_t size_to_decode = sizeof(T);
   89|  17.1k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 134, False: 17.0k]
  ------------------
   90|    134|      return false;  // Buffer overflow.
   91|    134|    }
   92|  17.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  17.0k|    return true;
   94|  17.1k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   966k|  bool Decode(T *out_val) {
   69|   966k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 169, False: 966k]
  ------------------
   70|    169|      return false;
   71|    169|    }
   72|   966k|    pos_ += sizeof(T);
   73|   966k|    return true;
   74|   966k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   966k|  bool Peek(T *out_val) {
   88|   966k|    const size_t size_to_decode = sizeof(T);
   89|   966k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 169, False: 966k]
  ------------------
   90|    169|      return false;  // Buffer overflow.
   91|    169|    }
   92|   966k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   966k|    return true;
   94|   966k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  30.4k|  bool Decode(T *out_val) {
   69|  30.4k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 98, False: 30.3k]
  ------------------
   70|     98|      return false;
   71|     98|    }
   72|  30.3k|    pos_ += sizeof(T);
   73|  30.3k|    return true;
   74|  30.4k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  30.4k|  bool Peek(T *out_val) {
   88|  30.4k|    const size_t size_to_decode = sizeof(T);
   89|  30.4k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 98, False: 30.3k]
  ------------------
   90|     98|      return false;  // Buffer overflow.
   91|     98|    }
   92|  30.3k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  30.3k|    return true;
   94|  30.4k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|  3.48M|  bool Decode(T *out_val) {
   69|  3.48M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 197, False: 3.48M]
  ------------------
   70|    197|      return false;
   71|    197|    }
   72|  3.48M|    pos_ += sizeof(T);
   73|  3.48M|    return true;
   74|  3.48M|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|  3.48M|  bool Peek(T *out_val) {
   88|  3.48M|    const size_t size_to_decode = sizeof(T);
   89|  3.48M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 197, False: 3.48M]
  ------------------
   90|    197|      return false;  // Buffer overflow.
   91|    197|    }
   92|  3.48M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  3.48M|    return true;
   94|  3.48M|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  22.2k|  bool Decode(T *out_val) {
   69|  22.2k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 7, False: 22.2k]
  ------------------
   70|      7|      return false;
   71|      7|    }
   72|  22.2k|    pos_ += sizeof(T);
   73|  22.2k|    return true;
   74|  22.2k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  22.2k|  bool Peek(T *out_val) {
   88|  22.2k|    const size_t size_to_decode = sizeof(T);
   89|  22.2k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 7, False: 22.2k]
  ------------------
   90|      7|      return false;  // Buffer overflow.
   91|      7|    }
   92|  22.2k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  22.2k|    return true;
   94|  22.2k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  2.24k|  bool Decode(T *out_val) {
   69|  2.24k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 17, False: 2.23k]
  ------------------
   70|     17|      return false;
   71|     17|    }
   72|  2.23k|    pos_ += sizeof(T);
   73|  2.23k|    return true;
   74|  2.24k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  2.24k|  bool Peek(T *out_val) {
   88|  2.24k|    const size_t size_to_decode = sizeof(T);
   89|  2.24k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 17, False: 2.23k]
  ------------------
   90|     17|      return false;  // Buffer overflow.
   91|     17|    }
   92|  2.23k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.23k|    return true;
   94|  2.24k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    138|  bool Decode(T *out_val) {
   69|    138|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 15, False: 123]
  ------------------
   70|     15|      return false;
   71|     15|    }
   72|    123|    pos_ += sizeof(T);
   73|    123|    return true;
   74|    138|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    138|  bool Peek(T *out_val) {
   88|    138|    const size_t size_to_decode = sizeof(T);
   89|    138|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 15, False: 123]
  ------------------
   90|     15|      return false;  // Buffer overflow.
   91|     15|    }
   92|    123|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    123|    return true;
   94|    138|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   138M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   141M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  12.6M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  12.6M|    return value_ >= val;
  100|  12.6M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   394M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  5.31G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  31.0M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   135M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   135M|    value_ = i.value_;
  153|   135M|    return *this;
  154|   135M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   108M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   108M|    value_ = i.value_;
  153|   108M|    return *this;
  154|   108M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  31.0M|  inline ThisIndexType &operator++() {
  103|  31.0M|    ++value_;
  104|  31.0M|    return *this;
  105|  31.0M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  3.90G|  constexpr bool operator==(const IndexType &i) const {
   76|  3.90G|    return value_ == i.value_;
   77|  3.90G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|  1.58G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  4.95k|  constexpr bool operator<(const IndexType &i) const {
   88|  4.95k|    return value_ < i.value_;
   89|  4.95k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   180M|  constexpr bool operator==(const IndexType &i) const {
   76|   180M|    return value_ == i.value_;
   77|   180M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   287M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   287M|    return ThisIndexType(value_ - val);
  133|   287M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|  1.22G|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  1.22G|    return ThisIndexType(value_ + val);
  127|  1.22G|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  28.4M|  constexpr bool operator==(const IndexType &i) const {
   76|  28.4M|    return value_ == i.value_;
   77|  28.4M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   440M|  constexpr bool operator!=(const IndexType &i) const {
   82|   440M|    return value_ != i.value_;
   83|   440M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   576M|  constexpr bool operator!=(const IndexType &i) const {
   82|   576M|    return value_ != i.value_;
   83|   576M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   841M|  inline ThisIndexType &operator++() {
  103|   841M|    ++value_;
  104|   841M|    return *this;
  105|   841M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   758M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   758M|    value_ = i.value_;
  153|   758M|    return *this;
  154|   758M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|  1.83G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  1.83G|    value_ = i.value_;
  153|  1.83G|    return *this;
  154|  1.83G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  55.2M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  55.2M|    return value_ >= val;
  100|  55.2M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  12.5M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.82G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  23.2G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   315M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  14.9G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   451M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  34.1M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  34.1M|    return ThisIndexType(value_ + val);
  127|  34.1M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   299M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  37.0M|  constexpr bool operator<(const IndexType &i) const {
   88|  37.0M|    return value_ < i.value_;
   89|  37.0M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   296M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   108M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  88.1M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   113M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   418M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  7.16M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  7.16M|    value_ = i.value_;
  153|  7.16M|    return *this;
  154|  7.16M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  12.5M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  12.5M|    value_ += val;
  141|  12.5M|    return *this;
  142|  12.5M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  37.8M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  37.8M|    value_ = val;
  157|  37.8M|    return *this;
  158|  37.8M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|  70.6M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  11.4M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  11.4M|  inline ThisIndexType &operator++() {
  103|  11.4M|    ++value_;
  104|  11.4M|    return *this;
  105|  11.4M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  33.3M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  33.3M|  inline ThisIndexType &operator++() {
  103|  33.3M|    ++value_;
  104|  33.3M|    return *this;
  105|  33.3M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  52.6M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  52.6M|    return vector_[index.value()];
   75|  52.6M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  33.3M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  12.7k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  29.8k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  88.5M|  inline reference operator[](const IndexTypeT &index) {
   71|  88.5M|    return vector_[index.value()];
   72|  88.5M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  2.15k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  25.2M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  5.25k|  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.6M|  inline reference operator[](const IndexTypeT &index) {
   71|  12.6M|    return vector_[index.value()];
   72|  12.6M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  32.6M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  32.6M|    return vector_[index.value()];
   75|  32.6M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   374M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  16.4M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   508M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   508M|    return vector_[index.value()];
   75|   508M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|  1.42G|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  1.42G|    return vector_[index.value()];
   75|  1.42G|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   694M|  inline reference operator[](const IndexTypeT &index) {
   71|   694M|    return vector_[index.value()];
   72|   694M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  87.1M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  87.1M|    return vector_[index.value()];
   75|  87.1M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   550M|  inline reference operator[](const IndexTypeT &index) {
   71|   550M|    return vector_[index.value()];
   72|   550M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   195M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   407M|  inline reference operator[](const IndexTypeT &index) {
   71|   407M|    return vector_[index.value()];
   72|   407M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.94k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   432M|  inline reference operator[](const IndexTypeT &index) {
   71|   432M|    return vector_[index.value()];
   72|   432M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  90.6k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  3.58M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  86.4k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  7.87k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  7.87k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  7.87k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  7.87k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  19.5k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  19.5k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  19.5k|    vector_.swap(arg.vector_);
   57|  19.5k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  19.5k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  19.5k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  19.5k|    vector_.swap(arg.vector_);
   57|  19.5k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  7.87k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  7.87k|  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.87k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  10.7k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  80.3k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|   117k|int32_t DataTypeLength(DataType dt) {
   20|   117k|  switch (dt) {
   21|  67.0k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 67.0k, False: 50.0k]
  ------------------
   22|  70.4k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.34k, False: 113k]
  ------------------
   23|  70.4k|      return 1;
   24|  1.85k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 1.85k, False: 115k]
  ------------------
   25|  2.38k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 534, False: 116k]
  ------------------
   26|  2.38k|      return 2;
   27|  37.8k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 37.8k, False: 79.2k]
  ------------------
   28|  38.4k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 534, False: 116k]
  ------------------
   29|  38.4k|      return 4;
   30|    712|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 712, False: 116k]
  ------------------
   31|  1.57k|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 858, False: 116k]
  ------------------
   32|  1.57k|      return 8;
   33|  3.80k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.80k, False: 113k]
  ------------------
   34|  3.80k|      return 4;
   35|    382|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 382, False: 116k]
  ------------------
   36|    382|      return 8;
   37|    173|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 173, False: 116k]
  ------------------
   38|    173|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 117k]
  ------------------
   40|      0|      return -1;
   41|   117k|  }
   42|   117k|}

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

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

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

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

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

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

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

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   771k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   771k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 771k, Folded]
  ------------------
   65|   771k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 944, False: 770k]
  ------------------
   66|    944|      return false;
   67|    944|    }
   68|   771k|  } 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|   770k|  return true;
   77|   771k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   509k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   509k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   509k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 75, False: 509k]
  ------------------
   33|     75|    return false;
   34|     75|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   509k|  uint8_t in;
   39|   509k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 563, False: 508k]
  ------------------
   40|    563|    return false;
   41|    563|  }
   42|   508k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 30.1k, False: 478k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  30.1k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 423, False: 29.7k]
  ------------------
   45|    423|      return false;
   46|    423|    }
   47|       |    // Append decoded info from this byte.
   48|  29.7k|    *out_val <<= 7;
   49|  29.7k|    *out_val |= in & ((1 << 7) - 1);
   50|   478k|  } else {
   51|       |    // Last byte reached
   52|   478k|    *out_val = in;
   53|   478k|  }
   54|   508k|  return true;
   55|   508k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  4.66k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.66k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.66k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 4.66k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.66k|  uint8_t in;
   39|  4.66k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 2, False: 4.65k]
  ------------------
   40|      2|    return false;
   41|      2|  }
   42|  4.65k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 388, False: 4.27k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    388|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 2, False: 386]
  ------------------
   45|      2|      return false;
   46|      2|    }
   47|       |    // Append decoded info from this byte.
   48|    386|    *out_val <<= 7;
   49|    386|    *out_val |= in & ((1 << 7) - 1);
   50|  4.27k|  } else {
   51|       |    // Last byte reached
   52|  4.27k|    *out_val = in;
   53|  4.27k|  }
   54|  4.65k|  return true;
   55|  4.65k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  7.59k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  7.59k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 7.59k, Folded]
  ------------------
   65|  7.59k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 121, False: 7.47k]
  ------------------
   66|    121|      return false;
   67|    121|    }
   68|  7.59k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  7.47k|  return true;
   77|  7.59k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.58k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.58k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.58k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 4.58k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.58k|  uint8_t in;
   39|  4.58k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 14, False: 4.57k]
  ------------------
   40|     14|    return false;
   41|     14|  }
   42|  4.57k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 78, False: 4.49k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     78|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 1, False: 77]
  ------------------
   45|      1|      return false;
   46|      1|    }
   47|       |    // Append decoded info from this byte.
   48|     77|    *out_val <<= 7;
   49|     77|    *out_val |= in & ((1 << 7) - 1);
   50|  4.49k|  } else {
   51|       |    // Last byte reached
   52|  4.49k|    *out_val = in;
   53|  4.49k|  }
   54|  4.57k|  return true;
   55|  4.57k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   179k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   179k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   179k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 17, False: 179k]
  ------------------
   33|     17|    return false;
   34|     17|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   179k|  uint8_t in;
   39|   179k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 75, False: 179k]
  ------------------
   40|     75|    return false;
   41|     75|  }
   42|   179k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.42k, False: 178k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.42k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 97, False: 1.32k]
  ------------------
   45|     97|      return false;
   46|     97|    }
   47|       |    // Append decoded info from this byte.
   48|  1.32k|    *out_val <<= 7;
   49|  1.32k|    *out_val |= in & ((1 << 7) - 1);
   50|   178k|  } else {
   51|       |    // Last byte reached
   52|   178k|    *out_val = in;
   53|   178k|  }
   54|   179k|  return true;
   55|   179k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  6.25k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  6.25k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.25k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 6.25k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.25k|  uint8_t in;
   39|  6.25k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 29, False: 6.22k]
  ------------------
   40|     29|    return false;
   41|     29|  }
   42|  6.22k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.01k, False: 5.20k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.01k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 30, False: 989]
  ------------------
   45|     30|      return false;
   46|     30|    }
   47|       |    // Append decoded info from this byte.
   48|    989|    *out_val <<= 7;
   49|    989|    *out_val |= in & ((1 << 7) - 1);
   50|  5.20k|  } else {
   51|       |    // Last byte reached
   52|  5.20k|    *out_val = in;
   53|  5.20k|  }
   54|  6.19k|  return true;
   55|  6.22k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  25.0k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  25.0k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  25.0k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 8, False: 25.0k]
  ------------------
   33|      8|    return false;
   34|      8|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  25.0k|  uint8_t in;
   39|  25.0k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 23, False: 24.9k]
  ------------------
   40|     23|    return false;
   41|     23|  }
   42|  24.9k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 519, False: 24.4k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    519|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 55, False: 464]
  ------------------
   45|     55|      return false;
   46|     55|    }
   47|       |    // Append decoded info from this byte.
   48|    464|    *out_val <<= 7;
   49|    464|    *out_val |= in & ((1 << 7) - 1);
   50|  24.4k|  } else {
   51|       |    // Last byte reached
   52|  24.4k|    *out_val = in;
   53|  24.4k|  }
   54|  24.9k|  return true;
   55|  24.9k|}
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: 84, False: 7.11k]
  ------------------
   33|     84|    return false;
   34|     84|  }
   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: 58, False: 7.05k]
  ------------------
   40|     58|    return false;
   41|     58|  }
   42|  7.05k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.75k, False: 5.30k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.75k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 456, False: 1.29k]
  ------------------
   45|    456|      return false;
   46|    456|    }
   47|       |    // Append decoded info from this byte.
   48|  1.29k|    *out_val <<= 7;
   49|  1.29k|    *out_val |= in & ((1 << 7) - 1);
   50|  5.30k|  } else {
   51|       |    // Last byte reached
   52|  5.30k|    *out_val = in;
   53|  5.30k|  }
   54|  6.59k|  return true;
   55|  7.05k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  5.20k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  5.20k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  5.20k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 81, False: 5.12k]
  ------------------
   33|     81|    return false;
   34|     81|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  5.12k|  uint8_t in;
   39|  5.12k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 26, False: 5.10k]
  ------------------
   40|     26|    return false;
   41|     26|  }
   42|  5.10k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.12k, False: 2.97k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.12k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 873, False: 1.25k]
  ------------------
   45|    873|      return false;
   46|    873|    }
   47|       |    // Append decoded info from this byte.
   48|  1.25k|    *out_val <<= 7;
   49|  1.25k|    *out_val |= in & ((1 << 7) - 1);
   50|  2.97k|  } else {
   51|       |    // Last byte reached
   52|  2.97k|    *out_val = in;
   53|  2.97k|  }
   54|  4.22k|  return true;
   55|  5.10k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  77.1k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  77.1k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  77.1k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 77.1k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  77.1k|  uint8_t in;
   39|  77.1k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 5, False: 77.0k]
  ------------------
   40|      5|    return false;
   41|      5|  }
   42|  77.0k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.19k, False: 74.9k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.19k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 13, False: 2.17k]
  ------------------
   45|     13|      return false;
   46|     13|    }
   47|       |    // Append decoded info from this byte.
   48|  2.17k|    *out_val <<= 7;
   49|  2.17k|    *out_val |= in & ((1 << 7) - 1);
   50|  74.9k|  } else {
   51|       |    // Last byte reached
   52|  74.9k|    *out_val = in;
   53|  74.9k|  }
   54|  77.0k|  return true;
   55|  77.0k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|  79.9k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|  95.0k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  7.91k|  Self operator-(const Self &o) const {
  138|  7.91k|    Self ret;
  139|  31.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 23.7k, False: 7.91k]
  ------------------
  140|  23.7k|      ret[i] = (*this)[i] - o[i];
  141|  23.7k|    }
  142|  7.91k|    return ret;
  143|  7.91k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  19.4k|  VectorD() {
   41|  77.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 58.3k, False: 19.4k]
  ------------------
   42|  58.3k|      (*this)[i] = Scalar(0);
   43|  58.3k|    }
   44|  19.4k|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   181M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  15.0M|  Self operator-(const Self &o) const {
  138|  15.0M|    Self ret;
  139|  60.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 45.2M, False: 15.0M]
  ------------------
  140|  45.2M|      ret[i] = (*this)[i] - o[i];
  141|  45.2M|    }
  142|  15.0M|    return ret;
  143|  15.0M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  7.53M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  7.53M|  static_assert(std::is_signed<ScalarT>::value,
  321|  7.53M|                "ScalarT must be a signed type. ");
  322|  7.53M|  VectorD<ScalarT, 3> r;
  323|  7.53M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  7.53M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  7.53M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  7.53M|  return r;
  327|  7.53M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  7.53M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  7.53M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  4.18M|  Scalar AbsSum() const {
  238|  4.18M|    Scalar result(0);
  239|  16.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 12.5M, False: 4.17M]
  ------------------
  240|  12.5M|      Scalar next_value = std::abs(v_[i]);
  241|  12.5M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 7.69k, False: 12.5M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  7.69k|        return std::numeric_limits<Scalar>::max();
  244|  7.69k|      }
  245|  12.5M|      result += next_value;
  246|  12.5M|    }
  247|  4.17M|    return result;
  248|  4.18M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   149k|  Self operator/(const Scalar &o) const {
  183|   149k|    Self ret;
  184|   597k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 448k, False: 149k]
  ------------------
  185|   448k|      ret[i] = (*this)[i] / o;
  186|   448k|    }
  187|   149k|    return ret;
  188|   149k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   238M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  21.7M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  12.5M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  3.61M|  Self operator-() const {
  121|  3.61M|    Self ret;
  122|  14.4M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 10.8M, False: 3.61M]
  ------------------
  123|  10.8M|      ret[i] = -(*this)[i];
  124|  10.8M|    }
  125|  3.61M|    return ret;
  126|  3.61M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  10.8M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   918k|  Self operator-(const Self &o) const {
  138|   918k|    Self ret;
  139|  2.75M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.83M, False: 918k]
  ------------------
  140|  1.83M|      ret[i] = (*this)[i] - o[i];
  141|  1.83M|    }
  142|   918k|    return ret;
  143|   918k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  11.0M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  16.5M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  61.3M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  1.83M|  Self operator+(const Self &o) const {
  130|  1.83M|    Self ret;
  131|  5.50M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 3.67M, False: 1.83M]
  ------------------
  132|  3.67M|      ret[i] = (*this)[i] + o[i];
  133|  3.67M|    }
  134|  1.83M|    return ret;
  135|  1.83M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  50.8M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  1.99M|  Self operator-(const Self &o) const {
  138|  1.99M|    Self ret;
  139|  5.97M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.98M, False: 1.99M]
  ------------------
  140|  3.98M|      ret[i] = (*this)[i] - o[i];
  141|  3.98M|    }
  142|  1.99M|    return ret;
  143|  1.99M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  1.99M|  Self operator+(const Self &o) const {
  130|  1.99M|    Self ret;
  131|  5.97M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 3.98M, False: 1.99M]
  ------------------
  132|  3.98M|      ret[i] = (*this)[i] + o[i];
  133|  3.98M|    }
  134|  1.99M|    return ret;
  135|  1.99M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   292k|  bool operator==(const Self &o) const {
  207|   870k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 581k, False: 288k]
  ------------------
  208|   581k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 3.59k, False: 578k]
  ------------------
  209|  3.59k|        return false;
  210|  3.59k|      }
  211|   581k|    }
  212|   288k|    return true;
  213|   292k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  3.51M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  4.32k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  5.04k|  Scalar Dot(const Self &o) const {
  251|  5.04k|    Scalar ret(0);
  252|  20.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 15.1k, False: 5.04k]
  ------------------
  253|  15.1k|      ret += (*this)[i] * o[i];
  254|  15.1k|    }
  255|  5.04k|    return ret;
  256|  5.04k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    721|  Self operator*(const Scalar &o) const {
  175|    721|    Self ret;
  176|  2.88k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 2.16k, False: 721]
  ------------------
  177|  2.16k|      ret[i] = (*this)[i] * o;
  178|  2.16k|    }
  179|    721|    return ret;
  180|    721|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  3.59k|  Self operator-(const Self &o) const {
  138|  3.59k|    Self ret;
  139|  10.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 7.19k, False: 3.59k]
  ------------------
  140|  7.19k|      ret[i] = (*this)[i] - o[i];
  141|  7.19k|    }
  142|  3.59k|    return ret;
  143|  3.59k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  7.19k|  VectorD() {
   41|  21.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 14.3k, False: 7.19k]
  ------------------
   42|  14.3k|      (*this)[i] = Scalar(0);
   43|  14.3k|    }
   44|  7.19k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   588k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   588k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   588k|    v_[0] = c0;
   55|   588k|    v_[1] = c1;
   56|   588k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  28.6k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   262k|  bool operator==(const Self &o) const {
  207|   775k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 519k, False: 256k]
  ------------------
  208|   519k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 6.90k, False: 512k]
  ------------------
  209|  6.90k|        return false;
  210|  6.90k|      }
  211|   519k|    }
  212|   256k|    return true;
  213|   262k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.62M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  46.2M|  VectorD() {
   41|   184M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 138M, False: 46.2M]
  ------------------
   42|   138M|      (*this)[i] = Scalar(0);
   43|   138M|    }
   44|  46.2M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  10.2k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  13.7k|  Scalar Dot(const Self &o) const {
  251|  13.7k|    Scalar ret(0);
  252|  54.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 41.1k, False: 13.7k]
  ------------------
  253|  41.1k|      ret += (*this)[i] * o[i];
  254|  41.1k|    }
  255|  13.7k|    return ret;
  256|  13.7k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  3.48k|  Self operator-(const Self &o) const {
  138|  3.48k|    Self ret;
  139|  10.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 6.97k, False: 3.48k]
  ------------------
  140|  6.97k|      ret[i] = (*this)[i] - o[i];
  141|  6.97k|    }
  142|  3.48k|    return ret;
  143|  3.48k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  13.4k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  40.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 26.8k, False: 13.4k]
  ------------------
  104|  26.8k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 26.8k, False: 0]
  ------------------
  105|  26.8k|        v_[i] = Scalar(src_vector[i]);
  106|  26.8k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  26.8k|    }
  110|  13.4k|  }
_ZNK5draco7VectorDImLi2EEmlERKm:
  174|  3.38k|  Self operator*(const Scalar &o) const {
  175|  3.38k|    Self ret;
  176|  10.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 6.77k, False: 3.38k]
  ------------------
  177|  6.77k|      ret[i] = (*this)[i] * o;
  178|  6.77k|    }
  179|  3.38k|    return ret;
  180|  3.38k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  13.4k|  VectorD() {
   41|  40.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 26.9k, False: 13.4k]
  ------------------
   42|  26.9k|      (*this)[i] = Scalar(0);
   43|  26.9k|    }
   44|  13.4k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  60.5k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  53.8k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|  4.40k|  Self operator+(const Self &o) const {
  130|  4.40k|    Self ret;
  131|  13.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 8.81k, False: 4.40k]
  ------------------
  132|  8.81k|      ret[i] = (*this)[i] + o[i];
  133|  8.81k|    }
  134|  4.40k|    return ret;
  135|  4.40k|  }
_ZN5draco7VectorDImLi2EEC2ERKmS3_:
   52|  3.38k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  3.38k|    DRACO_DCHECK_EQ(dimension, 2);
   54|  3.38k|    v_[0] = c0;
   55|  3.38k|    v_[1] = c1;
   56|  3.38k|  }
_ZNK5draco7VectorDImLi2EEmlERKS1_:
  145|  3.38k|  Self operator*(const Self &o) const {
  146|  3.38k|    Self ret;
  147|  10.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (147:21): [True: 6.77k, False: 3.38k]
  ------------------
  148|  6.77k|      ret[i] = (*this)[i] * o[i];
  149|  6.77k|    }
  150|  3.38k|    return ret;
  151|  3.38k|  }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  6.70k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  20.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 13.4k, False: 6.70k]
  ------------------
  104|  13.4k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 13.4k, False: 0]
  ------------------
  105|  13.4k|        v_[i] = Scalar(src_vector[i]);
  106|  13.4k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  13.4k|    }
  110|  6.70k|  }
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  3.33k|  Self operator+(const Self &o) const {
  130|  3.33k|    Self ret;
  131|  13.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 9.99k, False: 3.33k]
  ------------------
  132|  9.99k|      ret[i] = (*this)[i] + o[i];
  133|  9.99k|    }
  134|  3.33k|    return ret;
  135|  3.33k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.33k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.33k|  return v * o;
  294|  3.33k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  3.33k|  Self operator*(const Scalar &o) const {
  175|  3.33k|    Self ret;
  176|  13.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 9.99k, False: 3.33k]
  ------------------
  177|  9.99k|      ret[i] = (*this)[i] * o;
  178|  9.99k|    }
  179|  3.33k|    return ret;
  180|  3.33k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   529k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   529k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   529k|    v_[0] = c0;
   55|   529k|    v_[1] = c1;
   56|   529k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  3.33k|  Self operator*(const Scalar &o) const {
  175|  3.33k|    Self ret;
  176|  9.99k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 6.66k, False: 3.33k]
  ------------------
  177|  6.66k|      ret[i] = (*this)[i] * o;
  178|  6.66k|    }
  179|  3.33k|    return ret;
  180|  3.33k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  13.4k|  VectorD() {
   41|  40.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 26.9k, False: 13.4k]
  ------------------
   42|  26.9k|      (*this)[i] = Scalar(0);
   43|  26.9k|    }
   44|  13.4k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  3.31k|  Self operator/(const Scalar &o) const {
  183|  3.31k|    Self ret;
  184|  9.95k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 6.63k, False: 3.31k]
  ------------------
  185|  6.63k|      ret[i] = (*this)[i] / o;
  186|  6.63k|    }
  187|  3.31k|    return ret;
  188|  3.31k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  2.29k|  Self operator-(const Self &o) const {
  138|  2.29k|    Self ret;
  139|  6.88k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.59k, False: 2.29k]
  ------------------
  140|  4.59k|      ret[i] = (*this)[i] - o[i];
  141|  4.59k|    }
  142|  2.29k|    return ret;
  143|  2.29k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  53.8k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  3.61M|  VectorD() {
   41|  14.4M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 10.8M, False: 3.61M]
  ------------------
   42|  10.8M|      (*this)[i] = Scalar(0);
   43|  10.8M|    }
   44|  3.61M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  10.8M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  10.8M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  10.8M|    v_[0] = c0;
   55|  10.8M|    v_[1] = c1;
   56|  10.8M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  5.50M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  16.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 11.0M, False: 5.50M]
  ------------------
  104|  11.0M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 11.0M, False: 0]
  ------------------
  105|  11.0M|        v_[i] = Scalar(src_vector[i]);
  106|  11.0M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  11.0M|    }
  110|  5.50M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  2.75M|  VectorD() {
   41|  8.26M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.50M, False: 2.75M]
  ------------------
   42|  5.50M|      (*this)[i] = Scalar(0);
   43|  5.50M|    }
   44|  2.75M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  2.75M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  8.26M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 5.50M, False: 2.75M]
  ------------------
  104|  5.50M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 5.50M, False: 0]
  ------------------
  105|  5.50M|        v_[i] = Scalar(src_vector[i]);
  106|  5.50M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  5.50M|    }
  110|  2.75M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  7.02M|  VectorD(const Self &o) {
   89|  21.0M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 14.0M, False: 7.02M]
  ------------------
   90|  14.0M|      (*this)[i] = o[i];
   91|  14.0M|    }
   92|  7.02M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  3.98M|  VectorD() {
   41|  11.9M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 7.96M, False: 3.98M]
  ------------------
   42|  7.96M|      (*this)[i] = Scalar(0);
   43|  7.96M|    }
   44|  3.98M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|   179M|  inline int num_vertices() const {
   74|   179M|    return static_cast<int>(vertex_corners_.size());
   75|   179M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  12.5M|  inline int num_corners() const {
   77|  12.5M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  12.5M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  3.86M|  inline int num_faces() const {
   80|  3.86M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  3.86M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   508M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   508M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 508M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   508M|    return opposite_corners_[corner];
   88|   508M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   863M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   863M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 22.4M, False: 841M]
  ------------------
   91|  22.4M|      return corner;
   92|  22.4M|    }
   93|   841M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 757M, False: 83.8M]
  ------------------
   94|   863M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   753M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   753M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 9.47M, False: 743M]
  ------------------
   97|  9.47M|      return corner;
   98|  9.47M|    }
   99|   743M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 203M, False: 539M]
  ------------------
  100|   753M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.42G|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|  1.42G|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1.42G]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|  1.42G|    return ConfidentVertex(corner);
  106|  1.42G|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  1.42G|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|  1.42G|    DRACO_DCHECK_GE(corner.value(), 0);
  109|  1.42G|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|  1.42G|    return corner_to_vertex_map_[corner];
  111|  1.42G|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  49.5M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  49.5M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 49.5M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  49.5M|    return FaceIndex(corner.value() / 3);
  117|  49.5M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|  1.58G|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  87.1M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  87.1M|    return vertex_corners_[v];
  152|  87.1M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.57M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.57M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.57M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 48.2k, False: 1.52M]
  ------------------
  188|  48.2k|      return true;
  189|  48.2k|    }
  190|  1.52M|    return false;
  191|  1.57M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|   115M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|   115M|    return Previous(Opposite(Previous(corner)));
  202|   115M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  26.7M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  26.7M|    return Next(Opposite(Next(corner)));
  207|  26.7M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  5.18M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  5.18M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 5.18M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  5.18M|    return Opposite(Previous(corner_id));
  222|  5.18M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  6.71M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  6.71M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 6.71M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  6.71M|    return Opposite(Next(corner_id));
  228|  6.71M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   550M|                                CornerIndex opp_corner_id) {
  249|   550M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   550M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   550M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   694M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   694M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   694M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   694M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|   195M|  VertexIndex AddNewVertex() {
  271|   195M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|   195M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|   195M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|   195M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   403M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   403M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   403M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 403M, False: 0]
  ------------------
  295|   403M|      vertex_corners_[vert] = corner;
  296|   403M|    }
  297|   403M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  4.35M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  4.35M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  4.35M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  4.35M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  4.47k|      : corner_table_(table),
  229|  4.47k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  4.47k|        corner_(start_corner_),
  231|  4.47k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  4.14M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  40.9k|  VertexCornersIterator &operator++() {
  268|  40.9k|    Next();
  269|  40.9k|    return *this;
  270|  40.9k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.53M|  void Next() {
  248|  3.53M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.48M, False: 49.3k]
  ------------------
  249|  3.48M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.48M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 24.1k, False: 3.46M]
  ------------------
  251|       |        // Open boundary reached.
  252|  24.1k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  24.1k|        left_traversal_ = false;
  254|  3.46M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 578k, False: 2.88M]
  ------------------
  255|       |        // End reached.
  256|   578k|        corner_ = kInvalidCornerIndex;
  257|   578k|      }
  258|  3.48M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  49.3k|      corner_ = corner_table_->SwingRight(corner_);
  262|  49.3k|    }
  263|  3.53M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  7.03M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  7.62M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  8.07M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  4.03M|  void Next() {
  248|  4.03M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 4.01M, False: 24.1k]
  ------------------
  249|  4.01M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  4.01M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 3.50M, False: 511k]
  ------------------
  251|       |        // Open boundary reached.
  252|  3.50M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  3.50M|        left_traversal_ = false;
  254|  3.50M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 82.7k, False: 428k]
  ------------------
  255|       |        // End reached.
  256|  82.7k|        corner_ = kInvalidCornerIndex;
  257|  82.7k|      }
  258|  4.01M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  24.1k|      corner_ = corner_table_->SwingRight(corner_);
  262|  24.1k|    }
  263|  4.03M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  3.58M|      : corner_table_(table),
  236|  3.58M|        start_corner_(corner_id),
  237|  3.58M|        corner_(start_corner_),
  238|  3.58M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   598k|      : corner_table_(table),
  236|   598k|        start_corner_(corner_id),
  237|   598k|        corner_(start_corner_),
  238|   598k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  96.8M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  96.8M|    return is_edge_on_seam_[corner.value()];
   47|  96.8M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  44.3M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  44.3M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 44.3M]
  |  Branch (50:42): [True: 40.8M, False: 3.56M]
  ------------------
   51|  40.8M|      return kInvalidCornerIndex;
   52|  40.8M|    }
   53|  3.56M|    return corner_table_->Opposite(corner);
   54|  44.3M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  54.4M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  54.4M|    return corner_table_->Next(corner);
   58|  54.4M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  32.7M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  32.7M|    return corner_table_->Previous(corner);
   62|  32.7M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  6.15M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  6.15M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  6.15M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.79M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  3.79M|    return Opposite(Previous(corner));
   73|  3.79M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  4.04M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  4.04M|    return Opposite(Next(corner));
   76|  4.04M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  8.32M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  8.32M|    return Previous(Opposite(Previous(corner)));
   81|  8.32M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  19.0M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  19.0M|    return Next(Opposite(Next(corner)));
   86|  19.0M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  16.5k|  int num_vertices() const {
   89|  16.5k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  16.5k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  4.83k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  2.85k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|   121M|  VertexIndex Vertex(CornerIndex corner) const {
   95|   121M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|   121M|    return ConfidentVertex(corner);
   97|   121M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|   121M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|   121M|    return corner_to_vertex_map_[corner.value()];
  100|   121M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  3.78M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  3.78M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  3.78M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  3.78M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  3.78M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  3.78M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 3.78M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  3.78M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 3.53M, False: 247k]
  ------------------
  128|  3.53M|      return true;
  129|  3.53M|    }
  130|   247k|    return false;
  131|  3.78M|  }

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

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

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

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

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

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

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

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

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

