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

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

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

_ZN5draco30AttributeQuantizationTransformC2Ev:
   29|    374|  AttributeQuantizationTransform() : quantization_bits_(-1), range_(0.f) {}
_ZNK5draco30AttributeQuantizationTransform17quantization_bitsEv:
   59|     44|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco30AttributeQuantizationTransform5rangeEv:
   62|     44|  float range() const { return range_; }

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

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

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

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

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

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

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

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

_ZNK5draco17AttributesDecoder14GetAttributeIdEi:
   44|  42.3k|  int32_t GetAttributeId(int i) const override {
   45|  42.3k|    return point_attribute_ids_[i];
   46|  42.3k|  }
_ZNK5draco17AttributesDecoder16GetNumAttributesEv:
   47|  30.0k|  int32_t GetNumAttributes() const override {
   48|  30.0k|    return static_cast<int32_t>(point_attribute_ids_.size());
   49|  30.0k|  }
_ZNK5draco17AttributesDecoder10GetDecoderEv:
   50|  24.0k|  PointCloudDecoder *GetDecoder() const override {
   51|  24.0k|    return point_cloud_decoder_;
   52|  24.0k|  }
_ZN5draco17AttributesDecoder16DecodeAttributesEPNS_13DecoderBufferE:
   55|  4.02k|  bool DecodeAttributes(DecoderBuffer *in_buffer) override {
   56|  4.02k|    if (!DecodePortableAttributes(in_buffer)) {
  ------------------
  |  Branch (56:9): [True: 1.95k, False: 2.06k]
  ------------------
   57|  1.95k|      return false;
   58|  1.95k|    }
   59|  2.06k|    if (!DecodeDataNeededByPortableTransforms(in_buffer)) {
  ------------------
  |  Branch (59:9): [True: 968, False: 1.10k]
  ------------------
   60|    968|      return false;
   61|    968|    }
   62|  1.10k|    if (!TransformAttributesToOriginalFormat()) {
  ------------------
  |  Branch (62:9): [True: 287, False: 814]
  ------------------
   63|    287|      return false;
   64|    287|    }
   65|    814|    return true;
   66|  1.10k|  }
_ZNK5draco17AttributesDecoder27GetLocalIdForPointAttributeEi:
   69|  1.47k|  int32_t GetLocalIdForPointAttribute(int32_t point_attribute_id) const {
   70|  1.47k|    const int id_map_size =
   71|  1.47k|        static_cast<int>(point_attribute_to_local_id_map_.size());
   72|  1.47k|    if (point_attribute_id >= id_map_size) {
  ------------------
  |  Branch (72:9): [True: 0, False: 1.47k]
  ------------------
   73|      0|      return -1;
   74|      0|    }
   75|  1.47k|    return point_attribute_to_local_id_map_[point_attribute_id];
   76|  1.47k|  }
_ZN5draco17AttributesDecoderD2Ev:
   35|  12.4k|  virtual ~AttributesDecoder() = default;

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

_ZN5draco23KdTreeAttributesDecoderC2Ev:
  132|  6.35k|KdTreeAttributesDecoder::KdTreeAttributesDecoder() {}
_ZN5draco23KdTreeAttributesDecoder24DecodePortableAttributesEPNS_13DecoderBufferE:
  135|  1.29k|    DecoderBuffer *in_buffer) {
  136|  1.29k|  if (in_buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 3)) {
  ------------------
  |  |  115|  1.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (136:7): [True: 674, False: 617]
  ------------------
  137|       |    // Old bitstream does everything in the
  138|       |    // DecodeDataNeededByPortableTransforms() method.
  139|    674|    return true;
  140|    674|  }
  141|    617|  uint8_t compression_level = 0;
  142|    617|  if (!in_buffer->Decode(&compression_level)) {
  ------------------
  |  Branch (142:7): [True: 3, False: 614]
  ------------------
  143|      3|    return false;
  144|      3|  }
  145|    614|  const int32_t num_points = GetDecoder()->point_cloud()->num_points();
  146|       |
  147|       |  // Decode data using the kd tree decoding into integer (portable) attributes.
  148|       |  // We first need to go over all attributes and create a new portable storage
  149|       |  // for those attributes that need it (floating point attributes that have to
  150|       |  // be dequantized after decoding).
  151|       |
  152|    614|  const int num_attributes = GetNumAttributes();
  153|    614|  uint32_t total_dimensionality = 0;  // position is a required dimension
  154|    614|  std::vector<AttributeTuple> atts(num_attributes);
  155|       |
  156|  1.80k|  for (int i = 0; i < GetNumAttributes(); ++i) {
  ------------------
  |  Branch (156:19): [True: 1.19k, False: 612]
  ------------------
  157|  1.19k|    const int att_id = GetAttributeId(i);
  158|  1.19k|    PointAttribute *const att = GetDecoder()->point_cloud()->attribute(att_id);
  159|       |    // All attributes have the same number of values and identity mapping
  160|       |    // between PointIndex and AttributeValueIndex.
  161|  1.19k|    att->Reset(num_points);
  162|  1.19k|    att->SetIdentityMapping();
  163|       |
  164|  1.19k|    PointAttribute *target_att = nullptr;
  165|  1.19k|    if (att->data_type() == DT_UINT32 || att->data_type() == DT_UINT16 ||
  ------------------
  |  Branch (165:9): [True: 34, False: 1.15k]
  |  Branch (165:42): [True: 170, False: 988]
  ------------------
  166|    988|        att->data_type() == DT_UINT8) {
  ------------------
  |  Branch (166:9): [True: 164, False: 824]
  ------------------
  167|       |      // We can decode to these attributes directly.
  168|    368|      target_att = att;
  169|    824|    } else if (att->data_type() == DT_INT32 || att->data_type() == DT_INT16 ||
  ------------------
  |  Branch (169:16): [True: 118, False: 706]
  |  Branch (169:48): [True: 127, False: 579]
  ------------------
  170|    601|               att->data_type() == DT_INT8) {
  ------------------
  |  Branch (170:16): [True: 356, False: 223]
  ------------------
  171|       |      // Prepare storage for data that is used to convert unsigned values back
  172|       |      // to the signed ones.
  173|  18.5k|      for (int c = 0; c < att->num_components(); ++c) {
  ------------------
  |  Branch (173:23): [True: 17.9k, False: 601]
  ------------------
  174|  17.9k|        min_signed_values_.push_back(0);
  175|  17.9k|      }
  176|    601|      target_att = att;
  177|    601|    } else if (att->data_type() == DT_FLOAT32) {
  ------------------
  |  Branch (177:16): [True: 221, False: 2]
  ------------------
  178|       |      // Create a portable attribute that will hold the decoded data. We will
  179|       |      // dequantize the decoded data to the final attribute later on.
  180|    221|      const int num_components = att->num_components();
  181|    221|      GeometryAttribute va;
  182|    221|      va.Init(att->attribute_type(), nullptr, num_components, DT_UINT32, false,
  183|    221|              num_components * DataTypeLength(DT_UINT32), 0);
  184|    221|      std::unique_ptr<PointAttribute> port_att(new PointAttribute(va));
  185|    221|      port_att->SetIdentityMapping();
  186|    221|      port_att->Reset(num_points);
  187|    221|      quantized_portable_attributes_.push_back(std::move(port_att));
  188|    221|      target_att = quantized_portable_attributes_.back().get();
  189|    221|    } else {
  190|       |      // Unsupported type.
  191|      2|      return false;
  192|      2|    }
  193|       |    // Add attribute to the output iterator used by the core algorithm.
  194|  1.19k|    const DataType data_type = target_att->data_type();
  195|  1.19k|    const uint32_t data_size = (std::max)(0, DataTypeLength(data_type));
  196|  1.19k|    const uint32_t num_components = target_att->num_components();
  197|  1.19k|    atts[i] = std::make_tuple(target_att, total_dimensionality, data_type,
  198|  1.19k|                              data_size, num_components);
  199|  1.19k|    total_dimensionality += num_components;
  200|  1.19k|  }
  201|    612|  typedef PointAttributeVectorOutputIterator<uint32_t> OutIt;
  202|    612|  OutIt out_it(atts);
  203|       |
  204|    612|  switch (compression_level) {
  205|     78|    case 0: {
  ------------------
  |  Branch (205:5): [True: 78, False: 534]
  ------------------
  206|     78|      if (!DecodePoints<0, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (206:11): [True: 31, False: 47]
  ------------------
  207|     78|                                  &out_it)) {
  208|     31|        return false;
  209|     31|      }
  210|     47|      break;
  211|     78|    }
  212|     47|    case 1: {
  ------------------
  |  Branch (212:5): [True: 44, False: 568]
  ------------------
  213|     44|      if (!DecodePoints<1, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (213:11): [True: 26, False: 18]
  ------------------
  214|     44|                                  &out_it)) {
  215|     26|        return false;
  216|     26|      }
  217|     18|      break;
  218|     44|    }
  219|     84|    case 2: {
  ------------------
  |  Branch (219:5): [True: 84, False: 528]
  ------------------
  220|     84|      if (!DecodePoints<2, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (220:11): [True: 68, False: 16]
  ------------------
  221|     84|                                  &out_it)) {
  222|     68|        return false;
  223|     68|      }
  224|     16|      break;
  225|     84|    }
  226|     80|    case 3: {
  ------------------
  |  Branch (226:5): [True: 80, False: 532]
  ------------------
  227|     80|      if (!DecodePoints<3, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (227:11): [True: 69, False: 11]
  ------------------
  228|     80|                                  &out_it)) {
  229|     69|        return false;
  230|     69|      }
  231|     11|      break;
  232|     80|    }
  233|    105|    case 4: {
  ------------------
  |  Branch (233:5): [True: 105, False: 507]
  ------------------
  234|    105|      if (!DecodePoints<4, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (234:11): [True: 82, False: 23]
  ------------------
  235|    105|                                  &out_it)) {
  236|     82|        return false;
  237|     82|      }
  238|     23|      break;
  239|    105|    }
  240|    127|    case 5: {
  ------------------
  |  Branch (240:5): [True: 127, False: 485]
  ------------------
  241|    127|      if (!DecodePoints<5, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (241:11): [True: 114, False: 13]
  ------------------
  242|    127|                                  &out_it)) {
  243|    114|        return false;
  244|    114|      }
  245|     13|      break;
  246|    127|    }
  247|     86|    case 6: {
  ------------------
  |  Branch (247:5): [True: 86, False: 526]
  ------------------
  248|     86|      if (!DecodePoints<6, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (248:11): [True: 68, False: 18]
  ------------------
  249|     86|                                  &out_it)) {
  250|     68|        return false;
  251|     68|      }
  252|     18|      break;
  253|     86|    }
  254|     18|    default:
  ------------------
  |  Branch (254:5): [True: 8, False: 604]
  ------------------
  255|      8|      return false;
  256|    612|  }
  257|    146|  return true;
  258|    612|}
_ZN5draco23KdTreeAttributesDecoder36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
  274|    820|    DecoderBuffer *in_buffer) {
  275|    820|  if (in_buffer->bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 3)) {
  ------------------
  |  |  115|    820|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (275:7): [True: 146, False: 674]
  ------------------
  276|       |    // Decode quantization data for each attribute that need it.
  277|       |    // TODO(ostava): This should be moved to AttributeQuantizationTransform.
  278|    146|    std::vector<float> min_value;
  279|    476|    for (int i = 0; i < GetNumAttributes(); ++i) {
  ------------------
  |  Branch (279:21): [True: 354, False: 122]
  ------------------
  280|    354|      const int att_id = GetAttributeId(i);
  281|    354|      const PointAttribute *const att =
  282|    354|          GetDecoder()->point_cloud()->attribute(att_id);
  283|    354|      if (att->data_type() == DT_FLOAT32) {
  ------------------
  |  Branch (283:11): [True: 95, False: 259]
  ------------------
  284|     95|        const int num_components = att->num_components();
  285|     95|        min_value.resize(num_components);
  286|     95|        if (!in_buffer->Decode(&min_value[0], sizeof(float) * num_components)) {
  ------------------
  |  Branch (286:13): [True: 12, False: 83]
  ------------------
  287|     12|          return false;
  288|     12|        }
  289|     83|        float max_value_dif;
  290|     83|        if (!in_buffer->Decode(&max_value_dif)) {
  ------------------
  |  Branch (290:13): [True: 2, False: 81]
  ------------------
  291|      2|          return false;
  292|      2|        }
  293|     81|        uint8_t quantization_bits;
  294|     81|        if (!in_buffer->Decode(&quantization_bits) || quantization_bits > 31) {
  ------------------
  |  Branch (294:13): [True: 2, False: 79]
  |  Branch (294:55): [True: 4, False: 75]
  ------------------
  295|      6|          return false;
  296|      6|        }
  297|     75|        AttributeQuantizationTransform transform;
  298|     75|        if (!transform.SetParameters(quantization_bits, min_value.data(),
  ------------------
  |  Branch (298:13): [True: 4, False: 71]
  ------------------
  299|     75|                                     num_components, max_value_dif)) {
  300|      4|          return false;
  301|      4|        }
  302|     71|        const int num_transforms =
  303|     71|            static_cast<int>(attribute_quantization_transforms_.size());
  304|     71|        if (!transform.TransferToAttribute(
  ------------------
  |  Branch (304:13): [True: 0, False: 71]
  ------------------
  305|     71|                quantized_portable_attributes_[num_transforms].get())) {
  306|      0|          return false;
  307|      0|        }
  308|     71|        attribute_quantization_transforms_.push_back(transform);
  309|     71|      }
  310|    354|    }
  311|       |
  312|       |    // Decode transform data for signed integer attributes.
  313|  2.72k|    for (int i = 0; i < min_signed_values_.size(); ++i) {
  ------------------
  |  Branch (313:21): [True: 2.63k, False: 97]
  ------------------
  314|  2.63k|      int32_t val;
  315|  2.63k|      if (!DecodeVarint(&val, in_buffer)) {
  ------------------
  |  Branch (315:11): [True: 25, False: 2.60k]
  ------------------
  316|     25|        return false;
  317|     25|      }
  318|  2.60k|      min_signed_values_[i] = val;
  319|  2.60k|    }
  320|     97|    return true;
  321|    122|  }
  322|    674|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  323|       |  // Handle old bitstream
  324|       |  // Figure out the total dimensionality of the point cloud
  325|    674|  const uint32_t attribute_count = GetNumAttributes();
  326|    674|  uint32_t total_dimensionality = 0;  // position is a required dimension
  327|    674|  std::vector<AttributeTuple> atts(attribute_count);
  328|    674|  for (auto attribute_index = 0;
  329|  1.42k|       static_cast<uint32_t>(attribute_index) < attribute_count;
  ------------------
  |  Branch (329:8): [True: 754, False: 674]
  ------------------
  330|    754|       attribute_index += 1)  // increment the dimensionality as needed...
  331|    754|  {
  332|    754|    const int att_id = GetAttributeId(attribute_index);
  333|    754|    PointAttribute *const att = GetDecoder()->point_cloud()->attribute(att_id);
  334|    754|    const DataType data_type = att->data_type();
  335|    754|    const uint32_t data_size = (std::max)(0, DataTypeLength(data_type));
  336|    754|    const uint32_t num_components = att->num_components();
  337|    754|    if (data_size > 4) {
  ------------------
  |  Branch (337:9): [True: 0, False: 754]
  ------------------
  338|      0|      return false;
  339|      0|    }
  340|       |
  341|    754|    atts[attribute_index] = std::make_tuple(
  342|    754|        att, total_dimensionality, data_type, data_size, num_components);
  343|       |    // everything is treated as 32bit in the encoder.
  344|    754|    total_dimensionality += num_components;
  345|    754|  }
  346|       |
  347|    674|  const int att_id = GetAttributeId(0);
  348|    674|  PointAttribute *const att = GetDecoder()->point_cloud()->attribute(att_id);
  349|    674|  att->SetIdentityMapping();
  350|       |  // Decode method
  351|    674|  uint8_t method;
  352|    674|  if (!in_buffer->Decode(&method)) {
  ------------------
  |  Branch (352:7): [True: 1, False: 673]
  ------------------
  353|      1|    return false;
  354|      1|  }
  355|    673|  if (method == KdTreeAttributesEncodingMethod::kKdTreeQuantizationEncoding) {
  ------------------
  |  Branch (355:7): [True: 488, False: 185]
  ------------------
  356|       |    // This method only supports one attribute with exactly three components.
  357|    488|    if (atts.size() != 1 || std::get<4>(atts[0]) != 3) {
  ------------------
  |  Branch (357:9): [True: 2, False: 486]
  |  Branch (357:29): [True: 2, False: 484]
  ------------------
  358|      4|      return false;
  359|      4|    }
  360|    484|    uint8_t compression_level = 0;
  361|    484|    if (!in_buffer->Decode(&compression_level)) {
  ------------------
  |  Branch (361:9): [True: 0, False: 484]
  ------------------
  362|      0|      return false;
  363|      0|    }
  364|    484|    uint32_t num_points = 0;
  365|    484|    if (!in_buffer->Decode(&num_points)) {
  ------------------
  |  Branch (365:9): [True: 0, False: 484]
  ------------------
  366|      0|      return false;
  367|      0|    }
  368|    484|    att->Reset(num_points);
  369|    484|    FloatPointsTreeDecoder decoder;
  370|    484|    decoder.set_num_points_from_header(num_points);
  371|    484|    PointAttributeVectorOutputIterator<float> out_it(atts);
  372|    484|    if (!decoder.DecodePointCloud(in_buffer, out_it)) {
  ------------------
  |  Branch (372:9): [True: 476, False: 8]
  ------------------
  373|    476|      return false;
  374|    476|    }
  375|    484|  } else if (method == KdTreeAttributesEncodingMethod::kKdTreeIntegerEncoding) {
  ------------------
  |  Branch (375:14): [True: 182, False: 3]
  ------------------
  376|    182|    uint8_t compression_level = 0;
  377|    182|    if (!in_buffer->Decode(&compression_level)) {
  ------------------
  |  Branch (377:9): [True: 0, False: 182]
  ------------------
  378|      0|      return false;
  379|      0|    }
  380|    182|    if (6 < compression_level) {
  ------------------
  |  Branch (380:9): [True: 1, False: 181]
  ------------------
  381|      1|      DRACO_LOGE(
  ------------------
  |  |   31|      1|#define DRACO_LOGE printf
  ------------------
  382|      1|          "KdTreeAttributesDecoder: compression level %i not supported.\n",
  383|      1|          compression_level);
  384|      1|      return false;
  385|      1|    }
  386|       |
  387|    181|    uint32_t num_points;
  388|    181|    if (!in_buffer->Decode(&num_points)) {
  ------------------
  |  Branch (388:9): [True: 1, False: 180]
  ------------------
  389|      1|      return false;
  390|      1|    }
  391|       |
  392|    180|    for (auto attribute_index = 0;
  393|    418|         static_cast<uint32_t>(attribute_index) < attribute_count;
  ------------------
  |  Branch (393:10): [True: 238, False: 180]
  ------------------
  394|    238|         attribute_index += 1) {
  395|    238|      const int att_id = GetAttributeId(attribute_index);
  396|    238|      PointAttribute *const attr =
  397|    238|          GetDecoder()->point_cloud()->attribute(att_id);
  398|    238|      attr->Reset(num_points);
  399|    238|      attr->SetIdentityMapping();
  400|    238|    }
  401|       |
  402|    180|    using OutIt = PointAttributeVectorOutputIterator<uint32_t>;
  403|    180|    OutIt out_it(atts);
  404|       |
  405|    180|    switch (compression_level) {
  406|     69|      case 0: {
  ------------------
  |  Branch (406:7): [True: 69, False: 111]
  ------------------
  407|     69|        if (!DecodePoints<0, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (407:13): [True: 65, False: 4]
  ------------------
  408|     69|                                    &out_it)) {
  409|     65|          return false;
  410|     65|        }
  411|      4|        break;
  412|     69|      }
  413|     63|      case 1: {
  ------------------
  |  Branch (413:7): [True: 63, False: 117]
  ------------------
  414|     63|        if (!DecodePoints<1, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (414:13): [True: 59, False: 4]
  ------------------
  415|     63|                                    &out_it)) {
  416|     59|          return false;
  417|     59|        }
  418|      4|        break;
  419|     63|      }
  420|     21|      case 2: {
  ------------------
  |  Branch (420:7): [True: 21, False: 159]
  ------------------
  421|     21|        if (!DecodePoints<2, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (421:13): [True: 21, False: 0]
  ------------------
  422|     21|                                    &out_it)) {
  423|     21|          return false;
  424|     21|        }
  425|      0|        break;
  426|     21|      }
  427|     20|      case 3: {
  ------------------
  |  Branch (427:7): [True: 20, False: 160]
  ------------------
  428|     20|        if (!DecodePoints<3, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (428:13): [True: 20, False: 0]
  ------------------
  429|     20|                                    &out_it)) {
  430|     20|          return false;
  431|     20|        }
  432|      0|        break;
  433|     20|      }
  434|      4|      case 4: {
  ------------------
  |  Branch (434:7): [True: 4, False: 176]
  ------------------
  435|      4|        if (!DecodePoints<4, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (435:13): [True: 3, False: 1]
  ------------------
  436|      4|                                    &out_it)) {
  437|      3|          return false;
  438|      3|        }
  439|      1|        break;
  440|      4|      }
  441|      1|      case 5: {
  ------------------
  |  Branch (441:7): [True: 0, False: 180]
  ------------------
  442|      0|        if (!DecodePoints<5, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (442:13): [True: 0, False: 0]
  ------------------
  443|      0|                                    &out_it)) {
  444|      0|          return false;
  445|      0|        }
  446|      0|        break;
  447|      0|      }
  448|      3|      case 6: {
  ------------------
  |  Branch (448:7): [True: 3, False: 177]
  ------------------
  449|      3|        if (!DecodePoints<6, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (449:13): [True: 0, False: 3]
  ------------------
  450|      3|                                    &out_it)) {
  451|      0|          return false;
  452|      0|        }
  453|      3|        break;
  454|      3|      }
  455|      3|      default:
  ------------------
  |  Branch (455:7): [True: 0, False: 180]
  ------------------
  456|      0|        return false;
  457|    180|    }
  458|    180|  } else {
  459|       |    // Invalid method.
  460|      3|    return false;
  461|      3|  }
  462|     20|  return true;
  463|       |#else
  464|       |  return false;
  465|       |#endif
  466|    673|}
_ZN5draco23KdTreeAttributesDecoder35TransformAttributesToOriginalFormatEv:
  494|    117|bool KdTreeAttributesDecoder::TransformAttributesToOriginalFormat() {
  495|    117|  if (quantized_portable_attributes_.empty() && min_signed_values_.empty()) {
  ------------------
  |  Branch (495:7): [True: 101, False: 16]
  |  Branch (495:49): [True: 40, False: 61]
  ------------------
  496|     40|    return true;
  497|     40|  }
  498|     77|  int num_processed_quantized_attributes = 0;
  499|     77|  int num_processed_signed_components = 0;
  500|       |  // Dequantize attributes that needed it.
  501|    310|  for (int i = 0; i < GetNumAttributes(); ++i) {
  ------------------
  |  Branch (501:19): [True: 233, False: 77]
  ------------------
  502|    233|    const int att_id = GetAttributeId(i);
  503|    233|    PointAttribute *const att = GetDecoder()->point_cloud()->attribute(att_id);
  504|    233|    if (att->data_type() == DT_INT32 || att->data_type() == DT_INT16 ||
  ------------------
  |  Branch (504:9): [True: 38, False: 195]
  |  Branch (504:41): [True: 51, False: 144]
  ------------------
  505|    144|        att->data_type() == DT_INT8) {
  ------------------
  |  Branch (505:9): [True: 30, False: 114]
  ------------------
  506|    119|      std::vector<uint32_t> unsigned_val(att->num_components());
  507|    119|      std::vector<int32_t> signed_val(att->num_components());
  508|       |      // Values are stored as unsigned in the attribute, make them signed again.
  509|    119|      if (att->data_type() == DT_INT32) {
  ------------------
  |  Branch (509:11): [True: 38, False: 81]
  ------------------
  510|     38|        if (!TransformAttributeBackToSignedType<int32_t>(
  ------------------
  |  Branch (510:13): [True: 0, False: 38]
  ------------------
  511|     38|                att, num_processed_signed_components)) {
  512|      0|          return false;
  513|      0|        }
  514|     81|      } else if (att->data_type() == DT_INT16) {
  ------------------
  |  Branch (514:18): [True: 51, False: 30]
  ------------------
  515|     51|        if (!TransformAttributeBackToSignedType<int16_t>(
  ------------------
  |  Branch (515:13): [True: 0, False: 51]
  ------------------
  516|     51|                att, num_processed_signed_components)) {
  517|      0|          return false;
  518|      0|        }
  519|     51|      } else if (att->data_type() == DT_INT8) {
  ------------------
  |  Branch (519:18): [True: 30, False: 0]
  ------------------
  520|     30|        if (!TransformAttributeBackToSignedType<int8_t>(
  ------------------
  |  Branch (520:13): [True: 0, False: 30]
  ------------------
  521|     30|                att, num_processed_signed_components)) {
  522|      0|          return false;
  523|      0|        }
  524|     30|      }
  525|    119|      num_processed_signed_components += att->num_components();
  526|    119|    } else if (att->data_type() == DT_FLOAT32) {
  ------------------
  |  Branch (526:16): [True: 44, False: 70]
  ------------------
  527|       |      // TODO(ostava): This code should be probably moved out to attribute
  528|       |      // transform and shared with the SequentialQuantizationAttributeDecoder.
  529|       |
  530|     44|      const PointAttribute *const src_att =
  531|     44|          quantized_portable_attributes_[num_processed_quantized_attributes]
  532|     44|              .get();
  533|       |
  534|     44|      const AttributeQuantizationTransform &transform =
  535|     44|          attribute_quantization_transforms_
  536|     44|              [num_processed_quantized_attributes];
  537|       |
  538|     44|      num_processed_quantized_attributes++;
  539|       |
  540|     44|      if (GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (540:11): [True: 0, False: 44]
  ------------------
  541|     44|              att->attribute_type(), "skip_attribute_transform", false)) {
  542|       |        // Attribute transform should not be performed. In this case, we replace
  543|       |        // the output geometry attribute with the portable attribute.
  544|       |        // TODO(ostava): We can potentially avoid this copy by introducing a new
  545|       |        // mechanism that would allow to use the final attributes as portable
  546|       |        // attributes for predictors that may need them.
  547|      0|        att->CopyFrom(*src_att);
  548|      0|        continue;
  549|      0|      }
  550|       |
  551|       |      // Convert all quantized values back to floats.
  552|     44|      const int32_t max_quantized_value =
  553|     44|          (1u << static_cast<uint32_t>(transform.quantization_bits())) - 1;
  554|     44|      const int num_components = att->num_components();
  555|     44|      const int entry_size = sizeof(float) * num_components;
  556|     44|      const std::unique_ptr<float[]> att_val(new float[num_components]);
  557|     44|      int quant_val_id = 0;
  558|     44|      int out_byte_pos = 0;
  559|     44|      Dequantizer dequantizer;
  560|     44|      if (!dequantizer.Init(transform.range(), max_quantized_value)) {
  ------------------
  |  Branch (560:11): [True: 0, False: 44]
  ------------------
  561|      0|        return false;
  562|      0|      }
  563|     44|      const uint32_t *const portable_attribute_data =
  564|     44|          reinterpret_cast<const uint32_t *>(
  565|     44|              src_att->GetAddress(AttributeValueIndex(0)));
  566|     44|      for (uint32_t i = 0; i < src_att->size(); ++i) {
  ------------------
  |  Branch (566:28): [True: 0, False: 44]
  ------------------
  567|      0|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (567:25): [True: 0, False: 0]
  ------------------
  568|      0|          float value = dequantizer.DequantizeFloat(
  569|      0|              portable_attribute_data[quant_val_id++]);
  570|      0|          value = value + transform.min_value(c);
  571|      0|          att_val[c] = value;
  572|      0|        }
  573|       |        // Store the floating point value into the attribute buffer.
  574|      0|        att->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  575|      0|        out_byte_pos += entry_size;
  576|      0|      }
  577|     44|    }
  578|    233|  }
  579|     77|  return true;
  580|     77|}
_ZN5draco34PointAttributeVectorOutputIteratorIjEC2ERKNSt3__16vectorINS2_5tupleIJPNS_14PointAttributeEjNS_8DataTypeEjjEEENS2_9allocatorIS8_EEEE:
   48|    792|      : attributes_(atts), point_id_(0) {
   49|    792|    DRACO_DCHECK_GE(atts.size(), 1);
   50|    792|    uint32_t required_decode_bytes = 0;
   51|  2.21k|    for (auto index = 0; index < attributes_.size(); index++) {
  ------------------
  |  Branch (51:26): [True: 1.42k, False: 792]
  ------------------
   52|  1.42k|      const AttributeTuple &att = attributes_[index];
   53|  1.42k|      required_decode_bytes = (std::max)(required_decode_bytes,
   54|  1.42k|                                         std::get<3>(att) * std::get<4>(att));
   55|  1.42k|    }
   56|    792|    memory_.resize(required_decode_bytes);
   57|    792|    data_ = memory_.data();
   58|    792|  }
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi0ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    147|                                           OutIteratorT *out_iterator) {
  265|    147|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    147|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 83, False: 64]
  ------------------
  267|     96|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 13, False: 51]
  ------------------
  268|     96|    return false;
  269|     96|  }
  270|     51|  return true;
  271|    147|}
_ZN5draco34PointAttributeVectorOutputIteratorIjEdeEv:
   73|   121M|  Self &operator*() { return *this; }
_ZN5draco34PointAttributeVectorOutputIteratorIjEaSERKNSt3__16vectorIjNS2_9allocatorIjEEEE:
   91|   121M|  const Self &operator=(const std::vector<CoeffT> &val) {
   92|   258M|    for (auto index = 0; index < attributes_.size(); index++) {
  ------------------
  |  Branch (92:26): [True: 137M, False: 121M]
  ------------------
   93|   137M|      AttributeTuple &att = attributes_[index];
   94|   137M|      PointAttribute *attribute = std::get<0>(att);
   95|   137M|      const AttributeValueIndex avi = attribute->mapped_index(point_id_);
   96|   137M|      if (avi >= static_cast<uint32_t>(attribute->size())) {
  ------------------
  |  Branch (96:11): [True: 0, False: 137M]
  ------------------
   97|      0|        return *this;
   98|      0|      }
   99|   137M|      const uint32_t &offset = std::get<1>(att);
  100|   137M|      const uint32_t &data_size = std::get<3>(att);
  101|   137M|      const uint32_t &num_components = std::get<4>(att);
  102|   137M|      const uint32_t *data_source = val.data() + offset;
  103|   137M|      if (data_size < 4) {  // handle uint16_t, uint8_t
  ------------------
  |  Branch (103:11): [True: 73.0M, False: 64.3M]
  ------------------
  104|       |        // selectively copy data bytes
  105|  73.0M|        uint8_t *data_counter = data_;
  106|   206M|        for (uint32_t index = 0; index < num_components;
  ------------------
  |  Branch (106:34): [True: 133M, False: 73.0M]
  ------------------
  107|   133M|             index += 1, data_counter += data_size) {
  108|   133M|          std::memcpy(data_counter, data_source + index, data_size);
  109|   133M|        }
  110|       |        // redirect to copied data
  111|  73.0M|        data_source = reinterpret_cast<uint32_t *>(data_);
  112|  73.0M|      }
  113|   137M|      attribute->SetAttributeValue(avi, data_source);
  114|   137M|    }
  115|   121M|    return *this;
  116|   121M|  }
_ZN5draco34PointAttributeVectorOutputIteratorIjEppEv:
   60|   121M|  const Self &operator++() {
   61|   121M|    ++point_id_;
   62|   121M|    return *this;
   63|   121M|  }
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi1ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    107|                                           OutIteratorT *out_iterator) {
  265|    107|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    107|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 78, False: 29]
  ------------------
  267|     85|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 7, False: 22]
  ------------------
  268|     85|    return false;
  269|     85|  }
  270|     22|  return true;
  271|    107|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi2ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    105|                                           OutIteratorT *out_iterator) {
  265|    105|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    105|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 83, False: 22]
  ------------------
  267|     89|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 6, False: 16]
  ------------------
  268|     89|    return false;
  269|     89|  }
  270|     16|  return true;
  271|    105|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi3ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    100|                                           OutIteratorT *out_iterator) {
  265|    100|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    100|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 85, False: 15]
  ------------------
  267|     89|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 4, False: 11]
  ------------------
  268|     89|    return false;
  269|     89|  }
  270|     11|  return true;
  271|    100|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi4ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    109|                                           OutIteratorT *out_iterator) {
  265|    109|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    109|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 72, False: 37]
  ------------------
  267|     85|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 13, False: 24]
  ------------------
  268|     85|    return false;
  269|     85|  }
  270|     24|  return true;
  271|    109|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi5ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    127|                                           OutIteratorT *out_iterator) {
  265|    127|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    127|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 89, False: 38]
  ------------------
  267|    114|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 25, False: 13]
  ------------------
  268|    114|    return false;
  269|    114|  }
  270|     13|  return true;
  271|    127|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi6ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|     89|                                           OutIteratorT *out_iterator) {
  265|     89|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|     89|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 58, False: 31]
  ------------------
  267|     68|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 10, False: 21]
  ------------------
  268|     68|    return false;
  269|     68|  }
  270|     21|  return true;
  271|     89|}
_ZN5draco34PointAttributeVectorOutputIteratorIfEC2ERKNSt3__16vectorINS2_5tupleIJPNS_14PointAttributeEjNS_8DataTypeEjjEEENS2_9allocatorIS8_EEEE:
   48|    484|      : attributes_(atts), point_id_(0) {
   49|    484|    DRACO_DCHECK_GE(atts.size(), 1);
   50|    484|    uint32_t required_decode_bytes = 0;
   51|    968|    for (auto index = 0; index < attributes_.size(); index++) {
  ------------------
  |  Branch (51:26): [True: 484, False: 484]
  ------------------
   52|    484|      const AttributeTuple &att = attributes_[index];
   53|    484|      required_decode_bytes = (std::max)(required_decode_bytes,
   54|    484|                                         std::get<3>(att) * std::get<4>(att));
   55|    484|    }
   56|    484|    memory_.resize(required_decode_bytes);
   57|    484|    data_ = memory_.data();
   58|    484|  }
_ZN5draco34PointAttributeVectorOutputIteratorIfEdeEv:
   73|     14|  Self &operator*() { return *this; }
_ZN5draco34PointAttributeVectorOutputIteratorIfEaSERKNS_7VectorDIfLi3EEE:
   77|     14|  const Self &operator=(const VectorD<CoeffT, 3> &val) {
   78|     14|    DRACO_DCHECK_EQ(attributes_.size(), 1);  // Expect only ONE attribute.
   79|     14|    AttributeTuple &att = attributes_[0];
   80|     14|    PointAttribute *attribute = std::get<0>(att);
   81|     14|    const AttributeValueIndex avi = attribute->mapped_index(point_id_);
   82|     14|    if (avi >= static_cast<uint32_t>(attribute->size())) {
  ------------------
  |  Branch (82:9): [True: 7, False: 7]
  ------------------
   83|      7|      return *this;
   84|      7|    }
   85|      7|    const uint32_t &offset = std::get<1>(att);
   86|      7|    DRACO_DCHECK_EQ(offset, 0);  // expected to be zero
   87|      7|    attribute->SetAttributeValue(avi, &val[0] + offset);
   88|      7|    return *this;
   89|     14|  }
_ZN5draco34PointAttributeVectorOutputIteratorIfEppEv:
   60|     14|  const Self &operator++() {
   61|     14|    ++point_id_;
   62|     14|    return *this;
   63|     14|  }
_ZN5draco23KdTreeAttributesDecoder34TransformAttributeBackToSignedTypeIiEEbPNS_14PointAttributeEi:
  470|     38|    PointAttribute *att, int num_processed_signed_components) {
  471|     38|  typedef typename std::make_unsigned<SignedDataTypeT>::type UnsignedType;
  472|     38|  std::vector<UnsignedType> unsigned_val(att->num_components());
  473|     38|  std::vector<SignedDataTypeT> signed_val(att->num_components());
  474|       |
  475|     72|  for (AttributeValueIndex avi(0); avi < static_cast<uint32_t>(att->size());
  ------------------
  |  Branch (475:36): [True: 34, False: 38]
  ------------------
  476|     38|       ++avi) {
  477|     34|    att->GetValue(avi, &unsigned_val[0]);
  478|  5.50k|    for (int c = 0; c < att->num_components(); ++c) {
  ------------------
  |  Branch (478:21): [True: 5.47k, False: 34]
  ------------------
  479|       |      // Up-cast |unsigned_val| to int32_t to ensure we don't overflow it for
  480|       |      // smaller data types. But first check that the up-casting does not cause
  481|       |      // signed integer overflow.
  482|  5.47k|      if (unsigned_val[c] > std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (482:11): [True: 0, False: 5.47k]
  ------------------
  483|      0|        return false;
  484|      0|      }
  485|  5.47k|      signed_val[c] = static_cast<SignedDataTypeT>(
  486|  5.47k|          static_cast<int32_t>(unsigned_val[c]) +
  487|  5.47k|          min_signed_values_[num_processed_signed_components + c]);
  488|  5.47k|    }
  489|     34|    att->SetAttributeValue(avi, &signed_val[0]);
  490|     34|  }
  491|     38|  return true;
  492|     38|}
_ZN5draco23KdTreeAttributesDecoder34TransformAttributeBackToSignedTypeIsEEbPNS_14PointAttributeEi:
  470|     51|    PointAttribute *att, int num_processed_signed_components) {
  471|     51|  typedef typename std::make_unsigned<SignedDataTypeT>::type UnsignedType;
  472|     51|  std::vector<UnsignedType> unsigned_val(att->num_components());
  473|     51|  std::vector<SignedDataTypeT> signed_val(att->num_components());
  474|       |
  475|     51|  for (AttributeValueIndex avi(0); avi < static_cast<uint32_t>(att->size());
  ------------------
  |  Branch (475:36): [True: 0, False: 51]
  ------------------
  476|     51|       ++avi) {
  477|      0|    att->GetValue(avi, &unsigned_val[0]);
  478|      0|    for (int c = 0; c < att->num_components(); ++c) {
  ------------------
  |  Branch (478:21): [True: 0, False: 0]
  ------------------
  479|       |      // Up-cast |unsigned_val| to int32_t to ensure we don't overflow it for
  480|       |      // smaller data types. But first check that the up-casting does not cause
  481|       |      // signed integer overflow.
  482|      0|      if (unsigned_val[c] > std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (482:11): [True: 0, False: 0]
  ------------------
  483|      0|        return false;
  484|      0|      }
  485|      0|      signed_val[c] = static_cast<SignedDataTypeT>(
  486|      0|          static_cast<int32_t>(unsigned_val[c]) +
  487|      0|          min_signed_values_[num_processed_signed_components + c]);
  488|      0|    }
  489|      0|    att->SetAttributeValue(avi, &signed_val[0]);
  490|      0|  }
  491|     51|  return true;
  492|     51|}
_ZN5draco23KdTreeAttributesDecoder34TransformAttributeBackToSignedTypeIaEEbPNS_14PointAttributeEi:
  470|     30|    PointAttribute *att, int num_processed_signed_components) {
  471|     30|  typedef typename std::make_unsigned<SignedDataTypeT>::type UnsignedType;
  472|     30|  std::vector<UnsignedType> unsigned_val(att->num_components());
  473|     30|  std::vector<SignedDataTypeT> signed_val(att->num_components());
  474|       |
  475|     93|  for (AttributeValueIndex avi(0); avi < static_cast<uint32_t>(att->size());
  ------------------
  |  Branch (475:36): [True: 63, False: 30]
  ------------------
  476|     63|       ++avi) {
  477|     63|    att->GetValue(avi, &unsigned_val[0]);
  478|    315|    for (int c = 0; c < att->num_components(); ++c) {
  ------------------
  |  Branch (478:21): [True: 252, False: 63]
  ------------------
  479|       |      // Up-cast |unsigned_val| to int32_t to ensure we don't overflow it for
  480|       |      // smaller data types. But first check that the up-casting does not cause
  481|       |      // signed integer overflow.
  482|    252|      if (unsigned_val[c] > std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (482:11): [True: 0, False: 252]
  ------------------
  483|      0|        return false;
  484|      0|      }
  485|    252|      signed_val[c] = static_cast<SignedDataTypeT>(
  486|    252|          static_cast<int32_t>(unsigned_val[c]) +
  487|    252|          min_signed_values_[num_processed_signed_components + c]);
  488|    252|    }
  489|     63|    att->SetAttributeValue(avi, &signed_val[0]);
  490|     63|  }
  491|     30|  return true;
  492|     30|}

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  1.72k|      : quantization_bits_(-1),
   54|  1.72k|        max_quantized_value_(-1),
   55|  1.72k|        max_value_(-1),
   56|  1.72k|        dequantization_scale_(1.f),
   57|  1.72k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  1.55k|  bool SetQuantizationBits(int32_t q) {
   60|  1.55k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 482, False: 1.07k]
  |  Branch (60:18): [True: 77, False: 993]
  ------------------
   61|    559|      return false;
   62|    559|    }
   63|    993|    quantization_bits_ = q;
   64|    993|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|    993|    max_value_ = max_quantized_value_ - 1;
   66|    993|    dequantization_scale_ = 2.f / max_value_;
   67|    993|    center_value_ = max_value_ / 2;
   68|    993|    return true;
   69|  1.55k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  1.25M|                                           int32_t *out_t) const {
   77|  1.25M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 1.82k, False: 1.24M]
  |  Branch (77:20): [True: 0, False: 1.82k]
  |  Branch (77:32): [True: 1.82k, False: 1.24M]
  |  Branch (77:42): [True: 0, False: 1.82k]
  ------------------
   78|  1.25M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.09M, False: 156k]
  |  Branch (78:29): [True: 5.81k, False: 1.08M]
  ------------------
   79|  5.81k|      s = max_value_;
   80|  5.81k|      t = max_value_;
   81|  1.24M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 1.82k, False: 1.24M]
  |  Branch (81:26): [True: 558, False: 1.27k]
  ------------------
   82|    558|      t = center_value_ - (t - center_value_);
   83|  1.24M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.08M, False: 155k]
  |  Branch (83:35): [True: 5.77k, False: 1.08M]
  ------------------
   84|  5.77k|      t = center_value_ + (center_value_ - t);
   85|  1.23M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.08M, False: 154k]
  |  Branch (85:35): [True: 330, False: 1.08M]
  ------------------
   86|    330|      s = center_value_ + (center_value_ - s);
   87|  1.23M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 2.43k, False: 1.23M]
  |  Branch (87:26): [True: 941, False: 1.49k]
  ------------------
   88|    941|      s = center_value_ - (s - center_value_);
   89|    941|    }
   90|       |
   91|  1.25M|    *out_s = s;
   92|  1.25M|    *out_t = t;
   93|  1.25M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  1.25M|                                                       int32_t *out_t) const {
  100|  1.25M|    DRACO_DCHECK_EQ(
  101|  1.25M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  1.25M|        center_value_);
  103|  1.25M|    int32_t s, t;
  104|  1.25M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 416k, False: 835k]
  ------------------
  105|       |      // Right hemisphere.
  106|   416k|      s = (int_vec[1] + center_value_);
  107|   416k|      t = (int_vec[2] + center_value_);
  108|   835k|    } else {
  109|       |      // Left hemisphere.
  110|   835k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 22.3k, False: 812k]
  ------------------
  111|  22.3k|        s = std::abs(int_vec[2]);
  112|   812k|      } else {
  113|   812k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   812k|      }
  115|   835k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 24.3k, False: 810k]
  ------------------
  116|  24.3k|        t = std::abs(int_vec[1]);
  117|   810k|      } else {
  118|   810k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   810k|      }
  120|   835k|    }
  121|  1.25M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  1.25M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  11.0M|                                                    float *out_vector) const {
  199|  11.0M|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  11.0M|                                 in_t * dequantization_scale_ - 1.f,
  201|  11.0M|                                 out_vector);
  202|  11.0M|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  44.8M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  44.8M|    DRACO_DCHECK_LE(s, center_value_);
  208|  44.8M|    DRACO_DCHECK_LE(t, center_value_);
  209|  44.8M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  44.8M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  44.8M|    const uint32_t st =
  212|  44.8M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  44.8M|    return st <= center_value_;
  214|  44.8M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  55.7M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  55.7M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  55.7M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  55.7M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  55.7M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  55.7M|    int32_t sign_s = 0;
  223|  55.7M|    int32_t sign_t = 0;
  224|  55.7M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 48.3M, False: 7.35M]
  |  Branch (224:20): [True: 40.5M, False: 7.87M]
  ------------------
  225|  40.5M|      sign_s = 1;
  226|  40.5M|      sign_t = 1;
  227|  40.5M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 8.04M, False: 7.17M]
  |  Branch (227:27): [True: 3.17M, False: 4.87M]
  ------------------
  228|  3.17M|      sign_s = -1;
  229|  3.17M|      sign_t = -1;
  230|  12.0M|    } else {
  231|  12.0M|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 7.17M, False: 4.87M]
  ------------------
  232|  12.0M|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 4.87M, False: 7.17M]
  ------------------
  233|  12.0M|    }
  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|  55.7M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  55.7M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  55.7M|    uint32_t us = *s;
  241|  55.7M|    uint32_t ut = *t;
  242|  55.7M|    us = us + us - corner_point_s;
  243|  55.7M|    ut = ut + ut - corner_point_t;
  244|  55.7M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 43.6M, False: 12.0M]
  ------------------
  245|  43.6M|      uint32_t temp = us;
  246|  43.6M|      us = -ut;
  247|  43.6M|      ut = -temp;
  248|  43.6M|    } else {
  249|  12.0M|      std::swap(us, ut);
  250|  12.0M|    }
  251|  55.7M|    us = us + corner_point_s;
  252|  55.7M|    ut = ut + corner_point_t;
  253|       |
  254|  55.7M|    *s = us;
  255|  55.7M|    *t = ut;
  256|  55.7M|    *s /= 2;
  257|  55.7M|    *t /= 2;
  258|  55.7M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  89.6M|  int32_t ModMax(int32_t x) const {
  273|  89.6M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 7.12k, False: 89.6M]
  ------------------
  274|  7.12k|      return x - this->max_quantized_value();
  275|  7.12k|    }
  276|  89.6M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 2.55k, False: 89.6M]
  ------------------
  277|  2.55k|      return x + this->max_quantized_value();
  278|  2.55k|    }
  279|  89.6M|    return x;
  280|  89.6M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|    971|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  9.67k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|   269M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  11.0M|                                           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|  11.0M|    float y = in_s_scaled;
  329|  11.0M|    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|  11.0M|    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|  11.0M|    float x_offset = -x;
  342|  11.0M|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 2.09M, False: 8.99M]
  ------------------
  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|  11.0M|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 4.98M, False: 6.11M]
  ------------------
  348|  11.0M|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 4.98M, False: 6.11M]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  11.0M|    const float norm_squared = x * x + y * y + z * z;
  352|  11.0M|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 11.0M]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  11.0M|    } else {
  357|  11.0M|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  11.0M|      out_vector[0] = x * d;
  359|  11.0M|      out_vector[1] = y * d;
  360|  11.0M|      out_vector[2] = z * d;
  361|  11.0M|    }
  362|  11.0M|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  1.25M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  1.25M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  1.25M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  1.25M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  1.25M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  1.25M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  1.25M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 1.12M, False: 128k]
  ------------------
  181|  1.12M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.12M|    } else {
  183|   128k|      vec[0] =
  184|   128k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   128k|          abs_sum;
  186|   128k|      vec[1] =
  187|   128k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   128k|          abs_sum;
  189|   128k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 69.1k, False: 59.2k]
  ------------------
  190|  69.1k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|  69.1k|      } else {
  192|  59.2k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|  59.2k|      }
  194|   128k|    }
  195|  1.25M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    311|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    311|            attribute, transform, mesh_data),
   52|    311|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    296|                                                                *buffer) {
  197|    296|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    296|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    296|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 6, False: 290]
  ------------------
  199|       |    // Decode prediction mode.
  200|      6|    uint8_t mode;
  201|      6|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 0, False: 6]
  ------------------
  202|      0|      return false;
  203|      0|    }
  204|       |
  205|      6|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 2, False: 4]
  ------------------
  206|       |      // Unsupported mode.
  207|      2|      return false;
  208|      2|    }
  209|      6|  }
  210|    294|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  1.29k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 1.07k, False: 224]
  ------------------
  214|  1.07k|    uint32_t num_flags;
  215|  1.07k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 14, False: 1.05k]
  ------------------
  216|     14|      return false;
  217|     14|    }
  218|  1.05k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 36, False: 1.02k]
  ------------------
  219|     36|      return false;
  220|     36|    }
  221|  1.02k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 430, False: 593]
  ------------------
  222|    430|      is_crease_edge_[i].resize(num_flags);
  223|    430|      RAnsBitDecoder decoder;
  224|    430|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 20, False: 410]
  ------------------
  225|     20|        return false;
  226|     20|      }
  227|   550k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 549k, False: 410]
  ------------------
  228|   549k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|   549k|      }
  230|    410|      decoder.EndDecoding();
  231|    410|    }
  232|  1.02k|  }
  233|    224|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    224|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    294|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    200|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    200|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    200|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.00k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 800, False: 200]
  ------------------
   93|    800|    pred_vals[i].resize(num_components, 0);
   94|    800|  }
   95|    200|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    200|                                         out_data);
   97|       |
   98|    200|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    200|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    200|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    200|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    200|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    200|  const int corner_map_size =
  109|    200|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    200|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 200]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   229k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 229k, False: 118]
  ------------------
  114|   229k|    const CornerIndex start_corner_id =
  115|   229k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   229k|    CornerIndex corner_id(start_corner_id);
  118|   229k|    int num_parallelograms = 0;
  119|   229k|    bool first_pass = true;
  120|   556k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 348k, False: 208k]
  ------------------
  121|   348k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 46.6k, False: 301k]
  ------------------
  122|   348k|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|   348k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|  46.6k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|  46.6k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 530, False: 46.1k]
  ------------------
  130|    530|          break;
  131|    530|        }
  132|  46.6k|      }
  133|       |
  134|       |      // Proceed to the next corner attached to the vertex. First swing left
  135|       |      // and if we reach a boundary, swing right from the start corner.
  136|   347k|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 341k, False: 6.72k]
  ------------------
  137|   341k|        corner_id = table->SwingLeft(corner_id);
  138|   341k|      } else {
  139|  6.72k|        corner_id = table->SwingRight(corner_id);
  140|  6.72k|      }
  141|   347k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 21.2k, False: 326k]
  ------------------
  142|  21.2k|        break;
  143|  21.2k|      }
  144|   326k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 210k, False: 115k]
  |  Branch (144:47): [True: 208k, False: 2.87k]
  ------------------
  145|   208k|        first_pass = false;
  146|   208k|        corner_id = table->SwingRight(start_corner_id);
  147|   208k|      }
  148|   326k|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   229k|    int num_used_parallelograms = 0;
  153|   229k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 25.9k, False: 203k]
  ------------------
  154|  1.43M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 1.41M, False: 25.9k]
  ------------------
  155|  1.41M|        multi_pred_vals[i] = 0;
  156|  1.41M|      }
  157|       |      // Check which parallelograms are actually used.
  158|  72.5k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 46.6k, False: 25.9k]
  ------------------
  159|  46.6k|        const int context = num_parallelograms - 1;
  160|  46.6k|        const int pos = is_crease_edge_pos[context]++;
  161|  46.6k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 82, False: 46.5k]
  ------------------
  162|     82|          return false;
  163|     82|        }
  164|  46.5k|        const bool is_crease = is_crease_edge_[context][pos];
  165|  46.5k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 4.55k, False: 42.0k]
  ------------------
  166|  4.55k|          ++num_used_parallelograms;
  167|   272k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 268k, False: 4.55k]
  ------------------
  168|   268k|            multi_pred_vals[j] =
  169|   268k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|   268k|          }
  171|  4.55k|        }
  172|  46.5k|      }
  173|  25.9k|    }
  174|   229k|    const int dst_offset = p * num_components;
  175|   229k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 227k, False: 2.24k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|   227k|      const int src_offset = (p - 1) * num_components;
  179|   227k|      this->transform().ComputeOriginalValue(
  180|   227k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|   227k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|   145k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 143k, False: 2.24k]
  ------------------
  184|   143k|        multi_pred_vals[c] /= num_used_parallelograms;
  185|   143k|      }
  186|  2.24k|      this->transform().ComputeOriginalValue(
  187|  2.24k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  2.24k|    }
  189|   229k|  }
  190|    118|  return true;
  191|    200|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    295|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    295|            attribute, transform, mesh_data),
   52|    295|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    276|                                                                *buffer) {
  197|    276|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    276|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    276|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 2, False: 274]
  ------------------
  199|       |    // Decode prediction mode.
  200|      2|    uint8_t mode;
  201|      2|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 0, False: 2]
  ------------------
  202|      0|      return false;
  203|      0|    }
  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|    275|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  1.23k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 1.01k, False: 223]
  ------------------
  214|  1.01k|    uint32_t num_flags;
  215|  1.01k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 7, False: 1.00k]
  ------------------
  216|      7|      return false;
  217|      7|    }
  218|  1.00k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 26, False: 982]
  ------------------
  219|     26|      return false;
  220|     26|    }
  221|    982|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 366, False: 616]
  ------------------
  222|    366|      is_crease_edge_[i].resize(num_flags);
  223|    366|      RAnsBitDecoder decoder;
  224|    366|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 19, False: 347]
  ------------------
  225|     19|        return false;
  226|     19|      }
  227|   564k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 564k, False: 347]
  ------------------
  228|   564k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|   564k|      }
  230|    347|      decoder.EndDecoding();
  231|    347|    }
  232|    982|  }
  233|    223|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    223|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    275|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    201|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    201|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    201|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.00k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 804, False: 201]
  ------------------
   93|    804|    pred_vals[i].resize(num_components, 0);
   94|    804|  }
   95|    201|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    201|                                         out_data);
   97|       |
   98|    201|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    201|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    201|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    201|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    201|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    201|  const int corner_map_size =
  109|    201|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    201|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 201]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|  74.1k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 74.0k, False: 117]
  ------------------
  114|  74.0k|    const CornerIndex start_corner_id =
  115|  74.0k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|  74.0k|    CornerIndex corner_id(start_corner_id);
  118|  74.0k|    int num_parallelograms = 0;
  119|  74.0k|    bool first_pass = true;
  120|   431k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 426k, False: 4.39k]
  ------------------
  121|   426k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 140k, False: 286k]
  ------------------
  122|   426k|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|   426k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|   140k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|   140k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 155, False: 140k]
  ------------------
  130|    155|          break;
  131|    155|        }
  132|   140k|      }
  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|   426k|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 423k, False: 3.34k]
  ------------------
  137|   423k|        corner_id = table->SwingLeft(corner_id);
  138|   423k|      } else {
  139|  3.34k|        corner_id = table->SwingRight(corner_id);
  140|  3.34k|      }
  141|   426k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 69.5k, False: 357k]
  ------------------
  142|  69.5k|        break;
  143|  69.5k|      }
  144|   357k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 6.05k, False: 351k]
  |  Branch (144:47): [True: 4.41k, False: 1.64k]
  ------------------
  145|  4.41k|        first_pass = false;
  146|  4.41k|        corner_id = table->SwingRight(start_corner_id);
  147|  4.41k|      }
  148|   357k|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|  74.0k|    int num_used_parallelograms = 0;
  153|  74.0k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 71.7k, False: 2.31k]
  ------------------
  154|  11.9M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 11.8M, False: 71.7k]
  ------------------
  155|  11.8M|        multi_pred_vals[i] = 0;
  156|  11.8M|      }
  157|       |      // Check which parallelograms are actually used.
  158|   211k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 140k, False: 71.6k]
  ------------------
  159|   140k|        const int context = num_parallelograms - 1;
  160|   140k|        const int pos = is_crease_edge_pos[context]++;
  161|   140k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 84, False: 140k]
  ------------------
  162|     84|          return false;
  163|     84|        }
  164|   140k|        const bool is_crease = is_crease_edge_[context][pos];
  165|   140k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 5.07k, False: 135k]
  ------------------
  166|  5.07k|          ++num_used_parallelograms;
  167|   822k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 817k, False: 5.07k]
  ------------------
  168|   817k|            multi_pred_vals[j] =
  169|   817k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|   817k|          }
  171|  5.07k|        }
  172|   140k|      }
  173|  71.7k|    }
  174|  73.9k|    const int dst_offset = p * num_components;
  175|  73.9k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 70.5k, False: 3.41k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|  70.5k|      const int src_offset = (p - 1) * num_components;
  179|  70.5k|      this->transform().ComputeOriginalValue(
  180|  70.5k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|  70.5k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|   541k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 538k, False: 3.41k]
  ------------------
  184|   538k|        multi_pred_vals[c] /= num_used_parallelograms;
  185|   538k|      }
  186|  3.41k|      this->transform().ComputeOriginalValue(
  187|  3.41k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  3.41k|    }
  189|  73.9k|  }
  190|    117|  return true;
  191|    201|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.57k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.57k|    mesh_ = mesh;
   39|  1.57k|    corner_table_ = table;
   40|  1.57k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.57k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.57k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  6.43M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  4.42M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  4.42M|    return vertex_to_data_map_;
   48|  4.42M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  2.86M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  2.86M|    return data_to_corner_map_;
   51|  2.86M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.85k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.85k|    mesh_ = mesh;
   39|  1.85k|    corner_table_ = table;
   40|  1.85k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.85k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.85k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  5.41M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  4.71M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  4.71M|    return vertex_to_data_map_;
   48|  4.71M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  1.32M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  1.32M|    return data_to_corner_map_;
   51|  1.32M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  1.57k|      : mesh_(nullptr),
   31|  1.57k|        corner_table_(nullptr),
   32|  1.57k|        vertex_to_data_map_(nullptr),
   33|  1.57k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  1.85k|      : mesh_(nullptr),
   31|  1.85k|        corner_table_(nullptr),
   32|  1.85k|        vertex_to_data_map_(nullptr),
   33|  1.85k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   529k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   112k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   151k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   105k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.31k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.31k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  3.99M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.62k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.62k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  1.50M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    121|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    121|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    108|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    108|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    131|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    131|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    120|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    120|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    241|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    121|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    121|    DRACO_DCHECK_EQ(i, 0);
   70|    121|    (void)i;
   71|    121|    return GeometryAttribute::POSITION;
   72|    121|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    121|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    121|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 121]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    121|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 120]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    120|    predictor_.SetPositionAttribute(*att);
   82|    120|    return true;
   83|    121|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    120|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    120|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 7, False: 113]
  ------------------
  148|      7|    return false;
  149|      7|  }
  150|       |
  151|    113|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    113|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    113|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 22, False: 91]
  ------------------
  153|     22|    uint8_t prediction_mode;
  154|     22|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 21]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     21|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 20]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     20|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 20]
  ------------------
  163|     20|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     20|  }
  167|    111|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    111|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 3, False: 108]
  ------------------
  171|      3|    return false;
  172|      3|  }
  173|       |
  174|    108|  return true;
  175|    111|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    108|                                      const PointIndex *entry_to_point_id_map) {
  103|    108|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    108|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    108|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    108|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    108|  const int corner_map_size =
  111|    108|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    108|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 108]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    108|  VectorD<int32_t, 3> pred_normal_3d;
  117|    108|  int32_t pred_normal_oct[2];
  118|       |
  119|   529k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 529k, False: 108]
  ------------------
  120|   529k|    const CornerIndex corner_id =
  121|   529k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   529k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   529k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   529k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   529k|                    octahedron_tool_box_.center_value());
  128|   529k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 528k, False: 1.28k]
  ------------------
  129|   528k|      pred_normal_3d = -pred_normal_3d;
  130|   528k|    }
  131|   529k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   529k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   529k|    const int data_offset = data_id * 2;
  135|   529k|    this->transform().ComputeOriginalValue(
  136|   529k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   529k|  }
  138|    108|  flip_normal_bit_decoder_.EndDecoding();
  139|    108|  return true;
  140|    108|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    108|  void SetQuantizationBits(int q) {
   85|    108|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    108|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    214|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    108|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    108|    DRACO_DCHECK_EQ(i, 0);
   70|    108|    (void)i;
   71|    108|    return GeometryAttribute::POSITION;
   72|    108|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    107|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    107|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 107]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    107|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 106]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    106|    predictor_.SetPositionAttribute(*att);
   82|    106|    return true;
   83|    107|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    104|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    104|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 7, False: 97]
  ------------------
  148|      7|    return false;
  149|      7|  }
  150|       |
  151|     97|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|     97|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     97|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 17, False: 80]
  ------------------
  153|     17|    uint8_t prediction_mode;
  154|     17|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 17]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     17|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 16]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     16|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 16]
  ------------------
  163|     16|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     16|  }
  167|     96|#endif
  168|       |
  169|       |  // Init normal flips.
  170|     96|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 3, False: 93]
  ------------------
  171|      3|    return false;
  172|      3|  }
  173|       |
  174|     93|  return true;
  175|     96|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     93|                                      const PointIndex *entry_to_point_id_map) {
  103|     93|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     93|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     93|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     93|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     93|  const int corner_map_size =
  111|     93|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|     93|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 93]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|     93|  VectorD<int32_t, 3> pred_normal_3d;
  117|     93|  int32_t pred_normal_oct[2];
  118|       |
  119|   112k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 112k, False: 93]
  ------------------
  120|   112k|    const CornerIndex corner_id =
  121|   112k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   112k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   112k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   112k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   112k|                    octahedron_tool_box_.center_value());
  128|   112k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 77.3k, False: 34.9k]
  ------------------
  129|  77.3k|      pred_normal_3d = -pred_normal_3d;
  130|  77.3k|    }
  131|   112k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   112k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   112k|    const int data_offset = data_id * 2;
  135|   112k|    this->transform().ComputeOriginalValue(
  136|   112k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   112k|  }
  138|     93|  flip_normal_bit_decoder_.EndDecoding();
  139|     93|  return true;
  140|     93|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     93|  void SetQuantizationBits(int q) {
   85|     93|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     93|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    260|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    131|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    131|    DRACO_DCHECK_EQ(i, 0);
   70|    131|    (void)i;
   71|    131|    return GeometryAttribute::POSITION;
   72|    131|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    131|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    131|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 131]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    131|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 129]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    129|    predictor_.SetPositionAttribute(*att);
   82|    129|    return true;
   83|    131|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    129|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    129|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 7, False: 122]
  ------------------
  148|      7|    return false;
  149|      7|  }
  150|       |
  151|    122|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    122|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    122|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 29, False: 93]
  ------------------
  153|     29|    uint8_t prediction_mode;
  154|     29|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 28]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     28|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 3, False: 25]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      3|      return false;
  160|      3|    }
  161|       |
  162|     25|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 25]
  ------------------
  163|     25|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     25|  }
  167|    118|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    118|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 3, False: 115]
  ------------------
  171|      3|    return false;
  172|      3|  }
  173|       |
  174|    115|  return true;
  175|    118|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    115|                                      const PointIndex *entry_to_point_id_map) {
  103|    115|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    115|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    115|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    115|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    115|  const int corner_map_size =
  111|    115|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    115|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 115]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    115|  VectorD<int32_t, 3> pred_normal_3d;
  117|    115|  int32_t pred_normal_oct[2];
  118|       |
  119|   151k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 151k, False: 115]
  ------------------
  120|   151k|    const CornerIndex corner_id =
  121|   151k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   151k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   151k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   151k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   151k|                    octahedron_tool_box_.center_value());
  128|   151k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 150k, False: 1.10k]
  ------------------
  129|   150k|      pred_normal_3d = -pred_normal_3d;
  130|   150k|    }
  131|   151k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   151k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   151k|    const int data_offset = data_id * 2;
  135|   151k|    this->transform().ComputeOriginalValue(
  136|   151k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   151k|  }
  138|    115|  flip_normal_bit_decoder_.EndDecoding();
  139|    115|  return true;
  140|    115|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    115|  void SetQuantizationBits(int q) {
   85|    115|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    115|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    238|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    120|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    120|    DRACO_DCHECK_EQ(i, 0);
   70|    120|    (void)i;
   71|    120|    return GeometryAttribute::POSITION;
   72|    120|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    120|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    120|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 120]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    120|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 118]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    118|    predictor_.SetPositionAttribute(*att);
   82|    118|    return true;
   83|    120|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    118|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    118|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 5, False: 113]
  ------------------
  148|      5|    return false;
  149|      5|  }
  150|       |
  151|    113|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    113|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    113|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 20, False: 93]
  ------------------
  153|     20|    uint8_t prediction_mode;
  154|     20|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 20]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     20|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 19]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     19|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 19]
  ------------------
  163|     19|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     19|  }
  167|    112|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    112|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 3, False: 109]
  ------------------
  171|      3|    return false;
  172|      3|  }
  173|       |
  174|    109|  return true;
  175|    112|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    109|                                      const PointIndex *entry_to_point_id_map) {
  103|    109|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    109|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    109|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    109|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    109|  const int corner_map_size =
  111|    109|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    109|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 109]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    109|  VectorD<int32_t, 3> pred_normal_3d;
  117|    109|  int32_t pred_normal_oct[2];
  118|       |
  119|   105k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 105k, False: 109]
  ------------------
  120|   105k|    const CornerIndex corner_id =
  121|   105k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   105k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   105k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   105k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   105k|                    octahedron_tool_box_.center_value());
  128|   105k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 98.2k, False: 7.62k]
  ------------------
  129|  98.2k|      pred_normal_3d = -pred_normal_3d;
  130|  98.2k|    }
  131|   105k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   105k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   105k|    const int data_offset = data_id * 2;
  135|   105k|    this->transform().ComputeOriginalValue(
  136|   105k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   105k|  }
  138|    109|  flip_normal_bit_decoder_.EndDecoding();
  139|    109|  return true;
  140|    109|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    109|  void SetQuantizationBits(int q) {
   85|    109|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    109|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    139|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    139|            attribute, transform, mesh_data),
   37|    139|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    274|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    139|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    139|    DRACO_DCHECK_EQ(i, 0);
   70|    139|    (void)i;
   71|    139|    return GeometryAttribute::POSITION;
   72|    139|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    137|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    137|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 137]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    137|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 135]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    135|    predictor_.SetPositionAttribute(*att);
   82|    135|    return true;
   83|    137|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    135|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    135|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 10, False: 125]
  ------------------
  148|     10|    return false;
  149|     10|  }
  150|       |
  151|    125|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    125|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    125|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 37, False: 88]
  ------------------
  153|     37|    uint8_t prediction_mode;
  154|     37|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 36]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     36|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 35]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     35|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 35]
  ------------------
  163|     35|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     35|  }
  167|    123|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    123|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 9, False: 114]
  ------------------
  171|      9|    return false;
  172|      9|  }
  173|       |
  174|    114|  return true;
  175|    123|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    114|                                      const PointIndex *entry_to_point_id_map) {
  103|    114|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    114|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    114|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    114|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    114|  const int corner_map_size =
  111|    114|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    114|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 114]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    114|  VectorD<int32_t, 3> pred_normal_3d;
  117|    114|  int32_t pred_normal_oct[2];
  118|       |
  119|   228k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 228k, False: 114]
  ------------------
  120|   228k|    const CornerIndex corner_id =
  121|   228k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   228k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   228k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   228k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   228k|                    octahedron_tool_box_.center_value());
  128|   228k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 204k, False: 24.5k]
  ------------------
  129|   204k|      pred_normal_3d = -pred_normal_3d;
  130|   204k|    }
  131|   228k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   228k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   228k|    const int data_offset = data_id * 2;
  135|   228k|    this->transform().ComputeOriginalValue(
  136|   228k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   228k|  }
  138|    114|  flip_normal_bit_decoder_.EndDecoding();
  139|    114|  return true;
  140|    114|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    114|  void SetQuantizationBits(int q) {
   85|    114|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    114|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    341|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    341|            attribute, transform, mesh_data),
   37|    341|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    681|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    341|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    341|    DRACO_DCHECK_EQ(i, 0);
   70|    341|    (void)i;
   71|    341|    return GeometryAttribute::POSITION;
   72|    341|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    341|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    341|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 341]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    341|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 340]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    340|    predictor_.SetPositionAttribute(*att);
   82|    340|    return true;
   83|    341|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    339|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    339|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 21, False: 318]
  ------------------
  148|     21|    return false;
  149|     21|  }
  150|       |
  151|    318|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    318|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    318|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 87, False: 231]
  ------------------
  153|     87|    uint8_t prediction_mode;
  154|     87|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 86]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     86|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 0, False: 86]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      0|      return false;
  160|      0|    }
  161|       |
  162|     86|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 86]
  ------------------
  163|     86|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     86|  }
  167|    317|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    317|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 13, False: 304]
  ------------------
  171|     13|    return false;
  172|     13|  }
  173|       |
  174|    304|  return true;
  175|    317|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    304|                                      const PointIndex *entry_to_point_id_map) {
  103|    304|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    304|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    304|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    304|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    304|  const int corner_map_size =
  111|    304|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    304|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 304]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    304|  VectorD<int32_t, 3> pred_normal_3d;
  117|    304|  int32_t pred_normal_oct[2];
  118|       |
  119|   123k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 123k, False: 304]
  ------------------
  120|   123k|    const CornerIndex corner_id =
  121|   123k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   123k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   123k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   123k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   123k|                    octahedron_tool_box_.center_value());
  128|   123k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 104k, False: 18.9k]
  ------------------
  129|   104k|      pred_normal_3d = -pred_normal_3d;
  130|   104k|    }
  131|   123k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   123k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   123k|    const int data_offset = data_id * 2;
  135|   123k|    this->transform().ComputeOriginalValue(
  136|   123k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   123k|  }
  138|    304|  flip_normal_bit_decoder_.EndDecoding();
  139|    304|  return true;
  140|    304|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    304|  void SetQuantizationBits(int q) {
   85|    304|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    304|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    121|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    121|            attribute, transform, mesh_data),
   37|    121|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    108|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    108|            attribute, transform, mesh_data),
   37|    108|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    131|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    131|            attribute, transform, mesh_data),
   37|    131|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    120|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    120|            attribute, transform, mesh_data),
   37|    120|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    141|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    141|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 17, False: 124]
  ------------------
  105|     17|      this->normal_prediction_mode_ = mode;
  106|     17|      return true;
  107|    124|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 124, False: 0]
  ------------------
  108|    124|      this->normal_prediction_mode_ = mode;
  109|    124|      return true;
  110|    124|    }
  111|      0|    return false;
  112|    141|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   529k|                             DataTypeT *prediction) override {
   42|   529k|    DRACO_DCHECK(this->IsInitialized());
   43|   529k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   529k|    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|   529k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   529k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   529k|    VectorD<int64_t, 3> normal;
   53|   529k|    CornerIndex c_next, c_prev;
   54|  1.15M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 625k, False: 529k]
  ------------------
   55|       |      // Getting corners.
   56|   625k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 96, False: 625k]
  ------------------
   57|     96|        c_next = corner_table->Next(corner_id);
   58|     96|        c_prev = corner_table->Previous(corner_id);
   59|   625k|      } else {
   60|   625k|        c_next = corner_table->Next(cit.Corner());
   61|   625k|        c_prev = corner_table->Previous(cit.Corner());
   62|   625k|      }
   63|   625k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   625k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   625k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   625k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   625k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   625k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   625k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   625k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   625k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   625k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   625k|      cit.Next();
   81|   625k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   529k|    constexpr int64_t upper_bound = 1 << 29;
   85|   529k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 68, False: 529k]
  ------------------
   86|     68|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     68|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 23, False: 45]
  ------------------
   88|     23|        const int64_t quotient = abs_sum / upper_bound;
   89|     23|        normal = normal / quotient;
   90|     23|      }
   91|   529k|    } else {
   92|   529k|      const int64_t abs_sum = normal.AbsSum();
   93|   529k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.36k, False: 528k]
  ------------------
   94|  1.36k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.36k|        normal = normal / quotient;
   96|  1.36k|      }
   97|   529k|    }
   98|   529k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   529k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   529k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   529k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   529k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    124|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    124|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 15, False: 109]
  ------------------
  105|     15|      this->normal_prediction_mode_ = mode;
  106|     15|      return true;
  107|    109|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 109, False: 0]
  ------------------
  108|    109|      this->normal_prediction_mode_ = mode;
  109|    109|      return true;
  110|    109|    }
  111|      0|    return false;
  112|    124|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   112k|                             DataTypeT *prediction) override {
   42|   112k|    DRACO_DCHECK(this->IsInitialized());
   43|   112k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   112k|    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|   112k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   112k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   112k|    VectorD<int64_t, 3> normal;
   53|   112k|    CornerIndex c_next, c_prev;
   54|   780k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 668k, False: 112k]
  ------------------
   55|       |      // Getting corners.
   56|   668k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 84, False: 668k]
  ------------------
   57|     84|        c_next = corner_table->Next(corner_id);
   58|     84|        c_prev = corner_table->Previous(corner_id);
   59|   668k|      } else {
   60|   668k|        c_next = corner_table->Next(cit.Corner());
   61|   668k|        c_prev = corner_table->Previous(cit.Corner());
   62|   668k|      }
   63|   668k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   668k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   668k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   668k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   668k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   668k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   668k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   668k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   668k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   668k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   668k|      cit.Next();
   81|   668k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   112k|    constexpr int64_t upper_bound = 1 << 29;
   85|   112k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 56, False: 112k]
  ------------------
   86|     56|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     56|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 16, False: 40]
  ------------------
   88|     16|        const int64_t quotient = abs_sum / upper_bound;
   89|     16|        normal = normal / quotient;
   90|     16|      }
   91|   112k|    } else {
   92|   112k|      const int64_t abs_sum = normal.AbsSum();
   93|   112k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 43.8k, False: 68.3k]
  ------------------
   94|  43.8k|        const int64_t quotient = abs_sum / upper_bound;
   95|  43.8k|        normal = normal / quotient;
   96|  43.8k|      }
   97|   112k|    }
   98|   112k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   112k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   112k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   112k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   112k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    156|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    156|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 24, False: 132]
  ------------------
  105|     24|      this->normal_prediction_mode_ = mode;
  106|     24|      return true;
  107|    132|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 132, False: 0]
  ------------------
  108|    132|      this->normal_prediction_mode_ = mode;
  109|    132|      return true;
  110|    132|    }
  111|      0|    return false;
  112|    156|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   151k|                             DataTypeT *prediction) override {
   42|   151k|    DRACO_DCHECK(this->IsInitialized());
   43|   151k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   151k|    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|   151k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   151k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   151k|    VectorD<int64_t, 3> normal;
   53|   151k|    CornerIndex c_next, c_prev;
   54|   367k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 215k, False: 151k]
  ------------------
   55|       |      // Getting corners.
   56|   215k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 138, False: 215k]
  ------------------
   57|    138|        c_next = corner_table->Next(corner_id);
   58|    138|        c_prev = corner_table->Previous(corner_id);
   59|   215k|      } else {
   60|   215k|        c_next = corner_table->Next(cit.Corner());
   61|   215k|        c_prev = corner_table->Previous(cit.Corner());
   62|   215k|      }
   63|   215k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   215k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   215k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   215k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   215k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   215k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   215k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   215k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   215k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   215k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   215k|      cit.Next();
   81|   215k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   151k|    constexpr int64_t upper_bound = 1 << 29;
   85|   151k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 92, False: 151k]
  ------------------
   86|     92|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     92|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 26, False: 66]
  ------------------
   88|     26|        const int64_t quotient = abs_sum / upper_bound;
   89|     26|        normal = normal / quotient;
   90|     26|      }
   91|   151k|    } else {
   92|   151k|      const int64_t abs_sum = normal.AbsSum();
   93|   151k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.31k, False: 150k]
  ------------------
   94|  1.31k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.31k|        normal = normal / quotient;
   96|  1.31k|      }
   97|   151k|    }
   98|   151k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   151k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   151k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   151k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   151k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    139|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    139|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 18, False: 121]
  ------------------
  105|     18|      this->normal_prediction_mode_ = mode;
  106|     18|      return true;
  107|    121|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 121, False: 0]
  ------------------
  108|    121|      this->normal_prediction_mode_ = mode;
  109|    121|      return true;
  110|    121|    }
  111|      0|    return false;
  112|    139|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   105k|                             DataTypeT *prediction) override {
   42|   105k|    DRACO_DCHECK(this->IsInitialized());
   43|   105k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   105k|    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|   105k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   105k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   105k|    VectorD<int64_t, 3> normal;
   53|   105k|    CornerIndex c_next, c_prev;
   54|   735k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 629k, False: 105k]
  ------------------
   55|       |      // Getting corners.
   56|   629k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 108, False: 629k]
  ------------------
   57|    108|        c_next = corner_table->Next(corner_id);
   58|    108|        c_prev = corner_table->Previous(corner_id);
   59|   629k|      } else {
   60|   629k|        c_next = corner_table->Next(cit.Corner());
   61|   629k|        c_prev = corner_table->Previous(cit.Corner());
   62|   629k|      }
   63|   629k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   629k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   629k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   629k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   629k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   629k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   629k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   629k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   629k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   629k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   629k|      cit.Next();
   81|   629k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   105k|    constexpr int64_t upper_bound = 1 << 29;
   85|   105k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 72, False: 105k]
  ------------------
   86|     72|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     72|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 25, False: 47]
  ------------------
   88|     25|        const int64_t quotient = abs_sum / upper_bound;
   89|     25|        normal = normal / quotient;
   90|     25|      }
   91|   105k|    } else {
   92|   105k|      const int64_t abs_sum = normal.AbsSum();
   93|   105k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 63.6k, False: 42.1k]
  ------------------
   94|  63.6k|        const int64_t quotient = abs_sum / upper_bound;
   95|  63.6k|        normal = normal / quotient;
   96|  63.6k|      }
   97|   105k|    }
   98|   105k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   105k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   105k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   105k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   105k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    139|      : Base(md) {
   35|    139|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    139|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    174|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    174|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 33, False: 141]
  ------------------
  105|     33|      this->normal_prediction_mode_ = mode;
  106|     33|      return true;
  107|    141|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 141, False: 0]
  ------------------
  108|    141|      this->normal_prediction_mode_ = mode;
  109|    141|      return true;
  110|    141|    }
  111|      0|    return false;
  112|    174|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   228k|                             DataTypeT *prediction) override {
   42|   228k|    DRACO_DCHECK(this->IsInitialized());
   43|   228k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   228k|    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|   228k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   228k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   228k|    VectorD<int64_t, 3> normal;
   53|   228k|    CornerIndex c_next, c_prev;
   54|   600k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 371k, False: 228k]
  ------------------
   55|       |      // Getting corners.
   56|   371k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 130k, False: 240k]
  ------------------
   57|   130k|        c_next = corner_table->Next(corner_id);
   58|   130k|        c_prev = corner_table->Previous(corner_id);
   59|   240k|      } else {
   60|   240k|        c_next = corner_table->Next(cit.Corner());
   61|   240k|        c_prev = corner_table->Previous(cit.Corner());
   62|   240k|      }
   63|   371k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   371k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   371k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   371k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   371k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   371k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   371k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   371k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   371k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   371k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   371k|      cit.Next();
   81|   371k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   228k|    constexpr int64_t upper_bound = 1 << 29;
   85|   228k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 22.1k, False: 206k]
  ------------------
   86|  22.1k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  22.1k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 95, False: 22.0k]
  ------------------
   88|     95|        const int64_t quotient = abs_sum / upper_bound;
   89|     95|        normal = normal / quotient;
   90|     95|      }
   91|   206k|    } else {
   92|   206k|      const int64_t abs_sum = normal.AbsSum();
   93|   206k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.12k, False: 205k]
  ------------------
   94|  1.12k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.12k|        normal = normal / quotient;
   96|  1.12k|      }
   97|   206k|    }
   98|   228k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   228k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   228k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   228k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   228k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    341|      : Base(md) {
   35|    341|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    341|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    427|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    427|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 85, False: 342]
  ------------------
  105|     85|      this->normal_prediction_mode_ = mode;
  106|     85|      return true;
  107|    342|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 342, False: 0]
  ------------------
  108|    342|      this->normal_prediction_mode_ = mode;
  109|    342|      return true;
  110|    342|    }
  111|      0|    return false;
  112|    427|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   123k|                             DataTypeT *prediction) override {
   42|   123k|    DRACO_DCHECK(this->IsInitialized());
   43|   123k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   123k|    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|   123k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   123k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   123k|    VectorD<int64_t, 3> normal;
   53|   123k|    CornerIndex c_next, c_prev;
   54|   827k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 703k, False: 123k]
  ------------------
   55|       |      // Getting corners.
   56|   703k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 259k, False: 444k]
  ------------------
   57|   259k|        c_next = corner_table->Next(corner_id);
   58|   259k|        c_prev = corner_table->Previous(corner_id);
   59|   444k|      } else {
   60|   444k|        c_next = corner_table->Next(cit.Corner());
   61|   444k|        c_prev = corner_table->Previous(cit.Corner());
   62|   444k|      }
   63|   703k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   703k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   703k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   703k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   703k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   703k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   703k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   703k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   703k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   703k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   703k|      cit.Next();
   81|   703k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   123k|    constexpr int64_t upper_bound = 1 << 29;
   85|   123k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 44.0k, False: 79.1k]
  ------------------
   86|  44.0k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  44.0k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 236, False: 43.8k]
  ------------------
   88|    236|        const int64_t quotient = abs_sum / upper_bound;
   89|    236|        normal = normal / quotient;
   90|    236|      }
   91|  79.1k|    } else {
   92|  79.1k|      const int64_t abs_sum = normal.AbsSum();
   93|  79.1k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 8.17k, False: 70.9k]
  ------------------
   94|  8.17k|        const int64_t quotient = abs_sum / upper_bound;
   95|  8.17k|        normal = normal / quotient;
   96|  8.17k|      }
   97|  79.1k|    }
   98|   123k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   123k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   123k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   123k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   123k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    121|      : Base(md) {
   35|    121|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    121|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    108|      : Base(md) {
   35|    108|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    108|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    131|      : Base(md) {
   35|    131|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    131|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    120|      : Base(md) {
   35|    120|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    120|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.78M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.78M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.78M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.78M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.78M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.78M|    return GetPositionForDataId(data_id);
   77|  1.78M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.78M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.78M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.78M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.78M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.78M|    VectorD<int64_t, 3> pos;
   68|  1.78M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.78M|    return pos;
   70|  1.78M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    120|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    120|    pos_attribute_ = &position_attribute;
   43|    120|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    108|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    108|    entry_to_point_id_map_ = map;
   46|    108|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.44M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.44M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.44M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.44M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.44M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.44M|    return GetPositionForDataId(data_id);
   77|  1.44M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.44M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.44M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.44M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.44M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.44M|    VectorD<int64_t, 3> pos;
   68|  1.44M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.44M|    return pos;
   70|  1.44M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    106|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    106|    pos_attribute_ = &position_attribute;
   43|    106|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     93|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     93|    entry_to_point_id_map_ = map;
   46|     93|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   582k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   582k|    DRACO_DCHECK(this->IsInitialized());
   73|   582k|    const auto corner_table = mesh_data_.corner_table();
   74|   582k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   582k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   582k|    return GetPositionForDataId(data_id);
   77|   582k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|   582k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   582k|    DRACO_DCHECK(this->IsInitialized());
   65|   582k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   582k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   582k|    VectorD<int64_t, 3> pos;
   68|   582k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   582k|    return pos;
   70|   582k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    129|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    129|    pos_attribute_ = &position_attribute;
   43|    129|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    115|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    115|    entry_to_point_id_map_ = map;
   46|    115|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.36M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.36M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.36M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.36M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.36M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.36M|    return GetPositionForDataId(data_id);
   77|  1.36M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.36M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.36M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.36M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.36M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.36M|    VectorD<int64_t, 3> pos;
   68|  1.36M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.36M|    return pos;
   70|  1.36M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    118|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    118|    pos_attribute_ = &position_attribute;
   43|    118|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    109|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    109|    entry_to_point_id_map_ = map;
   46|    109|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    139|      : pos_attribute_(nullptr),
   36|    139|        entry_to_point_id_map_(nullptr),
   37|    139|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    139|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   971k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   971k|    DRACO_DCHECK(this->IsInitialized());
   73|   971k|    const auto corner_table = mesh_data_.corner_table();
   74|   971k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   971k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   971k|    return GetPositionForDataId(data_id);
   77|   971k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|   971k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   971k|    DRACO_DCHECK(this->IsInitialized());
   65|   971k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   971k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   971k|    VectorD<int64_t, 3> pos;
   68|   971k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   971k|    return pos;
   70|   971k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    135|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    135|    pos_attribute_ = &position_attribute;
   43|    135|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    114|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    114|    entry_to_point_id_map_ = map;
   46|    114|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    341|      : pos_attribute_(nullptr),
   36|    341|        entry_to_point_id_map_(nullptr),
   37|    341|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    341|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.53M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.53M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.53M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.53M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.53M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.53M|    return GetPositionForDataId(data_id);
   77|  1.53M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.53M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.53M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.53M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.53M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.53M|    VectorD<int64_t, 3> pos;
   68|  1.53M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.53M|    return pos;
   70|  1.53M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    340|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    340|    pos_attribute_ = &position_attribute;
   43|    340|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    304|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    304|    entry_to_point_id_map_ = map;
   46|    304|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    121|      : pos_attribute_(nullptr),
   36|    121|        entry_to_point_id_map_(nullptr),
   37|    121|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    121|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    108|      : pos_attribute_(nullptr),
   36|    108|        entry_to_point_id_map_(nullptr),
   37|    108|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    108|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    131|      : pos_attribute_(nullptr),
   36|    131|        entry_to_point_id_map_(nullptr),
   37|    131|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    131|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    120|      : pos_attribute_(nullptr),
   36|    120|        entry_to_point_id_map_(nullptr),
   37|    120|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    120|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    246|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    246|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    235|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    235|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    235|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    235|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    235|      new DataTypeT[num_components]());
   70|       |
   71|    235|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    235|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    235|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    235|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    235|  const int corner_map_size =
   78|    235|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    235|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 235]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|   587k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 587k, False: 235]
  ------------------
   83|   587k|    const CornerIndex start_corner_id =
   84|   587k|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|   587k|    CornerIndex corner_id(start_corner_id);
   87|   587k|    int num_parallelograms = 0;
   88|  44.8M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 44.2M, False: 587k]
  ------------------
   89|  44.2M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  44.2M|    }
   91|  1.54M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 960k, False: 587k]
  ------------------
   92|   960k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 150k, False: 809k]
  ------------------
   93|   960k|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|   960k|              num_components, parallelogram_pred_vals.get())) {
   95|  7.30M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 7.15M, False: 150k]
  ------------------
   96|  7.15M|          pred_vals[c] =
   97|  7.15M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  7.15M|        }
   99|   150k|        ++num_parallelograms;
  100|   150k|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|   960k|      corner_id = table->SwingRight(corner_id);
  104|   960k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 73.6k, False: 887k]
  ------------------
  105|  73.6k|        corner_id = kInvalidCornerIndex;
  106|  73.6k|      }
  107|   960k|    }
  108|       |
  109|   587k|    const int dst_offset = p * num_components;
  110|   587k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 508k, False: 78.5k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|   508k|      const int src_offset = (p - 1) * num_components;
  114|   508k|      this->transform().ComputeOriginalValue(
  115|   508k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|   508k|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  3.81M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 3.73M, False: 78.5k]
  ------------------
  119|  3.73M|        pred_vals[c] /= num_parallelograms;
  120|  3.73M|      }
  121|  78.5k|      this->transform().ComputeOriginalValue(
  122|  78.5k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|  78.5k|    }
  124|   587k|  }
  125|    235|  return true;
  126|    235|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    286|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    286|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    264|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    264|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    264|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    264|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    264|      new DataTypeT[num_components]());
   70|       |
   71|    264|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    264|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    264|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    264|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    264|  const int corner_map_size =
   78|    264|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    264|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 264]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|   415k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 415k, False: 264]
  ------------------
   83|   415k|    const CornerIndex start_corner_id =
   84|   415k|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|   415k|    CornerIndex corner_id(start_corner_id);
   87|   415k|    int num_parallelograms = 0;
   88|  15.5M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 15.1M, False: 415k]
  ------------------
   89|  15.1M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  15.1M|    }
   91|  2.86M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 2.45M, False: 415k]
  ------------------
   92|  2.45M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 809k, False: 1.64M]
  ------------------
   93|  2.45M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  2.45M|              num_components, parallelogram_pred_vals.get())) {
   95|  30.3M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 29.5M, False: 809k]
  ------------------
   96|  29.5M|          pred_vals[c] =
   97|  29.5M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  29.5M|        }
   99|   809k|        ++num_parallelograms;
  100|   809k|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  2.45M|      corner_id = table->SwingRight(corner_id);
  104|  2.45M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 406k, False: 2.04M]
  ------------------
  105|   406k|        corner_id = kInvalidCornerIndex;
  106|   406k|      }
  107|  2.45M|    }
  108|       |
  109|   415k|    const int dst_offset = p * num_components;
  110|   415k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 1.25k, False: 414k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  1.25k|      const int src_offset = (p - 1) * num_components;
  114|  1.25k|      this->transform().ComputeOriginalValue(
  115|  1.25k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|   414k|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  15.5M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 15.0M, False: 414k]
  ------------------
  119|  15.0M|        pred_vals[c] /= num_parallelograms;
  120|  15.0M|      }
  121|   414k|      this->transform().ComputeOriginalValue(
  122|   414k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|   414k|    }
  124|   415k|  }
  125|    264|  return true;
  126|    264|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  1.90M|    int num_components, DataTypeT *out_prediction) {
   49|  1.90M|  const CornerIndex oci = table->Opposite(ci);
   50|  1.90M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 1.23M, False: 665k]
  ------------------
   51|  1.23M|    return false;
   52|  1.23M|  }
   53|   665k|  int vert_opp, vert_next, vert_prev;
   54|   665k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   665k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   665k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 366k, False: 298k]
  |  Branch (56:35): [True: 282k, False: 84.2k]
  ------------------
   57|   282k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 273k, False: 9.07k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   273k|    const int v_opp_off = vert_opp * num_components;
   60|   273k|    const int v_next_off = vert_next * num_components;
   61|   273k|    const int v_prev_off = vert_prev * num_components;
   62|  11.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 11.5M, False: 273k]
  ------------------
   63|  11.5M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  11.5M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  11.5M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  11.5M|      const int64_t result =
   67|  11.5M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  11.5M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  11.5M|    }
   71|   273k|    return true;
   72|   273k|  }
   73|   392k|  return false;  // Not all data is available for prediction
   74|   665k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   665k|    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|   665k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   665k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   665k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   665k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  3.18M|    int num_components, DataTypeT *out_prediction) {
   49|  3.18M|  const CornerIndex oci = table->Opposite(ci);
   50|  3.18M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 13.7k, False: 3.17M]
  ------------------
   51|  13.7k|    return false;
   52|  13.7k|  }
   53|  3.17M|  int vert_opp, vert_next, vert_prev;
   54|  3.17M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  3.17M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  3.17M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 1.72M, False: 1.44M]
  |  Branch (56:35): [True: 1.35M, False: 373k]
  ------------------
   57|  1.35M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 1.24M, False: 106k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  1.24M|    const int v_opp_off = vert_opp * num_components;
   60|  1.24M|    const int v_next_off = vert_next * num_components;
   61|  1.24M|    const int v_prev_off = vert_prev * num_components;
   62|  64.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 63.6M, False: 1.24M]
  ------------------
   63|  63.6M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  63.6M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  63.6M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  63.6M|      const int64_t result =
   67|  63.6M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  63.6M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  63.6M|    }
   71|  1.24M|    return true;
   72|  1.24M|  }
   73|  1.92M|  return false;  // Not all data is available for prediction
   74|  3.17M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  3.17M|    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|  3.17M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  3.17M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  3.17M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  3.17M|}

_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|     94|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|     94|            attribute, transform, mesh_data),
   46|     94|        pos_attribute_(nullptr),
   47|     94|        entry_to_point_id_map_(nullptr),
   48|     94|        num_components_(0),
   49|     94|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   71|    185|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   73|     94|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|     94|    DRACO_DCHECK_EQ(i, 0);
   75|     94|    (void)i;
   76|     94|    return GeometryAttribute::POSITION;
   77|     94|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|     92|  bool SetParentAttribute(const PointAttribute *att) override {
   80|     92|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 92]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|     92|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 92]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|     92|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 1, False: 91]
  ------------------
   87|      1|      return false;  // Currently works only for 3 component positions.
   88|      1|    }
   89|     91|    pos_attribute_ = att;
   90|     91|    return true;
   91|     92|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|     89|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|     89|  uint32_t num_orientations = 0;
  156|     89|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     89|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 5, False: 84]
  ------------------
  157|      5|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 1, False: 4]
  ------------------
  158|      1|      return false;
  159|      1|    }
  160|     84|  } else {
  161|     84|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 1, False: 83]
  ------------------
  162|      1|      return false;
  163|      1|    }
  164|     84|  }
  165|     87|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 1, False: 86]
  ------------------
  166|      1|    return false;
  167|      1|  }
  168|     86|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 6, False: 80]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      6|    return false;
  172|      6|  }
  173|     80|  orientations_.resize(num_orientations);
  174|     80|  bool last_orientation = true;
  175|     80|  RAnsBitDecoder decoder;
  176|     80|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 1, False: 79]
  ------------------
  177|      1|    return false;
  178|      1|  }
  179|  8.32k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 8.24k, False: 79]
  ------------------
  180|  8.24k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 1.61k, False: 6.62k]
  ------------------
  181|  1.61k|      last_orientation = !last_orientation;
  182|  1.61k|    }
  183|  8.24k|    orientations_[i] = last_orientation;
  184|  8.24k|  }
  185|     79|  decoder.EndDecoding();
  186|     79|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|     79|                                     MeshDataT>::DecodePredictionData(buffer);
  188|     80|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|     55|                          const PointIndex *entry_to_point_id_map) {
  126|     55|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 1, False: 54]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      1|    return false;
  129|      1|  }
  130|     54|  num_components_ = num_components;
  131|     54|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|     54|  predicted_value_ =
  133|     54|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|     54|  this->transform().Init(num_components);
  135|       |
  136|     54|  const int corner_map_size =
  137|     54|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|   301k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 301k, False: 44]
  ------------------
  139|   301k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|   301k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 10, False: 301k]
  ------------------
  141|     10|      return false;
  142|     10|    }
  143|       |
  144|   301k|    const int dst_offset = p * num_components;
  145|   301k|    this->transform().ComputeOriginalValue(
  146|   301k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|   301k|  }
  148|     44|  return true;
  149|     54|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|   301k|                          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|   301k|  const CornerIndex next_corner_id =
  198|   301k|      this->mesh_data().corner_table()->Next(corner_id);
  199|   301k|  const CornerIndex prev_corner_id =
  200|   301k|      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|   301k|  int next_data_id, prev_data_id;
  204|       |
  205|   301k|  int next_vert_id, prev_vert_id;
  206|   301k|  next_vert_id =
  207|   301k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|   301k|  prev_vert_id =
  209|   301k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|   301k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|   301k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|   301k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 206k, False: 95.3k]
  |  Branch (214:33): [True: 110k, False: 95.2k]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|   110k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|   110k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|   110k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 109k, False: 1.64k]
  ------------------
  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|   218k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 218k, False: 109k]
  ------------------
  223|   218k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 218k]
  |  Branch (223:36): [True: 80, False: 218k]
  ------------------
  224|   218k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 218k]
  ------------------
  225|     80|          predicted_value_[i] = INT_MIN;
  226|   218k|        } else {
  227|   218k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   218k|        }
  229|   218k|      }
  230|   109k|      return true;
  231|   109k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  1.64k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  1.64k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  1.64k|    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.64k|    const Vector3f pn = prev_pos - next_pos;
  261|  1.64k|    const Vector3f cn = tip_pos - next_pos;
  262|  1.64k|    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.64k|    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.64k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  3.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 1.64k]
  |  Branch (273:53): [True: 73, False: 1.57k]
  ------------------
  274|     73|      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|     73|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  1.57k|    } else {
  280|  1.57k|      s = 0;
  281|  1.57k|      t = 0;
  282|  1.57k|    }
  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.64k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  1.64k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  1.64k|    const float pnut = pn_uv[0] * t;
  301|  1.64k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  1.64k|    const float pnvt = pn_uv[1] * t;
  303|  1.64k|    Vector2f predicted_uv;
  304|  1.64k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 10, False: 1.63k]
  ------------------
  305|     10|      return false;
  306|     10|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  1.63k|    const bool orientation = orientations_.back();
  310|  1.63k|    orientations_.pop_back();
  311|  1.63k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 491, False: 1.14k]
  ------------------
  312|    491|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|  1.14k|    } else {
  314|  1.14k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|  1.14k|    }
  316|  1.63k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 1.63k, 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.63k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  1.63k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 1.63k]
  |  Branch (321:28): [True: 78, False: 1.55k]
  |  Branch (321:43): [True: 9, False: 1.54k]
  ------------------
  322|     87|        predicted_value_[0] = INT_MIN;
  323|  1.54k|      } else {
  324|  1.54k|        predicted_value_[0] = static_cast<int>(u);
  325|  1.54k|      }
  326|  1.63k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  1.63k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 1.63k]
  |  Branch (327:28): [True: 52, False: 1.58k]
  |  Branch (327:43): [True: 13, False: 1.57k]
  ------------------
  328|     65|        predicted_value_[1] = INT_MIN;
  329|  1.57k|      } else {
  330|  1.57k|        predicted_value_[1] = static_cast<int>(v);
  331|  1.57k|      }
  332|  1.63k|    } 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.63k|    return true;
  338|  1.64k|  }
  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|   190k|  int data_offset = 0;
  343|   190k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 95.2k, False: 95.3k]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|  95.2k|    data_offset = prev_data_id * num_components_;
  346|  95.2k|  }
  347|   190k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 10, False: 190k]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|     10|    data_offset = next_data_id * num_components_;
  350|   190k|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|   190k|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 190k, False: 54]
  ------------------
  354|   190k|      data_offset = (data_id - 1) * num_components_;
  355|   190k|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    162|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 108, False: 54]
  ------------------
  358|    108|        predicted_value_[i] = 0;
  359|    108|      }
  360|     54|      return true;
  361|     54|    }
  362|   190k|  }
  363|   571k|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 381k, False: 190k]
  ------------------
  364|   381k|    predicted_value_[i] = data[data_offset + i];
  365|   381k|  }
  366|   190k|  return true;
  367|   190k|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   221k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   221k|    const int data_offset = entry_id * num_components_;
  104|   221k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   221k|                    static_cast<float>(data[data_offset + 1]));
  106|   221k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   94|  4.93k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  4.93k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  4.93k|    Vector3f pos;
   97|  4.93k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  4.93k|                                 &pos[0]);
   99|  4.93k|    return pos;
  100|  4.93k|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    124|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    124|            attribute, transform, mesh_data),
   46|    124|        pos_attribute_(nullptr),
   47|    124|        entry_to_point_id_map_(nullptr),
   48|    124|        num_components_(0),
   49|    124|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   71|    243|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   73|    124|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    124|    DRACO_DCHECK_EQ(i, 0);
   75|    124|    (void)i;
   76|    124|    return GeometryAttribute::POSITION;
   77|    124|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    124|  bool SetParentAttribute(const PointAttribute *att) override {
   80|    124|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 124]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    124|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 124]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    124|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 5, False: 119]
  ------------------
   87|      5|      return false;  // Currently works only for 3 component positions.
   88|      5|    }
   89|    119|    pos_attribute_ = att;
   90|    119|    return true;
   91|    124|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|    114|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|    114|  uint32_t num_orientations = 0;
  156|    114|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    114|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 2, False: 112]
  ------------------
  157|      2|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 2]
  ------------------
  158|      0|      return false;
  159|      0|    }
  160|    112|  } else {
  161|    112|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 1, False: 111]
  ------------------
  162|      1|      return false;
  163|      1|    }
  164|    112|  }
  165|    113|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 2, False: 111]
  ------------------
  166|      2|    return false;
  167|      2|  }
  168|    111|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 10, False: 101]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|     10|    return false;
  172|     10|  }
  173|    101|  orientations_.resize(num_orientations);
  174|    101|  bool last_orientation = true;
  175|    101|  RAnsBitDecoder decoder;
  176|    101|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 3, False: 98]
  ------------------
  177|      3|    return false;
  178|      3|  }
  179|  39.4k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 39.3k, False: 98]
  ------------------
  180|  39.3k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 13.8k, False: 25.4k]
  ------------------
  181|  13.8k|      last_orientation = !last_orientation;
  182|  13.8k|    }
  183|  39.3k|    orientations_[i] = last_orientation;
  184|  39.3k|  }
  185|     98|  decoder.EndDecoding();
  186|     98|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|     98|                                     MeshDataT>::DecodePredictionData(buffer);
  188|    101|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|     78|                          const PointIndex *entry_to_point_id_map) {
  126|     78|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 5, False: 73]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      5|    return false;
  129|      5|  }
  130|     73|  num_components_ = num_components;
  131|     73|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|     73|  predicted_value_ =
  133|     73|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|     73|  this->transform().Init(num_components);
  135|       |
  136|     73|  const int corner_map_size =
  137|     73|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|  65.8k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 65.8k, False: 55]
  ------------------
  139|  65.8k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|  65.8k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 18, False: 65.8k]
  ------------------
  141|     18|      return false;
  142|     18|    }
  143|       |
  144|  65.8k|    const int dst_offset = p * num_components;
  145|  65.8k|    this->transform().ComputeOriginalValue(
  146|  65.8k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|  65.8k|  }
  148|     55|  return true;
  149|     73|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|  65.8k|                          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|  65.8k|  const CornerIndex next_corner_id =
  198|  65.8k|      this->mesh_data().corner_table()->Next(corner_id);
  199|  65.8k|  const CornerIndex prev_corner_id =
  200|  65.8k|      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|  65.8k|  int next_data_id, prev_data_id;
  204|       |
  205|  65.8k|  int next_vert_id, prev_vert_id;
  206|  65.8k|  next_vert_id =
  207|  65.8k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|  65.8k|  prev_vert_id =
  209|  65.8k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|  65.8k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|  65.8k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|  65.8k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 65.5k, False: 274]
  |  Branch (214:33): [True: 65.3k, False: 252]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|  65.3k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|  65.3k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|  65.3k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 64.0k, False: 1.25k]
  ------------------
  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|   128k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 128k, False: 64.0k]
  ------------------
  223|   128k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 128k]
  |  Branch (223:36): [True: 127, False: 127k]
  ------------------
  224|   127k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 127k]
  ------------------
  225|    127|          predicted_value_[i] = INT_MIN;
  226|   127k|        } else {
  227|   127k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   127k|        }
  229|   128k|      }
  230|  64.0k|      return true;
  231|  64.0k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  1.25k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  1.25k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  1.25k|    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.25k|    const Vector3f pn = prev_pos - next_pos;
  261|  1.25k|    const Vector3f cn = tip_pos - next_pos;
  262|  1.25k|    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.25k|    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.25k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  2.50k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 1.25k]
  |  Branch (273:53): [True: 250, False: 1.00k]
  ------------------
  274|    250|      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|    250|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  1.00k|    } else {
  280|  1.00k|      s = 0;
  281|  1.00k|      t = 0;
  282|  1.00k|    }
  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.25k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  1.25k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  1.25k|    const float pnut = pn_uv[0] * t;
  301|  1.25k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  1.25k|    const float pnvt = pn_uv[1] * t;
  303|  1.25k|    Vector2f predicted_uv;
  304|  1.25k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 18, False: 1.23k]
  ------------------
  305|     18|      return false;
  306|     18|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  1.23k|    const bool orientation = orientations_.back();
  310|  1.23k|    orientations_.pop_back();
  311|  1.23k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 694, False: 542]
  ------------------
  312|    694|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|    694|    } else {
  314|    542|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|    542|    }
  316|  1.23k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 1.23k, 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.23k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  1.23k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 1.23k]
  |  Branch (321:28): [True: 53, False: 1.18k]
  |  Branch (321:43): [True: 35, False: 1.14k]
  ------------------
  322|     88|        predicted_value_[0] = INT_MIN;
  323|  1.14k|      } else {
  324|  1.14k|        predicted_value_[0] = static_cast<int>(u);
  325|  1.14k|      }
  326|  1.23k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  1.23k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 1.23k]
  |  Branch (327:28): [True: 64, False: 1.17k]
  |  Branch (327:43): [True: 28, False: 1.14k]
  ------------------
  328|     92|        predicted_value_[1] = INT_MIN;
  329|  1.14k|      } else {
  330|  1.14k|        predicted_value_[1] = static_cast<int>(v);
  331|  1.14k|      }
  332|  1.23k|    } 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.23k|    return true;
  338|  1.25k|  }
  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|    526|  int data_offset = 0;
  343|    526|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 252, False: 274]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|    252|    data_offset = prev_data_id * num_components_;
  346|    252|  }
  347|    526|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 27, False: 499]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|     27|    data_offset = next_data_id * num_components_;
  350|    499|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|    499|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 426, False: 73]
  ------------------
  354|    426|      data_offset = (data_id - 1) * num_components_;
  355|    426|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    219|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 146, False: 73]
  ------------------
  358|    146|        predicted_value_[i] = 0;
  359|    146|      }
  360|     73|      return true;
  361|     73|    }
  362|    499|  }
  363|  1.35k|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 906, False: 453]
  ------------------
  364|    906|    predicted_value_[i] = data[data_offset + i];
  365|    906|  }
  366|    453|  return true;
  367|    526|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   130k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   130k|    const int data_offset = entry_id * num_components_;
  104|   130k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   130k|                    static_cast<float>(data[data_offset + 1]));
  106|   130k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   94|  3.76k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  3.76k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  3.76k|    Vector3f pos;
   97|  3.76k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  3.76k|                                 &pos[0]);
   99|  3.76k|    return pos;
  100|  3.76k|  }

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    152|      : pos_attribute_(nullptr),
   39|    152|        entry_to_point_id_map_(nullptr),
   40|    152|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    150|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    150|    pos_attribute_ = &position_attribute;
   43|    150|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    140|  void ResizeOrientations(int num_orientations) {
   74|    140|    orientations_.resize(num_orientations);
   75|    140|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  4.82G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    116|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    116|    entry_to_point_id_map_ = map;
   46|    116|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   244k|                                                 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|   244k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   244k|  const CornerIndex prev_corner_id =
   99|   244k|      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|   244k|  int next_data_id, prev_data_id;
  103|       |
  104|   244k|  int next_vert_id, prev_vert_id;
  105|   244k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   244k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   244k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   244k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   244k|  typedef VectorD<int64_t, 2> Vec2;
  112|   244k|  typedef VectorD<int64_t, 3> Vec3;
  113|   244k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   244k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 173k, False: 71.2k]
  |  Branch (115:33): [True: 102k, False: 71.2k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   102k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   102k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   102k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 100k, False: 1.99k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   100k|      predicted_value_[0] = p_uv[0];
  122|   100k|      predicted_value_[1] = p_uv[1];
  123|   100k|      return true;
  124|   100k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  1.99k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  1.99k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  1.99k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  1.99k|    const Vec3 pn = prev_pos - next_pos;
  146|  1.99k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  1.99k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.48k, False: 515]
  ------------------
  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.48k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.48k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.48k|      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.48k|      const int64_t n_uv_absmax_element =
  164|  1.48k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.48k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 26, False: 1.45k]
  ------------------
  166|  1.48k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     26|        return false;
  169|     26|      }
  170|  1.45k|      const int64_t pn_uv_absmax_element =
  171|  1.45k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.45k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 5, False: 1.45k]
  ------------------
  173|  1.45k|          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.45k|      const Vec2 x_uv =
  183|  1.45k|          Vec2(Vec2u(n_uv) * pn_norm2_squared +
  184|  1.45k|               Vec2u(static_cast<uint64_t>(cn_dot_pn),
  185|  1.45k|                     static_cast<uint64_t>(cn_dot_pn)) * Vec2u(pn_uv));
  186|  1.45k|      const int64_t pn_absmax_element =
  187|  1.45k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  188|  1.45k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (188:11): [True: 8, False: 1.44k]
  ------------------
  189|  1.45k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  190|       |        // Return false if squared length calculation would overflow.
  191|      8|        return false;
  192|      8|      }
  193|       |
  194|       |      // Compute squared length of vector CX in position coordinate system:
  195|  1.44k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  196|  1.44k|      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.44k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  213|       |      // Compute CX.Norm2() * PN.Norm2()
  214|  1.44k|      const uint64_t norm_squared =
  215|  1.44k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  216|       |      // Final cx_uv in the scaled coordinate space.
  217|  1.44k|      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.44k|      Vec2 predicted_uv;
  222|  1.44k|      if (is_encoder_t) {
  ------------------
  |  Branch (222:11): [Folded, False: 1.44k]
  ------------------
  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.44k|      } else {
  239|       |        // When decoding the data, we already know which orientation to use.
  240|  1.44k|        if (orientations_.empty()) {
  ------------------
  |  Branch (240:13): [True: 7, False: 1.43k]
  ------------------
  241|      7|          return false;
  242|      7|        }
  243|  1.43k|        const bool orientation = orientations_.back();
  244|  1.43k|        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.43k|        if (orientation) {
  ------------------
  |  Branch (247:13): [True: 761, False: 674]
  ------------------
  248|    761|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  249|    761|        } else {
  250|    674|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  251|    674|        }
  252|  1.43k|      }
  253|  1.43k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  254|  1.43k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  255|  1.43k|      return true;
  256|  1.44k|    }
  257|  1.99k|  }
  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|   142k|  int data_offset = 0;
  262|   142k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (262:7): [True: 71.7k, False: 71.2k]
  ------------------
  263|       |    // Use the value on the previous corner as the prediction.
  264|  71.7k|    data_offset = prev_data_id * kNumComponents;
  265|  71.7k|  }
  266|   142k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (266:7): [True: 522, False: 142k]
  ------------------
  267|       |    // Use the value on the next corner as the prediction.
  268|    522|    data_offset = next_data_id * kNumComponents;
  269|   142k|  } else {
  270|       |    // None of the other corners have a valid value. Use the last encoded value
  271|       |    // as the prediction if possible.
  272|   142k|    if (data_id > 0) {
  ------------------
  |  Branch (272:9): [True: 142k, False: 116]
  ------------------
  273|   142k|      data_offset = (data_id - 1) * kNumComponents;
  274|   142k|    } else {
  275|       |      // We are encoding the first value. Predict 0.
  276|    348|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (276:23): [True: 232, False: 116]
  ------------------
  277|    232|        predicted_value_[i] = 0;
  278|    232|      }
  279|    116|      return true;
  280|    116|    }
  281|   142k|  }
  282|   428k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (282:19): [True: 285k, False: 142k]
  ------------------
  283|   285k|    predicted_value_[i] = data[data_offset + i];
  284|   285k|  }
  285|   142k|  return true;
  286|   142k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   204k|                                            const DataTypeT *data) const {
   59|   204k|    const int data_offset = entry_id * kNumComponents;
   60|   204k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   204k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  5.98k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  5.98k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  5.98k|    VectorD<int64_t, 3> pos;
   52|  5.98k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  5.98k|                                 &pos[0]);
   54|  5.98k|    return pos;
   55|  5.98k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   244k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    146|      : pos_attribute_(nullptr),
   39|    146|        entry_to_point_id_map_(nullptr),
   40|    146|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    143|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    143|    pos_attribute_ = &position_attribute;
   43|    143|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    138|  void ResizeOrientations(int num_orientations) {
   74|    138|    orientations_.resize(num_orientations);
   75|    138|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  5.44G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    106|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    106|    entry_to_point_id_map_ = map;
   46|    106|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   116k|                                                 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|   116k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   116k|  const CornerIndex prev_corner_id =
   99|   116k|      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|   116k|  int next_data_id, prev_data_id;
  103|       |
  104|   116k|  int next_vert_id, prev_vert_id;
  105|   116k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   116k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   116k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   116k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   116k|  typedef VectorD<int64_t, 2> Vec2;
  112|   116k|  typedef VectorD<int64_t, 3> Vec3;
  113|   116k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   116k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 116k, False: 268]
  |  Branch (115:33): [True: 116k, False: 270]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   116k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   116k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   116k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 109k, False: 7.11k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   109k|      predicted_value_[0] = p_uv[0];
  122|   109k|      predicted_value_[1] = p_uv[1];
  123|   109k|      return true;
  124|   109k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  7.11k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  7.11k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  7.11k|    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|  7.11k|    const Vec3 pn = prev_pos - next_pos;
  146|  7.11k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  7.11k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 857, False: 6.25k]
  ------------------
  148|       |      // Compute the projection of C onto PN by computing dot product of CN with
  149|       |      // PN and normalizing it by length of PN. This gives us a factor |s| where
  150|       |      // |s = PN.Dot(CN) / PN.SquaredNorm2()|. This factor can be used to
  151|       |      // compute X in UV space |X_UV| as |X_UV = N_UV + s * PN_UV|.
  152|    857|      const Vec3 cn = tip_pos - next_pos;
  153|    857|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    857|      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|    857|      const int64_t n_uv_absmax_element =
  164|    857|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    857|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 10, False: 847]
  ------------------
  166|    857|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     10|        return false;
  169|     10|      }
  170|    847|      const int64_t pn_uv_absmax_element =
  171|    847|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    847|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 4, False: 843]
  ------------------
  173|    847|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      4|        return false;
  176|      4|      }
  177|       |      // Keep the scaled prediction arithmetic in the unsigned domain.  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|    843|      const Vec2 x_uv =
  183|    843|          Vec2(Vec2u(n_uv) * pn_norm2_squared +
  184|    843|               Vec2u(static_cast<uint64_t>(cn_dot_pn),
  185|    843|                     static_cast<uint64_t>(cn_dot_pn)) * Vec2u(pn_uv));
  186|    843|      const int64_t pn_absmax_element =
  187|    843|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  188|    843|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (188:11): [True: 8, False: 835]
  ------------------
  189|    843|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  190|       |        // Return false if squared length calculation would overflow.
  191|      8|        return false;
  192|      8|      }
  193|       |
  194|       |      // Compute squared length of vector CX in position coordinate system:
  195|    835|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  196|    835|      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|    835|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  213|       |      // Compute CX.Norm2() * PN.Norm2()
  214|    835|      const uint64_t norm_squared =
  215|    835|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  216|       |      // Final cx_uv in the scaled coordinate space.
  217|    835|      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|    835|      Vec2 predicted_uv;
  222|    835|      if (is_encoder_t) {
  ------------------
  |  Branch (222:11): [Folded, False: 835]
  ------------------
  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|    835|      } else {
  239|       |        // When decoding the data, we already know which orientation to use.
  240|    835|        if (orientations_.empty()) {
  ------------------
  |  Branch (240:13): [True: 11, False: 824]
  ------------------
  241|     11|          return false;
  242|     11|        }
  243|    824|        const bool orientation = orientations_.back();
  244|    824|        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|    824|        if (orientation) {
  ------------------
  |  Branch (247:13): [True: 340, False: 484]
  ------------------
  248|    340|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  249|    484|        } else {
  250|    484|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  251|    484|        }
  252|    824|      }
  253|    824|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  254|    824|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  255|    824|      return true;
  256|    835|    }
  257|  7.11k|  }
  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|  6.79k|  int data_offset = 0;
  262|  6.79k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (262:7): [True: 6.52k, False: 268]
  ------------------
  263|       |    // Use the value on the previous corner as the prediction.
  264|  6.52k|    data_offset = prev_data_id * kNumComponents;
  265|  6.52k|  }
  266|  6.79k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (266:7): [True: 6.26k, False: 533]
  ------------------
  267|       |    // Use the value on the next corner as the prediction.
  268|  6.26k|    data_offset = next_data_id * kNumComponents;
  269|  6.26k|  } else {
  270|       |    // None of the other corners have a valid value. Use the last encoded value
  271|       |    // as the prediction if possible.
  272|    533|    if (data_id > 0) {
  ------------------
  |  Branch (272:9): [True: 427, False: 106]
  ------------------
  273|    427|      data_offset = (data_id - 1) * kNumComponents;
  274|    427|    } else {
  275|       |      // We are encoding the first value. Predict 0.
  276|    318|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (276:23): [True: 212, False: 106]
  ------------------
  277|    212|        predicted_value_[i] = 0;
  278|    212|      }
  279|    106|      return true;
  280|    106|    }
  281|    533|  }
  282|  20.0k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (282:19): [True: 13.3k, False: 6.68k]
  ------------------
  283|  13.3k|    predicted_value_[i] = data[data_offset + i];
  284|  13.3k|  }
  285|  6.68k|  return true;
  286|  6.79k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   232k|                                            const DataTypeT *data) const {
   59|   232k|    const int data_offset = entry_id * kNumComponents;
   60|   232k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   232k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  21.3k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  21.3k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  21.3k|    VectorD<int64_t, 3> pos;
   52|  21.3k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  21.3k|                                 &pos[0]);
   54|  21.3k|    return pos;
   55|  21.3k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   116k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     70|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    285|  bool AreCorrectionsPositive() override {
   71|    285|    return transform_.AreCorrectionsPositive();
   72|    285|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     61|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     61|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 13, False: 48]
  ------------------
   50|     13|      return false;
   51|     13|    }
   52|     48|    return true;
   53|     61|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  37.5M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     54|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    294|  bool AreCorrectionsPositive() override {
   71|    294|    return transform_.AreCorrectionsPositive();
   72|    294|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     47|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     47|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 9, False: 38]
  ------------------
   50|      9|      return false;
   51|      9|    }
   52|     38|    return true;
   53|     47|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  7.26M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  3.19k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  2.19k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  3.04k|  bool AreCorrectionsPositive() override {
   71|  3.04k|    return transform_.AreCorrectionsPositive();
   72|  3.04k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  2.39k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  2.39k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 166, False: 2.22k]
  ------------------
   50|    166|      return false;
   51|    166|    }
   52|  2.22k|    return true;
   53|  2.39k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  45.4M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    299|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    305|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    299|                                 const PointCloudDecoder *decoder) {
  188|    299|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    299|      method, att_id, decoder, TransformT());
  190|    299|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    299|                                 const TransformT &transform) {
  156|    299|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 299]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    299|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    299|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 283, False: 16]
  ------------------
  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|    283|    const MeshDecoder *const mesh_decoder =
  167|    283|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    283|    auto ret = CreateMeshPredictionScheme<
  170|    283|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    283|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    283|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    283|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 229, False: 54]
  ------------------
  174|    229|      return ret;
  175|    229|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    283|  }
  178|       |  // Create delta decoder.
  179|     70|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     70|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    299|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    124|      uint16_t bitstream_version) {
  143|    124|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    124|        method, attribute, transform, mesh_data, bitstream_version);
  145|    124|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    124|        uint16_t bitstream_version) {
  127|    124|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 121, False: 3]
  ------------------
  128|    121|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    121|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    121|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    121|                                                  mesh_data));
  132|    121|      }
  133|      3|      return nullptr;
  134|    124|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    111|      uint16_t bitstream_version) {
  143|    111|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    111|        method, attribute, transform, mesh_data, bitstream_version);
  145|    111|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    111|        uint16_t bitstream_version) {
  127|    111|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 108, False: 3]
  ------------------
  128|    108|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    108|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    108|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    108|                                                  mesh_data));
  132|    108|      }
  133|      3|      return nullptr;
  134|    111|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    305|                                 const PointCloudDecoder *decoder) {
  188|    305|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    305|      method, att_id, decoder, TransformT());
  190|    305|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    305|                                 const TransformT &transform) {
  156|    305|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 305]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    305|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    305|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 305, 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|    305|    const MeshDecoder *const mesh_decoder =
  167|    305|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    305|    auto ret = CreateMeshPredictionScheme<
  170|    305|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    305|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    305|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    305|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 251, False: 54]
  ------------------
  174|    251|      return ret;
  175|    251|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    305|  }
  178|       |  // Create delta decoder.
  179|     54|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     54|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    305|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    134|      uint16_t bitstream_version) {
  143|    134|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    134|        method, attribute, transform, mesh_data, bitstream_version);
  145|    134|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    134|        uint16_t bitstream_version) {
  111|    134|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 131, False: 3]
  ------------------
  112|    131|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    131|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    131|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    131|                                                  mesh_data));
  116|    131|      }
  117|      3|      return nullptr;
  118|    134|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    123|      uint16_t bitstream_version) {
  143|    123|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    123|        method, attribute, transform, mesh_data, bitstream_version);
  145|    123|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    123|        uint16_t bitstream_version) {
  111|    123|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 120, False: 3]
  ------------------
  112|    120|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    120|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    120|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    120|                                                  mesh_data));
  116|    120|      }
  117|      3|      return nullptr;
  118|    123|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  3.19k|                                 const PointCloudDecoder *decoder) {
  188|  3.19k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  3.19k|      method, att_id, decoder, TransformT());
  190|  3.19k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  3.19k|                                 const TransformT &transform) {
  156|  3.19k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 3.19k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  3.19k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  3.19k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 3.16k, False: 28]
  ------------------
  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|  3.16k|    const MeshDecoder *const mesh_decoder =
  167|  3.16k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  3.16k|    auto ret = CreateMeshPredictionScheme<
  170|  3.16k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  3.16k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  3.16k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  3.16k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 2.93k, False: 223]
  ------------------
  174|  2.93k|      return ret;
  175|  2.93k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  3.16k|  }
  178|       |  // Create delta decoder.
  179|    251|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    251|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  3.19k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.31k|      uint16_t bitstream_version) {
  143|  1.31k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.31k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.31k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.31k|        uint16_t bitstream_version) {
   53|  1.31k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 374, False: 942]
  ------------------
   54|    374|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    374|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    374|                                                         MeshDataT>(
   57|    374|                attribute, transform, mesh_data));
   58|    374|      }
   59|    942|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|    942|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 246, False: 696]
  ------------------
   61|    246|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    246|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    246|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    246|                                                  mesh_data));
   65|    246|      }
   66|    696|#endif
   67|    696|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 311, False: 385]
  ------------------
   68|    311|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    311|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    311|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    311|                                                  mesh_data));
   72|    311|      }
   73|    385|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    385|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 94, False: 291]
  ------------------
   75|     94|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|     94|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|     94|                                                     MeshDataT>(
   78|     94|                attribute, transform, mesh_data, bitstream_version));
   79|     94|      }
   80|    291|#endif
   81|    291|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 152, False: 139]
  ------------------
   82|    152|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    152|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    152|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    152|                                                  mesh_data));
   86|    152|      }
   87|    139|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    139|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 139, False: 0]
  ------------------
   89|    139|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    139|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    139|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    139|                                                  mesh_data));
   93|    139|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.31k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.62k|      uint16_t bitstream_version) {
  143|  1.62k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.62k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.62k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.62k|        uint16_t bitstream_version) {
   53|  1.62k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 431, False: 1.19k]
  ------------------
   54|    431|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    431|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    431|                                                         MeshDataT>(
   57|    431|                attribute, transform, mesh_data));
   58|    431|      }
   59|  1.19k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.19k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 286, False: 906]
  ------------------
   61|    286|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    286|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    286|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    286|                                                  mesh_data));
   65|    286|      }
   66|    906|#endif
   67|    906|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 295, False: 611]
  ------------------
   68|    295|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    295|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    295|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    295|                                                  mesh_data));
   72|    295|      }
   73|    611|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    611|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 124, False: 487]
  ------------------
   75|    124|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    124|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    124|                                                     MeshDataT>(
   78|    124|                attribute, transform, mesh_data, bitstream_version));
   79|    124|      }
   80|    487|#endif
   81|    487|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 146, False: 341]
  ------------------
   82|    146|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    146|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    146|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    146|                                                  mesh_data));
   86|    146|      }
   87|    341|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    341|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 341, False: 0]
  ------------------
   89|    341|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    341|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    341|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    341|                                                  mesh_data));
   93|    341|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.62k|    }

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     48|    const PointIndex *) {
   50|     48|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     48|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     48|  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|  36.9M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 36.9M, False: 48]
  ------------------
   57|  36.9M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  36.9M|                                           in_corr + i, out_data + i);
   59|  36.9M|  }
   60|     48|  return true;
   61|     48|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     38|    const PointIndex *) {
   50|     38|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     38|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     38|  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|  7.00M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 7.00M, False: 38]
  ------------------
   57|  7.00M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  7.00M|                                           in_corr + i, out_data + i);
   59|  7.00M|  }
   60|     38|  return true;
   61|     38|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    251|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    222|    const PointIndex *) {
   50|    222|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    222|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    222|  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|  42.1M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 42.1M, False: 222]
  ------------------
   57|  42.1M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  42.1M|                                           in_corr + i, out_data + i);
   59|  42.1M|  }
   60|    222|  return true;
   61|    222|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     70|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     54|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    283|    uint16_t bitstream_version) {
   38|    283|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    283|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 283, False: 0]
  ------------------
   40|    283|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 3, False: 280]
  ------------------
   41|    280|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 2, False: 278]
  ------------------
   42|    278|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 278]
  ------------------
   43|    278|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 277]
  ------------------
   44|    277|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 229, False: 48]
  ------------------
   45|    236|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 1, False: 47]
  ------------------
   46|    236|    const CornerTable *const ct = source->GetCornerTable();
   47|    236|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    236|        source->GetAttributeEncodingData(att_id);
   49|    236|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 1, False: 235]
  |  Branch (49:26): [True: 0, False: 235]
  ------------------
   50|       |      // No connectivity data found.
   51|      1|      return nullptr;
   52|      1|    }
   53|       |    // Connectivity data exists.
   54|    235|    const MeshAttributeCornerTable *const att_ct =
   55|    235|        source->GetAttributeCornerTable(att_id);
   56|    235|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 124, False: 111]
  ------------------
   57|    124|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    124|      MeshData md;
   59|    124|      md.Set(source->mesh(), att_ct,
   60|    124|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    124|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    124|      MeshPredictionSchemeFactoryT factory;
   63|    124|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    124|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 121, False: 3]
  ------------------
   65|    121|        return ret;
   66|    121|      }
   67|    124|    } else {
   68|    111|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    111|      MeshData md;
   70|    111|      md.Set(source->mesh(), ct,
   71|    111|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    111|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    111|      MeshPredictionSchemeFactoryT factory;
   74|    111|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    111|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 108, False: 3]
  ------------------
   76|    108|        return ret;
   77|    108|      }
   78|    111|    }
   79|    235|  }
   80|     53|  return nullptr;
   81|    283|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    305|    uint16_t bitstream_version) {
   38|    305|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    305|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 305, False: 0]
  ------------------
   40|    305|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 8, False: 297]
  ------------------
   41|    297|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1, False: 296]
  ------------------
   42|    296|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 296]
  ------------------
   43|    296|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 295]
  ------------------
   44|    295|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 251, False: 44]
  ------------------
   45|    262|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 1, False: 43]
  ------------------
   46|    262|    const CornerTable *const ct = source->GetCornerTable();
   47|    262|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    262|        source->GetAttributeEncodingData(att_id);
   49|    262|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 5, False: 257]
  |  Branch (49:26): [True: 0, False: 257]
  ------------------
   50|       |      // No connectivity data found.
   51|      5|      return nullptr;
   52|      5|    }
   53|       |    // Connectivity data exists.
   54|    257|    const MeshAttributeCornerTable *const att_ct =
   55|    257|        source->GetAttributeCornerTable(att_id);
   56|    257|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 134, False: 123]
  ------------------
   57|    134|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    134|      MeshData md;
   59|    134|      md.Set(source->mesh(), att_ct,
   60|    134|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    134|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    134|      MeshPredictionSchemeFactoryT factory;
   63|    134|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    134|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 131, False: 3]
  ------------------
   65|    131|        return ret;
   66|    131|      }
   67|    134|    } else {
   68|    123|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    123|      MeshData md;
   70|    123|      md.Set(source->mesh(), ct,
   71|    123|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    123|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    123|      MeshPredictionSchemeFactoryT factory;
   74|    123|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    123|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 120, False: 3]
  ------------------
   76|    120|        return ret;
   77|    120|      }
   78|    123|    }
   79|    257|  }
   80|     49|  return nullptr;
   81|    305|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  3.16k|    uint16_t bitstream_version) {
   38|  3.16k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  3.16k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 3.16k, False: 0]
  ------------------
   40|  3.16k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 816, False: 2.34k]
  ------------------
   41|  2.34k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 544, False: 1.80k]
  ------------------
   42|  1.80k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 630, False: 1.17k]
  ------------------
   43|  1.17k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 304, False: 868]
  ------------------
   44|    868|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 481, False: 387]
  ------------------
   45|  3.00k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 233, False: 154]
  ------------------
   46|  3.00k|    const CornerTable *const ct = source->GetCornerTable();
   47|  3.00k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  3.00k|        source->GetAttributeEncodingData(att_id);
   49|  3.00k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 69, False: 2.93k]
  |  Branch (49:26): [True: 0, False: 2.93k]
  ------------------
   50|       |      // No connectivity data found.
   51|     69|      return nullptr;
   52|     69|    }
   53|       |    // Connectivity data exists.
   54|  2.93k|    const MeshAttributeCornerTable *const att_ct =
   55|  2.93k|        source->GetAttributeCornerTable(att_id);
   56|  2.93k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.31k, False: 1.62k]
  ------------------
   57|  1.31k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.31k|      MeshData md;
   59|  1.31k|      md.Set(source->mesh(), att_ct,
   60|  1.31k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.31k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.31k|      MeshPredictionSchemeFactoryT factory;
   63|  1.31k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.31k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.31k, False: 0]
  ------------------
   65|  1.31k|        return ret;
   66|  1.31k|      }
   67|  1.62k|    } else {
   68|  1.62k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  1.62k|      MeshData md;
   70|  1.62k|      md.Set(source->mesh(), ct,
   71|  1.62k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  1.62k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  1.62k|      MeshPredictionSchemeFactoryT factory;
   74|  1.62k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  1.62k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 1.62k, False: 0]
  ------------------
   76|  1.62k|        return ret;
   77|  1.62k|      }
   78|  1.62k|    }
   79|  2.93k|  }
   80|    154|  return nullptr;
   81|  3.16k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  7.26M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  7.26M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 2.29M, False: 4.97M]
  |  Branch (93:22): [True: 544k, False: 1.74M]
  ------------------
   94|   544k|      return true;
   95|   544k|    }
   96|  6.71M|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 1.76M, False: 4.94M]
  |  Branch (96:25): [True: 1.05M, False: 712k]
  ------------------
   97|  7.26M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  7.26M|  int32_t GetRotationCount(Point2 pred) const {
   51|  7.26M|    const DataType sign_x = pred[0];
   52|  7.26M|    const DataType sign_y = pred[1];
   53|       |
   54|  7.26M|    int32_t rotation_count = 0;
   55|  7.26M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 2.29M, False: 4.97M]
  ------------------
   56|  2.29M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 544k, False: 1.74M]
  ------------------
   57|   544k|        rotation_count = 0;
   58|  1.74M|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 1.04M, False: 698k]
  ------------------
   59|  1.04M|        rotation_count = 3;
   60|  1.04M|      } else {
   61|   698k|        rotation_count = 1;
   62|   698k|      }
   63|  4.97M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 3.20M, False: 1.76M]
  ------------------
   64|  3.20M|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 2.48M, False: 714k]
  ------------------
   65|  2.48M|        rotation_count = 2;
   66|  2.48M|      } else {
   67|   714k|        rotation_count = 1;
   68|   714k|      }
   69|  3.20M|    } else {
   70|  1.76M|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 1.05M, False: 712k]
  ------------------
   71|  1.05M|        rotation_count = 0;
   72|  1.05M|      } else {
   73|   712k|        rotation_count = 3;
   74|   712k|      }
   75|  1.76M|    }
   76|  7.26M|    return rotation_count;
   77|  7.26M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|  11.3M|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|  11.3M|    switch (rotation_count) {
   81|  3.17M|      case 1:
  ------------------
  |  Branch (81:7): [True: 3.17M, False: 8.14M]
  ------------------
   82|  3.17M|        return Point2(p[1], -p[0]);
   83|  4.97M|      case 2:
  ------------------
  |  Branch (83:7): [True: 4.97M, False: 6.34M]
  ------------------
   84|  4.97M|        return Point2(-p[0], -p[1]);
   85|  3.17M|      case 3:
  ------------------
  |  Branch (85:7): [True: 3.17M, False: 8.14M]
  ------------------
   86|  3.17M|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 11.3M]
  ------------------
   88|      0|        return p;
   89|  11.3M|    }
   90|  11.3M|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    305|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

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

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  4.64k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  44.6M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  3.79k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  16.8k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  5.27k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  5.27k|    portable_attribute_ = std::move(att);
   71|  5.27k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  17.8k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  8.46k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  6.12k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  2.95k|    DecoderBuffer *buffer) {
   30|  2.95k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 86, False: 2.87k]
  ------------------
   31|     86|    return false;
   32|     86|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  2.87k|  const int32_t num_attributes = GetNumAttributes();
   35|  2.87k|  sequential_decoders_.resize(num_attributes);
   36|  11.3k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 8.47k, False: 2.86k]
  ------------------
   37|  8.47k|    uint8_t decoder_type;
   38|  8.47k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 6, False: 8.46k]
  ------------------
   39|      6|      return false;
   40|      6|    }
   41|       |    // Create the decoder from the id.
   42|  8.46k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  8.46k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 2, False: 8.46k]
  ------------------
   44|      2|      return false;
   45|      2|    }
   46|  8.46k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 2, False: 8.46k]
  ------------------
   47|      2|      return false;
   48|      2|    }
   49|  8.46k|  }
   50|  2.86k|  return true;
   51|  2.87k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  2.73k|    DecoderBuffer *buffer) {
   55|  2.73k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 2.73k]
  |  Branch (55:22): [True: 0, False: 2.73k]
  ------------------
   56|      0|    return false;
   57|      0|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  2.73k|  const int32_t num_attributes = GetNumAttributes();
   60|  11.0k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 8.30k, False: 2.73k]
  ------------------
   61|  8.30k|    PointAttribute *const pa =
   62|  8.30k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  8.30k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 1, False: 8.30k]
  ------------------
   64|      1|      return false;
   65|      1|    }
   66|  8.30k|  }
   67|  2.73k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  2.73k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  2.73k|    DecoderBuffer *in_buffer) {
   72|  2.73k|  const int32_t num_attributes = GetNumAttributes();
   73|  7.19k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 5.94k, False: 1.24k]
  ------------------
   74|  5.94k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 1.48k, False: 4.46k]
  ------------------
   75|  5.94k|                                                          in_buffer)) {
   76|  1.48k|      return false;
   77|  1.48k|    }
   78|  5.94k|  }
   79|  1.24k|  return true;
   80|  2.73k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  1.24k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  1.24k|  const int32_t num_attributes = GetNumAttributes();
   85|  3.22k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 2.23k, False: 984]
  ------------------
   86|  2.23k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 265, False: 1.97k]
  ------------------
   87|  2.23k|            point_ids_, in_buffer)) {
   88|    265|      return false;
   89|    265|    }
   90|  2.23k|  }
   91|    984|  return true;
   92|  1.24k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|    984|    TransformAttributesToOriginalFormat() {
   96|    984|  const int32_t num_attributes = GetNumAttributes();
   97|  2.35k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 1.65k, False: 697]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  1.65k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 1.65k, False: 0]
  ------------------
  100|  1.65k|      const PointAttribute *const attribute =
  101|  1.65k|          sequential_decoders_[i]->attribute();
  102|  1.65k|      const PointAttribute *const portable_attribute =
  103|  1.65k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  1.65k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 1.51k, False: 137]
  |  Branch (104:11): [True: 0, False: 1.65k]
  ------------------
  105|  1.51k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 0, False: 1.51k]
  ------------------
  106|  1.51k|              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|  1.65k|    }
  116|  1.65k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 287, False: 1.36k]
  ------------------
  117|  1.65k|            point_ids_)) {
  118|    287|      return false;
  119|    287|    }
  120|  1.65k|  }
  121|    697|  return true;
  122|    984|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  8.46k|    uint8_t decoder_type) {
  127|  8.46k|  switch (decoder_type) {
  128|    837|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 837, False: 7.63k]
  ------------------
  129|    837|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|    837|          new SequentialAttributeDecoder());
  131|  6.54k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 6.54k, False: 1.91k]
  ------------------
  132|  6.54k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  6.54k|          new SequentialIntegerAttributeDecoder());
  134|    299|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 299, False: 8.16k]
  ------------------
  135|    299|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    299|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|    781|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 781, False: 7.68k]
  ------------------
  139|    781|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|    781|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|      2|    default:
  ------------------
  |  Branch (142:5): [True: 2, False: 8.46k]
  ------------------
  143|      2|      break;
  144|  8.46k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|      2|  return nullptr;
  147|  8.46k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  7.62k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  7.62k|                                             int attribute_id) {
   27|  7.62k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 7.62k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  7.62k|  return true;
   31|  7.62k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  1.51k|    const std::vector<PointIndex> &point_ids) {
   35|  1.51k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  1.51k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 1.51k, False: 0]
  ------------------
   37|  1.51k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.51k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 0, False: 1.51k]
  ------------------
   38|      0|    return true;  // Don't revert the transform here for older files.
   39|      0|  }
   40|  1.51k|#endif
   41|  1.51k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  1.51k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  5.62k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  5.62k|  int8_t prediction_scheme_method;
   48|  5.62k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 108, False: 5.51k]
  ------------------
   49|    108|    return false;
   50|    108|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  5.51k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 39, False: 5.47k]
  ------------------
   53|  5.47k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 109, False: 5.36k]
  ------------------
   54|    148|    return false;
   55|    148|  }
   56|  5.36k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 5.28k, False: 81]
  ------------------
   57|  5.28k|    int8_t prediction_transform_type;
   58|  5.28k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 31, False: 5.25k]
  ------------------
   59|     31|      return false;
   60|     31|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  5.25k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 10, False: 5.24k]
  ------------------
   63|  5.24k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 28, False: 5.21k]
  ------------------
   64|     38|      return false;
   65|     38|    }
   66|  5.21k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  5.21k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  5.21k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  5.21k|  }
   70|       |
   71|  5.29k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 3.79k, False: 1.50k]
  ------------------
   72|  3.79k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 25, False: 3.76k]
  ------------------
   73|     25|      return false;
   74|     25|    }
   75|  3.79k|  }
   76|       |
   77|  5.27k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 987, False: 4.28k]
  ------------------
   78|    987|    return false;
   79|    987|  }
   80|       |
   81|  4.28k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  4.28k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  4.28k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 4.28k, False: 0]
  ------------------
   84|  4.28k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.28k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 0, False: 4.28k]
  ------------------
   85|       |    // For older files, revert the transform right after we decode the data.
   86|      0|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 0]
  ------------------
   87|      0|      return false;
   88|      0|    }
   89|      0|  }
   90|  4.28k|#endif
   91|  4.28k|  return true;
   92|  4.28k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  4.58k|    PredictionSchemeTransformType transform_type) {
   98|  4.58k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 1.39k, False: 3.19k]
  ------------------
   99|  1.39k|    return nullptr;  // For now we support only wrap transform.
  100|  1.39k|  }
  101|  3.19k|  return CreatePredictionSchemeForDecoder<
  102|  3.19k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  3.19k|      method, attribute_id(), decoder());
  104|  4.58k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  5.27k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  5.27k|  const int num_components = GetNumValueComponents();
  109|  5.27k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 5.27k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  5.27k|  const size_t num_entries = point_ids.size();
  113|  5.27k|  const size_t num_values = num_entries * num_components;
  114|  5.27k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  5.27k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  5.27k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 2, False: 5.26k]
  ------------------
  117|      2|    return false;
  118|      2|  }
  119|  5.26k|  uint8_t compressed;
  120|  5.26k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 17, False: 5.25k]
  ------------------
  121|     17|    return false;
  122|     17|  }
  123|  5.25k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 443, False: 4.80k]
  ------------------
  124|       |    // Decode compressed values.
  125|    443|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 158, False: 285]
  ------------------
  126|    443|                       in_buffer,
  127|    443|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    158|      return false;
  129|    158|    }
  130|  4.80k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  4.80k|    uint8_t num_bytes;
  134|  4.80k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 7, False: 4.80k]
  ------------------
  135|      7|      return false;
  136|      7|    }
  137|  4.80k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 169, False: 4.63k]
  ------------------
  138|    169|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 169]
  ------------------
  139|    169|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    169|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 0, False: 169]
  ------------------
  143|    169|                             sizeof(int32_t) * num_values)) {
  144|      0|        return false;
  145|      0|      }
  146|  4.63k|    } else {
  147|  4.63k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 25, False: 4.60k]
  ------------------
  148|  4.63k|          num_bytes * num_values) {
  149|     25|        return false;
  150|     25|      }
  151|  4.60k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 24, False: 4.58k]
  ------------------
  152|  4.60k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     24|        return false;
  154|     24|      }
  155|   456M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 456M, False: 4.58k]
  ------------------
  156|   456M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 456M]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|   456M|      }
  160|  4.58k|    }
  161|  4.80k|  }
  162|       |
  163|  5.03k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 5.03k, False: 0]
  |  Branch (163:26): [True: 1.41k, False: 3.62k]
  ------------------
  164|  4.45k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 3.04k, False: 579]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  4.45k|    ConvertSymbolsToSignedInts(
  167|  4.45k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  4.45k|        static_cast<int>(num_values), portable_attribute_data);
  169|  4.45k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  5.03k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 3.62k, False: 1.41k]
  ------------------
  173|  3.62k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 464, False: 3.15k]
  ------------------
  174|    464|      return false;
  175|    464|    }
  176|       |
  177|  3.15k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 3.15k, False: 0]
  ------------------
  178|  3.15k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 290, False: 2.86k]
  ------------------
  179|  3.15k|              portable_attribute_data, portable_attribute_data,
  180|  3.15k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    290|        return false;
  182|    290|      }
  183|  3.15k|    }
  184|  3.15k|  }
  185|  4.28k|  return true;
  186|  5.03k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  1.32k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  1.32k|  switch (attribute()->data_type()) {
  190|    227|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 227, False: 1.10k]
  ------------------
  191|    227|      StoreTypedValues<uint8_t>(num_values);
  192|    227|      break;
  193|    450|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 450, False: 879]
  ------------------
  194|    450|      StoreTypedValues<int8_t>(num_values);
  195|    450|      break;
  196|     62|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 62, False: 1.26k]
  ------------------
  197|     62|      StoreTypedValues<uint16_t>(num_values);
  198|     62|      break;
  199|    243|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 243, False: 1.08k]
  ------------------
  200|    243|      StoreTypedValues<int16_t>(num_values);
  201|    243|      break;
  202|    143|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 143, False: 1.18k]
  ------------------
  203|    143|      StoreTypedValues<uint32_t>(num_values);
  204|    143|      break;
  205|     43|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 43, False: 1.28k]
  ------------------
  206|     43|      StoreTypedValues<int32_t>(num_values);
  207|     43|      break;
  208|    161|    default:
  ------------------
  |  Branch (208:5): [True: 161, False: 1.16k]
  ------------------
  209|    161|      return false;
  210|  1.32k|  }
  211|  1.16k|  return true;
  212|  1.32k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  5.27k|    int num_entries, int num_components) {
  237|  5.27k|  GeometryAttribute ga;
  238|  5.27k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  5.27k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  5.27k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  5.27k|  port_att->SetIdentityMapping();
  242|  5.27k|  port_att->Reset(num_entries);
  243|  5.27k|  port_att->set_unique_id(attribute()->unique_id());
  244|  5.27k|  SetPortableAttribute(std::move(port_att));
  245|  5.27k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    227|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    227|  const int num_components = attribute()->num_components();
  217|    227|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    227|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    227|      new AttributeTypeT[num_components]);
  220|    227|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    227|  int val_id = 0;
  222|    227|  int out_byte_pos = 0;
  223|   257k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 256k, False: 227]
  ------------------
  224|  12.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 12.3M, False: 256k]
  ------------------
  225|  12.3M|      const AttributeTypeT value =
  226|  12.3M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  12.3M|      att_val[c] = value;
  228|  12.3M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   256k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   256k|    out_byte_pos += entry_size;
  232|   256k|  }
  233|    227|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|    450|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    450|  const int num_components = attribute()->num_components();
  217|    450|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    450|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    450|      new AttributeTypeT[num_components]);
  220|    450|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    450|  int val_id = 0;
  222|    450|  int out_byte_pos = 0;
  223|  40.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 40.7M, False: 450]
  ------------------
  224|  99.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 58.8M, False: 40.7M]
  ------------------
  225|  58.8M|      const AttributeTypeT value =
  226|  58.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  58.8M|      att_val[c] = value;
  228|  58.8M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  40.7M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  40.7M|    out_byte_pos += entry_size;
  232|  40.7M|  }
  233|    450|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|     62|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     62|  const int num_components = attribute()->num_components();
  217|     62|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     62|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     62|      new AttributeTypeT[num_components]);
  220|     62|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     62|  int val_id = 0;
  222|     62|  int out_byte_pos = 0;
  223|   250k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 250k, False: 62]
  ------------------
  224|  29.0M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 28.8M, False: 250k]
  ------------------
  225|  28.8M|      const AttributeTypeT value =
  226|  28.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  28.8M|      att_val[c] = value;
  228|  28.8M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   250k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   250k|    out_byte_pos += entry_size;
  232|   250k|  }
  233|     62|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    243|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    243|  const int num_components = attribute()->num_components();
  217|    243|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    243|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    243|      new AttributeTypeT[num_components]);
  220|    243|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    243|  int val_id = 0;
  222|    243|  int out_byte_pos = 0;
  223|  2.11M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 2.11M, False: 243]
  ------------------
  224|   243M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 241M, False: 2.11M]
  ------------------
  225|   241M|      const AttributeTypeT value =
  226|   241M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   241M|      att_val[c] = value;
  228|   241M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  2.11M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  2.11M|    out_byte_pos += entry_size;
  232|  2.11M|  }
  233|    243|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    143|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    143|  const int num_components = attribute()->num_components();
  217|    143|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    143|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    143|      new AttributeTypeT[num_components]);
  220|    143|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    143|  int val_id = 0;
  222|    143|  int out_byte_pos = 0;
  223|  1.08M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.08M, False: 143]
  ------------------
  224|  44.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 43.8M, False: 1.08M]
  ------------------
  225|  43.8M|      const AttributeTypeT value =
  226|  43.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  43.8M|      att_val[c] = value;
  228|  43.8M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.08M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.08M|    out_byte_pos += entry_size;
  232|  1.08M|  }
  233|    143|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|     43|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     43|  const int num_components = attribute()->num_components();
  217|     43|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     43|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     43|      new AttributeTypeT[num_components]);
  220|     43|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     43|  int val_id = 0;
  222|     43|  int out_byte_pos = 0;
  223|   155k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 155k, False: 43]
  ------------------
  224|  7.29M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 7.13M, False: 155k]
  ------------------
  225|  7.13M|      const AttributeTypeT value =
  226|  7.13M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  7.13M|      att_val[c] = value;
  228|  7.13M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   155k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   155k|    out_byte_pos += entry_size;
  232|   155k|  }
  233|     43|}

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

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

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

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

_ZN5draco16DirectBitDecoderC2Ev:
   19|  4.13k|DirectBitDecoder::DirectBitDecoder() : pos_(bits_.end()), num_used_bits_(0) {}
_ZN5draco16DirectBitDecoderD2Ev:
   21|  4.13k|DirectBitDecoder::~DirectBitDecoder() { Clear(); }
_ZN5draco16DirectBitDecoder13StartDecodingEPNS_13DecoderBufferE:
   23|  1.96k|bool DirectBitDecoder::StartDecoding(DecoderBuffer *source_buffer) {
   24|  1.96k|  Clear();
   25|  1.96k|  uint32_t size_in_bytes;
   26|  1.96k|  if (!source_buffer->Decode(&size_in_bytes)) {
  ------------------
  |  Branch (26:7): [True: 24, False: 1.94k]
  ------------------
   27|     24|    return false;
   28|     24|  }
   29|       |
   30|       |  // Check that size_in_bytes is > 0 and a multiple of 4 as the encoder always
   31|       |  // encodes 32 bit elements.
   32|  1.94k|  if (size_in_bytes == 0 || size_in_bytes & 0x3) {
  ------------------
  |  Branch (32:7): [True: 4, False: 1.93k]
  |  Branch (32:29): [True: 48, False: 1.88k]
  ------------------
   33|     52|    return false;
   34|     52|  }
   35|  1.88k|  if (size_in_bytes > source_buffer->remaining_size()) {
  ------------------
  |  Branch (35:7): [True: 47, False: 1.84k]
  ------------------
   36|     47|    return false;
   37|     47|  }
   38|  1.84k|  const uint32_t num_32bit_elements = size_in_bytes / 4;
   39|  1.84k|  bits_.resize(num_32bit_elements);
   40|  1.84k|  if (!source_buffer->Decode(bits_.data(), size_in_bytes)) {
  ------------------
  |  Branch (40:7): [True: 0, False: 1.84k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  1.84k|  pos_ = bits_.begin();
   44|  1.84k|  num_used_bits_ = 0;
   45|  1.84k|  return true;
   46|  1.84k|}
_ZN5draco16DirectBitDecoder5ClearEv:
   48|  6.09k|void DirectBitDecoder::Clear() {
   49|  6.09k|  bits_.clear();
   50|  6.09k|  num_used_bits_ = 0;
   51|  6.09k|  pos_ = bits_.end();
   52|  6.09k|}

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  4.88M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  4.88M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  4.88M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  4.88M|    const int remaining = 32 - num_used_bits_;
   54|  4.88M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 4.81M, False: 74.4k]
  ------------------
   55|  4.81M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 4.53M, False: 280k]
  ------------------
   56|  4.53M|        return false;
   57|  4.53M|      }
   58|   280k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   280k|      num_used_bits_ += nbits;
   60|   280k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 9.25k, False: 271k]
  ------------------
   61|  9.25k|        ++pos_;
   62|  9.25k|        num_used_bits_ = 0;
   63|  9.25k|      }
   64|   280k|    } else {
   65|  74.4k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 66.8k, False: 7.58k]
  ------------------
   66|  66.8k|        return false;
   67|  66.8k|      }
   68|  7.58k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  7.58k|      num_used_bits_ = nbits - remaining;
   70|  7.58k|      ++pos_;
   71|  7.58k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  7.58k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  7.58k|    }
   74|   287k|    return true;
   75|  4.88M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  5.61M|  bool DecodeNextBit() {
   35|  5.61M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  5.61M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 5.39M, False: 219k]
  ------------------
   37|  5.39M|      return false;
   38|  5.39M|    }
   39|   219k|    const bool bit = *pos_ & selector;
   40|   219k|    ++num_used_bits_;
   41|   219k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 6.73k, False: 212k]
  ------------------
   42|  6.73k|      ++pos_;
   43|  6.73k|      num_used_bits_ = 0;
   44|  6.73k|    }
   45|   219k|    return bit;
   46|  5.61M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    376|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    407|  FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    407|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    289|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  7.02k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 6.82k, False: 191]
  ------------------
   35|  6.82k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 98, False: 6.73k]
  ------------------
   36|     98|        return false;
   37|     98|      }
   38|  6.82k|    }
   39|    191|    return bit_decoder_.StartDecoding(source_buffer);
   40|    289|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  1.91M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  1.91M|    uint32_t result = 0;
   49|  11.9M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 10.0M, False: 1.91M]
  ------------------
   50|  10.0M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  10.0M|      result = (result << 1) + bit;
   52|  10.0M|    }
   53|  1.91M|    *value = result;
   54|  1.91M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     53|  void EndDecoding() {
   57|  1.74k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 1.69k, False: 53]
  ------------------
   58|  1.69k|      folded_number_decoders_[i].EndDecoding();
   59|  1.69k|    }
   60|     53|    bit_decoder_.EndDecoding();
   61|     53|  }

_ZN5draco14RAnsBitDecoderC2Ev:
   23|  29.5k|RAnsBitDecoder::RAnsBitDecoder() : prob_zero_(0) {}
_ZN5draco14RAnsBitDecoderD2Ev:
   25|  29.5k|RAnsBitDecoder::~RAnsBitDecoder() { Clear(); }
_ZN5draco14RAnsBitDecoder13StartDecodingEPNS_13DecoderBufferE:
   27|  20.9k|bool RAnsBitDecoder::StartDecoding(DecoderBuffer *source_buffer) {
   28|  20.9k|  Clear();
   29|       |
   30|  20.9k|  if (!source_buffer->Decode(&prob_zero_)) {
  ------------------
  |  Branch (30:7): [True: 49, False: 20.9k]
  ------------------
   31|     49|    return false;
   32|     49|  }
   33|       |
   34|  20.9k|  uint32_t size_in_bytes;
   35|  20.9k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  20.9k|  if (source_buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  20.9k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (36:7): [True: 786, False: 20.1k]
  ------------------
   37|    786|    if (!source_buffer->Decode(&size_in_bytes)) {
  ------------------
  |  Branch (37:9): [True: 16, False: 770]
  ------------------
   38|     16|      return false;
   39|     16|    }
   40|       |
   41|    786|  } else
   42|  20.1k|#endif
   43|  20.1k|  {
   44|  20.1k|    if (!DecodeVarint(&size_in_bytes, source_buffer)) {
  ------------------
  |  Branch (44:9): [True: 17, False: 20.1k]
  ------------------
   45|     17|      return false;
   46|     17|    }
   47|  20.1k|  }
   48|       |
   49|  20.8k|  if (size_in_bytes > source_buffer->remaining_size()) {
  ------------------
  |  Branch (49:7): [True: 133, False: 20.7k]
  ------------------
   50|    133|    return false;
   51|    133|  }
   52|       |
   53|  20.7k|  if (ans_read_init(&ans_decoder_,
  ------------------
  |  Branch (53:7): [True: 59, False: 20.6k]
  ------------------
   54|  20.7k|                    reinterpret_cast<uint8_t *>(
   55|  20.7k|                        const_cast<char *>(source_buffer->data_head())),
   56|  20.7k|                    size_in_bytes) != 0) {
   57|     59|    return false;
   58|     59|  }
   59|  20.6k|  source_buffer->Advance(size_in_bytes);
   60|  20.6k|  return true;
   61|  20.7k|}
_ZN5draco14RAnsBitDecoder13DecodeNextBitEv:
   63|  10.3G|bool RAnsBitDecoder::DecodeNextBit() {
   64|  10.3G|  const uint8_t bit = rabs_read(&ans_decoder_, prob_zero_);
  ------------------
  |  |  246|  10.3G|#define rabs_read rabs_desc_read
  ------------------
   65|  10.3G|  return bit > 0;
   66|  10.3G|}
_ZN5draco14RAnsBitDecoder28DecodeLeastSignificantBits32EiPj:
   68|  2.14M|void RAnsBitDecoder::DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   69|  2.14M|  DRACO_DCHECK_EQ(true, nbits <= 32);
   70|  2.14M|  DRACO_DCHECK_EQ(true, nbits > 0);
   71|       |
   72|  2.14M|  uint32_t result = 0;
   73|  8.63M|  while (nbits) {
  ------------------
  |  Branch (73:10): [True: 6.48M, False: 2.14M]
  ------------------
   74|  6.48M|    result = (result << 1) + DecodeNextBit();
   75|  6.48M|    --nbits;
   76|  6.48M|  }
   77|  2.14M|  *value = result;
   78|  2.14M|}
_ZN5draco14RAnsBitDecoder5ClearEv:
   80|  50.5k|void RAnsBitDecoder::Clear() { ans_read_end(&ans_decoder_); }

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

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

_ZN5draco23CreatePointCloudDecoderEa:
   33|  1.40k|    int8_t method) {
   34|  1.40k|  if (method == POINT_CLOUD_SEQUENTIAL_ENCODING) {
  ------------------
  |  Branch (34:7): [True: 82, False: 1.32k]
  ------------------
   35|     82|    return std::unique_ptr<PointCloudDecoder>(
   36|     82|        new PointCloudSequentialDecoder());
   37|  1.32k|  } else if (method == POINT_CLOUD_KD_TREE_ENCODING) {
  ------------------
  |  Branch (37:14): [True: 1.32k, False: 0]
  ------------------
   38|  1.32k|    return std::unique_ptr<PointCloudDecoder>(new PointCloudKdTreeDecoder());
   39|  1.32k|  }
   40|      0|  return Status(Status::DRACO_ERROR, "Unsupported encoding method.");
   41|  1.40k|}
_ZN5draco17CreateMeshDecoderEh:
   45|  6.77k|StatusOr<std::unique_ptr<MeshDecoder>> CreateMeshDecoder(uint8_t method) {
   46|  6.77k|  if (method == MESH_SEQUENTIAL_ENCODING) {
  ------------------
  |  Branch (46:7): [True: 1.37k, False: 5.39k]
  ------------------
   47|  1.37k|    return std::unique_ptr<MeshDecoder>(new MeshSequentialDecoder());
   48|  5.39k|  } else if (method == MESH_EDGEBREAKER_ENCODING) {
  ------------------
  |  Branch (48:14): [True: 5.39k, False: 0]
  ------------------
   49|  5.39k|    return std::unique_ptr<MeshDecoder>(new MeshEdgebreakerDecoder());
   50|  5.39k|  }
   51|      0|  return Status(Status::DRACO_ERROR, "Unsupported encoding method.");
   52|  6.77k|}
_ZN5draco7Decoder22GetEncodedGeometryTypeEPNS_13DecoderBufferE:
   56|  8.18k|    DecoderBuffer *in_buffer) {
   57|  8.18k|  DecoderBuffer temp_buffer(*in_buffer);
   58|  8.18k|  DracoHeader header;
   59|  8.18k|  DRACO_RETURN_IF_ERROR(PointCloudDecoder::DecodeHeader(&temp_buffer, &header));
  ------------------
  |  |   74|  8.18k|  {                                                   \
  |  |   75|  8.18k|    const draco::Status _local_status = (expression); \
  |  |   76|  8.18k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 4, False: 8.17k]
  |  |  ------------------
  |  |   77|      4|      return _local_status;                           \
  |  |   78|      4|    }                                                 \
  |  |   79|  8.18k|  }
  ------------------
   60|  8.17k|  if (header.encoder_type >= NUM_ENCODED_GEOMETRY_TYPES) {
  ------------------
  |  Branch (60:7): [True: 0, False: 8.17k]
  ------------------
   61|      0|    return Status(Status::DRACO_ERROR, "Unsupported geometry type.");
   62|      0|  }
   63|  8.17k|  return static_cast<EncodedGeometryType>(header.encoder_type);
   64|  8.17k|}
_ZN5draco7Decoder26DecodePointCloudFromBufferEPNS_13DecoderBufferE:
   67|  8.18k|    DecoderBuffer *in_buffer) {
   68|  8.18k|  DRACO_ASSIGN_OR_RETURN(EncodedGeometryType type,
  ------------------
  |  |   66|  8.18k|  DRACO_ASSIGN_OR_RETURN_IMPL_(DRACO_MACROS_IMPL_CONCAT_(_statusor, __LINE__), \
  |  |  ------------------
  |  |  |  |   71|  8.18k|  auto statusor = (expression);                                             \
  |  |  |  |   72|  8.18k|  if (!statusor.ok()) {                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (72:7): [True: 4, False: 8.17k]
  |  |  |  |  ------------------
  |  |  |  |   73|      4|    auto _status = std::move(statusor.status());                            \
  |  |  |  |   74|      4|    (void)_status; /* error_expression may not use it */                    \
  |  |  |  |   75|      4|    return error_expr;                                                      \
  |  |  |  |   76|      4|  }                                                                         \
  |  |  |  |   77|  8.18k|  lhs = std::move(statusor).value();
  |  |  ------------------
  |  |   67|  8.17k|                               lhs, expression, _status)
  ------------------
   69|  8.17k|                         GetEncodedGeometryType(in_buffer))
   70|  8.17k|  if (type == POINT_CLOUD) {
  ------------------
  |  Branch (70:7): [True: 1.40k, False: 6.77k]
  ------------------
   71|  1.40k|#ifdef DRACO_POINT_CLOUD_COMPRESSION_SUPPORTED
   72|  1.40k|    std::unique_ptr<PointCloud> point_cloud(new PointCloud());
   73|  1.40k|    DRACO_RETURN_IF_ERROR(DecodeBufferToGeometry(in_buffer, point_cloud.get()))
  ------------------
  |  |   74|  1.40k|  {                                                   \
  |  |   75|  1.40k|    const draco::Status _local_status = (expression); \
  |  |   76|  1.40k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 1.35k, False: 53]
  |  |  ------------------
  |  |   77|  1.35k|      return _local_status;                           \
  |  |   78|  1.35k|    }                                                 \
  |  |   79|  1.40k|  }
  ------------------
   74|     53|    return std::move(point_cloud);
   75|  1.40k|#endif
   76|  6.77k|  } else if (type == TRIANGULAR_MESH) {
  ------------------
  |  Branch (76:14): [True: 6.77k, False: 0]
  ------------------
   77|  6.77k|#ifdef DRACO_MESH_COMPRESSION_SUPPORTED
   78|  6.77k|    std::unique_ptr<Mesh> mesh(new Mesh());
   79|  6.77k|    DRACO_RETURN_IF_ERROR(DecodeBufferToGeometry(in_buffer, mesh.get()))
  ------------------
  |  |   74|  6.77k|  {                                                   \
  |  |   75|  6.77k|    const draco::Status _local_status = (expression); \
  |  |   76|  6.77k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 6.08k, False: 683]
  |  |  ------------------
  |  |   77|  6.08k|      return _local_status;                           \
  |  |   78|  6.08k|    }                                                 \
  |  |   79|  6.77k|  }
  ------------------
   80|    683|    return static_cast<std::unique_ptr<PointCloud>>(std::move(mesh));
   81|  6.77k|#endif
   82|  6.77k|  }
   83|      0|  return Status(Status::DRACO_ERROR, "Unsupported geometry type.");
   84|  8.17k|}
_ZN5draco7Decoder22DecodeBufferToGeometryEPNS_13DecoderBufferEPNS_10PointCloudE:
   94|  1.40k|                                       PointCloud *out_geometry) {
   95|  1.40k|#ifdef DRACO_POINT_CLOUD_COMPRESSION_SUPPORTED
   96|  1.40k|  DecoderBuffer temp_buffer(*in_buffer);
   97|  1.40k|  DracoHeader header;
   98|  1.40k|  DRACO_RETURN_IF_ERROR(PointCloudDecoder::DecodeHeader(&temp_buffer, &header))
  ------------------
  |  |   74|  1.40k|  {                                                   \
  |  |   75|  1.40k|    const draco::Status _local_status = (expression); \
  |  |   76|  1.40k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 0, False: 1.40k]
  |  |  ------------------
  |  |   77|      0|      return _local_status;                           \
  |  |   78|      0|    }                                                 \
  |  |   79|  1.40k|  }
  ------------------
   99|  1.40k|  if (header.encoder_type != POINT_CLOUD) {
  ------------------
  |  Branch (99:7): [True: 0, False: 1.40k]
  ------------------
  100|      0|    return Status(Status::DRACO_ERROR, "Input is not a point cloud.");
  101|      0|  }
  102|  2.81k|  DRACO_ASSIGN_OR_RETURN(std::unique_ptr<PointCloudDecoder> decoder,
  ------------------
  |  |   66|  1.40k|  DRACO_ASSIGN_OR_RETURN_IMPL_(DRACO_MACROS_IMPL_CONCAT_(_statusor, __LINE__), \
  |  |  ------------------
  |  |  |  |   71|  1.40k|  auto statusor = (expression);                                             \
  |  |  |  |   72|  1.40k|  if (!statusor.ok()) {                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (72:7): [True: 0, False: 1.40k]
  |  |  |  |  ------------------
  |  |  |  |   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|  1.40k|  lhs = std::move(statusor).value();
  |  |  ------------------
  |  |   67|  1.40k|                               lhs, expression, _status)
  ------------------
  103|  2.81k|                         CreatePointCloudDecoder(header.encoder_method))
  104|       |
  105|  2.81k|  DRACO_RETURN_IF_ERROR(decoder->Decode(options_, in_buffer, out_geometry))
  ------------------
  |  |   74|  1.40k|  {                                                   \
  |  |   75|  1.40k|    const draco::Status _local_status = (expression); \
  |  |   76|  1.40k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 1.35k, False: 53]
  |  |  ------------------
  |  |   77|  1.35k|      return _local_status;                           \
  |  |   78|  1.35k|    }                                                 \
  |  |   79|  1.40k|  }
  ------------------
  106|     53|  return OkStatus();
  107|       |#else
  108|       |  return Status(Status::DRACO_ERROR, "Unsupported geometry type.");
  109|       |#endif
  110|  2.81k|}
_ZN5draco7Decoder22DecodeBufferToGeometryEPNS_13DecoderBufferEPNS_4MeshE:
  113|  6.77k|                                       Mesh *out_geometry) {
  114|  6.77k|#ifdef DRACO_MESH_COMPRESSION_SUPPORTED
  115|  6.77k|  DecoderBuffer temp_buffer(*in_buffer);
  116|  6.77k|  DracoHeader header;
  117|  6.77k|  DRACO_RETURN_IF_ERROR(PointCloudDecoder::DecodeHeader(&temp_buffer, &header))
  ------------------
  |  |   74|  6.77k|  {                                                   \
  |  |   75|  6.77k|    const draco::Status _local_status = (expression); \
  |  |   76|  6.77k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 0, False: 6.77k]
  |  |  ------------------
  |  |   77|      0|      return _local_status;                           \
  |  |   78|      0|    }                                                 \
  |  |   79|  6.77k|  }
  ------------------
  118|  6.77k|  if (header.encoder_type != TRIANGULAR_MESH) {
  ------------------
  |  Branch (118:7): [True: 0, False: 6.77k]
  ------------------
  119|      0|    return Status(Status::DRACO_ERROR, "Input is not a mesh.");
  120|      0|  }
  121|  13.5k|  DRACO_ASSIGN_OR_RETURN(std::unique_ptr<MeshDecoder> decoder,
  ------------------
  |  |   66|  6.77k|  DRACO_ASSIGN_OR_RETURN_IMPL_(DRACO_MACROS_IMPL_CONCAT_(_statusor, __LINE__), \
  |  |  ------------------
  |  |  |  |   71|  6.77k|  auto statusor = (expression);                                             \
  |  |  |  |   72|  6.77k|  if (!statusor.ok()) {                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (72:7): [True: 0, False: 6.77k]
  |  |  |  |  ------------------
  |  |  |  |   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|  6.77k|  lhs = std::move(statusor).value();
  |  |  ------------------
  |  |   67|  6.77k|                               lhs, expression, _status)
  ------------------
  122|  13.5k|                         CreateMeshDecoder(header.encoder_method))
  123|       |
  124|  13.5k|  DRACO_RETURN_IF_ERROR(decoder->Decode(options_, in_buffer, out_geometry))
  ------------------
  |  |   74|  6.77k|  {                                                   \
  |  |   75|  6.77k|    const draco::Status _local_status = (expression); \
  |  |   76|  6.77k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 6.08k, False: 683]
  |  |  ------------------
  |  |   77|  6.08k|      return _local_status;                           \
  |  |   78|  6.08k|    }                                                 \
  |  |   79|  6.77k|  }
  ------------------
  125|    683|  return OkStatus();
  126|       |#else
  127|       |  return Status(Status::DRACO_ERROR, "Unsupported geometry type.");
  128|       |#endif
  129|  13.5k|}

_ZN5draco10AnsDecoderC2Ev:
   56|  34.6k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  20.7k|                                const uint8_t *const buf, int offset) {
  301|  20.7k|  unsigned x;
  302|  20.7k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 38, False: 20.7k]
  ------------------
  303|     38|    return 1;
  304|     38|  }
  305|  20.7k|  ans->buf = buf;
  306|  20.7k|  x = buf[offset - 1] >> 6;
  307|  20.7k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 18.3k, False: 2.34k]
  ------------------
  308|  18.3k|    ans->buf_offset = offset - 1;
  309|  18.3k|    ans->state = buf[offset - 1] & 0x3F;
  310|  18.3k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.08k, False: 258]
  ------------------
  311|  2.08k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 2, False: 2.08k]
  ------------------
  312|      2|      return 1;
  313|      2|    }
  314|  2.08k|    ans->buf_offset = offset - 2;
  315|  2.08k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.08k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 246, False: 12]
  ------------------
  317|    246|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 3, False: 243]
  ------------------
  318|      3|      return 1;
  319|      3|    }
  320|    243|    ans->buf_offset = offset - 3;
  321|    243|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    243|  } else {
  323|     12|    return 1;
  324|     12|  }
  325|  20.6k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  20.6k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  20.6k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  20.6k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  20.6k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 4, False: 20.6k]
  ------------------
  327|      4|    return 1;
  328|      4|  }
  329|  20.6k|  return 0;
  330|  20.6k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.08k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.08k|  uint32_t val;
   69|  2.08k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.08k|  val = mem[1] << 8;
   72|  2.08k|  val |= mem[0];
   73|  2.08k|  return val;
   74|  2.08k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    243|static uint32_t mem_get_le24(const void *vmem) {
   77|    243|  uint32_t val;
   78|    243|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    243|  val = mem[2] << 16;
   81|    243|  val |= mem[1] << 8;
   82|    243|  val |= mem[0];
   83|    243|  return val;
   84|    243|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  10.3G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  10.3G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  10.3G|  unsigned quot, rem, x, xn;
  172|  10.3G|#endif
  173|  10.3G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  10.3G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  10.3G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  20.6G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 9.63G, False: 704M]
  |  Branch (174:40): [True: 58.0k, False: 9.63G]
  ------------------
  175|  58.0k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  58.0k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  58.0k|  }
  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|  10.3G|  x = ans->state;
  184|  10.3G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  10.3G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  10.3G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  10.3G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  10.3G|  xn = quot * p;
  187|  10.3G|  val = rem < p;
  188|  10.3G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  20.6G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 9.63G, False: 701M]
  |  |  ------------------
  ------------------
  189|  9.63G|    ans->state = xn + rem;
  190|  9.63G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   701M|    ans->state = x - xn - p;
  193|   701M|  }
  194|  10.3G|#endif
  195|  10.3G|  return val;
  196|  10.3G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  50.5k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  50.5k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  50.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  50.5k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  2.78k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  484|  1.55k|                                       uint32_t num_symbols) {
  485|  1.55k|    lut_table_.resize(rans_precision);
  486|  1.55k|    probability_table_.resize(num_symbols);
  487|  1.55k|    uint32_t cum_prob = 0;
  488|  1.55k|    uint32_t act_prob = 0;
  489|  12.1k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 10.7k, False: 1.44k]
  ------------------
  490|  10.7k|      probability_table_[i].prob = token_probs[i];
  491|  10.7k|      probability_table_[i].cum_prob = cum_prob;
  492|  10.7k|      cum_prob += token_probs[i];
  493|  10.7k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 112, False: 10.6k]
  ------------------
  494|    112|        return false;
  495|    112|      }
  496|  5.42M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 5.41M, False: 10.6k]
  ------------------
  497|  5.41M|        lut_table_[j] = i;
  498|  5.41M|      }
  499|  10.6k|      act_prob = cum_prob;
  500|  10.6k|    }
  501|  1.44k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 144, False: 1.29k]
  ------------------
  502|    144|      return false;
  503|    144|    }
  504|  1.29k|    return true;
  505|  1.44k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.20k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.20k|    unsigned x;
  423|  1.20k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 85, False: 1.12k]
  ------------------
  424|     85|      return 1;
  425|     85|    }
  426|  1.12k|    ans_.buf = buf;
  427|  1.12k|    x = buf[offset - 1] >> 6;
  428|  1.12k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 637, False: 486]
  ------------------
  429|    637|      ans_.buf_offset = offset - 1;
  430|    637|      ans_.state = buf[offset - 1] & 0x3F;
  431|    637|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 195, False: 291]
  ------------------
  432|    195|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 46, False: 149]
  ------------------
  433|     46|        return 1;
  434|     46|      }
  435|    149|      ans_.buf_offset = offset - 2;
  436|    149|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    291|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 204, False: 87]
  ------------------
  438|    204|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 60, False: 144]
  ------------------
  439|     60|        return 1;
  440|     60|      }
  441|    144|      ans_.buf_offset = offset - 3;
  442|    144|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    144|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 87, False: 0]
  ------------------
  444|     87|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 15, False: 72]
  ------------------
  445|     15|        return 1;
  446|     15|      }
  447|     72|      ans_.buf_offset = offset - 4;
  448|     72|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     72|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|  1.00k|    ans_.state += l_rans_base;
  453|  1.00k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.00k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 72, False: 930]
  ------------------
  454|     72|      return 1;
  455|     72|    }
  456|    930|    return 0;
  457|  1.00k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    257|static uint32_t mem_get_le16(const void *vmem) {
   68|    257|  uint32_t val;
   69|    257|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    257|  val = mem[1] << 8;
   72|    257|  val |= mem[0];
   73|    257|  return val;
   74|    257|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    208|static uint32_t mem_get_le24(const void *vmem) {
   77|    208|  uint32_t val;
   78|    208|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    208|  val = mem[2] << 16;
   81|    208|  val |= mem[1] << 8;
   82|    208|  val |= mem[0];
   83|    208|  return val;
   84|    208|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    192|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    192|  uint32_t val;
   88|    192|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    192|  val = mem[3] << 24;
   91|    192|  val |= mem[2] << 16;
   92|    192|  val |= mem[1] << 8;
   93|    192|  val |= mem[0];
   94|    192|  return val;
   95|    192|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  465|   391M|  inline int rans_read() {
  466|   391M|    unsigned rem;
  467|   391M|    unsigned quo;
  468|   391M|    struct rans_dec_sym sym;
  469|   391M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 369M, False: 22.3M]
  |  Branch (469:40): [True: 13.4k, False: 369M]
  ------------------
  470|  13.4k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  13.4k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  13.4k|    }
  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|   391M|    quo = ans_.state / rans_precision;
  475|   391M|    rem = ans_.state % rans_precision;
  476|   391M|    fetch_sym(&sym, rem);
  477|   391M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   391M|    return sym.val;
  479|   391M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  508|   391M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   391M|    uint32_t symbol = lut_table_[rem];
  510|   391M|    out->val = symbol;
  511|   391M|    out->prob = probability_table_[symbol].prob;
  512|   391M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   391M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  459|    892|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    231|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  484|    152|                                       uint32_t num_symbols) {
  485|    152|    lut_table_.resize(rans_precision);
  486|    152|    probability_table_.resize(num_symbols);
  487|    152|    uint32_t cum_prob = 0;
  488|    152|    uint32_t act_prob = 0;
  489|  12.0k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 11.9k, False: 131]
  ------------------
  490|  11.9k|      probability_table_[i].prob = token_probs[i];
  491|  11.9k|      probability_table_[i].cum_prob = cum_prob;
  492|  11.9k|      cum_prob += token_probs[i];
  493|  11.9k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 21, False: 11.9k]
  ------------------
  494|     21|        return false;
  495|     21|      }
  496|  1.03M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 1.02M, False: 11.9k]
  ------------------
  497|  1.02M|        lut_table_[j] = i;
  498|  1.02M|      }
  499|  11.9k|      act_prob = cum_prob;
  500|  11.9k|    }
  501|    131|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 13, False: 118]
  ------------------
  502|     13|      return false;
  503|     13|    }
  504|    118|    return true;
  505|    131|  }
_ZN5draco11RAnsDecoderILi13EE9read_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: 4, False: 90]
  ------------------
  424|      4|      return 1;
  425|      4|    }
  426|     90|    ans_.buf = buf;
  427|     90|    x = buf[offset - 1] >> 6;
  428|     90|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 39, False: 51]
  ------------------
  429|     39|      ans_.buf_offset = offset - 1;
  430|     39|      ans_.state = buf[offset - 1] & 0x3F;
  431|     51|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 24, False: 27]
  ------------------
  432|     24|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 12, False: 12]
  ------------------
  433|     12|        return 1;
  434|     12|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     27|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 16, False: 11]
  ------------------
  438|     16|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 9, False: 7]
  ------------------
  439|      9|        return 1;
  440|      9|      }
  441|      7|      ans_.buf_offset = offset - 3;
  442|      7|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     11|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 11, False: 0]
  ------------------
  444|     11|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 1, False: 10]
  ------------------
  445|      1|        return 1;
  446|      1|      }
  447|     10|      ans_.buf_offset = offset - 4;
  448|     10|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     10|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     68|    ans_.state += l_rans_base;
  453|     68|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     68|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 9, False: 59]
  ------------------
  454|      9|      return 1;
  455|      9|    }
  456|     59|    return 0;
  457|     68|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  465|   110k|  inline int rans_read() {
  466|   110k|    unsigned rem;
  467|   110k|    unsigned quo;
  468|   110k|    struct rans_dec_sym sym;
  469|   111k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 80.1k, False: 31.3k]
  |  Branch (469:40): [True: 950, False: 79.1k]
  ------------------
  470|    950|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    950|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    950|    }
  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|   110k|    quo = ans_.state / rans_precision;
  475|   110k|    rem = ans_.state % rans_precision;
  476|   110k|    fetch_sym(&sym, rem);
  477|   110k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   110k|    return sym.val;
  479|   110k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  508|   110k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   110k|    uint32_t symbol = lut_table_[rem];
  510|   110k|    out->val = symbol;
  511|   110k|    out->prob = probability_table_[symbol].prob;
  512|   110k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   110k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  459|     59|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    233|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  484|    151|                                       uint32_t num_symbols) {
  485|    151|    lut_table_.resize(rans_precision);
  486|    151|    probability_table_.resize(num_symbols);
  487|    151|    uint32_t cum_prob = 0;
  488|    151|    uint32_t act_prob = 0;
  489|  7.37k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 7.24k, False: 137]
  ------------------
  490|  7.24k|      probability_table_[i].prob = token_probs[i];
  491|  7.24k|      probability_table_[i].cum_prob = cum_prob;
  492|  7.24k|      cum_prob += token_probs[i];
  493|  7.24k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 14, False: 7.22k]
  ------------------
  494|     14|        return false;
  495|     14|      }
  496|  3.63M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 3.62M, False: 7.22k]
  ------------------
  497|  3.62M|        lut_table_[j] = i;
  498|  3.62M|      }
  499|  7.22k|      act_prob = cum_prob;
  500|  7.22k|    }
  501|    137|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 36, False: 101]
  ------------------
  502|     36|      return false;
  503|     36|    }
  504|    101|    return true;
  505|    137|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     76|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     76|    unsigned x;
  423|     76|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 7, False: 69]
  ------------------
  424|      7|      return 1;
  425|      7|    }
  426|     69|    ans_.buf = buf;
  427|     69|    x = buf[offset - 1] >> 6;
  428|     69|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 21, False: 48]
  ------------------
  429|     21|      ans_.buf_offset = offset - 1;
  430|     21|      ans_.state = buf[offset - 1] & 0x3F;
  431|     48|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 20, False: 28]
  ------------------
  432|     20|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 11]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     11|      ans_.buf_offset = offset - 2;
  436|     11|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     28|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 19, False: 9]
  ------------------
  438|     19|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 7, False: 12]
  ------------------
  439|      7|        return 1;
  440|      7|      }
  441|     12|      ans_.buf_offset = offset - 3;
  442|     12|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     12|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 9, False: 0]
  ------------------
  444|      9|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 1, False: 8]
  ------------------
  445|      1|        return 1;
  446|      1|      }
  447|      8|      ans_.buf_offset = offset - 4;
  448|      8|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|      8|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     52|    ans_.state += l_rans_base;
  453|     52|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     52|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 8, False: 44]
  ------------------
  454|      8|      return 1;
  455|      8|    }
  456|     44|    return 0;
  457|     52|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  465|   330k|  inline int rans_read() {
  466|   330k|    unsigned rem;
  467|   330k|    unsigned quo;
  468|   330k|    struct rans_dec_sym sym;
  469|   334k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 240k, False: 93.3k]
  |  Branch (469:40): [True: 3.80k, False: 237k]
  ------------------
  470|  3.80k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  3.80k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  3.80k|    }
  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|   330k|    quo = ans_.state / rans_precision;
  475|   330k|    rem = ans_.state % rans_precision;
  476|   330k|    fetch_sym(&sym, rem);
  477|   330k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   330k|    return sym.val;
  479|   330k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  508|   330k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   330k|    uint32_t symbol = lut_table_[rem];
  510|   330k|    out->val = symbol;
  511|   330k|    out->prob = probability_table_[symbol].prob;
  512|   330k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   330k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  459|     44|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    188|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  484|     94|                                       uint32_t num_symbols) {
  485|     94|    lut_table_.resize(rans_precision);
  486|     94|    probability_table_.resize(num_symbols);
  487|     94|    uint32_t cum_prob = 0;
  488|     94|    uint32_t act_prob = 0;
  489|  5.54k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 5.46k, False: 80]
  ------------------
  490|  5.46k|      probability_table_[i].prob = token_probs[i];
  491|  5.46k|      probability_table_[i].cum_prob = cum_prob;
  492|  5.46k|      cum_prob += token_probs[i];
  493|  5.46k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 14, False: 5.45k]
  ------------------
  494|     14|        return false;
  495|     14|      }
  496|  4.89M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 4.88M, False: 5.45k]
  ------------------
  497|  4.88M|        lut_table_[j] = i;
  498|  4.88M|      }
  499|  5.45k|      act_prob = cum_prob;
  500|  5.45k|    }
  501|     80|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 18, False: 62]
  ------------------
  502|     18|      return false;
  503|     18|    }
  504|     62|    return true;
  505|     80|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     34|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     34|    unsigned x;
  423|     34|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 2, False: 32]
  ------------------
  424|      2|      return 1;
  425|      2|    }
  426|     32|    ans_.buf = buf;
  427|     32|    x = buf[offset - 1] >> 6;
  428|     32|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 17, False: 15]
  ------------------
  429|     17|      ans_.buf_offset = offset - 1;
  430|     17|      ans_.state = buf[offset - 1] & 0x3F;
  431|     17|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 3, False: 12]
  ------------------
  432|      3|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 3]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     12|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 4, False: 8]
  ------------------
  438|      4|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 3]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|      3|      ans_.buf_offset = offset - 3;
  442|      3|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      8|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 8, False: 0]
  ------------------
  444|      8|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 7, False: 1]
  ------------------
  445|      7|        return 1;
  446|      7|      }
  447|      1|      ans_.buf_offset = offset - 4;
  448|      1|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|      1|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     24|    ans_.state += l_rans_base;
  453|     24|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     24|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 1, False: 23]
  ------------------
  454|      1|      return 1;
  455|      1|    }
  456|     23|    return 0;
  457|     24|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  465|   201k|  inline int rans_read() {
  466|   201k|    unsigned rem;
  467|   201k|    unsigned quo;
  468|   201k|    struct rans_dec_sym sym;
  469|   202k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 110k, False: 91.4k]
  |  Branch (469:40): [True: 425, False: 110k]
  ------------------
  470|    425|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    425|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    425|    }
  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|   201k|    quo = ans_.state / rans_precision;
  475|   201k|    rem = ans_.state % rans_precision;
  476|   201k|    fetch_sym(&sym, rem);
  477|   201k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   201k|    return sym.val;
  479|   201k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  508|   201k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   201k|    uint32_t symbol = lut_table_[rem];
  510|   201k|    out->val = symbol;
  511|   201k|    out->prob = probability_table_[symbol].prob;
  512|   201k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   201k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  459|     23|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    210|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  484|    136|                                       uint32_t num_symbols) {
  485|    136|    lut_table_.resize(rans_precision);
  486|    136|    probability_table_.resize(num_symbols);
  487|    136|    uint32_t cum_prob = 0;
  488|    136|    uint32_t act_prob = 0;
  489|  5.11k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 4.99k, False: 122]
  ------------------
  490|  4.99k|      probability_table_[i].prob = token_probs[i];
  491|  4.99k|      probability_table_[i].cum_prob = cum_prob;
  492|  4.99k|      cum_prob += token_probs[i];
  493|  4.99k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 14, False: 4.97k]
  ------------------
  494|     14|        return false;
  495|     14|      }
  496|  28.0M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 28.0M, False: 4.97k]
  ------------------
  497|  28.0M|        lut_table_[j] = i;
  498|  28.0M|      }
  499|  4.97k|      act_prob = cum_prob;
  500|  4.97k|    }
  501|    122|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 24, False: 98]
  ------------------
  502|     24|      return false;
  503|     24|    }
  504|     98|    return true;
  505|    122|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     63|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     63|    unsigned x;
  423|     63|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 10, False: 53]
  ------------------
  424|     10|      return 1;
  425|     10|    }
  426|     53|    ans_.buf = buf;
  427|     53|    x = buf[offset - 1] >> 6;
  428|     53|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 19, False: 34]
  ------------------
  429|     19|      ans_.buf_offset = offset - 1;
  430|     19|      ans_.state = buf[offset - 1] & 0x3F;
  431|     34|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 15, False: 19]
  ------------------
  432|     15|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 5, False: 10]
  ------------------
  433|      5|        return 1;
  434|      5|      }
  435|     10|      ans_.buf_offset = offset - 2;
  436|     10|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     19|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 8, False: 11]
  ------------------
  438|      8|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 8]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      8|      ans_.buf_offset = offset - 3;
  442|      8|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     11|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 11, False: 0]
  ------------------
  444|     11|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 10, False: 1]
  ------------------
  445|     10|        return 1;
  446|     10|      }
  447|      1|      ans_.buf_offset = offset - 4;
  448|      1|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|      1|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     38|    ans_.state += l_rans_base;
  453|     38|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     38|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 1, False: 37]
  ------------------
  454|      1|      return 1;
  455|      1|    }
  456|     37|    return 0;
  457|     38|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  465|   128k|  inline int rans_read() {
  466|   128k|    unsigned rem;
  467|   128k|    unsigned quo;
  468|   128k|    struct rans_dec_sym sym;
  469|   129k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 124k, False: 4.22k]
  |  Branch (469:40): [True: 297, False: 124k]
  ------------------
  470|    297|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    297|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    297|    }
  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|   128k|    quo = ans_.state / rans_precision;
  475|   128k|    rem = ans_.state % rans_precision;
  476|   128k|    fetch_sym(&sym, rem);
  477|   128k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   128k|    return sym.val;
  479|   128k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  508|   128k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   128k|    uint32_t symbol = lut_table_[rem];
  510|   128k|    out->val = symbol;
  511|   128k|    out->prob = probability_table_[symbol].prob;
  512|   128k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   128k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  459|     37|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    189|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  484|    113|                                       uint32_t num_symbols) {
  485|    113|    lut_table_.resize(rans_precision);
  486|    113|    probability_table_.resize(num_symbols);
  487|    113|    uint32_t cum_prob = 0;
  488|    113|    uint32_t act_prob = 0;
  489|  7.39k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 7.29k, False: 98]
  ------------------
  490|  7.29k|      probability_table_[i].prob = token_probs[i];
  491|  7.29k|      probability_table_[i].cum_prob = cum_prob;
  492|  7.29k|      cum_prob += token_probs[i];
  493|  7.29k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 15, False: 7.28k]
  ------------------
  494|     15|        return false;
  495|     15|      }
  496|  39.9M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 39.9M, False: 7.28k]
  ------------------
  497|  39.9M|        lut_table_[j] = i;
  498|  39.9M|      }
  499|  7.28k|      act_prob = cum_prob;
  500|  7.28k|    }
  501|     98|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 31, False: 67]
  ------------------
  502|     31|      return false;
  503|     31|    }
  504|     67|    return true;
  505|     98|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     49|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     49|    unsigned x;
  423|     49|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 49]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     49|    ans_.buf = buf;
  427|     49|    x = buf[offset - 1] >> 6;
  428|     49|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 18, False: 31]
  ------------------
  429|     18|      ans_.buf_offset = offset - 1;
  430|     18|      ans_.state = buf[offset - 1] & 0x3F;
  431|     31|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 9, False: 22]
  ------------------
  432|      9|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 8]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      8|      ans_.buf_offset = offset - 2;
  436|      8|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     22|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 14, False: 8]
  ------------------
  438|     14|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 9, False: 5]
  ------------------
  439|      9|        return 1;
  440|      9|      }
  441|      5|      ans_.buf_offset = offset - 3;
  442|      5|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      8|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 8, False: 0]
  ------------------
  444|      8|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 0, False: 8]
  ------------------
  445|      0|        return 1;
  446|      0|      }
  447|      8|      ans_.buf_offset = offset - 4;
  448|      8|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|      8|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     39|    ans_.state += l_rans_base;
  453|     39|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     39|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 3, False: 36]
  ------------------
  454|      3|      return 1;
  455|      3|    }
  456|     36|    return 0;
  457|     39|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  465|   191k|  inline int rans_read() {
  466|   191k|    unsigned rem;
  467|   191k|    unsigned quo;
  468|   191k|    struct rans_dec_sym sym;
  469|   191k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 68.2k, False: 123k]
  |  Branch (469:40): [True: 223, False: 68.0k]
  ------------------
  470|    223|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    223|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    223|    }
  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|   191k|    quo = ans_.state / rans_precision;
  475|   191k|    rem = ans_.state % rans_precision;
  476|   191k|    fetch_sym(&sym, rem);
  477|   191k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   191k|    return sym.val;
  479|   191k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  508|   191k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   191k|    uint32_t symbol = lut_table_[rem];
  510|   191k|    out->val = symbol;
  511|   191k|    out->prob = probability_table_[symbol].prob;
  512|   191k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   191k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  459|     36|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.24k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  484|    793|                                       uint32_t num_symbols) {
  485|    793|    lut_table_.resize(rans_precision);
  486|    793|    probability_table_.resize(num_symbols);
  487|    793|    uint32_t cum_prob = 0;
  488|    793|    uint32_t act_prob = 0;
  489|  8.86k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 8.11k, False: 748]
  ------------------
  490|  8.11k|      probability_table_[i].prob = token_probs[i];
  491|  8.11k|      probability_table_[i].cum_prob = cum_prob;
  492|  8.11k|      cum_prob += token_probs[i];
  493|  8.11k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 45, False: 8.06k]
  ------------------
  494|     45|        return false;
  495|     45|      }
  496|   733M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 733M, False: 8.06k]
  ------------------
  497|   733M|        lut_table_[j] = i;
  498|   733M|      }
  499|  8.06k|      act_prob = cum_prob;
  500|  8.06k|    }
  501|    748|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 64, False: 684]
  ------------------
  502|     64|      return false;
  503|     64|    }
  504|    684|    return true;
  505|    748|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    373|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    373|    unsigned x;
  423|    373|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 32, False: 341]
  ------------------
  424|     32|      return 1;
  425|     32|    }
  426|    341|    ans_.buf = buf;
  427|    341|    x = buf[offset - 1] >> 6;
  428|    341|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 96, False: 245]
  ------------------
  429|     96|      ans_.buf_offset = offset - 1;
  430|     96|      ans_.state = buf[offset - 1] & 0x3F;
  431|    245|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 81, False: 164]
  ------------------
  432|     81|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 17, False: 64]
  ------------------
  433|     17|        return 1;
  434|     17|      }
  435|     64|      ans_.buf_offset = offset - 2;
  436|     64|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    164|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 57, False: 107]
  ------------------
  438|     57|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 28, False: 29]
  ------------------
  439|     28|        return 1;
  440|     28|      }
  441|     29|      ans_.buf_offset = offset - 3;
  442|     29|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    107|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 107, False: 0]
  ------------------
  444|    107|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 15, False: 92]
  ------------------
  445|     15|        return 1;
  446|     15|      }
  447|     92|      ans_.buf_offset = offset - 4;
  448|     92|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     92|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|    281|    ans_.state += l_rans_base;
  453|    281|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    281|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 28, False: 253]
  ------------------
  454|     28|      return 1;
  455|     28|    }
  456|    253|    return 0;
  457|    281|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  465|  25.2M|  inline int rans_read() {
  466|  25.2M|    unsigned rem;
  467|  25.2M|    unsigned quo;
  468|  25.2M|    struct rans_dec_sym sym;
  469|  25.2M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 19.8M, False: 5.43M]
  |  Branch (469:40): [True: 4.30k, False: 19.8M]
  ------------------
  470|  4.30k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.30k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  4.30k|    }
  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|  25.2M|    quo = ans_.state / rans_precision;
  475|  25.2M|    rem = ans_.state % rans_precision;
  476|  25.2M|    fetch_sym(&sym, rem);
  477|  25.2M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|  25.2M|    return sym.val;
  479|  25.2M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  508|  25.2M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|  25.2M|    uint32_t symbol = lut_table_[rem];
  510|  25.2M|    out->val = symbol;
  511|  25.2M|    out->prob = probability_table_[symbol].prob;
  512|  25.2M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|  25.2M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  459|    253|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    798|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    798|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    798|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 798]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    798|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    798|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    798|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 41, False: 757]
  ------------------
   67|     41|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 6, False: 35]
  ------------------
   68|      6|      return false;
   69|      6|    }
   70|       |
   71|     41|  } else
   72|    757|#endif
   73|    757|  {
   74|    757|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 34, False: 723]
  ------------------
   75|     34|      return false;
   76|     34|    }
   77|    757|  }
   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|    758|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 47, False: 711]
  ------------------
   83|     47|    return false;
   84|     47|  }
   85|    711|  probability_table_.resize(num_symbols_);
   86|    711|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 252, False: 459]
  ------------------
   87|    252|    return true;
   88|    252|  }
   89|       |  // Decode the table.
   90|  51.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 50.8k, False: 272]
  ------------------
   91|  50.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|  50.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 38, False: 50.8k]
  ------------------
   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|  50.8k|    const int token = prob_data & 3;
  102|  50.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 8.17k, False: 42.6k]
  ------------------
  103|  8.17k|      const uint32_t offset = prob_data >> 2;
  104|  8.17k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 121, False: 8.05k]
  ------------------
  105|    121|        return false;
  106|    121|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   245k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 236k, False: 8.05k]
  ------------------
  109|   236k|        probability_table_[i + j] = 0;
  110|   236k|      }
  111|  8.05k|      i += offset;
  112|  42.6k|    } else {
  113|  42.6k|      const int extra_bytes = token;
  114|  42.6k|      uint32_t prob = prob_data >> 2;
  115|  82.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 40.1k, False: 42.6k]
  ------------------
  116|  40.1k|        uint8_t eb;
  117|  40.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 40.1k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  40.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  40.1k|      }
  124|  42.6k|      probability_table_[i] = prob;
  125|  42.6k|    }
  126|  50.8k|  }
  127|    272|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 108, False: 164]
  ------------------
  128|    108|    return false;
  129|    108|  }
  130|    164|  return true;
  131|    272|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    330|    DecoderBuffer *buffer) {
  136|    330|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    330|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    330|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    330|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 310]
  ------------------
  140|     20|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 18]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     20|  } else
  145|    310|#endif
  146|    310|  {
  147|    310|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 300]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    310|  }
  151|    318|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 43, False: 275]
  ------------------
  152|     43|    return false;
  153|     43|  }
  154|    275|  const uint8_t *const data_head =
  155|    275|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    275|  buffer->Advance(bytes_encoded);
  158|    275|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 80, False: 195]
  ------------------
  159|     80|    return false;
  160|     80|  }
  161|    195|  return true;
  162|    275|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    287|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  6.08M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    157|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    157|  ans_.read_end();
  167|    157|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    365|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    365|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    365|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 365]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    365|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    365|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    365|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 336]
  ------------------
   67|     29|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 25]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     29|  } else
   72|    336|#endif
   73|    336|  {
   74|    336|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 328]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    336|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    353|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 29, False: 324]
  ------------------
   83|     29|    return false;
   84|     29|  }
   85|    324|  probability_table_.resize(num_symbols_);
   86|    324|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 22, False: 302]
  ------------------
   87|     22|    return true;
   88|     22|  }
   89|       |  // Decode the table.
   90|   346k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 345k, False: 228]
  ------------------
   91|   345k|    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|   345k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 24, False: 345k]
  ------------------
   95|     24|      return false;
   96|     24|    }
   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|   345k|    const int token = prob_data & 3;
  102|   345k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 157k, False: 187k]
  ------------------
  103|   157k|      const uint32_t offset = prob_data >> 2;
  104|   157k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 35, False: 157k]
  ------------------
  105|     35|        return false;
  106|     35|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  9.30M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 9.15M, False: 157k]
  ------------------
  109|  9.15M|        probability_table_[i + j] = 0;
  110|  9.15M|      }
  111|   157k|      i += offset;
  112|   187k|    } else {
  113|   187k|      const int extra_bytes = token;
  114|   187k|      uint32_t prob = prob_data >> 2;
  115|   233k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 45.4k, False: 187k]
  ------------------
  116|  45.4k|        uint8_t eb;
  117|  45.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 45.4k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  45.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  45.4k|      }
  124|   187k|      probability_table_[i] = prob;
  125|   187k|    }
  126|   345k|  }
  127|    228|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 67, False: 161]
  ------------------
  128|     67|    return false;
  129|     67|  }
  130|    161|  return true;
  131|    228|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    183|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    161|    DecoderBuffer *buffer) {
  136|    161|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    161|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    161|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    161|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 157]
  ------------------
  140|      4|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 4]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      4|  } else
  145|    157|#endif
  146|    157|  {
  147|    157|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 14, False: 143]
  ------------------
  148|     14|      return false;
  149|     14|    }
  150|    157|  }
  151|    147|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 11, False: 136]
  ------------------
  152|     11|    return false;
  153|     11|  }
  154|    136|  const uint8_t *const data_head =
  155|    136|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    136|  buffer->Advance(bytes_encoded);
  158|    136|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 24, False: 112]
  ------------------
  159|     24|    return false;
  160|     24|  }
  161|    112|  return true;
  162|    136|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|   241M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    112|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    112|  ans_.read_end();
  167|    112|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    285|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    285|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    285|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 285]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    285|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    285|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    285|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 23, False: 262]
  ------------------
   67|     23|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 23]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     23|  } else
   72|    262|#endif
   73|    262|  {
   74|    262|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 261]
  ------------------
   75|      1|      return false;
   76|      1|    }
   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|    284|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 273]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    273|  probability_table_.resize(num_symbols_);
   86|    273|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 267]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|  86.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 86.5k, False: 187]
  ------------------
   91|  86.5k|    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|  86.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 34, False: 86.4k]
  ------------------
   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|  86.4k|    const int token = prob_data & 3;
  102|  86.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 39.6k, False: 46.8k]
  ------------------
  103|  39.6k|      const uint32_t offset = prob_data >> 2;
  104|  39.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 39.6k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.16M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.12M, False: 39.6k]
  ------------------
  109|  1.12M|        probability_table_[i + j] = 0;
  110|  1.12M|      }
  111|  39.6k|      i += offset;
  112|  46.8k|    } else {
  113|  46.8k|      const int extra_bytes = token;
  114|  46.8k|      uint32_t prob = prob_data >> 2;
  115|  82.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 35.2k, False: 46.8k]
  ------------------
  116|  35.2k|        uint8_t eb;
  117|  35.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 35.2k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  35.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  35.2k|      }
  124|  46.8k|      probability_table_[i] = prob;
  125|  46.8k|    }
  126|  86.4k|  }
  127|    187|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 19, False: 168]
  ------------------
  128|     19|    return false;
  129|     19|  }
  130|    168|  return true;
  131|    187|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    174|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    168|    DecoderBuffer *buffer) {
  136|    168|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    168|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    168|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    168|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 17, False: 151]
  ------------------
  140|     17|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 17]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     17|  } else
  145|    151|#endif
  146|    151|  {
  147|    151|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 150]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    151|  }
  151|    167|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 23, False: 144]
  ------------------
  152|     23|    return false;
  153|     23|  }
  154|    144|  const uint8_t *const data_head =
  155|    144|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    144|  buffer->Advance(bytes_encoded);
  158|    144|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 110]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|    110|  return true;
  162|    144|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  71.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    110|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    110|  ans_.read_end();
  167|    110|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    303|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    303|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    303|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 303]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    303|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    303|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    303|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 32, False: 271]
  ------------------
   67|     32|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 32]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     32|  } else
   72|    271|#endif
   73|    271|  {
   74|    271|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 265]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    271|  }
   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: 14, False: 283]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    283|  probability_table_.resize(num_symbols_);
   86|    283|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 274]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  5.50k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 5.29k, False: 205]
  ------------------
   91|  5.29k|    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.29k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 39, False: 5.25k]
  ------------------
   95|     39|      return false;
   96|     39|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  5.25k|    const int token = prob_data & 3;
  102|  5.25k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.99k, False: 2.26k]
  ------------------
  103|  2.99k|      const uint32_t offset = prob_data >> 2;
  104|  2.99k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 2.97k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  98.4k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 95.5k, False: 2.97k]
  ------------------
  109|  95.5k|        probability_table_[i + j] = 0;
  110|  95.5k|      }
  111|  2.97k|      i += offset;
  112|  2.97k|    } else {
  113|  2.26k|      const int extra_bytes = token;
  114|  2.26k|      uint32_t prob = prob_data >> 2;
  115|  3.55k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.30k, False: 2.25k]
  ------------------
  116|  1.30k|        uint8_t eb;
  117|  1.30k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 1.29k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.29k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.29k|      }
  124|  2.25k|      probability_table_[i] = prob;
  125|  2.25k|    }
  126|  5.25k|  }
  127|    205|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 18, False: 187]
  ------------------
  128|     18|    return false;
  129|     18|  }
  130|    187|  return true;
  131|    205|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    196|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    187|    DecoderBuffer *buffer) {
  136|    187|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    187|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    187|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    187|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 23, False: 164]
  ------------------
  140|     23|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 22]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     23|  } else
  145|    164|#endif
  146|    164|  {
  147|    164|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 161]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    164|  }
  151|    183|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 35, False: 148]
  ------------------
  152|     35|    return false;
  153|     35|  }
  154|    148|  const uint8_t *const data_head =
  155|    148|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    148|  buffer->Advance(bytes_encoded);
  158|    148|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 24, False: 124]
  ------------------
  159|     24|    return false;
  160|     24|  }
  161|    124|  return true;
  162|    148|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  21.4M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    124|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    124|  ans_.read_end();
  167|    124|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    277|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    277|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    277|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 277]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    277|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    277|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    277|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 262]
  ------------------
   67|     15|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 15]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     15|  } else
   72|    262|#endif
   73|    262|  {
   74|    262|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 252]
  ------------------
   75|     10|      return false;
   76|     10|    }
   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|    267|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 24, False: 243]
  ------------------
   83|     24|    return false;
   84|     24|  }
   85|    243|  probability_table_.resize(num_symbols_);
   86|    243|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 14, False: 229]
  ------------------
   87|     14|    return true;
   88|     14|  }
   89|       |  // Decode the table.
   90|  12.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 12.1k, False: 173]
  ------------------
   91|  12.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|  12.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 12.0k]
  ------------------
   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|  12.0k|    const int token = prob_data & 3;
  102|  12.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.78k, False: 8.29k]
  ------------------
  103|  3.78k|      const uint32_t offset = prob_data >> 2;
  104|  3.78k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 14, False: 3.76k]
  ------------------
  105|     14|        return false;
  106|     14|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   151k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 147k, False: 3.76k]
  ------------------
  109|   147k|        probability_table_[i + j] = 0;
  110|   147k|      }
  111|  3.76k|      i += offset;
  112|  8.29k|    } else {
  113|  8.29k|      const int extra_bytes = token;
  114|  8.29k|      uint32_t prob = prob_data >> 2;
  115|  13.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.74k, False: 8.28k]
  ------------------
  116|  4.74k|        uint8_t eb;
  117|  4.74k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 4.73k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.73k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.73k|      }
  124|  8.28k|      probability_table_[i] = prob;
  125|  8.28k|    }
  126|  12.0k|  }
  127|    173|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 8, False: 165]
  ------------------
  128|      8|    return false;
  129|      8|  }
  130|    165|  return true;
  131|    173|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    179|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    165|    DecoderBuffer *buffer) {
  136|    165|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    165|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    165|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    165|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 164]
  ------------------
  140|      1|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 1]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      1|  } else
  145|    164|#endif
  146|    164|  {
  147|    164|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 161]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    164|  }
  151|    162|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 12, False: 150]
  ------------------
  152|     12|    return false;
  153|     12|  }
  154|    150|  const uint8_t *const data_head =
  155|    150|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    150|  buffer->Advance(bytes_encoded);
  158|    150|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 125]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|    125|  return true;
  162|    150|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  7.71M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    125|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    125|  ans_.read_end();
  167|    125|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    245|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    245|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    245|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 245]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    245|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    245|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    245|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 25, False: 220]
  ------------------
   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|    220|#endif
   73|    220|  {
   74|    220|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 215]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    220|  }
   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|    240|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 225]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    225|  probability_table_.resize(num_symbols_);
   86|    225|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 221]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  15.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 14.9k, False: 148]
  ------------------
   91|  14.9k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  14.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 38, False: 14.9k]
  ------------------
   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|  14.9k|    const int token = prob_data & 3;
  102|  14.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.15k, False: 10.7k]
  ------------------
  103|  4.15k|      const uint32_t offset = prob_data >> 2;
  104|  4.15k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 4.13k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   139k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 135k, False: 4.13k]
  ------------------
  109|   135k|        probability_table_[i + j] = 0;
  110|   135k|      }
  111|  4.13k|      i += offset;
  112|  10.7k|    } else {
  113|  10.7k|      const int extra_bytes = token;
  114|  10.7k|      uint32_t prob = prob_data >> 2;
  115|  15.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.95k, False: 10.7k]
  ------------------
  116|  4.95k|        uint8_t eb;
  117|  4.95k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 4.94k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.94k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.94k|      }
  124|  10.7k|      probability_table_[i] = prob;
  125|  10.7k|    }
  126|  14.9k|  }
  127|    148|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 19, False: 129]
  ------------------
  128|     19|    return false;
  129|     19|  }
  130|    129|  return true;
  131|    148|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    133|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    129|    DecoderBuffer *buffer) {
  136|    129|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    129|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    129|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    129|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 113]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 15]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     16|  } else
  145|    113|#endif
  146|    113|  {
  147|    113|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 113]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    113|  }
  151|    128|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 26, False: 102]
  ------------------
  152|     26|    return false;
  153|     26|  }
  154|    102|  const uint8_t *const data_head =
  155|    102|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    102|  buffer->Advance(bytes_encoded);
  158|    102|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 68]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|     68|  return true;
  162|    102|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  24.0M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|     68|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     68|  ans_.read_end();
  167|     68|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    289|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_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: 21, False: 268]
  ------------------
   67|     21|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 21]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     21|  } else
   72|    268|#endif
   73|    268|  {
   74|    268|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 263]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    268|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    284|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 275]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    275|  probability_table_.resize(num_symbols_);
   86|    275|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 268]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|   185k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 185k, False: 197]
  ------------------
   91|   185k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   185k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 39, False: 185k]
  ------------------
   95|     39|      return false;
   96|     39|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   185k|    const int token = prob_data & 3;
  102|   185k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 107k, False: 77.4k]
  ------------------
  103|   107k|      const uint32_t offset = prob_data >> 2;
  104|   107k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 107k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.60M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.49M, False: 107k]
  ------------------
  109|  4.49M|        probability_table_[i + j] = 0;
  110|  4.49M|      }
  111|   107k|      i += offset;
  112|   107k|    } else {
  113|  77.4k|      const int extra_bytes = token;
  114|  77.4k|      uint32_t prob = prob_data >> 2;
  115|   164k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 87.3k, False: 77.4k]
  ------------------
  116|  87.3k|        uint8_t eb;
  117|  87.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 87.2k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  87.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  87.2k|      }
  124|  77.4k|      probability_table_[i] = prob;
  125|  77.4k|    }
  126|   185k|  }
  127|    197|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 7, False: 190]
  ------------------
  128|      7|    return false;
  129|      7|  }
  130|    190|  return true;
  131|    197|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    197|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    190|    DecoderBuffer *buffer) {
  136|    190|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    190|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    190|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    190|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 15, False: 175]
  ------------------
  140|     15|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 13]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     15|  } else
  145|    175|#endif
  146|    175|  {
  147|    175|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 173]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    175|  }
  151|    186|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 20, False: 166]
  ------------------
  152|     20|    return false;
  153|     20|  }
  154|    166|  const uint8_t *const data_head =
  155|    166|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    166|  buffer->Advance(bytes_encoded);
  158|    166|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 140]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|    140|  return true;
  162|    166|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  8.08M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    140|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    140|  ans_.read_end();
  167|    140|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    223|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    223|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    223|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 223]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    223|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    223|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    223|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 21, False: 202]
  ------------------
   67|     21|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 21]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     21|  } else
   72|    202|#endif
   73|    202|  {
   74|    202|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 195]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    202|  }
   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|    216|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 207]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    207|  probability_table_.resize(num_symbols_);
   86|    207|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 197]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|   100k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 100k, False: 142]
  ------------------
   91|   100k|    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|   100k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 29, False: 100k]
  ------------------
   95|     29|      return false;
   96|     29|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   100k|    const int token = prob_data & 3;
  102|   100k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 15.0k, False: 85.4k]
  ------------------
  103|  15.0k|      const uint32_t offset = prob_data >> 2;
  104|  15.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 12, False: 14.9k]
  ------------------
  105|     12|        return false;
  106|     12|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   515k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 500k, False: 14.9k]
  ------------------
  109|   500k|        probability_table_[i + j] = 0;
  110|   500k|      }
  111|  14.9k|      i += offset;
  112|  85.4k|    } else {
  113|  85.4k|      const int extra_bytes = token;
  114|  85.4k|      uint32_t prob = prob_data >> 2;
  115|   157k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 71.9k, False: 85.4k]
  ------------------
  116|  71.9k|        uint8_t eb;
  117|  71.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 71.9k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  71.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  71.9k|      }
  124|  85.4k|      probability_table_[i] = prob;
  125|  85.4k|    }
  126|   100k|  }
  127|    142|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 10, False: 132]
  ------------------
  128|     10|    return false;
  129|     10|  }
  130|    132|  return true;
  131|    142|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    142|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    132|    DecoderBuffer *buffer) {
  136|    132|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    132|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    132|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    132|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 18, False: 114]
  ------------------
  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|    114|#endif
  146|    114|  {
  147|    114|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 104]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    114|  }
  151|    121|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 34, False: 87]
  ------------------
  152|     34|    return false;
  153|     34|  }
  154|     87|  const uint8_t *const data_head =
  155|     87|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     87|  buffer->Advance(bytes_encoded);
  158|     87|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 31, False: 56]
  ------------------
  159|     31|    return false;
  160|     31|  }
  161|     56|  return true;
  162|     87|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  11.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     56|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     56|  ans_.read_end();
  167|     56|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    231|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    231|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    231|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 231]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    231|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    231|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    231|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 16, False: 215]
  ------------------
   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|    215|#endif
   73|    215|  {
   74|    215|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 215]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    215|  }
   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|    231|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 221]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    221|  probability_table_.resize(num_symbols_);
   86|    221|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 214]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  47.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 47.5k, False: 152]
  ------------------
   91|  47.5k|    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|  47.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 28, False: 47.4k]
  ------------------
   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|  47.4k|    const int token = prob_data & 3;
  102|  47.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.67k, False: 40.8k]
  ------------------
  103|  6.67k|      const uint32_t offset = prob_data >> 2;
  104|  6.67k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 6.65k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   186k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 179k, False: 6.65k]
  ------------------
  109|   179k|        probability_table_[i + j] = 0;
  110|   179k|      }
  111|  6.65k|      i += offset;
  112|  40.8k|    } else {
  113|  40.8k|      const int extra_bytes = token;
  114|  40.8k|      uint32_t prob = prob_data >> 2;
  115|  73.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 32.9k, False: 40.8k]
  ------------------
  116|  32.9k|        uint8_t eb;
  117|  32.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 32.9k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  32.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  32.9k|      }
  124|  40.8k|      probability_table_[i] = prob;
  125|  40.8k|    }
  126|  47.4k|  }
  127|    152|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 34, False: 118]
  ------------------
  128|     34|    return false;
  129|     34|  }
  130|    118|  return true;
  131|    152|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    125|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_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: 3, False: 115]
  ------------------
  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|    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|    118|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 24, False: 94]
  ------------------
  152|     24|    return false;
  153|     24|  }
  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: 35, False: 59]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|     59|  return true;
  162|     94|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   110k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     59|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     59|  ans_.read_end();
  167|     59|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    233|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    233|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    233|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 233]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    233|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    233|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    233|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 33, False: 200]
  ------------------
   67|     33|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 32]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     33|  } else
   72|    200|#endif
   73|    200|  {
   74|    200|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 187]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    200|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    219|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 207]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    207|  probability_table_.resize(num_symbols_);
   86|    207|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 197]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  44.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 44.3k, False: 151]
  ------------------
   91|  44.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  44.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 20, False: 44.3k]
  ------------------
   95|     20|      return false;
   96|     20|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  44.3k|    const int token = prob_data & 3;
  102|  44.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.53k, False: 37.8k]
  ------------------
  103|  6.53k|      const uint32_t offset = prob_data >> 2;
  104|  6.53k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 6.52k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   223k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 217k, False: 6.52k]
  ------------------
  109|   217k|        probability_table_[i + j] = 0;
  110|   217k|      }
  111|  6.52k|      i += offset;
  112|  37.8k|    } else {
  113|  37.8k|      const int extra_bytes = token;
  114|  37.8k|      uint32_t prob = prob_data >> 2;
  115|  67.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 29.3k, False: 37.8k]
  ------------------
  116|  29.3k|        uint8_t eb;
  117|  29.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 29.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|  29.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  29.3k|      }
  124|  37.8k|      probability_table_[i] = prob;
  125|  37.8k|    }
  126|  44.3k|  }
  127|    151|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 50, False: 101]
  ------------------
  128|     50|    return false;
  129|     50|  }
  130|    101|  return true;
  131|    151|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    111|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    101|    DecoderBuffer *buffer) {
  136|    101|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    101|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    101|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    101|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 10, False: 91]
  ------------------
  140|     10|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 9]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     10|  } else
  145|     91|#endif
  146|     91|  {
  147|     91|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 90]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     91|  }
  151|     99|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 23, False: 76]
  ------------------
  152|     23|    return false;
  153|     23|  }
  154|     76|  const uint8_t *const data_head =
  155|     76|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     76|  buffer->Advance(bytes_encoded);
  158|     76|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 32, False: 44]
  ------------------
  159|     32|    return false;
  160|     32|  }
  161|     44|  return true;
  162|     76|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   330k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     44|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     44|  ans_.read_end();
  167|     44|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    188|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    188|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    188|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 188]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    188|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    188|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    188|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 20, False: 168]
  ------------------
   67|     20|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 19]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     20|  } else
   72|    168|#endif
   73|    168|  {
   74|    168|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 161]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    168|  }
   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|    180|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 160]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    160|  probability_table_.resize(num_symbols_);
   86|    160|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 152]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|  6.04k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 5.94k, False: 94]
  ------------------
   91|  5.94k|    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.94k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 30, False: 5.91k]
  ------------------
   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|  5.91k|    const int token = prob_data & 3;
  102|  5.91k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.52k, False: 3.38k]
  ------------------
  103|  2.52k|      const uint32_t offset = prob_data >> 2;
  104|  2.52k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 2.50k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  84.9k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 82.3k, False: 2.50k]
  ------------------
  109|  82.3k|        probability_table_[i + j] = 0;
  110|  82.3k|      }
  111|  2.50k|      i += offset;
  112|  3.38k|    } else {
  113|  3.38k|      const int extra_bytes = token;
  114|  3.38k|      uint32_t prob = prob_data >> 2;
  115|  5.53k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.15k, False: 3.37k]
  ------------------
  116|  2.15k|        uint8_t eb;
  117|  2.15k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 2.14k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.14k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.14k|      }
  124|  3.37k|      probability_table_[i] = prob;
  125|  3.37k|    }
  126|  5.91k|  }
  127|     94|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 32, False: 62]
  ------------------
  128|     32|    return false;
  129|     32|  }
  130|     62|  return true;
  131|     94|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|     70|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|     62|    DecoderBuffer *buffer) {
  136|     62|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     62|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     62|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     62|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 62]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|     62|#endif
  146|     62|  {
  147|     62|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 62]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     62|  }
  151|     62|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 28, False: 34]
  ------------------
  152|     28|    return false;
  153|     28|  }
  154|     34|  const uint8_t *const data_head =
  155|     34|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     34|  buffer->Advance(bytes_encoded);
  158|     34|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 11, False: 23]
  ------------------
  159|     11|    return false;
  160|     11|  }
  161|     23|  return true;
  162|     34|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   201k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     23|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     23|  ans_.read_end();
  167|     23|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    210|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    210|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    210|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 210]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    210|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    210|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    210|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 17, False: 193]
  ------------------
   67|     17|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 17]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     17|  } else
   72|    193|#endif
   73|    193|  {
   74|    193|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 190]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    193|  }
   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|    207|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 203]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|    203|  probability_table_.resize(num_symbols_);
   86|    203|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 197]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|  59.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 59.3k, False: 136]
  ------------------
   91|  59.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  59.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 32, False: 59.2k]
  ------------------
   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|  59.2k|    const int token = prob_data & 3;
  102|  59.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.66k, False: 49.6k]
  ------------------
  103|  9.66k|      const uint32_t offset = prob_data >> 2;
  104|  9.66k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 9.64k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   314k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 304k, False: 9.64k]
  ------------------
  109|   304k|        probability_table_[i + j] = 0;
  110|   304k|      }
  111|  9.64k|      i += offset;
  112|  49.6k|    } else {
  113|  49.6k|      const int extra_bytes = token;
  114|  49.6k|      uint32_t prob = prob_data >> 2;
  115|  99.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 49.4k, False: 49.6k]
  ------------------
  116|  49.4k|        uint8_t eb;
  117|  49.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 49.4k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  49.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  49.4k|      }
  124|  49.6k|      probability_table_[i] = prob;
  125|  49.6k|    }
  126|  59.2k|  }
  127|    136|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 38, False: 98]
  ------------------
  128|     38|    return false;
  129|     38|  }
  130|     98|  return true;
  131|    136|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    104|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|     98|    DecoderBuffer *buffer) {
  136|     98|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     98|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     98|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     98|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 14, False: 84]
  ------------------
  140|     14|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 13]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     14|  } else
  145|     84|#endif
  146|     84|  {
  147|     84|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 84]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     84|  }
  151|     97|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 34, False: 63]
  ------------------
  152|     34|    return false;
  153|     34|  }
  154|     63|  const uint8_t *const data_head =
  155|     63|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     63|  buffer->Advance(bytes_encoded);
  158|     63|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 37]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     37|  return true;
  162|     63|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   128k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     37|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     37|  ans_.read_end();
  167|     37|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    189|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    189|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    189|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 189]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    189|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    189|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    189|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 189]
  ------------------
   67|      0|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 0]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      0|  } else
   72|    189|#endif
   73|    189|  {
   74|    189|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 15, False: 174]
  ------------------
   75|     15|      return false;
   76|     15|    }
   77|    189|  }
   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|    174|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 167]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    167|  probability_table_.resize(num_symbols_);
   86|    167|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 164]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   199k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 199k, False: 113]
  ------------------
   91|   199k|    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|   199k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 27, False: 199k]
  ------------------
   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|   199k|    const int token = prob_data & 3;
  102|   199k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 127k, False: 71.9k]
  ------------------
  103|   127k|      const uint32_t offset = prob_data >> 2;
  104|   127k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 127k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.27M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.14M, False: 127k]
  ------------------
  109|  4.14M|        probability_table_[i + j] = 0;
  110|  4.14M|      }
  111|   127k|      i += offset;
  112|   127k|    } else {
  113|  71.9k|      const int extra_bytes = token;
  114|  71.9k|      uint32_t prob = prob_data >> 2;
  115|   106k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 34.6k, False: 71.8k]
  ------------------
  116|  34.6k|        uint8_t eb;
  117|  34.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 9, False: 34.6k]
  ------------------
  118|      9|          return false;
  119|      9|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  34.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  34.6k|      }
  124|  71.8k|      probability_table_[i] = prob;
  125|  71.8k|    }
  126|   199k|  }
  127|    113|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 46, False: 67]
  ------------------
  128|     46|    return false;
  129|     46|  }
  130|     67|  return true;
  131|    113|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|     70|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|     67|    DecoderBuffer *buffer) {
  136|     67|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     67|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     67|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     67|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 67]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|     67|#endif
  146|     67|  {
  147|     67|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 66]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     67|  }
  151|     66|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 17, False: 49]
  ------------------
  152|     17|    return false;
  153|     17|  }
  154|     49|  const uint8_t *const data_head =
  155|     49|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     49|  buffer->Advance(bytes_encoded);
  158|     49|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 13, False: 36]
  ------------------
  159|     13|    return false;
  160|     13|  }
  161|     36|  return true;
  162|     49|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   191k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     36|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     36|  ans_.read_end();
  167|     36|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    245|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    245|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    245|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 245]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    245|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    245|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    245|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 36, False: 209]
  ------------------
   67|     36|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 32]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     36|  } else
   72|    209|#endif
   73|    209|  {
   74|    209|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 201]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    209|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    233|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 221]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    221|  probability_table_.resize(num_symbols_);
   86|    221|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 220]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   100k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 100k, False: 145]
  ------------------
   91|   100k|    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|   100k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 100k]
  ------------------
   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|   100k|    const int token = prob_data & 3;
  102|   100k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 29.7k, False: 70.4k]
  ------------------
  103|  29.7k|      const uint32_t offset = prob_data >> 2;
  104|  29.7k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 29.7k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.37M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.34M, False: 29.7k]
  ------------------
  109|  1.34M|        probability_table_[i + j] = 0;
  110|  1.34M|      }
  111|  29.7k|      i += offset;
  112|  70.4k|    } else {
  113|  70.4k|      const int extra_bytes = token;
  114|  70.4k|      uint32_t prob = prob_data >> 2;
  115|   138k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 68.2k, False: 70.4k]
  ------------------
  116|  68.2k|        uint8_t eb;
  117|  68.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 68.1k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  68.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  68.1k|      }
  124|  70.4k|      probability_table_[i] = prob;
  125|  70.4k|    }
  126|   100k|  }
  127|    145|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 15, False: 130]
  ------------------
  128|     15|    return false;
  129|     15|  }
  130|    130|  return true;
  131|    145|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    131|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    130|    DecoderBuffer *buffer) {
  136|    130|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    130|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    130|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    130|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 5, False: 125]
  ------------------
  140|      5|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 4]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      5|  } else
  145|    125|#endif
  146|    125|  {
  147|    125|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 122]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    125|  }
  151|    126|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 53, False: 73]
  ------------------
  152|     53|    return false;
  153|     53|  }
  154|     73|  const uint8_t *const data_head =
  155|     73|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     73|  buffer->Advance(bytes_encoded);
  158|     73|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 19, False: 54]
  ------------------
  159|     19|    return false;
  160|     19|  }
  161|     54|  return true;
  162|     73|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  96.7k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     54|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     54|  ans_.read_end();
  167|     54|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    223|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    223|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    223|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 223]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    223|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    223|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    223|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 194]
  ------------------
   67|     29|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 29]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     29|  } else
   72|    194|#endif
   73|    194|  {
   74|    194|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 185]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    194|  }
   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|    214|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 199]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    199|  probability_table_.resize(num_symbols_);
   86|    199|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 197]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  83.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 82.8k, False: 146]
  ------------------
   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: 27, False: 82.8k]
  ------------------
   95|     27|      return false;
   96|     27|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  82.8k|    const int token = prob_data & 3;
  102|  82.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.63k, False: 76.2k]
  ------------------
  103|  6.63k|      const uint32_t offset = prob_data >> 2;
  104|  6.63k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 19, False: 6.61k]
  ------------------
  105|     19|        return false;
  106|     19|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   269k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 262k, False: 6.61k]
  ------------------
  109|   262k|        probability_table_[i + j] = 0;
  110|   262k|      }
  111|  6.61k|      i += offset;
  112|  76.2k|    } else {
  113|  76.2k|      const int extra_bytes = token;
  114|  76.2k|      uint32_t prob = prob_data >> 2;
  115|   151k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 75.6k, False: 76.2k]
  ------------------
  116|  75.6k|        uint8_t eb;
  117|  75.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 5, False: 75.6k]
  ------------------
  118|      5|          return false;
  119|      5|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  75.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  75.6k|      }
  124|  76.2k|      probability_table_[i] = prob;
  125|  76.2k|    }
  126|  82.8k|  }
  127|    146|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 120]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    120|  return true;
  131|    146|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    122|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    120|    DecoderBuffer *buffer) {
  136|    120|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    120|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    120|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    120|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 100]
  ------------------
  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|    100|#endif
  146|    100|  {
  147|    100|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 99]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    100|  }
  151|    119|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 40, False: 79]
  ------------------
  152|     40|    return false;
  153|     40|  }
  154|     79|  const uint8_t *const data_head =
  155|     79|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     79|  buffer->Advance(bytes_encoded);
  158|     79|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 29, False: 50]
  ------------------
  159|     29|    return false;
  160|     29|  }
  161|     50|  return true;
  162|     79|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  11.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     50|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     50|  ans_.read_end();
  167|     50|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    237|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    237|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    237|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 237]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    237|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    237|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    237|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 7, False: 230]
  ------------------
   67|      7|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 7]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      7|  } else
   72|    230|#endif
   73|    230|  {
   74|    230|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 228]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    230|  }
   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|    235|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 230]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    230|  probability_table_.resize(num_symbols_);
   86|    230|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 221]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  14.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 14.3k, False: 156]
  ------------------
   91|  14.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  14.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 24, False: 14.3k]
  ------------------
   95|     24|      return false;
   96|     24|    }
   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|  14.3k|    const int token = prob_data & 3;
  102|  14.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 7.56k, False: 6.74k]
  ------------------
  103|  7.56k|      const uint32_t offset = prob_data >> 2;
  104|  7.56k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 7.54k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   212k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 204k, False: 7.54k]
  ------------------
  109|   204k|        probability_table_[i + j] = 0;
  110|   204k|      }
  111|  7.54k|      i += offset;
  112|  7.54k|    } else {
  113|  6.74k|      const int extra_bytes = token;
  114|  6.74k|      uint32_t prob = prob_data >> 2;
  115|  12.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.32k, False: 6.72k]
  ------------------
  116|  5.32k|        uint8_t eb;
  117|  5.32k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 5.30k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.30k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.30k|      }
  124|  6.72k|      probability_table_[i] = prob;
  125|  6.72k|    }
  126|  14.3k|  }
  127|    156|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 136]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|    136|  return true;
  131|    156|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    145|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    136|    DecoderBuffer *buffer) {
  136|    136|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    136|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    136|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    136|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 133]
  ------------------
  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|    133|#endif
  146|    133|  {
  147|    133|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 12, False: 121]
  ------------------
  148|     12|      return false;
  149|     12|    }
  150|    133|  }
  151|    124|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 59, False: 65]
  ------------------
  152|     59|    return false;
  153|     59|  }
  154|     65|  const uint8_t *const data_head =
  155|     65|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     65|  buffer->Advance(bytes_encoded);
  158|     65|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 30, False: 35]
  ------------------
  159|     30|    return false;
  160|     30|  }
  161|     35|  return true;
  162|     65|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  9.01M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     35|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     35|  ans_.read_end();
  167|     35|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    254|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    254|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    254|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 254]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    254|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    254|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    254|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 16, False: 238]
  ------------------
   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|    238|#endif
   73|    238|  {
   74|    238|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 225]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    238|  }
   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|    241|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 226]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    226|  probability_table_.resize(num_symbols_);
   86|    226|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 214]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|   249k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 249k, False: 152]
  ------------------
   91|   249k|    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|   249k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 34, False: 249k]
  ------------------
   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|   249k|    const int token = prob_data & 3;
  102|   249k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 179k, False: 69.4k]
  ------------------
  103|   179k|      const uint32_t offset = prob_data >> 2;
  104|   179k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 179k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  8.91M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.73M, False: 179k]
  ------------------
  109|  8.73M|        probability_table_[i + j] = 0;
  110|  8.73M|      }
  111|   179k|      i += offset;
  112|   179k|    } else {
  113|  69.4k|      const int extra_bytes = token;
  114|  69.4k|      uint32_t prob = prob_data >> 2;
  115|   102k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 32.7k, False: 69.4k]
  ------------------
  116|  32.7k|        uint8_t eb;
  117|  32.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 32.7k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  32.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  32.7k|      }
  124|  69.4k|      probability_table_[i] = prob;
  125|  69.4k|    }
  126|   249k|  }
  127|    152|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 18, False: 134]
  ------------------
  128|     18|    return false;
  129|     18|  }
  130|    134|  return true;
  131|    152|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    146|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    134|    DecoderBuffer *buffer) {
  136|    134|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    134|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    134|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    134|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 127]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 7]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      7|  } else
  145|    127|#endif
  146|    127|  {
  147|    127|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 122]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    127|  }
  151|    129|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 63, False: 66]
  ------------------
  152|     63|    return false;
  153|     63|  }
  154|     66|  const uint8_t *const data_head =
  155|     66|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     66|  buffer->Advance(bytes_encoded);
  158|     66|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 16, False: 50]
  ------------------
  159|     16|    return false;
  160|     16|  }
  161|     50|  return true;
  162|     66|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  4.87M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     50|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     50|  ans_.read_end();
  167|     50|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    287|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    287|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    287|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 287]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    287|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    287|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    287|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 34, False: 253]
  ------------------
   67|     34|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 33]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     34|  } else
   72|    253|#endif
   73|    253|  {
   74|    253|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 246]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    253|  }
   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|    279|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 272]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    272|  probability_table_.resize(num_symbols_);
   86|    272|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 266]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|  7.24k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 7.05k, False: 194]
  ------------------
   91|  7.05k|    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|  7.05k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 7.01k]
  ------------------
   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|  7.01k|    const int token = prob_data & 3;
  102|  7.01k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.47k, False: 3.54k]
  ------------------
  103|  3.47k|      const uint32_t offset = prob_data >> 2;
  104|  3.47k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 3.45k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   127k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 124k, False: 3.45k]
  ------------------
  109|   124k|        probability_table_[i + j] = 0;
  110|   124k|      }
  111|  3.45k|      i += offset;
  112|  3.54k|    } else {
  113|  3.54k|      const int extra_bytes = token;
  114|  3.54k|      uint32_t prob = prob_data >> 2;
  115|  6.00k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.47k, False: 3.53k]
  ------------------
  116|  2.47k|        uint8_t eb;
  117|  2.47k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 2.45k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.45k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.45k|      }
  124|  3.53k|      probability_table_[i] = prob;
  125|  3.53k|    }
  126|  7.01k|  }
  127|    194|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 30, False: 164]
  ------------------
  128|     30|    return false;
  129|     30|  }
  130|    164|  return true;
  131|    194|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    170|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    164|    DecoderBuffer *buffer) {
  136|    164|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    164|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    164|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    164|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 144]
  ------------------
  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|    144|#endif
  146|    144|  {
  147|    144|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 137]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    144|  }
  151|    157|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 67, False: 90]
  ------------------
  152|     67|    return false;
  153|     67|  }
  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: 26, False: 64]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     64|  return true;
  162|     90|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|   116k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     64|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     64|  ans_.read_end();
  167|     64|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  7.55k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  7.55k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 1, False: 7.55k]
  ------------------
   35|      1|    return true;
   36|      1|  }
   37|       |  // Decode which scheme to use.
   38|  7.55k|  uint8_t scheme;
   39|  7.55k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 147, False: 7.40k]
  ------------------
   40|    147|    return false;
   41|    147|  }
   42|  7.40k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 633, False: 6.77k]
  ------------------
   43|    633|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    633|                                                  src_buffer, out_values);
   45|  6.77k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 4.69k, False: 2.07k]
  ------------------
   46|  4.69k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  4.69k|                                               out_values);
   48|  4.69k|  }
   49|  2.07k|  return false;
   50|  7.40k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    633|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    633|  SymbolDecoderT<5> tag_decoder;
   57|    633|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 352, False: 281]
  ------------------
   58|    352|    return false;
   59|    352|  }
   60|       |
   61|    281|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 129, False: 152]
  ------------------
   62|    129|    return false;
   63|    129|  }
   64|       |
   65|    152|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 152, False: 0]
  |  Branch (65:25): [True: 38, False: 114]
  ------------------
   66|     38|    return false;  // Wrong number of symbols.
   67|     38|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    114|  src_buffer->StartBitDecoding(false, nullptr);
   72|    114|  int value_id = 0;
   73|   907k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 907k, False: 114]
  ------------------
   74|       |    // Decode the tag.
   75|   907k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  1.83M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 930k, False: 907k]
  ------------------
   78|   930k|      uint32_t val;
   79|   930k|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 930k]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|   930k|      out_values[value_id++] = val;
   83|   930k|    }
   84|   907k|  }
   85|    114|  tag_decoder.EndDecoding();
   86|    114|  src_buffer->EndBitDecoding();
   87|    114|  return true;
   88|    114|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  4.69k|                      uint32_t *out_values) {
  117|  4.69k|  uint8_t max_bit_length;
  118|  4.69k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 32, False: 4.66k]
  ------------------
  119|     32|    return false;
  120|     32|  }
  121|  4.66k|  switch (max_bit_length) {
  122|    365|    case 1:
  ------------------
  |  Branch (122:5): [True: 365, False: 4.29k]
  ------------------
  123|    365|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    365|                                                         out_values);
  125|    285|    case 2:
  ------------------
  |  Branch (125:5): [True: 285, False: 4.37k]
  ------------------
  126|    285|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    285|                                                         out_values);
  128|    303|    case 3:
  ------------------
  |  Branch (128:5): [True: 303, False: 4.36k]
  ------------------
  129|    303|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    303|                                                         out_values);
  131|    277|    case 4:
  ------------------
  |  Branch (131:5): [True: 277, False: 4.38k]
  ------------------
  132|    277|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    277|                                                         out_values);
  134|    165|    case 5:
  ------------------
  |  Branch (134:5): [True: 165, False: 4.49k]
  ------------------
  135|    165|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    165|                                                         out_values);
  137|    245|    case 6:
  ------------------
  |  Branch (137:5): [True: 245, False: 4.41k]
  ------------------
  138|    245|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    245|                                                         out_values);
  140|    289|    case 7:
  ------------------
  |  Branch (140:5): [True: 289, False: 4.37k]
  ------------------
  141|    289|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    289|                                                         out_values);
  143|    223|    case 8:
  ------------------
  |  Branch (143:5): [True: 223, False: 4.44k]
  ------------------
  144|    223|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    223|                                                         out_values);
  146|    231|    case 9:
  ------------------
  |  Branch (146:5): [True: 231, False: 4.43k]
  ------------------
  147|    231|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    231|                                                         out_values);
  149|    233|    case 10:
  ------------------
  |  Branch (149:5): [True: 233, False: 4.43k]
  ------------------
  150|    233|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    233|          num_values, src_buffer, out_values);
  152|    188|    case 11:
  ------------------
  |  Branch (152:5): [True: 188, False: 4.47k]
  ------------------
  153|    188|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    188|          num_values, src_buffer, out_values);
  155|    210|    case 12:
  ------------------
  |  Branch (155:5): [True: 210, False: 4.45k]
  ------------------
  156|    210|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    210|          num_values, src_buffer, out_values);
  158|    189|    case 13:
  ------------------
  |  Branch (158:5): [True: 189, False: 4.47k]
  ------------------
  159|    189|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    189|          num_values, src_buffer, out_values);
  161|    245|    case 14:
  ------------------
  |  Branch (161:5): [True: 245, False: 4.41k]
  ------------------
  162|    245|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    245|          num_values, src_buffer, out_values);
  164|    223|    case 15:
  ------------------
  |  Branch (164:5): [True: 223, False: 4.44k]
  ------------------
  165|    223|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    223|          num_values, src_buffer, out_values);
  167|    237|    case 16:
  ------------------
  |  Branch (167:5): [True: 237, False: 4.42k]
  ------------------
  168|    237|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    237|          num_values, src_buffer, out_values);
  170|    254|    case 17:
  ------------------
  |  Branch (170:5): [True: 254, False: 4.40k]
  ------------------
  171|    254|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    254|          num_values, src_buffer, out_values);
  173|    287|    case 18:
  ------------------
  |  Branch (173:5): [True: 287, False: 4.37k]
  ------------------
  174|    287|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    287|          num_values, src_buffer, out_values);
  176|    214|    default:
  ------------------
  |  Branch (176:5): [True: 214, False: 4.44k]
  ------------------
  177|    214|      return false;
  178|  4.66k|  }
  179|  4.66k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    365|                              uint32_t *out_values) {
   93|    365|  SymbolDecoderT decoder;
   94|    365|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 182, False: 183]
  ------------------
   95|    182|    return false;
   96|    182|  }
   97|       |
   98|    183|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 183, False: 0]
  |  Branch (98:25): [True: 22, False: 161]
  ------------------
   99|     22|    return false;  // Wrong number of symbols.
  100|     22|  }
  101|       |
  102|    161|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 49, False: 112]
  ------------------
  103|     49|    return false;
  104|     49|  }
  105|   241M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 241M, False: 112]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   241M|    const uint32_t value = decoder.DecodeSymbol();
  108|   241M|    out_values[i] = value;
  109|   241M|  }
  110|    112|  decoder.EndDecoding();
  111|    112|  return true;
  112|    161|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    285|                              uint32_t *out_values) {
   93|    285|  SymbolDecoderT decoder;
   94|    285|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 111, False: 174]
  ------------------
   95|    111|    return false;
   96|    111|  }
   97|       |
   98|    174|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 174, False: 0]
  |  Branch (98:25): [True: 6, False: 168]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    168|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 58, False: 110]
  ------------------
  103|     58|    return false;
  104|     58|  }
  105|  71.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 71.9M, False: 110]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  71.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  71.9M|    out_values[i] = value;
  109|  71.9M|  }
  110|    110|  decoder.EndDecoding();
  111|    110|  return true;
  112|    168|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    303|                              uint32_t *out_values) {
   93|    303|  SymbolDecoderT decoder;
   94|    303|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 107, False: 196]
  ------------------
   95|    107|    return false;
   96|    107|  }
   97|       |
   98|    196|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 196, False: 0]
  |  Branch (98:25): [True: 9, False: 187]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    187|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 63, False: 124]
  ------------------
  103|     63|    return false;
  104|     63|  }
  105|  21.4M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 21.4M, False: 124]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  21.4M|    const uint32_t value = decoder.DecodeSymbol();
  108|  21.4M|    out_values[i] = value;
  109|  21.4M|  }
  110|    124|  decoder.EndDecoding();
  111|    124|  return true;
  112|    187|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    277|                              uint32_t *out_values) {
   93|    277|  SymbolDecoderT decoder;
   94|    277|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 98, False: 179]
  ------------------
   95|     98|    return false;
   96|     98|  }
   97|       |
   98|    179|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 179, False: 0]
  |  Branch (98:25): [True: 14, False: 165]
  ------------------
   99|     14|    return false;  // Wrong number of symbols.
  100|     14|  }
  101|       |
  102|    165|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 40, False: 125]
  ------------------
  103|     40|    return false;
  104|     40|  }
  105|  7.71M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.71M, False: 125]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.71M|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.71M|    out_values[i] = value;
  109|  7.71M|  }
  110|    125|  decoder.EndDecoding();
  111|    125|  return true;
  112|    165|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    165|                              uint32_t *out_values) {
   93|    165|  SymbolDecoderT decoder;
   94|    165|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 30, False: 135]
  ------------------
   95|     30|    return false;
   96|     30|  }
   97|       |
   98|    135|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 135, False: 0]
  |  Branch (98:25): [True: 86, False: 49]
  ------------------
   99|     86|    return false;  // Wrong number of symbols.
  100|     86|  }
  101|       |
  102|     49|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 6, False: 43]
  ------------------
  103|      6|    return false;
  104|      6|  }
  105|  5.17M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.17M, False: 43]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.17M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.17M|    out_values[i] = value;
  109|  5.17M|  }
  110|     43|  decoder.EndDecoding();
  111|     43|  return true;
  112|     49|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    245|                              uint32_t *out_values) {
   93|    245|  SymbolDecoderT decoder;
   94|    245|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 112, False: 133]
  ------------------
   95|    112|    return false;
   96|    112|  }
   97|       |
   98|    133|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 133, False: 0]
  |  Branch (98:25): [True: 4, False: 129]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    129|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 61, False: 68]
  ------------------
  103|     61|    return false;
  104|     61|  }
  105|  24.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 24.0M, False: 68]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  24.0M|    const uint32_t value = decoder.DecodeSymbol();
  108|  24.0M|    out_values[i] = value;
  109|  24.0M|  }
  110|     68|  decoder.EndDecoding();
  111|     68|  return true;
  112|    129|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    289|                              uint32_t *out_values) {
   93|    289|  SymbolDecoderT decoder;
   94|    289|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 92, False: 197]
  ------------------
   95|     92|    return false;
   96|     92|  }
   97|       |
   98|    197|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 197, False: 0]
  |  Branch (98:25): [True: 7, False: 190]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    190|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 50, False: 140]
  ------------------
  103|     50|    return false;
  104|     50|  }
  105|  8.08M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.08M, False: 140]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.08M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.08M|    out_values[i] = value;
  109|  8.08M|  }
  110|    140|  decoder.EndDecoding();
  111|    140|  return true;
  112|    190|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    223|                              uint32_t *out_values) {
   93|    223|  SymbolDecoderT decoder;
   94|    223|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 81, False: 142]
  ------------------
   95|     81|    return false;
   96|     81|  }
   97|       |
   98|    142|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 142, False: 0]
  |  Branch (98:25): [True: 10, False: 132]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    132|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 76, False: 56]
  ------------------
  103|     76|    return false;
  104|     76|  }
  105|  11.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 11.1M, False: 56]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  11.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  11.1M|    out_values[i] = value;
  109|  11.1M|  }
  110|     56|  decoder.EndDecoding();
  111|     56|  return true;
  112|    132|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    231|                              uint32_t *out_values) {
   93|    231|  SymbolDecoderT decoder;
   94|    231|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 106, False: 125]
  ------------------
   95|    106|    return false;
   96|    106|  }
   97|       |
   98|    125|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 125, False: 0]
  |  Branch (98:25): [True: 7, False: 118]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    118|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 59, False: 59]
  ------------------
  103|     59|    return false;
  104|     59|  }
  105|   110k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 110k, False: 59]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   110k|    const uint32_t value = decoder.DecodeSymbol();
  108|   110k|    out_values[i] = value;
  109|   110k|  }
  110|     59|  decoder.EndDecoding();
  111|     59|  return true;
  112|    118|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    233|                              uint32_t *out_values) {
   93|    233|  SymbolDecoderT decoder;
   94|    233|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 122, False: 111]
  ------------------
   95|    122|    return false;
   96|    122|  }
   97|       |
   98|    111|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 111, False: 0]
  |  Branch (98:25): [True: 10, False: 101]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    101|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 57, False: 44]
  ------------------
  103|     57|    return false;
  104|     57|  }
  105|   330k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 330k, False: 44]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   330k|    const uint32_t value = decoder.DecodeSymbol();
  108|   330k|    out_values[i] = value;
  109|   330k|  }
  110|     44|  decoder.EndDecoding();
  111|     44|  return true;
  112|    101|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    188|                              uint32_t *out_values) {
   93|    188|  SymbolDecoderT decoder;
   94|    188|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 118, False: 70]
  ------------------
   95|    118|    return false;
   96|    118|  }
   97|       |
   98|     70|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 70, False: 0]
  |  Branch (98:25): [True: 8, False: 62]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|     62|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 39, False: 23]
  ------------------
  103|     39|    return false;
  104|     39|  }
  105|   201k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 201k, False: 23]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   201k|    const uint32_t value = decoder.DecodeSymbol();
  108|   201k|    out_values[i] = value;
  109|   201k|  }
  110|     23|  decoder.EndDecoding();
  111|     23|  return true;
  112|     62|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    210|                              uint32_t *out_values) {
   93|    210|  SymbolDecoderT decoder;
   94|    210|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 106, False: 104]
  ------------------
   95|    106|    return false;
   96|    106|  }
   97|       |
   98|    104|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 104, False: 0]
  |  Branch (98:25): [True: 6, False: 98]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|     98|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 61, False: 37]
  ------------------
  103|     61|    return false;
  104|     61|  }
  105|   128k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 128k, False: 37]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   128k|    const uint32_t value = decoder.DecodeSymbol();
  108|   128k|    out_values[i] = value;
  109|   128k|  }
  110|     37|  decoder.EndDecoding();
  111|     37|  return true;
  112|     98|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    189|                              uint32_t *out_values) {
   93|    189|  SymbolDecoderT decoder;
   94|    189|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 119, False: 70]
  ------------------
   95|    119|    return false;
   96|    119|  }
   97|       |
   98|     70|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 70, False: 0]
  |  Branch (98:25): [True: 3, False: 67]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|     67|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 31, False: 36]
  ------------------
  103|     31|    return false;
  104|     31|  }
  105|   191k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 191k, False: 36]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   191k|    const uint32_t value = decoder.DecodeSymbol();
  108|   191k|    out_values[i] = value;
  109|   191k|  }
  110|     36|  decoder.EndDecoding();
  111|     36|  return true;
  112|     67|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    245|                              uint32_t *out_values) {
   93|    245|  SymbolDecoderT decoder;
   94|    245|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 114, False: 131]
  ------------------
   95|    114|    return false;
   96|    114|  }
   97|       |
   98|    131|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 131, False: 0]
  |  Branch (98:25): [True: 1, False: 130]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    130|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 76, False: 54]
  ------------------
  103|     76|    return false;
  104|     76|  }
  105|  96.8k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 96.7k, False: 54]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  96.7k|    const uint32_t value = decoder.DecodeSymbol();
  108|  96.7k|    out_values[i] = value;
  109|  96.7k|  }
  110|     54|  decoder.EndDecoding();
  111|     54|  return true;
  112|    130|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    223|                              uint32_t *out_values) {
   93|    223|  SymbolDecoderT decoder;
   94|    223|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 101, False: 122]
  ------------------
   95|    101|    return false;
   96|    101|  }
   97|       |
   98|    122|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 122, False: 0]
  |  Branch (98:25): [True: 2, False: 120]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    120|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 70, False: 50]
  ------------------
  103|     70|    return false;
  104|     70|  }
  105|  11.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 11.1M, False: 50]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  11.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  11.1M|    out_values[i] = value;
  109|  11.1M|  }
  110|     50|  decoder.EndDecoding();
  111|     50|  return true;
  112|    120|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    237|                              uint32_t *out_values) {
   93|    237|  SymbolDecoderT decoder;
   94|    237|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 92, False: 145]
  ------------------
   95|     92|    return false;
   96|     92|  }
   97|       |
   98|    145|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 145, False: 0]
  |  Branch (98:25): [True: 9, False: 136]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    136|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 101, False: 35]
  ------------------
  103|    101|    return false;
  104|    101|  }
  105|  9.01M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.01M, False: 35]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.01M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.01M|    out_values[i] = value;
  109|  9.01M|  }
  110|     35|  decoder.EndDecoding();
  111|     35|  return true;
  112|    136|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    254|                              uint32_t *out_values) {
   93|    254|  SymbolDecoderT decoder;
   94|    254|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 108, False: 146]
  ------------------
   95|    108|    return false;
   96|    108|  }
   97|       |
   98|    146|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 146, False: 0]
  |  Branch (98:25): [True: 12, False: 134]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    134|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 84, False: 50]
  ------------------
  103|     84|    return false;
  104|     84|  }
  105|  4.87M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.87M, False: 50]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.87M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.87M|    out_values[i] = value;
  109|  4.87M|  }
  110|     50|  decoder.EndDecoding();
  111|     50|  return true;
  112|    134|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    287|                              uint32_t *out_values) {
   93|    287|  SymbolDecoderT decoder;
   94|    287|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 117, False: 170]
  ------------------
   95|    117|    return false;
   96|    117|  }
   97|       |
   98|    170|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 170, False: 0]
  |  Branch (98:25): [True: 6, False: 164]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    164|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 100, False: 64]
  ------------------
  103|    100|    return false;
  104|    100|  }
  105|   116k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 116k, False: 64]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   116k|    const uint32_t value = decoder.DecodeSymbol();
  108|   116k|    out_values[i] = value;
  109|   116k|  }
  110|     64|  decoder.EndDecoding();
  111|     64|  return true;
  112|    164|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  5.89k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  2.06k|  const CornerTable *GetCornerTable() const override {
   67|  2.06k|    return corner_table_.get();
   68|  2.06k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  1.47M|                       int *out_encoder_split_symbol_id) {
   87|  1.47M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 1.27M, False: 200k]
  ------------------
   88|  1.27M|      return false;
   89|  1.27M|    }
   90|   200k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 9, False: 200k]
  ------------------
   91|   200k|        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|      9|      *out_encoder_split_symbol_id = -1;
   98|      9|      return true;
   99|      9|    }
  100|   200k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 199k, False: 1.04k]
  ------------------
  101|   199k|      return false;
  102|   199k|    }
  103|  1.04k|    *out_face_edge =
  104|  1.04k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.04k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.04k|    topology_split_data_.pop_back();
  108|  1.04k|    return true;
  109|   200k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  6.40M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  6.40M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  6.40M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  6.40M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  6.37k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  3.58k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  2.37k|  const CornerTable *GetCornerTable() const override {
   67|  2.37k|    return corner_table_.get();
   68|  2.37k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  17.3M|                       int *out_encoder_split_symbol_id) {
   87|  17.3M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 16.3M, False: 992k]
  ------------------
   88|  16.3M|      return false;
   89|  16.3M|    }
   90|   992k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 28, False: 992k]
  ------------------
   91|   992k|        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|   992k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 991k, False: 1.01k]
  ------------------
  101|   991k|      return false;
  102|   991k|    }
  103|  1.01k|    *out_face_edge =
  104|  1.01k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.01k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.01k|    topology_split_data_.pop_back();
  108|  1.01k|    return true;
  109|   992k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  51.8M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  51.8M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  51.8M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  51.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  3.59k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  9.30k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  1.88k|  const CornerTable *GetCornerTable() const override {
   67|  1.88k|    return corner_table_.get();
   68|  1.88k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  35.2M|                       int *out_encoder_split_symbol_id) {
   87|  35.2M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 34.9M, False: 344k]
  ------------------
   88|  34.9M|      return false;
   89|  34.9M|    }
   90|   344k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 24, False: 344k]
  ------------------
   91|   344k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     24|      *out_encoder_split_symbol_id = -1;
   98|     24|      return true;
   99|     24|    }
  100|   344k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 343k, False: 656]
  ------------------
  101|   343k|      return false;
  102|   343k|    }
  103|    656|    *out_face_edge =
  104|    656|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    656|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    656|    topology_split_data_.pop_back();
  108|    656|    return true;
  109|   344k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  40.3M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  40.3M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  40.3M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  40.3M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  4.99k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

_ZN5draco13HoleEventDataC2Ev:
  118|   564k|  HoleEventData() : symbol_id(0) {}

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  5.21k|      : attribute_connectivity_decoders_(nullptr),
   34|  5.21k|        num_attribute_data_(0),
   35|  5.21k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  4.86k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  4.86k|    decoder_impl_ = decoder;
   38|  4.86k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  4.86k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  4.86k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  4.86k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  4.20k|  uint16_t BitstreamVersion() const {
   45|  4.20k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  4.20k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  1.96k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  4.86k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  3.16k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  3.16k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 54, False: 3.10k]
  ------------------
   63|     54|      return false;
   64|     54|    }
   65|       |
   66|  3.10k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 52, False: 3.05k]
  ------------------
   67|     52|      return false;
   68|     52|    }
   69|       |
   70|  3.05k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 16, False: 3.04k]
  ------------------
   71|     16|      return false;
   72|     16|    }
   73|  3.04k|    *out_buffer = buffer_;
   74|  3.04k|    return true;
   75|  3.05k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  1.76M|  inline bool DecodeStartFaceConfiguration() {
   79|  1.76M|    uint32_t face_configuration;
   80|  1.76M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  1.76M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.76M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 578, False: 1.76M]
  ------------------
   82|    578|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    578|    } else
   85|  1.76M|#endif
   86|  1.76M|    {
   87|  1.76M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  1.76M|    }
   89|  1.76M|    return face_configuration;
   90|  1.76M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  4.41M|  inline uint32_t DecodeSymbol() {
   94|  4.41M|    uint32_t symbol;
   95|  4.41M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  4.41M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 2.15M, False: 2.26M]
  ------------------
   97|  2.15M|      return symbol;
   98|  2.15M|    }
   99|       |    // Else decode two additional bits.
  100|  2.26M|    uint32_t symbol_suffix;
  101|  2.26M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  2.26M|    symbol |= (symbol_suffix << 1);
  103|  2.26M|    return symbol;
  104|  4.41M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  4.36M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|   771k|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  10.9M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  10.9M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  10.9M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  2.94k|  void Done() {
  123|  2.94k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 2.73k, False: 203]
  ------------------
  124|  2.73k|      symbol_buffer_.EndBitDecoding();
  125|  2.73k|    }
  126|  2.94k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  2.94k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.94k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 225, False: 2.71k]
  ------------------
  128|    225|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    225|    } else
  131|  2.71k|#endif
  132|  2.71k|    {
  133|  2.71k|      start_face_decoder_.EndDecoding();
  134|  2.71k|    }
  135|  2.94k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  1.60k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  3.34k|  bool DecodeTraversalSymbols() {
  141|  3.34k|    uint64_t traversal_size;
  142|  3.34k|    symbol_buffer_ = buffer_;
  143|  3.34k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 15, False: 3.33k]
  ------------------
  144|     15|      return false;
  145|     15|    }
  146|  3.33k|    buffer_ = symbol_buffer_;
  147|  3.33k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 73, False: 3.26k]
  ------------------
  148|     73|      return false;
  149|     73|    }
  150|  3.26k|    buffer_.Advance(traversal_size);
  151|  3.26k|    return true;
  152|  3.33k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  4.77k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  4.77k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  4.77k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.77k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 459, False: 4.31k]
  ------------------
  158|    459|      start_face_buffer_ = buffer_;
  159|    459|      uint64_t traversal_size;
  160|    459|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 2, False: 457]
  ------------------
  161|      2|        return false;
  162|      2|      }
  163|    457|      buffer_ = start_face_buffer_;
  164|    457|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 98, False: 359]
  ------------------
  165|     98|        return false;
  166|     98|      }
  167|    359|      buffer_.Advance(traversal_size);
  168|    359|      return true;
  169|    457|    }
  170|  4.31k|#endif
  171|  4.31k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  4.77k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  4.66k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  4.66k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 2.96k, False: 1.69k]
  ------------------
  177|  2.96k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  2.96k|          new BinaryDecoder[num_attribute_data_]);
  179|  9.02k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 6.08k, False: 2.94k]
  ------------------
  180|  6.08k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 21, False: 6.06k]
  ------------------
  181|     21|          return false;
  182|     21|        }
  183|  6.08k|      }
  184|  2.96k|    }
  185|  4.64k|    return true;
  186|  4.66k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  1.37k|MeshSequentialDecoder::MeshSequentialDecoder() {}
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  1.26k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  1.26k|  uint32_t num_faces;
   31|  1.26k|  uint32_t num_points;
   32|  1.26k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  1.26k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.26k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 182, False: 1.08k]
  ------------------
   34|    182|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 0, False: 182]
  ------------------
   35|      0|      return false;
   36|      0|    }
   37|    182|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 0, False: 182]
  ------------------
   38|      0|      return false;
   39|      0|    }
   40|       |
   41|    182|  } else
   42|  1.08k|#endif
   43|  1.08k|  {
   44|  1.08k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 0, False: 1.08k]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|  1.08k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 0, False: 1.08k]
  ------------------
   48|      0|      return false;
   49|      0|    }
   50|  1.08k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  1.26k|  const uint64_t faces_64 = static_cast<uint64_t>(num_faces);
   54|       |  // Compressed sequential encoding can only handle (2^32 - 1) / 3 indices.
   55|  1.26k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 0, False: 1.26k]
  ------------------
   56|      0|    return false;
   57|      0|  }
   58|  1.26k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 1, False: 1.26k]
  ------------------
   59|       |    // The number of faces is unreasonably high, because face indices do not
   60|       |    // fit in the remaining size of the buffer.
   61|      1|    return false;
   62|      1|  }
   63|  1.26k|  uint8_t connectivity_method;
   64|  1.26k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 0, False: 1.26k]
  ------------------
   65|      0|    return false;
   66|      0|  }
   67|  1.26k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 1.02k, False: 242]
  ------------------
   68|  1.02k|    if (!DecodeAndDecompressIndices(num_faces, num_points)) {
  ------------------
  |  Branch (68:9): [True: 1.01k, False: 13]
  ------------------
   69|  1.01k|      return false;
   70|  1.01k|    }
   71|  1.02k|  } else {
   72|    242|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 104, False: 138]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|    196|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 97, False: 99]
  ------------------
   75|     97|        Mesh::Face face;
   76|    375|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 283, False: 92]
  ------------------
   77|    283|          uint8_t val;
   78|    283|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 0, False: 283]
  ------------------
   79|      0|            return false;
   80|      0|          }
   81|    283|          if (val >= num_points) {
  ------------------
  |  Branch (81:15): [True: 5, False: 278]
  ------------------
   82|      5|            return false;
   83|      5|          }
   84|    278|          face[j] = val;
   85|    278|        }
   86|     92|        mesh()->AddFace(face);
   87|     92|      }
   88|    138|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (88:16): [True: 29, False: 109]
  ------------------
   89|       |      // Decode indices as uint16_t.
   90|    201|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:28): [True: 193, False: 8]
  ------------------
   91|    193|        Mesh::Face face;
   92|    734|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (92:25): [True: 562, False: 172]
  ------------------
   93|    562|          uint16_t val;
   94|    562|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (94:15): [True: 2, False: 560]
  ------------------
   95|      2|            return false;
   96|      2|          }
   97|    560|          if (val >= num_points) {
  ------------------
  |  Branch (97:15): [True: 19, False: 541]
  ------------------
   98|     19|            return false;
   99|     19|          }
  100|    541|          face[j] = val;
  101|    541|        }
  102|    172|        mesh()->AddFace(face);
  103|    172|      }
  104|    109|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (104:16): [True: 84, False: 25]
  ------------------
  105|     84|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     84|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (105:16): [True: 83, False: 1]
  ------------------
  106|       |      // Decode indices as uint32_t.
  107|    457|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (107:28): [True: 389, False: 68]
  ------------------
  108|    389|        Mesh::Face face;
  109|  1.52k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (109:25): [True: 1.15k, False: 374]
  ------------------
  110|  1.15k|          uint32_t val;
  111|  1.15k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (111:15): [True: 4, False: 1.14k]
  ------------------
  112|      4|            return false;
  113|      4|          }
  114|  1.14k|          if (val >= num_points) {
  ------------------
  |  Branch (114:15): [True: 11, False: 1.13k]
  ------------------
  115|     11|            return false;
  116|     11|          }
  117|  1.13k|          face[j] = val;
  118|  1.13k|        }
  119|    374|        mesh()->AddFace(face);
  120|    374|      }
  121|     83|    } else {
  122|       |      // Decode faces as uint32_t (default).
  123|    114|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (123:28): [True: 104, False: 10]
  ------------------
  124|    104|        Mesh::Face face;
  125|    384|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (125:25): [True: 296, False: 88]
  ------------------
  126|    296|          uint32_t val;
  127|    296|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (127:15): [True: 4, False: 292]
  ------------------
  128|      4|            return false;
  129|      4|          }
  130|    292|          if (val >= num_points) {
  ------------------
  |  Branch (130:15): [True: 12, False: 280]
  ------------------
  131|     12|            return false;
  132|     12|          }
  133|    280|          face[j] = val;
  134|    280|        }
  135|     88|        mesh()->AddFace(face);
  136|     88|      }
  137|     26|    }
  138|    242|  }
  139|    198|  point_cloud()->set_num_points(num_points);
  140|    198|  return true;
  141|  1.26k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  143|  2.26k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  144|       |  // Always create the basic attribute decoder.
  145|  2.26k|  return SetAttributesDecoder(
  146|  2.26k|      att_decoder_id,
  147|  2.26k|      std::unique_ptr<AttributesDecoder>(
  148|  2.26k|          new SequentialAttributeDecodersController(
  149|  2.26k|              std::unique_ptr<PointsSequencer>(
  150|  2.26k|                  new LinearSequencer(point_cloud()->num_points())))));
  151|  2.26k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEjj:
  154|  1.02k|                                                       uint32_t num_points) {
  155|       |  // Get decoded indices differences that were encoded with an entropy code.
  156|  1.02k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  157|  1.02k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (157:7): [True: 981, False: 42]
  ------------------
  158|    981|    return false;
  159|    981|  }
  160|       |  // Reconstruct the indices from the differences.
  161|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  162|     42|  int32_t last_index_value = 0;  // This will always be >= 0.
  163|     42|  int vertex_index = 0;
  164|    133|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (164:24): [True: 120, False: 13]
  ------------------
  165|    120|    Mesh::Face face;
  166|    406|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (166:21): [True: 315, False: 91]
  ------------------
  167|    315|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  168|    315|      int32_t index_diff = (encoded_val >> 1);
  169|    315|      if (encoded_val & 1) {
  ------------------
  |  Branch (169:11): [True: 102, False: 213]
  ------------------
  170|    102|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (170:13): [True: 12, False: 90]
  ------------------
  171|       |          // Subtracting index_diff would result in a negative index.
  172|     12|          return false;
  173|     12|        }
  174|     90|        index_diff = -index_diff;
  175|    213|      } else {
  176|    213|        if (index_diff >
  ------------------
  |  Branch (176:13): [True: 0, False: 213]
  ------------------
  177|    213|            (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|    213|      }
  182|    303|      const int32_t index_value = index_diff + last_index_value;
  183|    303|      if (index_value < 0 ||
  ------------------
  |  Branch (183:11): [True: 0, False: 303]
  ------------------
  184|    303|          static_cast<uint32_t>(index_value) >= num_points) {
  ------------------
  |  Branch (184:11): [True: 17, False: 286]
  ------------------
  185|     17|        return false;
  186|     17|      }
  187|    286|      face[j] = index_value;
  188|    286|      last_index_value = index_value;
  189|    286|    }
  190|     91|    mesh()->AddFace(face);
  191|     91|  }
  192|     13|  return true;
  193|     42|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    907|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.09M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.09M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.08M, False: 3.79k]
  ------------------
   61|  1.08M|      return true;  // Already traversed.
   62|  1.08M|    }
   63|       |
   64|  3.79k|    corner_traversal_stack_.clear();
   65|  3.79k|    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.79k|    const VertexIndex next_vert =
   69|  3.79k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  3.79k|    const VertexIndex prev_vert =
   71|  3.79k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  3.79k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3.79k]
  |  Branch (72:45): [True: 0, False: 3.79k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  3.79k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 3.14k, False: 655]
  ------------------
   76|  3.14k|      this->MarkVertexVisited(next_vert);
   77|  3.14k|      this->traversal_observer().OnNewVertexVisited(
   78|  3.14k|          next_vert, this->corner_table()->Next(corner_id));
   79|  3.14k|    }
   80|  3.79k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.02k, False: 777]
  ------------------
   81|  3.02k|      this->MarkVertexVisited(prev_vert);
   82|  3.02k|      this->traversal_observer().OnNewVertexVisited(
   83|  3.02k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.02k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  16.8k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 13.0k, False: 3.79k]
  ------------------
   88|       |      // Currently processed corner.
   89|  13.0k|      corner_id = corner_traversal_stack_.back();
   90|  13.0k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  13.0k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 13.0k]
  |  Branch (92:47): [True: 541, False: 12.5k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    541|        corner_traversal_stack_.pop_back();
   95|    541|        continue;
   96|    541|      }
   97|  1.09M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.09M, Folded]
  ------------------
   98|  1.09M|        this->MarkFaceVisited(face_id);
   99|  1.09M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.09M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.09M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.09M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.09M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 553k, False: 538k]
  ------------------
  105|   553k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   553k|          this->MarkVertexVisited(vert_id);
  107|   553k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   553k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 535k, False: 18.1k]
  ------------------
  109|   535k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   535k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   535k|            continue;
  112|   535k|          }
  113|   553k|        }
  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|   556k|        const CornerIndex right_corner_id =
  118|   556k|            this->corner_table()->GetRightCorner(corner_id);
  119|   556k|        const CornerIndex left_corner_id =
  120|   556k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   556k|        const FaceIndex right_face_id(
  122|   556k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 13.0k, False: 543k]
  ------------------
  123|   556k|                 ? kInvalidFaceIndex
  124|   556k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   556k|        const FaceIndex left_face_id(
  126|   556k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 8.00k, False: 548k]
  ------------------
  127|   556k|                 ? kInvalidFaceIndex
  128|   556k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   556k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 539k, False: 17.6k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   539k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 7.89k, False: 531k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  7.89k|            corner_traversal_stack_.pop_back();
  134|  7.89k|            break;  // Break from the while (true) loop.
  135|   531k|          } else {
  136|       |            // Go to the left face.
  137|   531k|            corner_id = left_corner_id;
  138|   531k|            face_id = left_face_id;
  139|   531k|          }
  140|   539k|        } else {
  141|       |          // Right face was not visited.
  142|  17.6k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 12.9k, False: 4.64k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  12.9k|            corner_id = right_corner_id;
  145|  12.9k|            face_id = right_face_id;
  146|  12.9k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  4.64k|            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|  4.64k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  4.64k|            break;
  159|  4.64k|          }
  160|  17.6k|        }
  161|   556k|      }
  162|  12.5k|    }
  163|  3.79k|    return true;
  164|  3.79k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    907|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  1.92k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.24k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.85M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.85M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 668k, False: 1.18M]
  ------------------
   61|   668k|      return true;  // Already traversed.
   62|   668k|    }
   63|       |
   64|  1.18M|    corner_traversal_stack_.clear();
   65|  1.18M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  1.18M|    const VertexIndex next_vert =
   69|  1.18M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  1.18M|    const VertexIndex prev_vert =
   71|  1.18M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  1.18M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 1.18M]
  |  Branch (72:45): [True: 0, False: 1.18M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  1.18M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 1.18M, False: 829]
  ------------------
   76|  1.18M|      this->MarkVertexVisited(next_vert);
   77|  1.18M|      this->traversal_observer().OnNewVertexVisited(
   78|  1.18M|          next_vert, this->corner_table()->Next(corner_id));
   79|  1.18M|    }
   80|  1.18M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 1.18M, False: 6.20k]
  ------------------
   81|  1.18M|      this->MarkVertexVisited(prev_vert);
   82|  1.18M|      this->traversal_observer().OnNewVertexVisited(
   83|  1.18M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  1.18M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  2.40M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 1.22M, False: 1.18M]
  ------------------
   88|       |      // Currently processed corner.
   89|  1.22M|      corner_id = corner_traversal_stack_.back();
   90|  1.22M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  1.22M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 1.22M]
  |  Branch (92:47): [True: 2.25k, False: 1.21M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  2.25k|        corner_traversal_stack_.pop_back();
   95|  2.25k|        continue;
   96|  2.25k|      }
   97|  1.85M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.85M, Folded]
  ------------------
   98|  1.85M|        this->MarkFaceVisited(face_id);
   99|  1.85M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.85M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.85M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.85M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.85M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.53M, False: 327k]
  ------------------
  105|  1.53M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.53M|          this->MarkVertexVisited(vert_id);
  107|  1.53M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.53M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 314k, False: 1.21M]
  ------------------
  109|   314k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   314k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   314k|            continue;
  112|   314k|          }
  113|  1.53M|        }
  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.54M|        const CornerIndex right_corner_id =
  118|  1.54M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.54M|        const CornerIndex left_corner_id =
  120|  1.54M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.54M|        const FaceIndex right_face_id(
  122|  1.54M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 1.20M, False: 340k]
  ------------------
  123|  1.54M|                 ? kInvalidFaceIndex
  124|  1.54M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.54M|        const FaceIndex left_face_id(
  126|  1.54M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 1.20M, False: 340k]
  ------------------
  127|  1.54M|                 ? kInvalidFaceIndex
  128|  1.54M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.54M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.50M, False: 34.5k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.50M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 1.20M, False: 305k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  1.20M|            corner_traversal_stack_.pop_back();
  134|  1.20M|            break;  // Break from the while (true) loop.
  135|  1.20M|          } else {
  136|       |            // Go to the left face.
  137|   305k|            corner_id = left_corner_id;
  138|   305k|            face_id = left_face_id;
  139|   305k|          }
  140|  1.50M|        } else {
  141|       |          // Right face was not visited.
  142|  34.5k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 18.4k, False: 16.1k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  18.4k|            corner_id = right_corner_id;
  145|  18.4k|            face_id = right_face_id;
  146|  18.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|  16.1k|            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|  16.1k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  16.1k|            break;
  159|  16.1k|          }
  160|  34.5k|        }
  161|  1.54M|      }
  162|  1.21M|    }
  163|  1.18M|    return true;
  164|  1.18M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.24k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.58k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    388|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    689|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    689|    const auto *corner_table = traverser_.corner_table();
   50|    689|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    689|    const size_t num_faces = mesh_->num_faces();
   52|    689|    const size_t num_points = mesh_->num_points();
   53|  2.67M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 2.67M, False: 689]
  ------------------
   54|  2.67M|      const auto &face = mesh_->face(f);
   55|  10.6M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 8.02M, False: 2.67M]
  ------------------
   56|  8.02M|        const PointIndex point_id = face[p];
   57|  8.02M|        const VertexIndex vert_id =
   58|  8.02M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  8.02M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 8.02M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  8.02M|        const AttributeValueIndex att_entry_id(
   63|  8.02M|            encoding_data_
   64|  8.02M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  8.02M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 8.02M]
  |  Branch (65:13): [True: 0, False: 8.02M]
  |  Branch (65:39): [True: 0, False: 8.02M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  8.02M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  8.02M|      }
   71|  2.67M|    }
   72|    689|    return true;
   73|    689|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    347|  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|    347|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    347|    traverser_.OnTraversalStart();
   82|    347|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 347]
  ------------------
   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|    347|    } else {
   89|    347|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  1.53M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 1.53M, False: 347]
  ------------------
   91|  1.53M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 1.53M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  1.53M|      }
   95|    347|    }
   96|    347|    traverser_.OnTraversalEnd();
   97|    347|    return true;
   98|    347|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.53M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  1.53M|    return traverser_.TraverseFromCorner(corner_id);
  103|  1.53M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    388|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    964|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  3.91k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  3.91k|    const auto *corner_table = traverser_.corner_table();
   50|  3.91k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  3.91k|    const size_t num_faces = mesh_->num_faces();
   52|  3.91k|    const size_t num_points = mesh_->num_points();
   53|  2.03M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 2.03M, False: 3.91k]
  ------------------
   54|  2.03M|      const auto &face = mesh_->face(f);
   55|  8.12M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 6.09M, False: 2.03M]
  ------------------
   56|  6.09M|        const PointIndex point_id = face[p];
   57|  6.09M|        const VertexIndex vert_id =
   58|  6.09M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  6.09M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 6.09M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  6.09M|        const AttributeValueIndex att_entry_id(
   63|  6.09M|            encoding_data_
   64|  6.09M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  6.09M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 6.09M]
  |  Branch (65:13): [True: 0, False: 6.09M]
  |  Branch (65:39): [True: 0, False: 6.09M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  6.09M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  6.09M|      }
   71|  2.03M|    }
   72|  3.91k|    return true;
   73|  3.91k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    907|  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|    907|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    907|    traverser_.OnTraversalStart();
   82|    907|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 907]
  ------------------
   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|    907|    } else {
   89|    907|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  1.09M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 1.09M, False: 907]
  ------------------
   91|  1.09M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 1.09M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  1.09M|      }
   95|    907|    }
   96|    907|    traverser_.OnTraversalEnd();
   97|    907|    return true;
   98|    907|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.09M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  1.09M|    return traverser_.TraverseFromCorner(corner_id);
  103|  1.09M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    964|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.29k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  3.44k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  3.44k|    const auto *corner_table = traverser_.corner_table();
   50|  3.44k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  3.44k|    const size_t num_faces = mesh_->num_faces();
   52|  3.44k|    const size_t num_points = mesh_->num_points();
   53|  2.88M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 2.88M, False: 3.44k]
  ------------------
   54|  2.88M|      const auto &face = mesh_->face(f);
   55|  11.5M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 8.64M, False: 2.88M]
  ------------------
   56|  8.64M|        const PointIndex point_id = face[p];
   57|  8.64M|        const VertexIndex vert_id =
   58|  8.64M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  8.64M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 8.64M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  8.64M|        const AttributeValueIndex att_entry_id(
   63|  8.64M|            encoding_data_
   64|  8.64M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  8.64M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 8.64M]
  |  Branch (65:13): [True: 1, False: 8.64M]
  |  Branch (65:39): [True: 1, False: 8.64M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      1|          return false;
   68|      1|        }
   69|  8.64M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  8.64M|      }
   71|  2.88M|    }
   72|  3.44k|    return true;
   73|  3.44k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.24k|  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.24k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.24k|    traverser_.OnTraversalStart();
   82|  1.24k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.24k]
  ------------------
   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.24k|    } else {
   89|  1.24k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  1.85M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 1.85M, False: 1.24k]
  ------------------
   91|  1.85M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 1.85M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  1.85M|      }
   95|  1.24k|    }
   96|  1.24k|    traverser_.OnTraversalEnd();
   97|  1.24k|    return true;
   98|  1.24k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.85M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  1.85M|    return traverser_.TraverseFromCorner(corner_id);
  103|  1.85M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.29k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  2.58k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  17.8M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  9.47M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  9.47M|    return is_vertex_visited_[vert_id.value()];
   65|  9.47M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  1.35M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  1.35M|    is_vertex_visited_[vert_id.value()] = true;
   68|  1.35M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  3.97M|  inline TraversalObserverT &traversal_observer() {
   75|  3.97M|    return traversal_observer_;
   76|  3.97M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  7.15M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  7.15M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 67.1k, False: 7.08M]
  ------------------
   47|  67.1k|      return true;  // Invalid faces are always considered as visited.
   48|  67.1k|    }
   49|  7.08M|    return is_face_visited_[face_id.value()];
   50|  7.15M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.62M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.62M|    is_face_visited_[face_id.value()] = true;
   62|  2.62M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  2.70k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  2.70k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.35k|                    TraversalObserver traversal_observer) {
   37|  1.35k|    corner_table_ = corner_table;
   38|  1.35k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.35k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.35k|    traversal_observer_ = traversal_observer;
   41|  1.35k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.09M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.09M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.09M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.09M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.09M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  13.9M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.85M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.85M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.85M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.85M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.85M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  4.23M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  4.23M|    return is_vertex_visited_[vert_id.value()];
   65|  4.23M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  3.90M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  3.90M|    is_vertex_visited_[vert_id.value()] = true;
   68|  3.90M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  5.75M|  inline TraversalObserverT &traversal_observer() {
   75|  5.75M|    return traversal_observer_;
   76|  5.75M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  4.30M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  4.30M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 2.40M, False: 1.90M]
  ------------------
   47|  2.40M|      return true;  // Invalid faces are always considered as visited.
   48|  2.40M|    }
   49|  1.90M|    return is_face_visited_[face_id.value()];
   50|  4.30M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  1.85M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  1.85M|    is_face_visited_[face_id.value()] = true;
   62|  1.85M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  2.58k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.29k|                    TraversalObserver traversal_observer) {
   37|  1.29k|    corner_table_ = corner_table;
   38|  1.29k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.29k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.29k|    traversal_observer_ = traversal_observer;
   41|  1.29k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    240|      : bit_length_(0),
   87|    240|        num_points_(0),
   88|    240|        num_decoded_points_(0),
   89|    240|        dimension_(dimension),
   90|    240|        p_(dimension, 0),
   91|    240|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    240|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    240|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    147|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    147|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 9, False: 138]
  ------------------
  187|      9|    return false;
  188|      9|  }
  189|    138|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 9, False: 129]
  ------------------
  190|      9|    return false;
  191|      9|  }
  192|    129|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 127]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    127|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 53, False: 74]
  ------------------
  196|     53|    return true;
  197|     53|  }
  198|     74|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 28, False: 46]
  ------------------
  199|     28|    return false;
  200|     28|  }
  201|     46|  num_decoded_points_ = 0;
  202|       |
  203|     46|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 41]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     41|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 41]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     41|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 40]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     40|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 39]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     39|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 28, False: 11]
  ------------------
  217|     28|    return false;
  218|     28|  }
  219|       |
  220|     11|  numbers_decoder_.EndDecoding();
  221|     11|  remaining_bits_decoder_.EndDecoding();
  222|     11|  axis_decoder_.EndDecoding();
  223|     11|  half_decoder_.EndDecoding();
  224|       |
  225|     11|  return true;
  226|     39|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     39|    uint32_t num_points, OutputIteratorT &oit) {
  254|     39|  typedef DecodingStatus Status;
  255|     39|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     39|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     39|  DecodingStatus init_status(num_points, 0, 0);
  258|     39|  std::stack<Status> status_stack;
  259|     39|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   560k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 560k, False: 11]
  ------------------
  263|   560k|    const DecodingStatus status = status_stack.top();
  264|   560k|    status_stack.pop();
  265|       |
  266|   560k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   560k|    const uint32_t last_axis = status.last_axis;
  268|   560k|    const uint32_t stack_pos = status.stack_pos;
  269|   560k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   560k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   560k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 560k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   560k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   560k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 560k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   560k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   560k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 279k, False: 280k]
  ------------------
  285|  1.64M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 1.36M, False: 279k]
  ------------------
  286|  1.36M|        *oit = old_base;
  287|  1.36M|        ++oit;
  288|  1.36M|        ++num_decoded_points_;
  289|  1.36M|      }
  290|   279k|      continue;
  291|   279k|    }
  292|       |
  293|   280k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   280k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 312, False: 280k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    312|      axes_[0] = axis;
  300|  1.45k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.14k, False: 312]
  ------------------
  301|  1.14k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.14k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 62, False: 1.07k]
  |  |  ------------------
  ------------------
  302|  1.14k|      }
  303|    833|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 539, False: 294]
  ------------------
  304|  1.44k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 920, False: 521]
  ------------------
  305|    920|          p_[axes_[j]] = 0;
  306|    920|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|    920|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 780, False: 140]
  ------------------
  308|    780|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 18, False: 762]
  ------------------
  309|    780|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     18|              return false;
  311|     18|            }
  312|    780|          }
  313|    902|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|    902|        }
  315|    521|        *oit = p_;
  316|    521|        ++oit;
  317|    521|        ++num_decoded_points_;
  318|    521|      }
  319|    294|      continue;
  320|    312|    }
  321|       |
  322|   280k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 280k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   280k|    const int num_remaining_bits = bit_length_ - level;
  327|   280k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   280k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   280k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   280k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   280k|    uint32_t number = 0;
  334|   280k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   280k|    uint32_t first_half = num_remaining_points / 2;
  337|   280k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 10, False: 280k]
  ------------------
  338|       |      // Invalid |number|.
  339|     10|      return false;
  340|     10|    }
  341|   280k|    first_half -= number;
  342|   280k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   280k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 173k, False: 106k]
  ------------------
  345|   173k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 172k, False: 869]
  ------------------
  346|   172k|        std::swap(first_half, second_half);
  347|   172k|      }
  348|   173k|    }
  349|       |
  350|   280k|    levels_stack_[stack_pos][axis] += 1;
  351|   280k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   280k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 280k, False: 23]
  ------------------
  353|   280k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   280k|    }
  355|   280k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 280k, False: 29]
  ------------------
  356|   280k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   280k|    }
  358|   280k|  }
  359|     11|  return true;
  360|     39|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  1.98M|        : num_remaining_points(num_remaining_points_),
  135|  1.98M|          last_axis(last_axis_),
  136|  1.98M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|   990k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   990k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   990k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     64|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    201|      : bit_length_(0),
   87|    201|        num_points_(0),
   88|    201|        num_decoded_points_(0),
   89|    201|        dimension_(dimension),
   90|    201|        p_(dimension, 0),
   91|    201|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    201|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    201|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    107|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    107|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 5, False: 102]
  ------------------
  187|      5|    return false;
  188|      5|  }
  189|    102|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 11, False: 91]
  ------------------
  190|     11|    return false;
  191|     11|  }
  192|     91|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 89]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|     89|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 22, False: 67]
  ------------------
  196|     22|    return true;
  197|     22|  }
  198|     67|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 35, False: 32]
  ------------------
  199|     35|    return false;
  200|     35|  }
  201|     32|  num_decoded_points_ = 0;
  202|       |
  203|     32|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 29]
  ------------------
  204|      3|    return false;
  205|      3|  }
  206|     29|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 28]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     28|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 27]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     27|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 26]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     26|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 19, False: 7]
  ------------------
  217|     19|    return false;
  218|     19|  }
  219|       |
  220|      7|  numbers_decoder_.EndDecoding();
  221|      7|  remaining_bits_decoder_.EndDecoding();
  222|      7|  axis_decoder_.EndDecoding();
  223|      7|  half_decoder_.EndDecoding();
  224|       |
  225|      7|  return true;
  226|     26|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     26|    uint32_t num_points, OutputIteratorT &oit) {
  254|     26|  typedef DecodingStatus Status;
  255|     26|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     26|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     26|  DecodingStatus init_status(num_points, 0, 0);
  258|     26|  std::stack<Status> status_stack;
  259|     26|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   732k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 732k, False: 7]
  ------------------
  263|   732k|    const DecodingStatus status = status_stack.top();
  264|   732k|    status_stack.pop();
  265|       |
  266|   732k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   732k|    const uint32_t last_axis = status.last_axis;
  268|   732k|    const uint32_t stack_pos = status.stack_pos;
  269|   732k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   732k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   732k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 732k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   732k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   732k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 732k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   732k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   732k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 365k, False: 366k]
  ------------------
  285|  8.58M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 8.22M, False: 365k]
  ------------------
  286|  8.22M|        *oit = old_base;
  287|  8.22M|        ++oit;
  288|  8.22M|        ++num_decoded_points_;
  289|  8.22M|      }
  290|   365k|      continue;
  291|   365k|    }
  292|       |
  293|   366k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   366k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 276, False: 366k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    276|      axes_[0] = axis;
  300|    777|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 501, False: 276]
  ------------------
  301|    501|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    501|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 20, False: 481]
  |  |  ------------------
  ------------------
  302|    501|      }
  303|    761|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 495, False: 266]
  ------------------
  304|  1.85k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 1.36k, False: 485]
  ------------------
  305|  1.36k|          p_[axes_[j]] = 0;
  306|  1.36k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  1.36k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 568, False: 798]
  ------------------
  308|    568|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 10, False: 558]
  ------------------
  309|    568|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     10|              return false;
  311|     10|            }
  312|    568|          }
  313|  1.35k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  1.35k|        }
  315|    485|        *oit = p_;
  316|    485|        ++oit;
  317|    485|        ++num_decoded_points_;
  318|    485|      }
  319|    266|      continue;
  320|    276|    }
  321|       |
  322|   366k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 366k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   366k|    const int num_remaining_bits = bit_length_ - level;
  327|   366k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   366k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   366k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   366k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   366k|    uint32_t number = 0;
  334|   366k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   366k|    uint32_t first_half = num_remaining_points / 2;
  337|   366k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 9, False: 366k]
  ------------------
  338|       |      // Invalid |number|.
  339|      9|      return false;
  340|      9|    }
  341|   366k|    first_half -= number;
  342|   366k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   366k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 188k, False: 178k]
  ------------------
  345|   188k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 185k, False: 2.36k]
  ------------------
  346|   185k|        std::swap(first_half, second_half);
  347|   185k|      }
  348|   188k|    }
  349|       |
  350|   366k|    levels_stack_[stack_pos][axis] += 1;
  351|   366k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   366k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 366k, False: 2]
  ------------------
  353|   366k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   366k|    }
  355|   366k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 366k, False: 5]
  ------------------
  356|   366k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   366k|    }
  358|   366k|  }
  359|      7|  return true;
  360|     26|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  7.22M|        : num_remaining_points(num_remaining_points_),
  135|  7.22M|          last_axis(last_axis_),
  136|  7.22M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  7.22M|    uint32_t last_axis) {
  232|  7.22M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 7.22M, Folded]
  ------------------
  233|  7.22M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  7.22M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.06M, False: 5.16M]
  |  |  ------------------
  ------------------
  234|  7.22M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  7.22M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  3.61M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  3.61M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  3.61M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|     29|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    189|      : bit_length_(0),
   87|    189|        num_points_(0),
   88|    189|        num_decoded_points_(0),
   89|    189|        dimension_(dimension),
   90|    189|        p_(dimension, 0),
   91|    189|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    189|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    189|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    105|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    105|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 103]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|    103|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 95]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|     95|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 95]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     95|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 18, False: 77]
  ------------------
  196|     18|    return true;
  197|     18|  }
  198|     77|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 20, False: 57]
  ------------------
  199|     20|    return false;
  200|     20|  }
  201|     57|  num_decoded_points_ = 0;
  202|       |
  203|     57|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 57]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|     57|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 53]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     53|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 50]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     50|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 49]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     49|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 45, False: 4]
  ------------------
  217|     45|    return false;
  218|     45|  }
  219|       |
  220|      4|  numbers_decoder_.EndDecoding();
  221|      4|  remaining_bits_decoder_.EndDecoding();
  222|      4|  axis_decoder_.EndDecoding();
  223|      4|  half_decoder_.EndDecoding();
  224|       |
  225|      4|  return true;
  226|     49|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     49|    uint32_t num_points, OutputIteratorT &oit) {
  254|     49|  typedef DecodingStatus Status;
  255|     49|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     49|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     49|  DecodingStatus init_status(num_points, 0, 0);
  258|     49|  std::stack<Status> status_stack;
  259|     49|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  13.5k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 13.5k, False: 4]
  ------------------
  263|  13.5k|    const DecodingStatus status = status_stack.top();
  264|  13.5k|    status_stack.pop();
  265|       |
  266|  13.5k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  13.5k|    const uint32_t last_axis = status.last_axis;
  268|  13.5k|    const uint32_t stack_pos = status.stack_pos;
  269|  13.5k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  13.5k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  13.5k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 13.5k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  13.5k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  13.5k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 13.5k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  13.5k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  13.5k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.14k, False: 9.40k]
  ------------------
  285|  3.90M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 3.89M, False: 4.14k]
  ------------------
  286|  3.89M|        *oit = old_base;
  287|  3.89M|        ++oit;
  288|  3.89M|        ++num_decoded_points_;
  289|  3.89M|      }
  290|  4.14k|      continue;
  291|  4.14k|    }
  292|       |
  293|  9.40k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  9.40k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 303, False: 9.10k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    303|      axes_[0] = axis;
  300|  1.19k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 891, False: 303]
  ------------------
  301|    891|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    891|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 84, False: 807]
  |  |  ------------------
  ------------------
  302|    891|      }
  303|    857|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 564, False: 293]
  ------------------
  304|  2.28k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 1.72k, False: 554]
  ------------------
  305|  1.72k|          p_[axes_[j]] = 0;
  306|  1.72k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  1.72k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 943, False: 786]
  ------------------
  308|    943|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 10, False: 933]
  ------------------
  309|    943|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     10|              return false;
  311|     10|            }
  312|    943|          }
  313|  1.71k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  1.71k|        }
  315|    554|        *oit = p_;
  316|    554|        ++oit;
  317|    554|        ++num_decoded_points_;
  318|    554|      }
  319|    293|      continue;
  320|    303|    }
  321|       |
  322|  9.10k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 9.10k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  9.10k|    const int num_remaining_bits = bit_length_ - level;
  327|  9.10k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  9.10k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  9.10k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  9.10k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  9.10k|    uint32_t number = 0;
  334|  9.10k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  9.10k|    uint32_t first_half = num_remaining_points / 2;
  337|  9.10k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 35, False: 9.06k]
  ------------------
  338|       |      // Invalid |number|.
  339|     35|      return false;
  340|     35|    }
  341|  9.06k|    first_half -= number;
  342|  9.06k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  9.06k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 6.90k, False: 2.16k]
  ------------------
  345|  6.90k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 5.59k, False: 1.30k]
  ------------------
  346|  5.59k|        std::swap(first_half, second_half);
  347|  5.59k|      }
  348|  6.90k|    }
  349|       |
  350|  9.06k|    levels_stack_[stack_pos][axis] += 1;
  351|  9.06k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  9.06k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 8.27k, False: 789]
  ------------------
  353|  8.27k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  8.27k|    }
  355|  9.06k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 5.49k, False: 3.56k]
  ------------------
  356|  5.49k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  5.49k|    }
  358|  9.06k|  }
  359|      4|  return true;
  360|     49|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  4.23M|        : num_remaining_points(num_remaining_points_),
  135|  4.23M|          last_axis(last_axis_),
  136|  4.23M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  2.11M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.11M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.11M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|     22|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    194|      : bit_length_(0),
   87|    194|        num_points_(0),
   88|    194|        num_decoded_points_(0),
   89|    194|        dimension_(dimension),
   90|    194|        p_(dimension, 0),
   91|    194|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    194|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    194|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    100|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    100|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 98]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|     98|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 91]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|     91|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 90]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     90|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 11, False: 79]
  ------------------
  196|     11|    return true;
  197|     11|  }
  198|     79|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 26, False: 53]
  ------------------
  199|     26|    return false;
  200|     26|  }
  201|     53|  num_decoded_points_ = 0;
  202|       |
  203|     53|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 52]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|     52|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 49]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     49|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 47]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     47|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 46]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     46|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 42, False: 4]
  ------------------
  217|     42|    return false;
  218|     42|  }
  219|       |
  220|      4|  numbers_decoder_.EndDecoding();
  221|      4|  remaining_bits_decoder_.EndDecoding();
  222|      4|  axis_decoder_.EndDecoding();
  223|      4|  half_decoder_.EndDecoding();
  224|       |
  225|      4|  return true;
  226|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     46|    uint32_t num_points, OutputIteratorT &oit) {
  254|     46|  typedef DecodingStatus Status;
  255|     46|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     46|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     46|  DecodingStatus init_status(num_points, 0, 0);
  258|     46|  std::stack<Status> status_stack;
  259|     46|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  14.3k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 14.3k, False: 4]
  ------------------
  263|  14.3k|    const DecodingStatus status = status_stack.top();
  264|  14.3k|    status_stack.pop();
  265|       |
  266|  14.3k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  14.3k|    const uint32_t last_axis = status.last_axis;
  268|  14.3k|    const uint32_t stack_pos = status.stack_pos;
  269|  14.3k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  14.3k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  14.3k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 14.3k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  14.3k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  14.3k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 14.3k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  14.3k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  14.3k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.00k, False: 12.3k]
  ------------------
  285|   148k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 146k, False: 2.00k]
  ------------------
  286|   146k|        *oit = old_base;
  287|   146k|        ++oit;
  288|   146k|        ++num_decoded_points_;
  289|   146k|      }
  290|  2.00k|      continue;
  291|  2.00k|    }
  292|       |
  293|  12.3k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  12.3k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 253, False: 12.1k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    253|      axes_[0] = axis;
  300|  1.00k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 751, False: 253]
  ------------------
  301|    751|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    751|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 13, False: 738]
  |  |  ------------------
  ------------------
  302|    751|      }
  303|    647|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 401, False: 246]
  ------------------
  304|  1.84k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 1.44k, False: 394]
  ------------------
  305|  1.44k|          p_[axes_[j]] = 0;
  306|  1.44k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  1.44k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 494, False: 954]
  ------------------
  308|    494|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 7, False: 487]
  ------------------
  309|    494|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      7|              return false;
  311|      7|            }
  312|    494|          }
  313|  1.44k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  1.44k|        }
  315|    394|        *oit = p_;
  316|    394|        ++oit;
  317|    394|        ++num_decoded_points_;
  318|    394|      }
  319|    246|      continue;
  320|    253|    }
  321|       |
  322|  12.1k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 12.1k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  12.1k|    const int num_remaining_bits = bit_length_ - level;
  327|  12.1k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  12.1k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  12.1k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  12.1k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  12.1k|    uint32_t number = 0;
  334|  12.1k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  12.1k|    uint32_t first_half = num_remaining_points / 2;
  337|  12.1k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 35, False: 12.0k]
  ------------------
  338|       |      // Invalid |number|.
  339|     35|      return false;
  340|     35|    }
  341|  12.0k|    first_half -= number;
  342|  12.0k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  12.0k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 10.6k, False: 1.48k]
  ------------------
  345|  10.6k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 9.44k, False: 1.16k]
  ------------------
  346|  9.44k|        std::swap(first_half, second_half);
  347|  9.44k|      }
  348|  10.6k|    }
  349|       |
  350|  12.0k|    levels_stack_[stack_pos][axis] += 1;
  351|  12.0k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  12.0k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 11.2k, False: 819]
  ------------------
  353|  11.2k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  11.2k|    }
  355|  12.0k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 3.31k, False: 8.77k]
  ------------------
  356|  3.31k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  3.31k|    }
  358|  12.0k|  }
  359|      4|  return true;
  360|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  44.0k|        : num_remaining_points(num_remaining_points_),
  135|  44.0k|          last_axis(last_axis_),
  136|  44.0k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  43.0k|    uint32_t last_axis) {
  232|  43.0k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 43.0k, Folded]
  ------------------
  233|  43.0k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  43.0k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 11.0k, False: 31.9k]
  |  |  ------------------
  ------------------
  234|  43.0k|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  43.0k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  26.9k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  26.9k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  26.9k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|     15|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    147|      : bit_length_(0),
   87|    147|        num_points_(0),
   88|    147|        num_decoded_points_(0),
   89|    147|        dimension_(dimension),
   90|    147|        p_(dimension, 0),
   91|    147|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    147|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    147|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    109|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    109|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 107]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|    107|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 4, False: 103]
  ------------------
  190|      4|    return false;
  191|      4|  }
  192|    103|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 103]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    103|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 23, False: 80]
  ------------------
  196|     23|    return true;
  197|     23|  }
  198|     80|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 6, False: 74]
  ------------------
  199|      6|    return false;
  200|      6|  }
  201|     74|  num_decoded_points_ = 0;
  202|       |
  203|     74|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 9, False: 65]
  ------------------
  204|      9|    return false;
  205|      9|  }
  206|     65|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 65]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     65|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 63]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     63|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 62]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     62|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 48, False: 14]
  ------------------
  217|     48|    return false;
  218|     48|  }
  219|       |
  220|     14|  numbers_decoder_.EndDecoding();
  221|     14|  remaining_bits_decoder_.EndDecoding();
  222|     14|  axis_decoder_.EndDecoding();
  223|     14|  half_decoder_.EndDecoding();
  224|       |
  225|     14|  return true;
  226|     62|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     62|    uint32_t num_points, OutputIteratorT &oit) {
  254|     62|  typedef DecodingStatus Status;
  255|     62|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     62|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     62|  DecodingStatus init_status(num_points, 0, 0);
  258|     62|  std::stack<Status> status_stack;
  259|     62|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.42M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.42M, False: 14]
  ------------------
  263|  2.42M|    const DecodingStatus status = status_stack.top();
  264|  2.42M|    status_stack.pop();
  265|       |
  266|  2.42M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.42M|    const uint32_t last_axis = status.last_axis;
  268|  2.42M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.42M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.42M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.42M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.42M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.42M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.42M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.42M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.42M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.42M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.13M, False: 1.28M]
  ------------------
  285|  53.5M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 52.4M, False: 1.13M]
  ------------------
  286|  52.4M|        *oit = old_base;
  287|  52.4M|        ++oit;
  288|  52.4M|        ++num_decoded_points_;
  289|  52.4M|      }
  290|  1.13M|      continue;
  291|  1.13M|    }
  292|       |
  293|  1.28M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  1.28M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 62.0k, False: 1.22M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  62.0k|      axes_[0] = axis;
  300|  98.1k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 36.1k, False: 62.0k]
  ------------------
  301|  36.1k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  36.1k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 12.9k, False: 23.1k]
  |  |  ------------------
  ------------------
  302|  36.1k|      }
  303|   157k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 95.9k, False: 62.0k]
  ------------------
  304|   240k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 145k, False: 95.8k]
  ------------------
  305|   145k|          p_[axes_[j]] = 0;
  306|   145k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   145k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 128k, False: 16.9k]
  ------------------
  308|   128k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 41, False: 128k]
  ------------------
  309|   128k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     41|              return false;
  311|     41|            }
  312|   128k|          }
  313|   144k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   144k|        }
  315|  95.8k|        *oit = p_;
  316|  95.8k|        ++oit;
  317|  95.8k|        ++num_decoded_points_;
  318|  95.8k|      }
  319|  62.0k|      continue;
  320|  62.0k|    }
  321|       |
  322|  1.22M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.22M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.22M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.22M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.22M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.22M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.22M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.22M|    uint32_t number = 0;
  334|  1.22M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.22M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.22M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 7, False: 1.22M]
  ------------------
  338|       |      // Invalid |number|.
  339|      7|      return false;
  340|      7|    }
  341|  1.22M|    first_half -= number;
  342|  1.22M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.22M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.18M, False: 41.6k]
  ------------------
  345|  1.18M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.15M, False: 23.9k]
  ------------------
  346|  1.15M|        std::swap(first_half, second_half);
  347|  1.15M|      }
  348|  1.18M|    }
  349|       |
  350|  1.22M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.22M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.22M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.21M, False: 9.13k]
  ------------------
  353|  1.21M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.21M|    }
  355|  1.22M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.20M, False: 16.9k]
  ------------------
  356|  1.20M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.20M|    }
  358|  1.22M|  }
  359|     14|  return true;
  360|     62|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  2.42M|        : num_remaining_points(num_remaining_points_),
  135|  2.42M|          last_axis(last_axis_),
  136|  2.42M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  1.22M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.22M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.22M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     37|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    152|      : bit_length_(0),
   87|    152|        num_points_(0),
   88|    152|        num_decoded_points_(0),
   89|    152|        dimension_(dimension),
   90|    152|        p_(dimension, 0),
   91|    152|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    152|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    152|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    127|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    127|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 127]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    127|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 121]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|    121|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 121]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    121|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 11, False: 110]
  ------------------
  196|     11|    return true;
  197|     11|  }
  198|    110|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 9, False: 101]
  ------------------
  199|      9|    return false;
  200|      9|  }
  201|    101|  num_decoded_points_ = 0;
  202|       |
  203|    101|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 33, False: 68]
  ------------------
  204|     33|    return false;
  205|     33|  }
  206|     68|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 64]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     64|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 62]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     62|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 59]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     59|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 32, False: 27]
  ------------------
  217|     32|    return false;
  218|     32|  }
  219|       |
  220|     27|  numbers_decoder_.EndDecoding();
  221|     27|  remaining_bits_decoder_.EndDecoding();
  222|     27|  axis_decoder_.EndDecoding();
  223|     27|  half_decoder_.EndDecoding();
  224|       |
  225|     27|  return true;
  226|     59|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     59|    uint32_t num_points, OutputIteratorT &oit) {
  254|     59|  typedef DecodingStatus Status;
  255|     59|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     59|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     59|  DecodingStatus init_status(num_points, 0, 0);
  258|     59|  std::stack<Status> status_stack;
  259|     59|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.15M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.15M, False: 27]
  ------------------
  263|  1.15M|    const DecodingStatus status = status_stack.top();
  264|  1.15M|    status_stack.pop();
  265|       |
  266|  1.15M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.15M|    const uint32_t last_axis = status.last_axis;
  268|  1.15M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.15M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.15M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.15M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.15M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.15M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.15M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.15M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.15M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.15M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 520k, False: 633k]
  ------------------
  285|  55.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 55.2M, False: 520k]
  ------------------
  286|  55.2M|        *oit = old_base;
  287|  55.2M|        ++oit;
  288|  55.2M|        ++num_decoded_points_;
  289|  55.2M|      }
  290|   520k|      continue;
  291|   520k|    }
  292|       |
  293|   633k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   633k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 44.7k, False: 589k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  44.7k|      axes_[0] = axis;
  300|   125k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 80.6k, False: 44.7k]
  ------------------
  301|  80.6k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  80.6k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 14.1k, False: 66.4k]
  |  |  ------------------
  ------------------
  302|  80.6k|      }
  303|   109k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 64.9k, False: 44.7k]
  ------------------
  304|   256k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 191k, False: 64.9k]
  ------------------
  305|   191k|          p_[axes_[j]] = 0;
  306|   191k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   191k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 102k, False: 88.3k]
  ------------------
  308|   102k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 31, False: 102k]
  ------------------
  309|   102k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     31|              return false;
  311|     31|            }
  312|   102k|          }
  313|   191k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   191k|        }
  315|  64.9k|        *oit = p_;
  316|  64.9k|        ++oit;
  317|  64.9k|        ++num_decoded_points_;
  318|  64.9k|      }
  319|  44.7k|      continue;
  320|  44.7k|    }
  321|       |
  322|   589k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 589k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   589k|    const int num_remaining_bits = bit_length_ - level;
  327|   589k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   589k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   589k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   589k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   589k|    uint32_t number = 0;
  334|   589k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   589k|    uint32_t first_half = num_remaining_points / 2;
  337|   589k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 589k]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|   589k|    first_half -= number;
  342|   589k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   589k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 572k, False: 16.5k]
  ------------------
  345|   572k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 541k, False: 30.8k]
  ------------------
  346|   541k|        std::swap(first_half, second_half);
  347|   541k|      }
  348|   572k|    }
  349|       |
  350|   589k|    levels_stack_[stack_pos][axis] += 1;
  351|   589k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   589k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 579k, False: 9.34k]
  ------------------
  353|   579k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   579k|    }
  355|   589k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 575k, False: 13.8k]
  ------------------
  356|   575k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   575k|    }
  358|   589k|  }
  359|     27|  return true;
  360|     59|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  1.15M|        : num_remaining_points(num_remaining_points_),
  135|  1.15M|          last_axis(last_axis_),
  136|  1.15M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.15M|    uint32_t last_axis) {
  232|  1.15M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.15M, Folded]
  ------------------
  233|  1.15M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.15M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 551k, False: 603k]
  |  |  ------------------
  ------------------
  234|  1.15M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  1.15M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|   589k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   589k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   589k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     38|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    108|      : bit_length_(0),
   87|    108|        num_points_(0),
   88|    108|        num_decoded_points_(0),
   89|    108|        dimension_(dimension),
   90|    108|        p_(dimension, 0),
   91|    108|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    108|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    108|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     89|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     89|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 88]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     88|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 85]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     85|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 84]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     84|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 19, False: 65]
  ------------------
  196|     19|    return true;
  197|     19|  }
  198|     65|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 3, False: 62]
  ------------------
  199|      3|    return false;
  200|      3|  }
  201|     62|  num_decoded_points_ = 0;
  202|       |
  203|     62|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 58]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|     58|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 58]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     58|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 56]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     56|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 55]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     55|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 43, False: 12]
  ------------------
  217|     43|    return false;
  218|     43|  }
  219|       |
  220|     12|  numbers_decoder_.EndDecoding();
  221|     12|  remaining_bits_decoder_.EndDecoding();
  222|     12|  axis_decoder_.EndDecoding();
  223|     12|  half_decoder_.EndDecoding();
  224|       |
  225|     12|  return true;
  226|     55|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     55|    uint32_t num_points, OutputIteratorT &oit) {
  254|     55|  typedef DecodingStatus Status;
  255|     55|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     55|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     55|  DecodingStatus init_status(num_points, 0, 0);
  258|     55|  std::stack<Status> status_stack;
  259|     55|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   104k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 104k, False: 12]
  ------------------
  263|   104k|    const DecodingStatus status = status_stack.top();
  264|   104k|    status_stack.pop();
  265|       |
  266|   104k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   104k|    const uint32_t last_axis = status.last_axis;
  268|   104k|    const uint32_t stack_pos = status.stack_pos;
  269|   104k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   104k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   104k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 104k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   104k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   104k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 3, False: 104k]
  ------------------
  278|      3|      return false;
  279|      3|    }
  280|       |
  281|   104k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   104k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 287, False: 103k]
  ------------------
  285|  39.9k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 39.6k, False: 287]
  ------------------
  286|  39.6k|        *oit = old_base;
  287|  39.6k|        ++oit;
  288|  39.6k|        ++num_decoded_points_;
  289|  39.6k|      }
  290|    287|      continue;
  291|    287|    }
  292|       |
  293|   103k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   103k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 453, False: 103k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    453|      axes_[0] = axis;
  300|  30.4k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 29.9k, False: 453]
  ------------------
  301|  29.9k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  29.9k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 443, False: 29.5k]
  |  |  ------------------
  ------------------
  302|  29.9k|      }
  303|  1.05k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 622, False: 429]
  ------------------
  304|  40.6k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 40.0k, False: 598]
  ------------------
  305|  40.0k|          p_[axes_[j]] = 0;
  306|  40.0k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  40.0k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 39.8k, False: 198]
  ------------------
  308|  39.8k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 24, False: 39.8k]
  ------------------
  309|  39.8k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     24|              return false;
  311|     24|            }
  312|  39.8k|          }
  313|  39.9k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  39.9k|        }
  315|    598|        *oit = p_;
  316|    598|        ++oit;
  317|    598|        ++num_decoded_points_;
  318|    598|      }
  319|    429|      continue;
  320|    453|    }
  321|       |
  322|   103k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 103k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   103k|    const int num_remaining_bits = bit_length_ - level;
  327|   103k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   103k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   103k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   103k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   103k|    uint32_t number = 0;
  334|   103k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   103k|    uint32_t first_half = num_remaining_points / 2;
  337|   103k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 16, False: 103k]
  ------------------
  338|       |      // Invalid |number|.
  339|     16|      return false;
  340|     16|    }
  341|   103k|    first_half -= number;
  342|   103k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   103k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 103k, False: 61]
  ------------------
  345|   103k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 81.6k, False: 21.7k]
  ------------------
  346|  81.6k|        std::swap(first_half, second_half);
  347|  81.6k|      }
  348|   103k|    }
  349|       |
  350|   103k|    levels_stack_[stack_pos][axis] += 1;
  351|   103k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   103k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 81.9k, False: 21.5k]
  ------------------
  353|  81.9k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  81.9k|    }
  355|   103k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 22.3k, False: 81.1k]
  ------------------
  356|  22.3k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  22.3k|    }
  358|   103k|  }
  359|     12|  return true;
  360|     55|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   104k|        : num_remaining_points(num_remaining_points_),
  135|   104k|          last_axis(last_axis_),
  136|   104k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   103k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   103k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   103k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     31|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.98M|    uint32_t last_axis) {
  232|  1.98M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.98M, Folded]
  ------------------
  233|  1.98M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.98M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 568k, False: 1.41M]
  |  |  ------------------
  ------------------
  234|  1.98M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  1.98M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.22M|    uint32_t last_axis) {
  232|  4.22M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.22M, Folded]
  ------------------
  233|  4.22M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.22M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.20M, False: 3.02M]
  |  |  ------------------
  ------------------
  234|  4.22M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  4.22M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.42M|    uint32_t last_axis) {
  232|  2.42M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.42M, Folded]
  ------------------
  233|  2.42M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.42M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.31M, False: 102k]
  |  |  ------------------
  ------------------
  234|  2.42M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  2.42M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   104k|    uint32_t last_axis) {
  232|   104k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 104k]
  ------------------
  233|      0|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|      0|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  234|      0|  }
  235|       |
  236|   104k|  uint32_t best_axis = 0;
  237|   104k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 103k, False: 396]
  ------------------
  238|  11.4M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 11.3M, False: 103k]
  ------------------
  239|  11.3M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 121k, False: 11.2M]
  ------------------
  240|   121k|        best_axis = axis;
  241|   121k|      }
  242|  11.3M|    }
  243|   103k|  } else {
  244|    396|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|    396|  }
  246|       |
  247|   104k|  return best_axis;
  248|   104k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     93|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     93|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     93|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     93|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     93|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 93]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     93|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 83]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|     83|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 82]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     82|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 81]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     81|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 81]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     81|  num_decoded_points_ = 0;
  202|       |
  203|     81|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 25, False: 56]
  ------------------
  204|     25|    return false;
  205|     25|  }
  206|     56|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 5, False: 51]
  ------------------
  207|      5|    return false;
  208|      5|  }
  209|     51|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 48]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     48|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 47]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     47|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 34, False: 13]
  ------------------
  217|     34|    return false;
  218|     34|  }
  219|       |
  220|     13|  numbers_decoder_.EndDecoding();
  221|     13|  remaining_bits_decoder_.EndDecoding();
  222|     13|  axis_decoder_.EndDecoding();
  223|     13|  half_decoder_.EndDecoding();
  224|       |
  225|     13|  return true;
  226|     47|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     47|    uint32_t num_points, OutputIteratorT &oit) {
  254|     47|  typedef DecodingStatus Status;
  255|     47|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     47|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     47|  DecodingStatus init_status(num_points, 0, 0);
  258|     47|  std::stack<Status> status_stack;
  259|     47|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.41M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.41M, False: 13]
  ------------------
  263|  1.41M|    const DecodingStatus status = status_stack.top();
  264|  1.41M|    status_stack.pop();
  265|       |
  266|  1.41M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.41M|    const uint32_t last_axis = status.last_axis;
  268|  1.41M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.41M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.41M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.41M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.41M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.41M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.41M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.41M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.41M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.41M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 708k, False: 711k]
  ------------------
  285|  97.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 96.5M, False: 708k]
  ------------------
  286|  96.5M|        *oit = old_base;
  287|  96.5M|        ++oit;
  288|  96.5M|        ++num_decoded_points_;
  289|  96.5M|      }
  290|   708k|      continue;
  291|   708k|    }
  292|       |
  293|   711k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   711k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 965, False: 710k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    965|      axes_[0] = axis;
  300|  2.89k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.93k, False: 965]
  ------------------
  301|  1.93k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.93k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 343, False: 1.58k]
  |  |  ------------------
  ------------------
  302|  1.93k|      }
  303|  2.61k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.67k, False: 945]
  ------------------
  304|  6.63k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.98k, False: 1.65k]
  ------------------
  305|  4.98k|          p_[axes_[j]] = 0;
  306|  4.98k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.98k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.61k, False: 2.37k]
  ------------------
  308|  2.61k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 20, False: 2.59k]
  ------------------
  309|  2.61k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     20|              return false;
  311|     20|            }
  312|  2.61k|          }
  313|  4.96k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.96k|        }
  315|  1.65k|        *oit = p_;
  316|  1.65k|        ++oit;
  317|  1.65k|        ++num_decoded_points_;
  318|  1.65k|      }
  319|    945|      continue;
  320|    965|    }
  321|       |
  322|   710k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 710k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   710k|    const int num_remaining_bits = bit_length_ - level;
  327|   710k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   710k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   710k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   710k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   710k|    uint32_t number = 0;
  334|   710k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   710k|    uint32_t first_half = num_remaining_points / 2;
  337|   710k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 14, False: 710k]
  ------------------
  338|       |      // Invalid |number|.
  339|     14|      return false;
  340|     14|    }
  341|   710k|    first_half -= number;
  342|   710k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   710k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 333k, False: 376k]
  ------------------
  345|   333k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 330k, False: 2.85k]
  ------------------
  346|   330k|        std::swap(first_half, second_half);
  347|   330k|      }
  348|   333k|    }
  349|       |
  350|   710k|    levels_stack_[stack_pos][axis] += 1;
  351|   710k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   710k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 710k, False: 61]
  ------------------
  353|   710k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   710k|    }
  355|   710k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 710k, False: 130]
  ------------------
  356|   710k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   710k|    }
  358|   710k|  }
  359|     13|  return true;
  360|     47|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     94|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     94|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     94|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     94|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     94|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 93]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     93|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 85]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|     85|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 84]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     84|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 83]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     83|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 83]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     83|  num_decoded_points_ = 0;
  202|       |
  203|     83|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 21, False: 62]
  ------------------
  204|     21|    return false;
  205|     21|  }
  206|     62|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 59]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     59|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 56]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     56|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 7, False: 49]
  ------------------
  213|      7|    return false;
  214|      7|  }
  215|       |
  216|     49|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 37, False: 12]
  ------------------
  217|     37|    return false;
  218|     37|  }
  219|       |
  220|     12|  numbers_decoder_.EndDecoding();
  221|     12|  remaining_bits_decoder_.EndDecoding();
  222|     12|  axis_decoder_.EndDecoding();
  223|     12|  half_decoder_.EndDecoding();
  224|       |
  225|     12|  return true;
  226|     49|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     49|    uint32_t num_points, OutputIteratorT &oit) {
  254|     49|  typedef DecodingStatus Status;
  255|     49|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     49|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     49|  DecodingStatus init_status(num_points, 0, 0);
  258|     49|  std::stack<Status> status_stack;
  259|     49|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  6.49M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 6.49M, False: 12]
  ------------------
  263|  6.49M|    const DecodingStatus status = status_stack.top();
  264|  6.49M|    status_stack.pop();
  265|       |
  266|  6.49M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  6.49M|    const uint32_t last_axis = status.last_axis;
  268|  6.49M|    const uint32_t stack_pos = status.stack_pos;
  269|  6.49M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  6.49M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  6.49M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 6.49M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  6.49M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  6.49M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 6.49M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  6.49M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  6.49M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 3.24M, False: 3.24M]
  ------------------
  285|  84.4M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 81.1M, False: 3.24M]
  ------------------
  286|  81.1M|        *oit = old_base;
  287|  81.1M|        ++oit;
  288|  81.1M|        ++num_decoded_points_;
  289|  81.1M|      }
  290|  3.24M|      continue;
  291|  3.24M|    }
  292|       |
  293|  3.24M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  3.24M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.25k, False: 3.24M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.25k|      axes_[0] = axis;
  300|  3.76k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.50k, False: 1.25k]
  ------------------
  301|  2.50k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.50k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 443, False: 2.06k]
  |  |  ------------------
  ------------------
  302|  2.50k|      }
  303|  3.36k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.13k, False: 1.23k]
  ------------------
  304|  8.49k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.37k, False: 2.11k]
  ------------------
  305|  6.37k|          p_[axes_[j]] = 0;
  306|  6.37k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.37k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.39k, False: 2.98k]
  ------------------
  308|  3.39k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 23, False: 3.37k]
  ------------------
  309|  3.39k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     23|              return false;
  311|     23|            }
  312|  3.39k|          }
  313|  6.35k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.35k|        }
  315|  2.11k|        *oit = p_;
  316|  2.11k|        ++oit;
  317|  2.11k|        ++num_decoded_points_;
  318|  2.11k|      }
  319|  1.23k|      continue;
  320|  1.25k|    }
  321|       |
  322|  3.24M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 3.24M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  3.24M|    const int num_remaining_bits = bit_length_ - level;
  327|  3.24M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  3.24M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  3.24M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  3.24M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  3.24M|    uint32_t number = 0;
  334|  3.24M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  3.24M|    uint32_t first_half = num_remaining_points / 2;
  337|  3.24M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 14, False: 3.24M]
  ------------------
  338|       |      // Invalid |number|.
  339|     14|      return false;
  340|     14|    }
  341|  3.24M|    first_half -= number;
  342|  3.24M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  3.24M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 2.04M, False: 1.19M]
  ------------------
  345|  2.04M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 2.04M, False: 2.95k]
  ------------------
  346|  2.04M|        std::swap(first_half, second_half);
  347|  2.04M|      }
  348|  2.04M|    }
  349|       |
  350|  3.24M|    levels_stack_[stack_pos][axis] += 1;
  351|  3.24M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  3.24M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 3.24M, False: 156]
  ------------------
  353|  3.24M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  3.24M|    }
  355|  3.24M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 3.24M, False: 84]
  ------------------
  356|  3.24M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  3.24M|    }
  358|  3.24M|  }
  359|     12|  return true;
  360|     49|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     84|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     84|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     84|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     84|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     84|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 82]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|     82|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 79]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     79|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 79]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     79|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 78]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     78|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 78]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     78|  num_decoded_points_ = 0;
  202|       |
  203|     78|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 24, False: 54]
  ------------------
  204|     24|    return false;
  205|     24|  }
  206|     54|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 51]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     51|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 49]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     49|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 47]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     47|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 42, False: 5]
  ------------------
  217|     42|    return false;
  218|     42|  }
  219|       |
  220|      5|  numbers_decoder_.EndDecoding();
  221|      5|  remaining_bits_decoder_.EndDecoding();
  222|      5|  axis_decoder_.EndDecoding();
  223|      5|  half_decoder_.EndDecoding();
  224|       |
  225|      5|  return true;
  226|     47|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     47|    uint32_t num_points, OutputIteratorT &oit) {
  254|     47|  typedef DecodingStatus Status;
  255|     47|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     47|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     47|  DecodingStatus init_status(num_points, 0, 0);
  258|     47|  std::stack<Status> status_stack;
  259|     47|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  4.21M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.21M, False: 5]
  ------------------
  263|  4.21M|    const DecodingStatus status = status_stack.top();
  264|  4.21M|    status_stack.pop();
  265|       |
  266|  4.21M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.21M|    const uint32_t last_axis = status.last_axis;
  268|  4.21M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.21M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.21M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.21M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.21M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.21M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.21M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.21M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.21M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.21M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.10M, False: 2.10M]
  ------------------
  285|  17.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 15.6M, False: 2.10M]
  ------------------
  286|  15.6M|        *oit = old_base;
  287|  15.6M|        ++oit;
  288|  15.6M|        ++num_decoded_points_;
  289|  15.6M|      }
  290|  2.10M|      continue;
  291|  2.10M|    }
  292|       |
  293|  2.10M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  2.10M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 494, False: 2.10M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    494|      axes_[0] = axis;
  300|  1.48k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 988, False: 494]
  ------------------
  301|    988|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    988|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 148, False: 840]
  |  |  ------------------
  ------------------
  302|    988|      }
  303|  1.32k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 835, False: 485]
  ------------------
  304|  3.31k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 2.49k, False: 826]
  ------------------
  305|  2.49k|          p_[axes_[j]] = 0;
  306|  2.49k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  2.49k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.37k, False: 1.11k]
  ------------------
  308|  1.37k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 9, False: 1.36k]
  ------------------
  309|  1.37k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      9|              return false;
  311|      9|            }
  312|  1.37k|          }
  313|  2.48k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  2.48k|        }
  315|    826|        *oit = p_;
  316|    826|        ++oit;
  317|    826|        ++num_decoded_points_;
  318|    826|      }
  319|    485|      continue;
  320|    494|    }
  321|       |
  322|  2.10M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.10M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.10M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.10M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.10M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.10M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.10M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.10M|    uint32_t number = 0;
  334|  2.10M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.10M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.10M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 33, False: 2.10M]
  ------------------
  338|       |      // Invalid |number|.
  339|     33|      return false;
  340|     33|    }
  341|  2.10M|    first_half -= number;
  342|  2.10M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.10M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 989k, False: 1.11M]
  ------------------
  345|   989k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 987k, False: 2.70k]
  ------------------
  346|   987k|        std::swap(first_half, second_half);
  347|   987k|      }
  348|   989k|    }
  349|       |
  350|  2.10M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.10M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.10M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.10M, False: 97]
  ------------------
  353|  2.10M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.10M|    }
  355|  2.10M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.10M, False: 143]
  ------------------
  356|  2.10M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.10M|    }
  358|  2.10M|  }
  359|      5|  return true;
  360|     47|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     94|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     94|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     94|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     94|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     94|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 93]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     93|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 5, False: 88]
  ------------------
  190|      5|    return false;
  191|      5|  }
  192|     88|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 87]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     87|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 86]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     86|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 86]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     86|  num_decoded_points_ = 0;
  202|       |
  203|     86|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 28, False: 58]
  ------------------
  204|     28|    return false;
  205|     28|  }
  206|     58|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 5, False: 53]
  ------------------
  207|      5|    return false;
  208|      5|  }
  209|     53|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 53]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     53|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 52]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     52|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 50, False: 2]
  ------------------
  217|     50|    return false;
  218|     50|  }
  219|       |
  220|      2|  numbers_decoder_.EndDecoding();
  221|      2|  remaining_bits_decoder_.EndDecoding();
  222|      2|  axis_decoder_.EndDecoding();
  223|      2|  half_decoder_.EndDecoding();
  224|       |
  225|      2|  return true;
  226|     52|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     52|    uint32_t num_points, OutputIteratorT &oit) {
  254|     52|  typedef DecodingStatus Status;
  255|     52|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     52|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     52|  DecodingStatus init_status(num_points, 0, 0);
  258|     52|  std::stack<Status> status_stack;
  259|     52|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  28.6k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 28.6k, False: 2]
  ------------------
  263|  28.6k|    const DecodingStatus status = status_stack.top();
  264|  28.6k|    status_stack.pop();
  265|       |
  266|  28.6k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  28.6k|    const uint32_t last_axis = status.last_axis;
  268|  28.6k|    const uint32_t stack_pos = status.stack_pos;
  269|  28.6k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  28.6k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  28.6k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 28.6k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  28.6k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  28.6k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 28.6k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  28.6k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  28.6k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 12.5k, False: 16.1k]
  ------------------
  285|  9.03M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 9.02M, False: 12.5k]
  ------------------
  286|  9.02M|        *oit = old_base;
  287|  9.02M|        ++oit;
  288|  9.02M|        ++num_decoded_points_;
  289|  9.02M|      }
  290|  12.5k|      continue;
  291|  12.5k|    }
  292|       |
  293|  16.1k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  16.1k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.31k, False: 14.8k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.31k|      axes_[0] = axis;
  300|  3.93k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.62k, False: 1.31k]
  ------------------
  301|  2.62k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.62k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 728, False: 1.89k]
  |  |  ------------------
  ------------------
  302|  2.62k|      }
  303|  3.60k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.30k, False: 1.29k]
  ------------------
  304|  9.19k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.90k, False: 2.29k]
  ------------------
  305|  6.90k|          p_[axes_[j]] = 0;
  306|  6.90k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.90k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.68k, False: 2.21k]
  ------------------
  308|  4.68k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 12, False: 4.67k]
  ------------------
  309|  4.68k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     12|              return false;
  311|     12|            }
  312|  4.68k|          }
  313|  6.88k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.88k|        }
  315|  2.29k|        *oit = p_;
  316|  2.29k|        ++oit;
  317|  2.29k|        ++num_decoded_points_;
  318|  2.29k|      }
  319|  1.29k|      continue;
  320|  1.31k|    }
  321|       |
  322|  14.8k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 14.8k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  14.8k|    const int num_remaining_bits = bit_length_ - level;
  327|  14.8k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  14.8k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  14.8k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  14.8k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  14.8k|    uint32_t number = 0;
  334|  14.8k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  14.8k|    uint32_t first_half = num_remaining_points / 2;
  337|  14.8k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 38, False: 14.7k]
  ------------------
  338|       |      // Invalid |number|.
  339|     38|      return false;
  340|     38|    }
  341|  14.7k|    first_half -= number;
  342|  14.7k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  14.7k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 8.84k, False: 5.92k]
  ------------------
  345|  8.84k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 5.78k, False: 3.06k]
  ------------------
  346|  5.78k|        std::swap(first_half, second_half);
  347|  5.78k|      }
  348|  8.84k|    }
  349|       |
  350|  14.7k|    levels_stack_[stack_pos][axis] += 1;
  351|  14.7k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  14.7k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 14.7k, False: 67]
  ------------------
  353|  14.7k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  14.7k|    }
  355|  14.7k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 14.6k, False: 137]
  ------------------
  356|  14.6k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  14.6k|    }
  358|  14.7k|  }
  359|      2|  return true;
  360|     52|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     38|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     38|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     38|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     38|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     38|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 36]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|     36|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 28]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|     28|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 27]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     27|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 25]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|     25|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 25]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     25|  num_decoded_points_ = 0;
  202|       |
  203|     25|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 25, False: 0]
  ------------------
  204|     25|    return false;
  205|     25|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     25|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     25|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     25|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     25|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     25|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 24]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     24|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 18]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|     18|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 17]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     17|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 16]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     16|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 16]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     16|  num_decoded_points_ = 0;
  202|       |
  203|     16|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 16, False: 0]
  ------------------
  204|     16|    return false;
  205|     16|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     19|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     19|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     19|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     19|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     19|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 18]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     18|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 12]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|     12|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 12]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     12|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 11]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     11|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 11]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     11|  num_decoded_points_ = 0;
  202|       |
  203|     11|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 11, False: 0]
  ------------------
  204|     11|    return false;
  205|     11|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}

_ZN5draco22FloatPointsTreeDecoderC2Ev:
   65|    484|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    484|  qinfo_.quantization_bits = 0;
   67|    484|  qinfo_.range = 0;
   68|    484|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    471|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    471|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 471]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|    471|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 1, False: 470]
  ------------------
   76|      1|    return false;
   77|      1|  }
   78|    470|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 470]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|    470|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 1, False: 469]
  ------------------
   82|      1|    return false;
   83|      1|  }
   84|    469|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 21, False: 448]
  |  Branch (84:38): [True: 14, False: 7]
  ------------------
   85|     14|    return false;
   86|     14|  }
   87|    455|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 1, False: 454]
  ------------------
   88|      1|    return false;
   89|      1|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    454|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 4, False: 450]
  ------------------
   93|      4|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      4|#define DRACO_LOGE printf
  ------------------
   94|      4|               compression_level_);
   95|      4|    return false;
   96|      4|  }
   97|       |
   98|    450|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    450|      std::back_inserter(*qpoints);
  100|    450|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    450|                           Converter>
  102|    450|      oit(oit_qpoints);
  103|    450|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 447, False: 3]
  ------------------
  104|    447|    qpoints->reserve(num_points_);
  105|    447|    switch (compression_level_) {
  106|     93|      case 0: {
  ------------------
  |  Branch (106:7): [True: 93, False: 354]
  ------------------
  107|     93|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|     93|        qpoints_decoder.DecodePoints(buffer, oit);
  109|     93|        break;
  110|      0|      }
  111|     94|      case 1: {
  ------------------
  |  Branch (111:7): [True: 94, False: 353]
  ------------------
  112|     94|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     94|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     94|        break;
  115|      0|      }
  116|     84|      case 2: {
  ------------------
  |  Branch (116:7): [True: 84, False: 363]
  ------------------
  117|     84|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     84|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     84|        break;
  120|      0|      }
  121|     94|      case 3: {
  ------------------
  |  Branch (121:7): [True: 94, False: 353]
  ------------------
  122|     94|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|     94|        qpoints_decoder.DecodePoints(buffer, oit);
  124|     94|        break;
  125|      0|      }
  126|     38|      case 4: {
  ------------------
  |  Branch (126:7): [True: 38, False: 409]
  ------------------
  127|     38|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     38|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     38|        break;
  130|      0|      }
  131|     25|      case 5: {
  ------------------
  |  Branch (131:7): [True: 25, False: 422]
  ------------------
  132|     25|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|     25|        qpoints_decoder.DecodePoints(buffer, oit);
  134|     25|        break;
  135|      0|      }
  136|     19|      case 6: {
  ------------------
  |  Branch (136:7): [True: 19, False: 428]
  ------------------
  137|     19|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|     19|        qpoints_decoder.DecodePoints(buffer, oit);
  139|     19|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 447]
  ------------------
  142|      0|        return false;
  143|    447|    }
  144|    447|  }
  145|       |
  146|    450|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 442, False: 8]
  ------------------
  147|    442|    return false;
  148|    442|  }
  149|      8|  return true;
  150|    450|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    450|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   202M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   202M|  const Self &operator=(const SourceType &source) {
   56|   202M|    *oit_ = Converter()(source);
   57|   202M|    return *this;
   58|   202M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   202M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   202M|    return Point3ui(v[0], v[1], v[2]);
   31|   202M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   202M|  const Self &operator++() {
   46|   202M|    ++oit_;
   47|   202M|    return *this;
   48|   202M|  }

_ZN5draco22FloatPointsTreeDecoder26set_num_points_from_headerEj:
   69|    484|  void set_num_points_from_header(uint32_t num_points) {
   70|    484|    num_points_from_header_ = num_points;
   71|    484|  }
_ZN5draco22FloatPointsTreeDecoder16DecodePointCloudINS_34PointAttributeVectorOutputIteratorIfEEEEbPNS_13DecoderBufferERT_:
  102|    484|                                              OutputIteratorT &out) {
  103|    484|  std::vector<Point3ui> qpoints;
  104|       |
  105|    484|  uint32_t decoded_version;
  106|    484|  if (!buffer->Decode(&decoded_version)) {
  ------------------
  |  Branch (106:7): [True: 0, False: 484]
  ------------------
  107|      0|    return false;
  108|      0|  }
  109|       |
  110|    484|  if (decoded_version == 3) {
  ------------------
  |  Branch (110:7): [True: 3, False: 481]
  ------------------
  111|      3|    int8_t method_number;
  112|      3|    if (!buffer->Decode(&method_number)) {
  ------------------
  |  Branch (112:9): [True: 0, False: 3]
  ------------------
  113|      0|      return false;
  114|      0|    }
  115|       |
  116|      3|    method_ = method_number;
  117|       |
  118|      3|    if (method_ == KDTREE) {
  ------------------
  |  Branch (118:9): [True: 0, False: 3]
  ------------------
  119|      0|      if (!DecodePointCloudKdTreeInternal(buffer, &qpoints)) {
  ------------------
  |  Branch (119:11): [True: 0, False: 0]
  ------------------
  120|      0|        return false;
  121|      0|      }
  122|      3|    } else {  // Unsupported method.
  123|      3|      fprintf(stderr, "Method not supported. \n");
  124|      3|      return false;
  125|      3|    }
  126|    481|  } else if (decoded_version == 2) {  // Version 2 only uses KDTREE method.
  ------------------
  |  Branch (126:14): [True: 471, False: 10]
  ------------------
  127|    471|    if (!DecodePointCloudKdTreeInternal(buffer, &qpoints)) {
  ------------------
  |  Branch (127:9): [True: 463, False: 8]
  ------------------
  128|    463|      return false;
  129|    463|    }
  130|    471|  } else {  // Unsupported version.
  131|     10|    fprintf(stderr, "Version not supported. \n");
  132|     10|    return false;
  133|     10|  }
  134|       |
  135|      8|  DequantizePoints3(qpoints.begin(), qpoints.end(), qinfo_, out);
  136|      8|  return true;
  137|    484|}

_ZN5draco17DequantizePoints3INSt3__111__wrap_iterIPNS_7VectorDIjLi3EEEEENS_34PointAttributeVectorOutputIteratorIfEEEEvRKT_SB_RKNS_16QuantizationInfoERT0_:
   63|      8|                       const QuantizationInfo &info, OutputIterator &oit) {
   64|      8|  DRACO_DCHECK_GE(info.quantization_bits, 0);
   65|      8|  DRACO_DCHECK_GE(info.range, 0);
   66|       |
   67|      8|  const uint32_t quantization_bits = info.quantization_bits;
   68|      8|  const float range = info.range;
   69|      8|  const uint32_t max_quantized_value((1u << quantization_bits) - 1);
   70|      8|  Dequantizer dequantize;
   71|      8|  dequantize.Init(range, max_quantized_value);
   72|       |
   73|     22|  for (auto it = begin; it != end; ++it) {
  ------------------
  |  Branch (73:25): [True: 14, False: 8]
  ------------------
   74|     14|    const float x = dequantize((*it)[0] - max_quantized_value);
   75|     14|    const float y = dequantize((*it)[1] - max_quantized_value);
   76|     14|    const float z = dequantize((*it)[2] - max_quantized_value);
   77|     14|    *oit = Point3f(x, y, z);
   78|     14|    ++oit;
   79|     14|  }
   80|      8|}

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

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

_ZN5draco23PointCloudKdTreeDecoder18DecodeGeometryDataEv:
   21|  1.23k|bool PointCloudKdTreeDecoder::DecodeGeometryData() {
   22|  1.23k|  int32_t num_points;
   23|  1.23k|  if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (23:7): [True: 0, False: 1.23k]
  ------------------
   24|      0|    return false;
   25|      0|  }
   26|  1.23k|  if (num_points < 0) {
  ------------------
  |  Branch (26:7): [True: 4, False: 1.22k]
  ------------------
   27|      4|    return false;
   28|      4|  }
   29|  1.22k|  point_cloud()->set_num_points(num_points);
   30|  1.22k|  return true;
   31|  1.23k|}
_ZN5draco23PointCloudKdTreeDecoder23CreateAttributesDecoderEi:
   33|  6.35k|bool PointCloudKdTreeDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
   34|       |  // Always create the basic attribute decoder.
   35|  6.35k|  return SetAttributesDecoder(
   36|  6.35k|      att_decoder_id,
   37|  6.35k|      std::unique_ptr<AttributesDecoder>(new KdTreeAttributesDecoder()));
   38|  6.35k|}

_ZN5draco27PointCloudSequentialDecoder18DecodeGeometryDataEv:
   22|     76|bool PointCloudSequentialDecoder::DecodeGeometryData() {
   23|     76|  int32_t num_points;
   24|     76|  if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (24:7): [True: 0, False: 76]
  ------------------
   25|      0|    return false;
   26|      0|  }
   27|     76|  if (num_points < 0) {
  ------------------
  |  Branch (27:7): [True: 3, False: 73]
  ------------------
   28|      3|    return false;
   29|      3|  }
   30|     73|  point_cloud()->set_num_points(num_points);
   31|     73|  return true;
   32|     76|}
_ZN5draco27PointCloudSequentialDecoder23CreateAttributesDecoderEi:
   35|  1.22k|    int32_t att_decoder_id) {
   36|       |  // Always create the basic attribute decoder.
   37|  1.22k|  return SetAttributesDecoder(
   38|  1.22k|      att_decoder_id,
   39|  1.22k|      std::unique_ptr<AttributesDecoder>(
   40|  1.22k|          new SequentialAttributeDecodersController(
   41|  1.22k|              std::unique_ptr<PointsSequencer>(
   42|  1.22k|                  new LinearSequencer(point_cloud()->num_points())))));
   43|  1.22k|}

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

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

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

_ZN5draco20DataBufferDescriptorC2Ev:
   28|  34.2k|  DataBufferDescriptor() : buffer_id(0), buffer_update_count(0) {}
_ZNK5draco10DataBuffer4ReadElPvm:
   47|     97|  void Read(int64_t byte_pos, void *out_data, size_t data_size) const {
   48|     97|    memcpy(out_data, data() + byte_pos, data_size);
   49|     97|  }
_ZN5draco10DataBuffer5WriteElPKvm:
   53|   219M|  void Write(int64_t byte_pos, const void *in_data, size_t data_size) {
   54|   219M|    memcpy(const_cast<uint8_t *>(data()) + byte_pos, in_data, data_size);
   55|   219M|  }
_ZNK5draco10DataBuffer12update_countEv:
   67|  13.3k|  int64_t update_count() const { return descriptor_.buffer_update_count; }
_ZNK5draco10DataBuffer9data_sizeEv:
   68|  23.1M|  size_t data_size() const { return data_.size(); }
_ZNK5draco10DataBuffer4dataEv:
   69|     97|  const uint8_t *data() const { return data_.data(); }
_ZN5draco10DataBuffer4dataEv:
   70|   250M|  uint8_t *data() { return data_.data(); }
_ZNK5draco10DataBuffer9buffer_idEv:
   71|  13.3k|  int64_t buffer_id() const { return descriptor_.buffer_id; }

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  7.63M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  7.63M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 7.63M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  7.63M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  7.63M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   457M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   457M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 288, False: 457M]
  ------------------
   78|    288|      return false;  // Buffer overflow.
   79|    288|    }
   80|   457M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   457M|    pos_ += size_to_decode;
   82|   457M|    return true;
   83|   457M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  26.4k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  8.17k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  36.5k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   165k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  4.86k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  7.64M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  1.81M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  5.34k|    inline void reset(const void *b, size_t s) {
  131|  5.34k|      bit_offset_ = 0;
  132|  5.34k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  5.34k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  5.34k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  4.51k|    inline uint64_t BitsDecoded() const {
  138|  4.51k|      return static_cast<uint64_t>(bit_offset_);
  139|  4.51k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  7.63M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  7.63M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 7.63M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  7.63M|      uint32_t value = 0;
  165|  17.2M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 9.66M, False: 7.63M]
  ------------------
  166|  9.66M|        value |= GetBit() << bit;
  167|  9.66M|      }
  168|  7.63M|      *x = value;
  169|  7.63M|      return true;
  170|  7.63M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  9.66M|    inline int GetBit() {
  176|  9.66M|      const size_t off = bit_offset_;
  177|  9.66M|      const size_t byte_offset = off >> 3;
  178|  9.66M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  9.66M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 8.93M, False: 730k]
  ------------------
  180|  8.93M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  8.93M|        bit_offset_ = off + 1;
  182|  8.93M|        return bit;
  183|  8.93M|      }
  184|   730k|      return 0;
  185|  9.66M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  3.09M|  bool Decode(T *out_val) {
   69|  3.09M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2.44k, False: 3.09M]
  ------------------
   70|  2.44k|      return false;
   71|  2.44k|    }
   72|  3.09M|    pos_ += sizeof(T);
   73|  3.09M|    return true;
   74|  3.09M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  3.09M|  bool Peek(T *out_val) {
   88|  3.09M|    const size_t size_to_decode = sizeof(T);
   89|  3.09M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2.44k, False: 3.09M]
  ------------------
   90|  2.44k|      return false;  // Buffer overflow.
   91|  2.44k|    }
   92|  3.09M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  3.09M|    return true;
   94|  3.09M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  9.37k|  bool Decode(T *out_val) {
   69|  9.37k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 100, False: 9.27k]
  ------------------
   70|    100|      return false;
   71|    100|    }
   72|  9.27k|    pos_ += sizeof(T);
   73|  9.27k|    return true;
   74|  9.37k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  9.37k|  bool Peek(T *out_val) {
   88|  9.37k|    const size_t size_to_decode = sizeof(T);
   89|  9.37k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 100, False: 9.27k]
  ------------------
   90|    100|      return false;  // Buffer overflow.
   91|    100|    }
   92|  9.27k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  9.27k|    return true;
   94|  9.37k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   130k|  bool Decode(T *out_val) {
   69|   130k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 166, False: 130k]
  ------------------
   70|    166|      return false;
   71|    166|    }
   72|   130k|    pos_ += sizeof(T);
   73|   130k|    return true;
   74|   130k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   130k|  bool Peek(T *out_val) {
   88|   130k|    const size_t size_to_decode = sizeof(T);
   89|   130k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 166, False: 130k]
  ------------------
   90|    166|      return false;  // Buffer overflow.
   91|    166|    }
   92|   130k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   130k|    return true;
   94|   130k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  13.9k|  bool Decode(T *out_val) {
   69|  13.9k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 180, False: 13.7k]
  ------------------
   70|    180|      return false;
   71|    180|    }
   72|  13.7k|    pos_ += sizeof(T);
   73|  13.7k|    return true;
   74|  13.9k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  13.9k|  bool Peek(T *out_val) {
   88|  13.9k|    const size_t size_to_decode = sizeof(T);
   89|  13.9k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 180, False: 13.7k]
  ------------------
   90|    180|      return false;  // Buffer overflow.
   91|    180|    }
   92|  13.7k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  13.7k|    return true;
   94|  13.9k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   435k|  bool Decode(T *out_val) {
   69|   435k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 87, False: 435k]
  ------------------
   70|     87|      return false;
   71|     87|    }
   72|   435k|    pos_ += sizeof(T);
   73|   435k|    return true;
   74|   435k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   435k|  bool Peek(T *out_val) {
   88|   435k|    const size_t size_to_decode = sizeof(T);
   89|   435k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 87, False: 435k]
  ------------------
   90|     87|      return false;  // Buffer overflow.
   91|     87|    }
   92|   435k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   435k|    return true;
   94|   435k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  25.1k|  bool Decode(T *out_val) {
   69|  25.1k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2, False: 25.1k]
  ------------------
   70|      2|      return false;
   71|      2|    }
   72|  25.1k|    pos_ += sizeof(T);
   73|  25.1k|    return true;
   74|  25.1k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  25.1k|  bool Peek(T *out_val) {
   88|  25.1k|    const size_t size_to_decode = sizeof(T);
   89|  25.1k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2, False: 25.1k]
  ------------------
   90|      2|      return false;  // Buffer overflow.
   91|      2|    }
   92|  25.1k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  25.1k|    return true;
   94|  25.1k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.16k|  bool Decode(T *out_val) {
   69|  1.16k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 12, False: 1.15k]
  ------------------
   70|     12|      return false;
   71|     12|    }
   72|  1.15k|    pos_ += sizeof(T);
   73|  1.15k|    return true;
   74|  1.16k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.16k|  bool Peek(T *out_val) {
   88|  1.16k|    const size_t size_to_decode = sizeof(T);
   89|  1.16k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 12, False: 1.15k]
  ------------------
   90|     12|      return false;  // Buffer overflow.
   91|     12|    }
   92|  1.15k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.15k|    return true;
   94|  1.16k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    600|  bool Decode(T *out_val) {
   69|    600|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 6, False: 594]
  ------------------
   70|      6|      return false;
   71|      6|    }
   72|    594|    pos_ += sizeof(T);
   73|    594|    return true;
   74|    600|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    600|  bool Peek(T *out_val) {
   88|    600|    const size_t size_to_decode = sizeof(T);
   89|    600|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 6, False: 594]
  ------------------
   90|      6|      return false;  // Buffer overflow.
   91|      6|    }
   92|    594|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    594|    return true;
   94|    600|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   189M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   191M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  6.25M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  6.25M|    return value_ >= val;
  100|  6.25M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   149M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  1.92G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  13.8M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  49.0M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  49.0M|    value_ = i.value_;
  153|  49.0M|    return *this;
  154|  49.0M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   643M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   643M|    value_ = i.value_;
  153|   643M|    return *this;
  154|   643M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  13.8M|  inline ThisIndexType &operator++() {
  103|  13.8M|    ++value_;
  104|  13.8M|    return *this;
  105|  13.8M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  1.41G|  constexpr bool operator==(const IndexType &i) const {
   76|  1.41G|    return value_ == i.value_;
   77|  1.41G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   576M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  7.60k|  constexpr bool operator<(const IndexType &i) const {
   88|  7.60k|    return value_ < i.value_;
   89|  7.60k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|  70.2M|  constexpr bool operator==(const IndexType &i) const {
   76|  70.2M|    return value_ == i.value_;
   77|  70.2M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   100M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   100M|    return ThisIndexType(value_ - val);
  133|   100M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   435M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   435M|    return ThisIndexType(value_ + val);
  127|   435M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  11.4M|  constexpr bool operator==(const IndexType &i) const {
   76|  11.4M|    return value_ == i.value_;
   77|  11.4M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   150M|  constexpr bool operator!=(const IndexType &i) const {
   82|   150M|    return value_ != i.value_;
   83|   150M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   202M|  constexpr bool operator!=(const IndexType &i) const {
   82|   202M|    return value_ != i.value_;
   83|   202M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   305M|  inline ThisIndexType &operator++() {
  103|   305M|    ++value_;
  104|   305M|    return *this;
  105|   305M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   257M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   257M|    value_ = i.value_;
  153|   257M|    return *this;
  154|   257M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   642M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   642M|    value_ = i.value_;
  153|   642M|    return *this;
  154|   642M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  22.7M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  22.7M|    return value_ >= val;
  100|  22.7M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  5.30M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   650M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  13.0G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   113M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  10.1G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   157M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  7.69M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  7.69M|    return ThisIndexType(value_ + val);
  127|  7.69M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|  94.1M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  14.7M|  constexpr bool operator<(const IndexType &i) const {
   88|  14.7M|    return value_ < i.value_;
   89|  14.7M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   257M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   643M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  36.7M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   178M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   288M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  3.25M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  3.25M|    value_ = i.value_;
  153|  3.25M|    return *this;
  154|  3.25M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  5.30M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  5.30M|    value_ += val;
  141|  5.30M|    return *this;
  142|  5.30M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  18.7M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  18.7M|    value_ = val;
  157|  18.7M|    return *this;
  158|  18.7M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   624M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  3.99M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  3.99M|  inline ThisIndexType &operator++() {
  103|  3.99M|    ++value_;
  104|  3.99M|    return *this;
  105|  3.99M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  12.0M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|    216|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   133M|  inline ThisIndexType &operator++() {
  103|   133M|    ++value_;
  104|   133M|    return *this;
  105|   133M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|     97|  inline ThisIndexType &operator++() {
  103|     97|    ++value_;
  104|     97|    return *this;
  105|     97|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   137M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   137M|    return value_ >= val;
  100|   137M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  19.7M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  19.7M|    return vector_[index.value()];
   75|  19.7M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  12.0M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  7.85k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  10.6k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  34.7M|  inline reference operator[](const IndexTypeT &index) {
   71|  34.7M|    return vector_[index.value()];
   72|  34.7M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|    817|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  12.5M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  2.94k|  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|  6.25M|  inline reference operator[](const IndexTypeT &index) {
   71|  6.25M|    return vector_[index.value()];
   72|  6.25M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  12.8M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  12.8M|    return vector_[index.value()];
   75|  12.8M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   122M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  6.87M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   183M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   183M|    return vector_[index.value()];
   75|   183M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   522M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   522M|    return vector_[index.value()];
   75|   522M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   236M|  inline reference operator[](const IndexTypeT &index) {
   71|   236M|    return vector_[index.value()];
   72|   236M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  32.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  32.3M|    return vector_[index.value()];
   75|  32.3M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   197M|  inline reference operator[](const IndexTypeT &index) {
   71|   197M|    return vector_[index.value()];
   72|   197M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  61.8M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   135M|  inline reference operator[](const IndexTypeT &index) {
   71|   135M|    return vector_[index.value()];
   72|   135M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  1.94k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   147M|  inline reference operator[](const IndexTypeT &index) {
   71|   147M|    return vector_[index.value()];
   72|   147M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  33.1k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  1.53M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  30.5k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  5.15k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  5.15k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  5.15k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  5.15k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  10.4k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  10.4k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  10.4k|    vector_.swap(arg.vector_);
   57|  10.4k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  10.4k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  10.4k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  10.4k|    vector_.swap(arg.vector_);
   57|  10.4k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  5.15k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  5.15k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  5.15k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  6.77k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  20.6k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  40.7k|int32_t DataTypeLength(DataType dt) {
   20|  40.7k|  switch (dt) {
   21|  9.77k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 9.77k, False: 30.9k]
  ------------------
   22|  13.2k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.48k, False: 37.2k]
  ------------------
   23|  13.2k|      return 1;
   24|  2.30k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 2.30k, False: 38.4k]
  ------------------
   25|  5.20k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 2.90k, False: 37.8k]
  ------------------
   26|  5.20k|      return 2;
   27|  16.7k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 16.7k, False: 24.0k]
  ------------------
   28|  18.0k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.31k, False: 39.4k]
  ------------------
   29|  18.0k|      return 4;
   30|    529|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 529, False: 40.2k]
  ------------------
   31|    860|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 331, False: 40.4k]
  ------------------
   32|    860|      return 8;
   33|  3.02k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.02k, False: 37.7k]
  ------------------
   34|  3.02k|      return 4;
   35|     58|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 58, False: 40.6k]
  ------------------
   36|     58|      return 8;
   37|    306|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 306, False: 40.4k]
  ------------------
   38|    306|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 40.7k]
  ------------------
   40|      0|      return -1;
   41|  40.7k|  }
   42|  40.7k|}

_ZN5draco7IntSqrtEm:
   31|  2.27k|inline uint64_t IntSqrt(uint64_t number) {
   32|  2.27k|  if (number == 0) {
  ------------------
  |  Branch (32:7): [True: 344, False: 1.93k]
  ------------------
   33|    344|    return 0;
   34|    344|  }
   35|       |  // First estimate good initial value of the square root as log2(number).
   36|  1.93k|  uint64_t act_number = number;
   37|  1.93k|  uint64_t square_root = 1;
   38|  32.9k|  while (act_number >= 2) {
  ------------------
  |  Branch (38:10): [True: 31.0k, False: 1.93k]
  ------------------
   39|       |    // Double the square root until |square_root * square_root > number|.
   40|  31.0k|    square_root *= 2;
   41|  31.0k|    act_number /= 4;
   42|  31.0k|  }
   43|       |  // Perform Newton's (or Babylonian) method to find the true floor(sqrt()).
   44|  4.99k|  do {
   45|       |    // New |square_root| estimate is computed as the average between
   46|       |    // |square_root| and |number / square_root|.
   47|  4.99k|    square_root = (square_root + number / square_root) / 2;
   48|       |
   49|       |    // Note that after the first iteration, the estimate is always going to be
   50|       |    // larger or equal to the true square root value. Therefore to check
   51|       |    // convergence, we can simply detect condition when the square of the
   52|       |    // estimated square root is larger than the input.
   53|  4.99k|  } while (square_root * square_root > number);
  ------------------
  |  Branch (53:12): [True: 3.06k, False: 1.93k]
  ------------------
   54|  1.93k|  return square_root;
   55|  2.27k|}
_ZN5draco13AddAsUnsignedIiTnPNSt3__19enable_ifIXaasr3std11is_integralIT_EE5valuesr3std9is_signedIS3_EE5valueEvE4typeELPv0EEES3_S3_S3_:
   63|  52.3M|inline DataTypeT AddAsUnsigned(DataTypeT a, DataTypeT b) {
   64|  52.3M|  typedef typename std::make_unsigned<DataTypeT>::type DataTypeUT;
   65|  52.3M|  return static_cast<DataTypeT>(static_cast<DataTypeUT>(a) +
   66|  52.3M|                                static_cast<DataTypeUT>(b));
   67|  52.3M|}

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.40k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  6.77k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|      4|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  8.17k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  8.18k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|      4|  const Status &status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  7.44k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  8.17k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    736|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  1.40k|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  1.40k|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  6.77k|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  6.77k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   407k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   407k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 407k, Folded]
  ------------------
   65|   407k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.04k, False: 406k]
  ------------------
   66|  1.04k|      return false;
   67|  1.04k|    }
   68|   407k|  } 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|   406k|  return true;
   77|   407k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   240k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   240k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   240k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 58, False: 240k]
  ------------------
   33|     58|    return false;
   34|     58|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   240k|  uint8_t in;
   39|   240k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 687, False: 239k]
  ------------------
   40|    687|    return false;
   41|    687|  }
   42|   239k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 40.0k, False: 199k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  40.0k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 401, False: 39.6k]
  ------------------
   45|    401|      return false;
   46|    401|    }
   47|       |    // Append decoded info from this byte.
   48|  39.6k|    *out_val <<= 7;
   49|  39.6k|    *out_val |= in & ((1 << 7) - 1);
   50|   199k|  } else {
   51|       |    // Last byte reached
   52|   199k|    *out_val = in;
   53|   199k|  }
   54|   239k|  return true;
   55|   239k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.86k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.86k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.86k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 3.85k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.85k|  uint8_t in;
   39|  3.85k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 2, False: 3.85k]
  ------------------
   40|      2|    return false;
   41|      2|  }
   42|  3.85k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 539, False: 3.31k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    539|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 13, False: 526]
  ------------------
   45|     13|      return false;
   46|     13|    }
   47|       |    // Append decoded info from this byte.
   48|    526|    *out_val <<= 7;
   49|    526|    *out_val |= in & ((1 << 7) - 1);
   50|  3.31k|  } else {
   51|       |    // Last byte reached
   52|  3.31k|    *out_val = in;
   53|  3.31k|  }
   54|  3.84k|  return true;
   55|  3.85k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  5.23k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  5.23k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 5.23k, Folded]
  ------------------
   65|  5.23k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 88, False: 5.14k]
  ------------------
   66|     88|      return false;
   67|     88|    }
   68|  5.23k|  } 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|  5.14k|  return true;
   77|  5.23k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  2.94k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.94k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.94k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 2.94k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.94k|  uint8_t in;
   39|  2.94k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 15, False: 2.93k]
  ------------------
   40|     15|    return false;
   41|     15|  }
   42|  2.93k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 111, False: 2.82k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    111|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 111]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    111|    *out_val <<= 7;
   49|    111|    *out_val |= in & ((1 << 7) - 1);
   50|  2.82k|  } else {
   51|       |    // Last byte reached
   52|  2.82k|    *out_val = in;
   53|  2.82k|  }
   54|  2.93k|  return true;
   55|  2.93k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   156k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   156k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   156k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 12, False: 156k]
  ------------------
   33|     12|    return false;
   34|     12|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   156k|  uint8_t in;
   39|   156k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 70, False: 156k]
  ------------------
   40|     70|    return false;
   41|     70|  }
   42|   156k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 755, False: 155k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    755|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 79, False: 676]
  ------------------
   45|     79|      return false;
   46|     79|    }
   47|       |    // Append decoded info from this byte.
   48|    676|    *out_val <<= 7;
   49|    676|    *out_val |= in & ((1 << 7) - 1);
   50|   155k|  } else {
   51|       |    // Last byte reached
   52|   155k|    *out_val = in;
   53|   155k|  }
   54|   156k|  return true;
   55|   156k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  2.63k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.63k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 2.63k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  2.63k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  2.63k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  2.63k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 25, False: 2.60k]
  ------------------
   72|     25|      return false;
   73|     25|    }
   74|  2.60k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  2.60k|  }
   76|  2.60k|  return true;
   77|  2.63k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.90k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.90k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.90k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 2.90k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.90k|  uint8_t in;
   39|  2.90k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 22, False: 2.87k]
  ------------------
   40|     22|    return false;
   41|     22|  }
   42|  2.87k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 272, False: 2.60k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    272|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 36, False: 236]
  ------------------
   45|     36|      return false;
   46|     36|    }
   47|       |    // Append decoded info from this byte.
   48|    236|    *out_val <<= 7;
   49|    236|    *out_val |= in & ((1 << 7) - 1);
   50|  2.60k|  } else {
   51|       |    // Last byte reached
   52|  2.60k|    *out_val = in;
   53|  2.60k|  }
   54|  2.84k|  return true;
   55|  2.87k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.68k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.68k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.68k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 2.68k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.68k|  uint8_t in;
   39|  2.68k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 21, False: 2.66k]
  ------------------
   40|     21|    return false;
   41|     21|  }
   42|  2.66k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 399, False: 2.26k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    399|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 20, False: 379]
  ------------------
   45|     20|      return false;
   46|     20|    }
   47|       |    // Append decoded info from this byte.
   48|    379|    *out_val <<= 7;
   49|    379|    *out_val |= in & ((1 << 7) - 1);
   50|  2.26k|  } else {
   51|       |    // Last byte reached
   52|  2.26k|    *out_val = in;
   53|  2.26k|  }
   54|  2.64k|  return true;
   55|  2.66k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  20.5k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  20.5k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  20.5k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 20.5k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  20.5k|  uint8_t in;
   39|  20.5k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 13, False: 20.5k]
  ------------------
   40|     13|    return false;
   41|     13|  }
   42|  20.5k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 408, False: 20.1k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    408|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 20, False: 388]
  ------------------
   45|     20|      return false;
   46|     20|    }
   47|       |    // Append decoded info from this byte.
   48|    388|    *out_val <<= 7;
   49|    388|    *out_val |= in & ((1 << 7) - 1);
   50|  20.1k|  } else {
   51|       |    // Last byte reached
   52|  20.1k|    *out_val = in;
   53|  20.1k|  }
   54|  20.5k|  return true;
   55|  20.5k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  6.28k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  6.28k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.28k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 81, False: 6.20k]
  ------------------
   33|     81|    return false;
   34|     81|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.20k|  uint8_t in;
   39|  6.20k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 72, False: 6.13k]
  ------------------
   40|     72|    return false;
   41|     72|  }
   42|  6.13k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.62k, False: 4.51k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.62k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 442, False: 1.18k]
  ------------------
   45|    442|      return false;
   46|    442|    }
   47|       |    // Append decoded info from this byte.
   48|  1.18k|    *out_val <<= 7;
   49|  1.18k|    *out_val |= in & ((1 << 7) - 1);
   50|  4.51k|  } else {
   51|       |    // Last byte reached
   52|  4.51k|    *out_val = in;
   53|  4.51k|  }
   54|  5.69k|  return true;
   55|  6.13k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.75k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.75k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.75k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 40, False: 4.71k]
  ------------------
   33|     40|    return false;
   34|     40|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.71k|  uint8_t in;
   39|  4.71k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 33, False: 4.67k]
  ------------------
   40|     33|    return false;
   41|     33|  }
   42|  4.67k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.35k, False: 2.32k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.35k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 506, False: 1.84k]
  ------------------
   45|    506|      return false;
   46|    506|    }
   47|       |    // Append decoded info from this byte.
   48|  1.84k|    *out_val <<= 7;
   49|  1.84k|    *out_val |= in & ((1 << 7) - 1);
   50|  2.32k|  } else {
   51|       |    // Last byte reached
   52|  2.32k|    *out_val = in;
   53|  2.32k|  }
   54|  4.17k|  return true;
   55|  4.67k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  22.9k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  22.9k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  22.9k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 22.9k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  22.9k|  uint8_t in;
   39|  22.9k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 12, False: 22.9k]
  ------------------
   40|     12|    return false;
   41|     12|  }
   42|  22.9k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.16k, False: 20.7k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.16k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 32, False: 2.13k]
  ------------------
   45|     32|      return false;
   46|     32|    }
   47|       |    // Append decoded info from this byte.
   48|  2.13k|    *out_val <<= 7;
   49|  2.13k|    *out_val |= in & ((1 << 7) - 1);
   50|  20.7k|  } else {
   51|       |    // Last byte reached
   52|  20.7k|    *out_val = in;
   53|  20.7k|  }
   54|  22.9k|  return true;
   55|  22.9k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|  58.9k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|  73.4k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  6.12k|  Self operator-(const Self &o) const {
  138|  6.12k|    Self ret;
  139|  24.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 18.3k, False: 6.12k]
  ------------------
  140|  18.3k|      ret[i] = (*this)[i] - o[i];
  141|  18.3k|    }
  142|  6.12k|    return ret;
  143|  6.12k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  15.1k|  VectorD() {
   41|  60.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 45.4k, False: 15.1k]
  ------------------
   42|  45.4k|      (*this)[i] = Scalar(0);
   43|  45.4k|    }
   44|  15.1k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  1.39G|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|     14|      : v_({{c0, c1, c2}}) {
   60|     14|    DRACO_DCHECK_EQ(dimension, 3);
   61|     14|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|  77.6M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  6.44M|  Self operator-(const Self &o) const {
  138|  6.44M|    Self ret;
  139|  25.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 19.3M, False: 6.44M]
  ------------------
  140|  19.3M|      ret[i] = (*this)[i] - o[i];
  141|  19.3M|    }
  142|  6.44M|    return ret;
  143|  6.44M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  3.21M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  3.21M|  static_assert(std::is_signed<ScalarT>::value,
  321|  3.21M|                "ScalarT must be a signed type. ");
  322|  3.21M|  VectorD<ScalarT, 3> r;
  323|  3.21M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  3.21M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  3.21M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  3.21M|  return r;
  327|  3.21M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  3.21M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  3.21M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  1.25M|  Scalar AbsSum() const {
  238|  1.25M|    Scalar result(0);
  239|  4.99M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 3.75M, False: 1.24M]
  ------------------
  240|  3.75M|      Scalar next_value = std::abs(v_[i]);
  241|  3.75M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 7.57k, False: 3.74M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  7.57k|        return std::numeric_limits<Scalar>::max();
  244|  7.57k|      }
  245|  3.74M|      result += next_value;
  246|  3.74M|    }
  247|  1.24M|    return result;
  248|  1.25M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   122k|  Self operator/(const Scalar &o) const {
  183|   122k|    Self ret;
  184|   488k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 366k, False: 122k]
  ------------------
  185|   366k|      ret[i] = (*this)[i] / o;
  186|   366k|    }
  187|   122k|    return ret;
  188|   122k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|  97.0M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  6.97M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  3.75M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.16M|  Self operator-() const {
  121|  1.16M|    Self ret;
  122|  4.65M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 3.48M, False: 1.16M]
  ------------------
  123|  3.48M|      ret[i] = -(*this)[i];
  124|  3.48M|    }
  125|  1.16M|    return ret;
  126|  1.16M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  3.48M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  37.5M|  Self operator-(const Self &o) const {
  138|  37.5M|    Self ret;
  139|   112M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 75.1M, False: 37.5M]
  ------------------
  140|  75.1M|      ret[i] = (*this)[i] - o[i];
  141|  75.1M|    }
  142|  37.5M|    return ret;
  143|  37.5M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|   450M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|   676M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|   617M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  75.1M|  Self operator+(const Self &o) const {
  130|  75.1M|    Self ret;
  131|   225M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 150M, False: 75.1M]
  ------------------
  132|   150M|      ret[i] = (*this)[i] + o[i];
  133|   150M|    }
  134|  75.1M|    return ret;
  135|  75.1M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|   758M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  7.26M|  Self operator-(const Self &o) const {
  138|  7.26M|    Self ret;
  139|  21.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 14.5M, False: 7.26M]
  ------------------
  140|  14.5M|      ret[i] = (*this)[i] - o[i];
  141|  14.5M|    }
  142|  7.26M|    return ret;
  143|  7.26M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  7.26M|  Self operator+(const Self &o) const {
  130|  7.26M|    Self ret;
  131|  21.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 14.5M, False: 7.26M]
  ------------------
  132|  14.5M|      ret[i] = (*this)[i] + o[i];
  133|  14.5M|    }
  134|  7.26M|    return ret;
  135|  7.26M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   176k|  bool operator==(const Self &o) const {
  207|   522k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 349k, False: 173k]
  ------------------
  208|   349k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 2.90k, False: 346k]
  ------------------
  209|  2.90k|        return false;
  210|  2.90k|      }
  211|   349k|    }
  212|   173k|    return true;
  213|   176k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  2.11M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  3.22k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  3.54k|  Scalar Dot(const Self &o) const {
  251|  3.54k|    Scalar ret(0);
  252|  14.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 10.6k, False: 3.54k]
  ------------------
  253|  10.6k|      ret += (*this)[i] * o[i];
  254|  10.6k|    }
  255|  3.54k|    return ret;
  256|  3.54k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    323|  Self operator*(const Scalar &o) const {
  175|    323|    Self ret;
  176|  1.29k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 969, False: 323]
  ------------------
  177|    969|      ret[i] = (*this)[i] * o;
  178|    969|    }
  179|    323|    return ret;
  180|    323|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  2.90k|  Self operator-(const Self &o) const {
  138|  2.90k|    Self ret;
  139|  8.70k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 5.80k, False: 2.90k]
  ------------------
  140|  5.80k|      ret[i] = (*this)[i] - o[i];
  141|  5.80k|    }
  142|  2.90k|    return ret;
  143|  2.90k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  5.80k|  VectorD() {
   41|  17.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 11.6k, False: 5.80k]
  ------------------
   42|  11.6k|      (*this)[i] = Scalar(0);
   43|  11.6k|    }
   44|  5.80k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   355k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   355k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   355k|    v_[0] = c0;
   55|   355k|    v_[1] = c1;
   56|   355k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  23.1k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   218k|  bool operator==(const Self &o) const {
  207|   637k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 428k, False: 209k]
  ------------------
  208|   428k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 9.10k, False: 419k]
  ------------------
  209|  9.10k|        return false;
  210|  9.10k|      }
  211|   428k|    }
  212|   209k|    return true;
  213|   218k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.32M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  18.7M|  VectorD() {
   41|  74.9M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 56.2M, False: 18.7M]
  ------------------
   42|  56.2M|      (*this)[i] = Scalar(0);
   43|  56.2M|    }
   44|  18.7M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  11.3k|  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.8k|    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|  2.33k|  Self operator-(const Self &o) const {
  138|  2.33k|    Self ret;
  139|  7.01k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.67k, False: 2.33k]
  ------------------
  140|  4.67k|      ret[i] = (*this)[i] - o[i];
  141|  4.67k|    }
  142|  2.33k|    return ret;
  143|  2.33k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  9.10k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  27.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 18.2k, False: 9.10k]
  ------------------
  104|  18.2k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 18.2k, False: 0]
  ------------------
  105|  18.2k|        v_[i] = Scalar(src_vector[i]);
  106|  18.2k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  18.2k|    }
  110|  9.10k|  }
_ZNK5draco7VectorDImLi2EEmlERKm:
  174|  2.29k|  Self operator*(const Scalar &o) const {
  175|  2.29k|    Self ret;
  176|  6.87k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 4.58k, False: 2.29k]
  ------------------
  177|  4.58k|      ret[i] = (*this)[i] * o;
  178|  4.58k|    }
  179|  2.29k|    return ret;
  180|  2.29k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  9.13k|  VectorD() {
   41|  27.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 18.2k, False: 9.13k]
  ------------------
   42|  18.2k|      (*this)[i] = Scalar(0);
   43|  18.2k|    }
   44|  9.13k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  41.0k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  36.5k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|  3.39k|  Self operator+(const Self &o) const {
  130|  3.39k|    Self ret;
  131|  10.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 6.78k, False: 3.39k]
  ------------------
  132|  6.78k|      ret[i] = (*this)[i] + o[i];
  133|  6.78k|    }
  134|  3.39k|    return ret;
  135|  3.39k|  }
_ZN5draco7VectorDImLi2EEC2ERKmS3_:
   52|  2.29k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  2.29k|    DRACO_DCHECK_EQ(dimension, 2);
   54|  2.29k|    v_[0] = c0;
   55|  2.29k|    v_[1] = c1;
   56|  2.29k|  }
_ZNK5draco7VectorDImLi2EEmlERKS1_:
  145|  2.29k|  Self operator*(const Self &o) const {
  146|  2.29k|    Self ret;
  147|  6.87k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (147:21): [True: 4.58k, False: 2.29k]
  ------------------
  148|  4.58k|      ret[i] = (*this)[i] * o[i];
  149|  4.58k|    }
  150|  2.29k|    return ret;
  151|  2.29k|  }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  4.55k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  13.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 9.10k, False: 4.55k]
  ------------------
  104|  9.10k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 9.10k, False: 0]
  ------------------
  105|  9.10k|        v_[i] = Scalar(src_vector[i]);
  106|  9.10k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  9.10k|    }
  110|  4.55k|  }
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  2.27k|  Self operator+(const Self &o) const {
  130|  2.27k|    Self ret;
  131|  9.10k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 6.83k, False: 2.27k]
  ------------------
  132|  6.83k|      ret[i] = (*this)[i] + o[i];
  133|  6.83k|    }
  134|  2.27k|    return ret;
  135|  2.27k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.27k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.27k|  return v * o;
  294|  2.27k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  2.27k|  Self operator*(const Scalar &o) const {
  175|  2.27k|    Self ret;
  176|  9.10k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 6.83k, False: 2.27k]
  ------------------
  177|  6.83k|      ret[i] = (*this)[i] * o;
  178|  6.83k|    }
  179|  2.27k|    return ret;
  180|  2.27k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   439k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   439k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   439k|    v_[0] = c0;
   55|   439k|    v_[1] = c1;
   56|   439k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  2.27k|  Self operator*(const Scalar &o) const {
  175|  2.27k|    Self ret;
  176|  6.83k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 4.55k, False: 2.27k]
  ------------------
  177|  4.55k|      ret[i] = (*this)[i] * o;
  178|  4.55k|    }
  179|  2.27k|    return ret;
  180|  2.27k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  9.15k|  VectorD() {
   41|  27.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 18.3k, False: 9.15k]
  ------------------
   42|  18.3k|      (*this)[i] = Scalar(0);
   43|  18.3k|    }
   44|  9.15k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  2.25k|  Self operator/(const Scalar &o) const {
  183|  2.25k|    Self ret;
  184|  6.77k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 4.51k, False: 2.25k]
  ------------------
  185|  4.51k|      ret[i] = (*this)[i] / o;
  186|  4.51k|    }
  187|  2.25k|    return ret;
  188|  2.25k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.15k|  Self operator-(const Self &o) const {
  138|  1.15k|    Self ret;
  139|  3.47k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.31k, False: 1.15k]
  ------------------
  140|  2.31k|      ret[i] = (*this)[i] - o[i];
  141|  2.31k|    }
  142|  1.15k|    return ret;
  143|  1.15k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  36.5k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.16M|  VectorD() {
   41|  4.65M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.49M, False: 1.16M]
  ------------------
   42|  3.49M|      (*this)[i] = Scalar(0);
   43|  3.49M|    }
   44|  1.16M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|   153M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   153M|    DRACO_DCHECK_EQ(dimension, 2);
   54|   153M|    v_[0] = c0;
   55|   153M|    v_[1] = c1;
   56|   153M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|   225M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|   676M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 450M, False: 225M]
  ------------------
  104|   450M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 450M, False: 0]
  ------------------
  105|   450M|        v_[i] = Scalar(src_vector[i]);
  106|   450M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   450M|    }
  110|   225M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|   112M|  VectorD() {
   41|   338M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 225M, False: 112M]
  ------------------
   42|   225M|      (*this)[i] = Scalar(0);
   43|   225M|    }
   44|   112M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|   112M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|   338M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 225M, False: 112M]
  ------------------
  104|   225M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 225M, False: 0]
  ------------------
  105|   225M|        v_[i] = Scalar(src_vector[i]);
  106|   225M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   225M|    }
  110|   112M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  70.6M|  VectorD(const Self &o) {
   89|   212M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 141M, False: 70.6M]
  ------------------
   90|   141M|      (*this)[i] = o[i];
   91|   141M|    }
   92|  70.6M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  14.5M|  VectorD() {
   41|  43.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 29.0M, False: 14.5M]
  ------------------
   42|  29.0M|      (*this)[i] = Scalar(0);
   43|  29.0M|    }
   44|  14.5M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   466M|  VectorD(const Self &o) {
   89|  1.86G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 1.39G, False: 466M]
  ------------------
   90|  1.39G|      (*this)[i] = o[i];
   91|  1.39G|    }
   92|   466M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  1.39G|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   202M|      : v_({{c0, c1, c2}}) {
   60|   202M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   202M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  60.9M|  inline int num_vertices() const {
   74|  60.9M|    return static_cast<int>(vertex_corners_.size());
   75|  60.9M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  5.32M|  inline int num_corners() const {
   77|  5.32M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  5.32M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  1.54M|  inline int num_faces() const {
   80|  1.54M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  1.54M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   183M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   183M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 183M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   183M|    return opposite_corners_[corner];
   88|   183M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   311M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   311M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 6.43M, False: 305M]
  ------------------
   91|  6.43M|      return corner;
   92|  6.43M|    }
   93|   305M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 278M, False: 27.2M]
  ------------------
   94|   311M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   271M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   271M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 2.47M, False: 269M]
  ------------------
   97|  2.47M|      return corner;
   98|  2.47M|    }
   99|   269M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 73.3M, False: 196M]
  ------------------
  100|   271M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   522M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   522M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 522M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   522M|    return ConfidentVertex(corner);
  106|   522M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   522M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   522M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   522M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   522M|    return corner_to_vertex_map_[corner];
  111|   522M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  19.7M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  19.7M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 19.7M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  19.7M|    return FaceIndex(corner.value() / 3);
  117|  19.7M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   574M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  32.3M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  32.3M|    return vertex_corners_[v];
  152|  32.3M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|   553k|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|   553k|    const CornerIndex corner = LeftMostCorner(vert);
  187|   553k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 18.1k, False: 535k]
  ------------------
  188|  18.1k|      return true;
  189|  18.1k|    }
  190|   535k|    return false;
  191|   553k|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  42.4M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  42.4M|    return Previous(Opposite(Previous(corner)));
  202|  42.4M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  6.50M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  6.50M|    return Next(Opposite(Next(corner)));
  207|  6.50M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  2.08M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  2.08M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 2.08M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  2.08M|    return Opposite(Previous(corner_id));
  222|  2.08M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  2.62M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  2.62M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 2.62M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  2.62M|    return Opposite(Next(corner_id));
  228|  2.62M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   197M|                                CornerIndex opp_corner_id) {
  249|   197M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   197M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   197M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   236M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   236M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   236M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   236M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  61.8M|  VertexIndex AddNewVertex() {
  271|  61.8M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  61.8M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  61.8M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  61.8M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   134M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   134M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   134M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 134M, False: 0]
  ------------------
  295|   134M|      vertex_corners_[vert] = corner;
  296|   134M|    }
  297|   134M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|   796k|  void MakeVertexIsolated(VertexIndex vert) {
  329|   796k|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|   796k|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|   796k|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  6.94k|      : corner_table_(table),
  229|  6.94k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  6.94k|        corner_(start_corner_),
  231|  6.94k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  2.37M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  24.1k|  VertexCornersIterator &operator++() {
  268|  24.1k|    Next();
  269|  24.1k|    return *this;
  270|  24.1k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  2.02M|  void Next() {
  248|  2.02M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.00M, False: 21.8k]
  ------------------
  249|  2.00M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.00M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 16.6k, False: 1.98M]
  ------------------
  251|       |        // Open boundary reached.
  252|  16.6k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  16.6k|        left_traversal_ = false;
  254|  1.98M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 331k, False: 1.65M]
  ------------------
  255|       |        // End reached.
  256|   331k|        corner_ = kInvalidCornerIndex;
  257|   331k|      }
  258|  2.00M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  21.8k|      corner_ = corner_table_->SwingRight(corner_);
  262|  21.8k|    }
  263|  2.02M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  3.50M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  2.12M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  2.16M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  1.21M|  void Next() {
  248|  1.21M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 1.20M, False: 11.8k]
  ------------------
  249|  1.20M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  1.20M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 853k, False: 347k]
  ------------------
  251|       |        // Open boundary reached.
  252|   853k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|   853k|        left_traversal_ = false;
  254|   853k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 56.9k, False: 290k]
  ------------------
  255|       |        // End reached.
  256|  56.9k|        corner_ = kInvalidCornerIndex;
  257|  56.9k|      }
  258|  1.20M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  11.8k|      corner_ = corner_table_->SwingRight(corner_);
  262|  11.8k|    }
  263|  1.21M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   910k|      : corner_table_(table),
  236|   910k|        start_corner_(corner_id),
  237|   910k|        corner_(start_corner_),
  238|   910k|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   341k|      : corner_table_(table),
  236|   341k|        start_corner_(corner_id),
  237|   341k|        corner_(start_corner_),
  238|   341k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  31.6M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  31.6M|    return is_edge_on_seam_[corner.value()];
   47|  31.6M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  13.8M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  13.8M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 13.8M]
  |  Branch (50:42): [True: 10.8M, False: 2.99M]
  ------------------
   51|  10.8M|      return kInvalidCornerIndex;
   52|  10.8M|    }
   53|  2.99M|    return corner_table_->Opposite(corner);
   54|  13.8M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  19.6M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  19.6M|    return corner_table_->Next(corner);
   58|  19.6M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  10.4M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  10.4M|    return corner_table_->Previous(corner);
   62|  10.4M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  2.62M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  2.62M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  2.62M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.54M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  1.54M|    return Opposite(Previous(corner));
   73|  1.54M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  1.85M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  1.85M|    return Opposite(Next(corner));
   76|  1.85M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  2.04M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  2.04M|    return Previous(Opposite(Previous(corner)));
   81|  2.04M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  6.47M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  6.47M|    return Next(Opposite(Next(corner)));
   86|  6.47M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  7.82k|  int num_vertices() const {
   89|  7.82k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  7.82k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  2.53k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.14k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  51.2M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  51.2M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  51.2M|    return ConfidentVertex(corner);
   97|  51.2M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  51.2M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  51.2M|    return corner_to_vertex_map_[corner.value()];
  100|  51.2M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  1.53M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  1.53M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  1.53M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  1.53M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  1.53M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  1.53M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 1.53M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  1.53M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 1.21M, False: 314k]
  ------------------
  128|  1.21M|      return true;
  129|  1.21M|    }
  130|   314k|    return false;
  131|  1.53M|  }

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

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

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

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

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

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

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

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

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

