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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  1.51k|      : quantization_bits_(-1),
   54|  1.51k|        max_quantized_value_(-1),
   55|  1.51k|        max_value_(-1),
   56|  1.51k|        dequantization_scale_(1.f),
   57|  1.51k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  1.38k|  bool SetQuantizationBits(int32_t q) {
   60|  1.38k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 482, False: 901]
  |  Branch (60:18): [True: 57, False: 844]
  ------------------
   61|    539|      return false;
   62|    539|    }
   63|    844|    quantization_bits_ = q;
   64|    844|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|    844|    max_value_ = max_quantized_value_ - 1;
   66|    844|    dequantization_scale_ = 2.f / max_value_;
   67|    844|    center_value_ = max_value_ / 2;
   68|    844|    return true;
   69|  1.38k|  }
_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: 2.12k, False: 1.24M]
  |  Branch (77:20): [True: 0, False: 2.12k]
  |  Branch (77:32): [True: 2.12k, False: 1.24M]
  |  Branch (77:42): [True: 0, False: 2.12k]
  ------------------
   78|  1.25M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.04M, False: 210k]
  |  Branch (78:29): [True: 6.22k, False: 1.03M]
  ------------------
   79|  6.22k|      s = max_value_;
   80|  6.22k|      t = max_value_;
   81|  1.24M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 2.12k, False: 1.24M]
  |  Branch (81:26): [True: 610, False: 1.51k]
  ------------------
   82|    610|      t = center_value_ - (t - center_value_);
   83|  1.24M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.03M, False: 209k]
  |  Branch (83:35): [True: 6.19k, False: 1.02M]
  ------------------
   84|  6.19k|      t = center_value_ + (center_value_ - t);
   85|  1.23M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.03M, False: 208k]
  |  Branch (85:35): [True: 277, False: 1.02M]
  ------------------
   86|    277|      s = center_value_ + (center_value_ - s);
   87|  1.23M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 2.70k, False: 1.23M]
  |  Branch (87:26): [True: 1.09k, False: 1.60k]
  ------------------
   88|  1.09k|      s = center_value_ - (s - center_value_);
   89|  1.09k|    }
   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: 328k, False: 923k]
  ------------------
  105|       |      // Right hemisphere.
  106|   328k|      s = (int_vec[1] + center_value_);
  107|   328k|      t = (int_vec[2] + center_value_);
  108|   923k|    } else {
  109|       |      // Left hemisphere.
  110|   923k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 36.7k, False: 886k]
  ------------------
  111|  36.7k|        s = std::abs(int_vec[2]);
  112|   886k|      } else {
  113|   886k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   886k|      }
  115|   923k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 38.2k, False: 884k]
  ------------------
  116|  38.2k|        t = std::abs(int_vec[1]);
  117|   884k|      } else {
  118|   884k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   884k|      }
  120|   923k|    }
  121|  1.25M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  1.25M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  90.9k|                                                    float *out_vector) const {
  199|  90.9k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  90.9k|                                 in_t * dequantization_scale_ - 1.f,
  201|  90.9k|                                 out_vector);
  202|  90.9k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  2.14M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  2.14M|    DRACO_DCHECK_LE(s, center_value_);
  208|  2.14M|    DRACO_DCHECK_LE(t, center_value_);
  209|  2.14M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  2.14M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  2.14M|    const uint32_t st =
  212|  2.14M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  2.14M|    return st <= center_value_;
  214|  2.14M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  4.01M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  4.01M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  4.01M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  4.01M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  4.01M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  4.01M|    int32_t sign_s = 0;
  223|  4.01M|    int32_t sign_t = 0;
  224|  4.01M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 2.48M, False: 1.52M]
  |  Branch (224:20): [True: 2.44M, False: 46.6k]
  ------------------
  225|  2.44M|      sign_s = 1;
  226|  2.44M|      sign_t = 1;
  227|  2.44M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 1.53M, False: 45.3k]
  |  Branch (227:27): [True: 769k, False: 761k]
  ------------------
  228|   769k|      sign_s = -1;
  229|   769k|      sign_t = -1;
  230|   806k|    } else {
  231|   806k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 45.3k, False: 761k]
  ------------------
  232|   806k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 761k, False: 45.3k]
  ------------------
  233|   806k|    }
  234|       |
  235|       |    // Perform the addition and subtraction using unsigned integers to avoid
  236|       |    // signed integer overflows for bad data. Note that the result will be
  237|       |    // unchanged for non-overflowing cases.
  238|  4.01M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  4.01M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  4.01M|    uint32_t us = *s;
  241|  4.01M|    uint32_t ut = *t;
  242|  4.01M|    us = us + us - corner_point_s;
  243|  4.01M|    ut = ut + ut - corner_point_t;
  244|  4.01M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 3.21M, False: 806k]
  ------------------
  245|  3.21M|      uint32_t temp = us;
  246|  3.21M|      us = -ut;
  247|  3.21M|      ut = -temp;
  248|  3.21M|    } else {
  249|   806k|      std::swap(us, ut);
  250|   806k|    }
  251|  4.01M|    us = us + corner_point_s;
  252|  4.01M|    ut = ut + corner_point_t;
  253|       |
  254|  4.01M|    *s = us;
  255|  4.01M|    *t = ut;
  256|  4.01M|    *s /= 2;
  257|  4.01M|    *t /= 2;
  258|  4.01M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  4.28M|  int32_t ModMax(int32_t x) const {
  273|  4.28M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 412, False: 4.28M]
  ------------------
  274|    412|      return x - this->max_quantized_value();
  275|    412|    }
  276|  4.28M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 49, False: 4.28M]
  ------------------
  277|     49|      return x + this->max_quantized_value();
  278|     49|    }
  279|  4.28M|    return x;
  280|  4.28M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|    824|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|    461|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  12.8M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  90.9k|                                           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|  90.9k|    float y = in_s_scaled;
  329|  90.9k|    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|  90.9k|    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|  90.9k|    float x_offset = -x;
  342|  90.9k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 6.11k, False: 84.8k]
  ------------------
  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|  90.9k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 5.77k, False: 85.1k]
  ------------------
  348|  90.9k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 5.56k, False: 85.3k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  90.9k|    const float norm_squared = x * x + y * y + z * z;
  352|  90.9k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 90.9k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  90.9k|    } else {
  357|  90.9k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  90.9k|      out_vector[0] = x * d;
  359|  90.9k|      out_vector[1] = y * d;
  360|  90.9k|      out_vector[2] = z * d;
  361|  90.9k|    }
  362|  90.9k|  }
_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.06M, False: 186k]
  ------------------
  181|  1.06M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.06M|    } else {
  183|   186k|      vec[0] =
  184|   186k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   186k|          abs_sum;
  186|   186k|      vec[1] =
  187|   186k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   186k|          abs_sum;
  189|   186k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 98.7k, False: 87.4k]
  ------------------
  190|  98.7k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|  98.7k|      } else {
  192|  87.4k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|  87.4k|      }
  194|   186k|    }
  195|  1.25M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    193|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    193|            attribute, transform, mesh_data),
   52|    193|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    187|                                                                *buffer) {
  194|    187|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    187|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    187|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 6, False: 181]
  ------------------
  196|       |    // Decode prediction mode.
  197|      6|    uint8_t mode;
  198|      6|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 6]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      6|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 5, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      5|      return false;
  205|      5|    }
  206|      6|  }
  207|    182|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    837|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 688, False: 149]
  ------------------
  211|    688|    uint32_t num_flags;
  212|    688|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 5, False: 683]
  ------------------
  213|      5|      return false;
  214|      5|    }
  215|    683|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 17, False: 666]
  ------------------
  216|     17|      return false;
  217|     17|    }
  218|    666|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 347, False: 319]
  ------------------
  219|    347|      is_crease_edge_[i].resize(num_flags);
  220|    347|      RAnsBitDecoder decoder;
  221|    347|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 11, False: 336]
  ------------------
  222|     11|        return false;
  223|     11|      }
  224|   922k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 922k, False: 336]
  ------------------
  225|   922k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   922k|      }
  227|    336|      decoder.EndDecoding();
  228|    336|    }
  229|    666|  }
  230|    149|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    149|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    182|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    140|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    140|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    140|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    700|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 560, False: 140]
  ------------------
   93|    560|    pred_vals[i].resize(num_components, 0);
   94|    560|  }
   95|    140|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    140|                                         out_data);
   97|       |
   98|    140|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    140|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    140|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    140|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    140|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    140|  const int corner_map_size =
  109|    140|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   398k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 398k, False: 105]
  ------------------
  111|   398k|    const CornerIndex start_corner_id =
  112|   398k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   398k|    CornerIndex corner_id(start_corner_id);
  115|   398k|    int num_parallelograms = 0;
  116|   398k|    bool first_pass = true;
  117|   941k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 573k, False: 367k]
  ------------------
  118|   573k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 66.2k, False: 507k]
  ------------------
  119|   573k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   573k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  66.2k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  66.2k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 663, False: 65.5k]
  ------------------
  127|    663|          break;
  128|    663|        }
  129|  66.2k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|   572k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 564k, False: 8.55k]
  ------------------
  134|   564k|        corner_id = table->SwingLeft(corner_id);
  135|   564k|      } else {
  136|  8.55k|        corner_id = table->SwingRight(corner_id);
  137|  8.55k|      }
  138|   572k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 29.9k, False: 542k]
  ------------------
  139|  29.9k|        break;
  140|  29.9k|      }
  141|   542k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 372k, False: 170k]
  |  Branch (141:47): [True: 367k, False: 4.22k]
  ------------------
  142|   367k|        first_pass = false;
  143|   367k|        corner_id = table->SwingRight(start_corner_id);
  144|   367k|      }
  145|   542k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   398k|    int num_used_parallelograms = 0;
  150|   398k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 36.4k, False: 362k]
  ------------------
  151|  2.72M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 2.68M, False: 36.4k]
  ------------------
  152|  2.68M|        multi_pred_vals[i] = 0;
  153|  2.68M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   102k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 66.1k, False: 36.4k]
  ------------------
  156|  66.1k|        const int context = num_parallelograms - 1;
  157|  66.1k|        const int pos = is_crease_edge_pos[context]++;
  158|  66.1k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 35, False: 66.1k]
  ------------------
  159|     35|          return false;
  160|     35|        }
  161|  66.1k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  66.1k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 7.61k, False: 58.5k]
  ------------------
  163|  7.61k|          ++num_used_parallelograms;
  164|   689k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 682k, False: 7.61k]
  ------------------
  165|   682k|            multi_pred_vals[j] =
  166|   682k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   682k|          }
  168|  7.61k|        }
  169|  66.1k|      }
  170|  36.4k|    }
  171|   398k|    const int dst_offset = p * num_components;
  172|   398k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 395k, False: 3.29k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   395k|      const int src_offset = (p - 1) * num_components;
  176|   395k|      this->transform().ComputeOriginalValue(
  177|   395k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   395k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   287k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 284k, False: 3.29k]
  ------------------
  181|   284k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   284k|      }
  183|  3.29k|      this->transform().ComputeOriginalValue(
  184|  3.29k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  3.29k|    }
  186|   398k|  }
  187|    105|  return true;
  188|    140|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    204|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    204|            attribute, transform, mesh_data),
   52|    204|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    202|                                                                *buffer) {
  194|    202|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    202|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    202|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 0, False: 202]
  ------------------
  196|       |    // Decode prediction mode.
  197|      0|    uint8_t mode;
  198|      0|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 0]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      0|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 0, False: 0]
  ------------------
  203|       |      // Unsupported mode.
  204|      0|      return false;
  205|      0|    }
  206|      0|  }
  207|    202|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    968|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 786, False: 182]
  ------------------
  211|    786|    uint32_t num_flags;
  212|    786|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 2, False: 784]
  ------------------
  213|      2|      return false;
  214|      2|    }
  215|    784|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 12, False: 772]
  ------------------
  216|     12|      return false;
  217|     12|    }
  218|    772|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 363, False: 409]
  ------------------
  219|    363|      is_crease_edge_[i].resize(num_flags);
  220|    363|      RAnsBitDecoder decoder;
  221|    363|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 6, False: 357]
  ------------------
  222|      6|        return false;
  223|      6|      }
  224|   766k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 765k, False: 357]
  ------------------
  225|   765k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   765k|      }
  227|    357|      decoder.EndDecoding();
  228|    357|    }
  229|    772|  }
  230|    182|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    182|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    202|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    173|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    173|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    173|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    865|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 692, False: 173]
  ------------------
   93|    692|    pred_vals[i].resize(num_components, 0);
   94|    692|  }
   95|    173|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    173|                                         out_data);
   97|       |
   98|    173|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    173|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    173|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    173|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    173|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    173|  const int corner_map_size =
  109|    173|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  61.1k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 60.9k, False: 116]
  ------------------
  111|  60.9k|    const CornerIndex start_corner_id =
  112|  60.9k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  60.9k|    CornerIndex corner_id(start_corner_id);
  115|  60.9k|    int num_parallelograms = 0;
  116|  60.9k|    bool first_pass = true;
  117|   408k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 400k, False: 7.60k]
  ------------------
  118|   400k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 111k, False: 289k]
  ------------------
  119|   400k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   400k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   111k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   111k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 512, False: 110k]
  ------------------
  127|    512|          break;
  128|    512|        }
  129|   111k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|   400k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 392k, False: 7.67k]
  ------------------
  134|   392k|        corner_id = table->SwingLeft(corner_id);
  135|   392k|      } else {
  136|  7.67k|        corner_id = table->SwingRight(corner_id);
  137|  7.67k|      }
  138|   400k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 52.8k, False: 347k]
  ------------------
  139|  52.8k|        break;
  140|  52.8k|      }
  141|   347k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 13.7k, False: 333k]
  |  Branch (141:47): [True: 7.61k, False: 6.09k]
  ------------------
  142|  7.61k|        first_pass = false;
  143|  7.61k|        corner_id = table->SwingRight(start_corner_id);
  144|  7.61k|      }
  145|   347k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  60.9k|    int num_used_parallelograms = 0;
  150|  60.9k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 59.1k, False: 1.89k]
  ------------------
  151|  8.31M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 8.26M, False: 59.1k]
  ------------------
  152|  8.26M|        multi_pred_vals[i] = 0;
  153|  8.26M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   170k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 111k, False: 59.0k]
  ------------------
  156|   111k|        const int context = num_parallelograms - 1;
  157|   111k|        const int pos = is_crease_edge_pos[context]++;
  158|   111k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 57, False: 111k]
  ------------------
  159|     57|          return false;
  160|     57|        }
  161|   111k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   111k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 8.52k, False: 102k]
  ------------------
  163|  8.52k|          ++num_used_parallelograms;
  164|  1.26M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.26M, False: 8.52k]
  ------------------
  165|  1.26M|            multi_pred_vals[j] =
  166|  1.26M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.26M|          }
  168|  8.52k|        }
  169|   111k|      }
  170|  59.1k|    }
  171|  60.9k|    const int dst_offset = p * num_components;
  172|  60.9k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 57.4k, False: 3.52k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  57.4k|      const int src_offset = (p - 1) * num_components;
  176|  57.4k|      this->transform().ComputeOriginalValue(
  177|  57.4k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  57.4k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   429k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 426k, False: 3.52k]
  ------------------
  181|   426k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   426k|      }
  183|  3.52k|      this->transform().ComputeOriginalValue(
  184|  3.52k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  3.52k|    }
  186|  60.9k|  }
  187|    116|  return true;
  188|    173|}

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

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   549k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  63.8k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   188k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   202k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    909|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    909|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  6.07M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.24k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.24k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  1.55M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    122|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    122|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     86|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     86|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    112|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    112|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    100|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    100|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    244|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    122|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    122|    DRACO_DCHECK_EQ(i, 0);
   70|    122|    (void)i;
   71|    122|    return GeometryAttribute::POSITION;
   72|    122|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    122|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    122|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 122]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    122|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 122]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|    122|    predictor_.SetPositionAttribute(*att);
   82|    122|    return true;
   83|    122|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    122|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    122|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 4, False: 118]
  ------------------
  145|      4|    return false;
  146|      4|  }
  147|       |
  148|    118|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    118|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    118|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 40, False: 78]
  ------------------
  150|     40|    uint8_t prediction_mode;
  151|     40|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 39]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     39|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 38]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     38|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 38]
  ------------------
  160|     38|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     38|  }
  164|    116|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    116|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 4, False: 112]
  ------------------
  168|      4|    return false;
  169|      4|  }
  170|       |
  171|    112|  return true;
  172|    116|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    112|                                      const PointIndex *entry_to_point_id_map) {
  103|    112|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    112|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    112|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    112|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    112|  const int corner_map_size =
  111|    112|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    112|  VectorD<int32_t, 3> pred_normal_3d;
  114|    112|  int32_t pred_normal_oct[2];
  115|       |
  116|   549k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 549k, False: 112]
  ------------------
  117|   549k|    const CornerIndex corner_id =
  118|   549k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   549k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   549k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   549k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   549k|                    octahedron_tool_box_.center_value());
  125|   549k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 517k, False: 32.3k]
  ------------------
  126|   517k|      pred_normal_3d = -pred_normal_3d;
  127|   517k|    }
  128|   549k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   549k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   549k|    const int data_offset = data_id * 2;
  132|   549k|    this->transform().ComputeOriginalValue(
  133|   549k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   549k|  }
  135|    112|  flip_normal_bit_decoder_.EndDecoding();
  136|    112|  return true;
  137|    112|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    112|  void SetQuantizationBits(int q) {
   85|    112|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    112|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    172|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|     86|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|     86|    DRACO_DCHECK_EQ(i, 0);
   70|     86|    (void)i;
   71|     86|    return GeometryAttribute::POSITION;
   72|     86|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|     86|  bool SetParentAttribute(const PointAttribute *att) override {
   75|     86|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 86]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|     86|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 86]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|     86|    predictor_.SetPositionAttribute(*att);
   82|     86|    return true;
   83|     86|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|     86|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|     86|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 3, False: 83]
  ------------------
  145|      3|    return false;
  146|      3|  }
  147|       |
  148|     83|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|     83|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     83|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 21, False: 62]
  ------------------
  150|     21|    uint8_t prediction_mode;
  151|     21|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 21]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     21|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 20]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     20|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 20]
  ------------------
  160|     20|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     20|  }
  164|     82|#endif
  165|       |
  166|       |  // Init normal flips.
  167|     82|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 2, False: 80]
  ------------------
  168|      2|    return false;
  169|      2|  }
  170|       |
  171|     80|  return true;
  172|     82|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     80|                                      const PointIndex *entry_to_point_id_map) {
  103|     80|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     80|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     80|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     80|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     80|  const int corner_map_size =
  111|     80|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     80|  VectorD<int32_t, 3> pred_normal_3d;
  114|     80|  int32_t pred_normal_oct[2];
  115|       |
  116|  63.8k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 63.7k, False: 80]
  ------------------
  117|  63.7k|    const CornerIndex corner_id =
  118|  63.7k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|  63.7k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|  63.7k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|  63.7k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|  63.7k|                    octahedron_tool_box_.center_value());
  125|  63.7k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 63.4k, False: 314]
  ------------------
  126|  63.4k|      pred_normal_3d = -pred_normal_3d;
  127|  63.4k|    }
  128|  63.7k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|  63.7k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|  63.7k|    const int data_offset = data_id * 2;
  132|  63.7k|    this->transform().ComputeOriginalValue(
  133|  63.7k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|  63.7k|  }
  135|     80|  flip_normal_bit_decoder_.EndDecoding();
  136|     80|  return true;
  137|     80|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     80|  void SetQuantizationBits(int q) {
   85|     80|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     80|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    222|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    112|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    112|    DRACO_DCHECK_EQ(i, 0);
   70|    112|    (void)i;
   71|    112|    return GeometryAttribute::POSITION;
   72|    112|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    112|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    112|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 112]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    112|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 110]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    110|    predictor_.SetPositionAttribute(*att);
   82|    110|    return true;
   83|    112|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    110|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    110|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 4, False: 106]
  ------------------
  145|      4|    return false;
  146|      4|  }
  147|       |
  148|    106|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    106|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    106|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 40, False: 66]
  ------------------
  150|     40|    uint8_t prediction_mode;
  151|     40|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 39]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     39|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 7, False: 32]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      7|      return false;
  157|      7|    }
  158|       |
  159|     32|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 32]
  ------------------
  160|     32|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     32|  }
  164|     98|#endif
  165|       |
  166|       |  // Init normal flips.
  167|     98|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 95]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|     95|  return true;
  172|     98|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     95|                                      const PointIndex *entry_to_point_id_map) {
  103|     95|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     95|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     95|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     95|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     95|  const int corner_map_size =
  111|     95|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     95|  VectorD<int32_t, 3> pred_normal_3d;
  114|     95|  int32_t pred_normal_oct[2];
  115|       |
  116|   188k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 188k, False: 95]
  ------------------
  117|   188k|    const CornerIndex corner_id =
  118|   188k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   188k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   188k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   188k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   188k|                    octahedron_tool_box_.center_value());
  125|   188k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 186k, False: 1.69k]
  ------------------
  126|   186k|      pred_normal_3d = -pred_normal_3d;
  127|   186k|    }
  128|   188k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   188k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   188k|    const int data_offset = data_id * 2;
  132|   188k|    this->transform().ComputeOriginalValue(
  133|   188k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   188k|  }
  135|     95|  flip_normal_bit_decoder_.EndDecoding();
  136|     95|  return true;
  137|     95|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|     95|  void SetQuantizationBits(int q) {
   85|     95|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     95|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    199|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    100|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    100|    DRACO_DCHECK_EQ(i, 0);
   70|    100|    (void)i;
   71|    100|    return GeometryAttribute::POSITION;
   72|    100|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    100|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    100|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 100]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    100|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 99]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|     99|    predictor_.SetPositionAttribute(*att);
   82|     99|    return true;
   83|    100|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|     99|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|     99|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 2, False: 97]
  ------------------
  145|      2|    return false;
  146|      2|  }
  147|       |
  148|     97|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|     97|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     97|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 16, False: 81]
  ------------------
  150|     16|    uint8_t prediction_mode;
  151|     16|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 16]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     16|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 15]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     15|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 15]
  ------------------
  160|     15|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     15|  }
  164|     96|#endif
  165|       |
  166|       |  // Init normal flips.
  167|     96|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 93]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|     93|  return true;
  172|     96|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_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|       |
  113|     93|  VectorD<int32_t, 3> pred_normal_3d;
  114|     93|  int32_t pred_normal_oct[2];
  115|       |
  116|   202k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 202k, False: 93]
  ------------------
  117|   202k|    const CornerIndex corner_id =
  118|   202k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   202k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   202k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   202k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   202k|                    octahedron_tool_box_.center_value());
  125|   202k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 193k, False: 8.48k]
  ------------------
  126|   193k|      pred_normal_3d = -pred_normal_3d;
  127|   193k|    }
  128|   202k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   202k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   202k|    const int data_offset = data_id * 2;
  132|   202k|    this->transform().ComputeOriginalValue(
  133|   202k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   202k|  }
  135|     93|  flip_normal_bit_decoder_.EndDecoding();
  136|     93|  return true;
  137|     93|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     93|  void SetQuantizationBits(int q) {
   85|     93|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     93|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    124|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    124|            attribute, transform, mesh_data),
   37|    124|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    247|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    124|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    124|    DRACO_DCHECK_EQ(i, 0);
   70|    124|    (void)i;
   71|    124|    return GeometryAttribute::POSITION;
   72|    124|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    124|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    124|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 124]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    124|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 123]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    123|    predictor_.SetPositionAttribute(*att);
   82|    123|    return true;
   83|    124|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    122|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    122|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 16, False: 106]
  ------------------
  145|     16|    return false;
  146|     16|  }
  147|       |
  148|    106|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    106|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    106|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 39, False: 67]
  ------------------
  150|     39|    uint8_t prediction_mode;
  151|     39|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 39]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     39|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 37]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|     37|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 37]
  ------------------
  160|     37|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     37|  }
  164|    104|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    104|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 2, False: 102]
  ------------------
  168|      2|    return false;
  169|      2|  }
  170|       |
  171|    102|  return true;
  172|    104|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    102|                                      const PointIndex *entry_to_point_id_map) {
  103|    102|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    102|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    102|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    102|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    102|  const int corner_map_size =
  111|    102|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    102|  VectorD<int32_t, 3> pred_normal_3d;
  114|    102|  int32_t pred_normal_oct[2];
  115|       |
  116|  82.6k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 82.5k, False: 102]
  ------------------
  117|  82.5k|    const CornerIndex corner_id =
  118|  82.5k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|  82.5k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|  82.5k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|  82.5k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|  82.5k|                    octahedron_tool_box_.center_value());
  125|  82.5k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 45.9k, False: 36.6k]
  ------------------
  126|  45.9k|      pred_normal_3d = -pred_normal_3d;
  127|  45.9k|    }
  128|  82.5k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|  82.5k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|  82.5k|    const int data_offset = data_id * 2;
  132|  82.5k|    this->transform().ComputeOriginalValue(
  133|  82.5k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|  82.5k|  }
  135|    102|  flip_normal_bit_decoder_.EndDecoding();
  136|    102|  return true;
  137|    102|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    102|  void SetQuantizationBits(int q) {
   85|    102|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    102|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    359|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    359|            attribute, transform, mesh_data),
   37|    359|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    718|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    359|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    359|    DRACO_DCHECK_EQ(i, 0);
   70|    359|    (void)i;
   71|    359|    return GeometryAttribute::POSITION;
   72|    359|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    359|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    359|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 359]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    359|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 359]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|    359|    predictor_.SetPositionAttribute(*att);
   82|    359|    return true;
   83|    359|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    358|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    358|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 23, False: 335]
  ------------------
  145|     23|    return false;
  146|     23|  }
  147|       |
  148|    335|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    335|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    335|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 108, False: 227]
  ------------------
  150|    108|    uint8_t prediction_mode;
  151|    108|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 107]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    107|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 105]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|    105|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 105]
  ------------------
  160|    105|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    105|  }
  164|    332|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    332|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 11, False: 321]
  ------------------
  168|     11|    return false;
  169|     11|  }
  170|       |
  171|    321|  return true;
  172|    332|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    321|                                      const PointIndex *entry_to_point_id_map) {
  103|    321|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    321|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    321|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    321|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    321|  const int corner_map_size =
  111|    321|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    321|  VectorD<int32_t, 3> pred_normal_3d;
  114|    321|  int32_t pred_normal_oct[2];
  115|       |
  116|   165k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 165k, False: 321]
  ------------------
  117|   165k|    const CornerIndex corner_id =
  118|   165k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   165k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   165k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   165k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   165k|                    octahedron_tool_box_.center_value());
  125|   165k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 149k, False: 15.6k]
  ------------------
  126|   149k|      pred_normal_3d = -pred_normal_3d;
  127|   149k|    }
  128|   165k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   165k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   165k|    const int data_offset = data_id * 2;
  132|   165k|    this->transform().ComputeOriginalValue(
  133|   165k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   165k|  }
  135|    321|  flip_normal_bit_decoder_.EndDecoding();
  136|    321|  return true;
  137|    321|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    321|  void SetQuantizationBits(int q) {
   85|    321|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    321|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    122|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    122|            attribute, transform, mesh_data),
   37|    122|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     86|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|     86|            attribute, transform, mesh_data),
   37|     86|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    112|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    112|            attribute, transform, mesh_data),
   37|    112|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    100|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    100|            attribute, transform, mesh_data),
   37|    100|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    160|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    160|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 36, False: 124]
  ------------------
  105|     36|      this->normal_prediction_mode_ = mode;
  106|     36|      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|    160|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   549k|                             DataTypeT *prediction) override {
   42|   549k|    DRACO_DCHECK(this->IsInitialized());
   43|   549k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   549k|    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|   549k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   549k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   549k|    VectorD<int64_t, 3> normal;
   53|   549k|    CornerIndex c_next, c_prev;
   54|  1.25M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 710k, False: 549k]
  ------------------
   55|       |      // Getting corners.
   56|   710k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 210, False: 709k]
  ------------------
   57|    210|        c_next = corner_table->Next(corner_id);
   58|    210|        c_prev = corner_table->Previous(corner_id);
   59|   709k|      } else {
   60|   709k|        c_next = corner_table->Next(cit.Corner());
   61|   709k|        c_prev = corner_table->Previous(cit.Corner());
   62|   709k|      }
   63|   710k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   710k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   710k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   710k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   710k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   710k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   710k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   710k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   710k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   710k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   710k|      cit.Next();
   81|   710k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   549k|    constexpr int64_t upper_bound = 1 << 29;
   85|   549k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 160, False: 549k]
  ------------------
   86|    160|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    160|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 47, False: 113]
  ------------------
   88|     47|        const int64_t quotient = abs_sum / upper_bound;
   89|     47|        normal = normal / quotient;
   90|     47|      }
   91|   549k|    } else {
   92|   549k|      const int64_t abs_sum = normal.AbsSum();
   93|   549k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.41k, False: 547k]
  ------------------
   94|  1.41k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.41k|        normal = normal / quotient;
   96|  1.41k|      }
   97|   549k|    }
   98|   549k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   549k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   549k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   549k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   549k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    106|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    106|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 18, False: 88]
  ------------------
  105|     18|      this->normal_prediction_mode_ = mode;
  106|     18|      return true;
  107|     88|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 88, False: 0]
  ------------------
  108|     88|      this->normal_prediction_mode_ = mode;
  109|     88|      return true;
  110|     88|    }
  111|      0|    return false;
  112|    106|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  63.7k|                             DataTypeT *prediction) override {
   42|  63.7k|    DRACO_DCHECK(this->IsInitialized());
   43|  63.7k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  63.7k|    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|  63.7k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  63.7k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  63.7k|    VectorD<int64_t, 3> normal;
   53|  63.7k|    CornerIndex c_next, c_prev;
   54|   444k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 380k, False: 63.7k]
  ------------------
   55|       |      // Getting corners.
   56|   380k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 102, False: 380k]
  ------------------
   57|    102|        c_next = corner_table->Next(corner_id);
   58|    102|        c_prev = corner_table->Previous(corner_id);
   59|   380k|      } else {
   60|   380k|        c_next = corner_table->Next(cit.Corner());
   61|   380k|        c_prev = corner_table->Previous(cit.Corner());
   62|   380k|      }
   63|   380k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   380k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   380k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   380k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   380k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   380k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   380k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   380k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   380k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   380k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   380k|      cit.Next();
   81|   380k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  63.7k|    constexpr int64_t upper_bound = 1 << 29;
   85|  63.7k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 68, False: 63.6k]
  ------------------
   86|     68|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     68|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 20, False: 48]
  ------------------
   88|     20|        const int64_t quotient = abs_sum / upper_bound;
   89|     20|        normal = normal / quotient;
   90|     20|      }
   91|  63.6k|    } else {
   92|  63.6k|      const int64_t abs_sum = normal.AbsSum();
   93|  63.6k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 55.4k, False: 8.15k]
  ------------------
   94|  55.4k|        const int64_t quotient = abs_sum / upper_bound;
   95|  55.4k|        normal = normal / quotient;
   96|  55.4k|      }
   97|  63.6k|    }
   98|  63.7k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  63.7k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  63.7k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  63.7k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  63.7k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    144|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    144|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 30, False: 114]
  ------------------
  105|     30|      this->normal_prediction_mode_ = mode;
  106|     30|      return true;
  107|    114|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 114, False: 0]
  ------------------
  108|    114|      this->normal_prediction_mode_ = mode;
  109|    114|      return true;
  110|    114|    }
  111|      0|    return false;
  112|    144|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   188k|                             DataTypeT *prediction) override {
   42|   188k|    DRACO_DCHECK(this->IsInitialized());
   43|   188k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   188k|    const CornerTable *const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   188k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   188k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   188k|    VectorD<int64_t, 3> normal;
   53|   188k|    CornerIndex c_next, c_prev;
   54|   445k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 256k, False: 188k]
  ------------------
   55|       |      // Getting corners.
   56|   256k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 174, False: 256k]
  ------------------
   57|    174|        c_next = corner_table->Next(corner_id);
   58|    174|        c_prev = corner_table->Previous(corner_id);
   59|   256k|      } else {
   60|   256k|        c_next = corner_table->Next(cit.Corner());
   61|   256k|        c_prev = corner_table->Previous(cit.Corner());
   62|   256k|      }
   63|   256k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   256k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   256k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   256k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   256k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   256k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   256k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   256k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   256k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   256k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   256k|      cit.Next();
   81|   256k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   188k|    constexpr int64_t upper_bound = 1 << 29;
   85|   188k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 116, False: 188k]
  ------------------
   86|    116|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    116|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 34, False: 82]
  ------------------
   88|     34|        const int64_t quotient = abs_sum / upper_bound;
   89|     34|        normal = normal / quotient;
   90|     34|      }
   91|   188k|    } else {
   92|   188k|      const int64_t abs_sum = normal.AbsSum();
   93|   188k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.43k, False: 187k]
  ------------------
   94|  1.43k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.43k|        normal = normal / quotient;
   96|  1.43k|      }
   97|   188k|    }
   98|   188k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   188k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   188k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   188k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   188k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    115|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    115|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 14, False: 101]
  ------------------
  105|     14|      this->normal_prediction_mode_ = mode;
  106|     14|      return true;
  107|    101|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 101, False: 0]
  ------------------
  108|    101|      this->normal_prediction_mode_ = mode;
  109|    101|      return true;
  110|    101|    }
  111|      0|    return false;
  112|    115|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   202k|                             DataTypeT *prediction) override {
   42|   202k|    DRACO_DCHECK(this->IsInitialized());
   43|   202k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   202k|    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|   202k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   202k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   202k|    VectorD<int64_t, 3> normal;
   53|   202k|    CornerIndex c_next, c_prev;
   54|  1.40M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.20M, False: 202k]
  ------------------
   55|       |      // Getting corners.
   56|  1.20M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 78, False: 1.20M]
  ------------------
   57|     78|        c_next = corner_table->Next(corner_id);
   58|     78|        c_prev = corner_table->Previous(corner_id);
   59|  1.20M|      } else {
   60|  1.20M|        c_next = corner_table->Next(cit.Corner());
   61|  1.20M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.20M|      }
   63|  1.20M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.20M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.20M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.20M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.20M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.20M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.20M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.20M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.20M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.20M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.20M|      cit.Next();
   81|  1.20M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   202k|    constexpr int64_t upper_bound = 1 << 29;
   85|   202k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 52, False: 202k]
  ------------------
   86|     52|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     52|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 29, False: 23]
  ------------------
   88|     29|        const int64_t quotient = abs_sum / upper_bound;
   89|     29|        normal = normal / quotient;
   90|     29|      }
   91|   202k|    } else {
   92|   202k|      const int64_t abs_sum = normal.AbsSum();
   93|   202k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 107k, False: 94.9k]
  ------------------
   94|   107k|        const int64_t quotient = abs_sum / upper_bound;
   95|   107k|        normal = normal / quotient;
   96|   107k|      }
   97|   202k|    }
   98|   202k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   202k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   202k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   202k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   202k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    124|      : Base(md) {
   35|    124|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    124|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    161|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    161|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 34, False: 127]
  ------------------
  105|     34|      this->normal_prediction_mode_ = mode;
  106|     34|      return true;
  107|    127|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 127, False: 0]
  ------------------
  108|    127|      this->normal_prediction_mode_ = mode;
  109|    127|      return true;
  110|    127|    }
  111|      0|    return false;
  112|    161|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  82.5k|                             DataTypeT *prediction) override {
   42|  82.5k|    DRACO_DCHECK(this->IsInitialized());
   43|  82.5k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  82.5k|    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|  82.5k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  82.5k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  82.5k|    VectorD<int64_t, 3> normal;
   53|  82.5k|    CornerIndex c_next, c_prev;
   54|   433k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 350k, False: 82.5k]
  ------------------
   55|       |      // Getting corners.
   56|   350k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 204k, False: 146k]
  ------------------
   57|   204k|        c_next = corner_table->Next(corner_id);
   58|   204k|        c_prev = corner_table->Previous(corner_id);
   59|   204k|      } else {
   60|   146k|        c_next = corner_table->Next(cit.Corner());
   61|   146k|        c_prev = corner_table->Previous(cit.Corner());
   62|   146k|      }
   63|   350k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   350k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   350k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   350k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   350k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   350k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   350k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   350k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   350k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   350k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   350k|      cit.Next();
   81|   350k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  82.5k|    constexpr int64_t upper_bound = 1 << 29;
   85|  82.5k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 34.4k, False: 48.1k]
  ------------------
   86|  34.4k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  34.4k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 91, False: 34.3k]
  ------------------
   88|     91|        const int64_t quotient = abs_sum / upper_bound;
   89|     91|        normal = normal / quotient;
   90|     91|      }
   91|  48.1k|    } else {
   92|  48.1k|      const int64_t abs_sum = normal.AbsSum();
   93|  48.1k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.07k, False: 47.0k]
  ------------------
   94|  1.07k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.07k|        normal = normal / quotient;
   96|  1.07k|      }
   97|  48.1k|    }
   98|  82.5k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  82.5k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  82.5k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  82.5k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  82.5k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    359|      : Base(md) {
   35|    359|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    359|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    464|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    464|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 103, False: 361]
  ------------------
  105|    103|      this->normal_prediction_mode_ = mode;
  106|    103|      return true;
  107|    361|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 361, False: 0]
  ------------------
  108|    361|      this->normal_prediction_mode_ = mode;
  109|    361|      return true;
  110|    361|    }
  111|      0|    return false;
  112|    464|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   165k|                             DataTypeT *prediction) override {
   42|   165k|    DRACO_DCHECK(this->IsInitialized());
   43|   165k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   165k|    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|   165k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   165k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   165k|    VectorD<int64_t, 3> normal;
   53|   165k|    CornerIndex c_next, c_prev;
   54|  1.10M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 938k, False: 165k]
  ------------------
   55|       |      // Getting corners.
   56|   938k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 408k, False: 530k]
  ------------------
   57|   408k|        c_next = corner_table->Next(corner_id);
   58|   408k|        c_prev = corner_table->Previous(corner_id);
   59|   530k|      } else {
   60|   530k|        c_next = corner_table->Next(cit.Corner());
   61|   530k|        c_prev = corner_table->Previous(cit.Corner());
   62|   530k|      }
   63|   938k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   938k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   938k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   938k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   938k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   938k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   938k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   938k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   938k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   938k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   938k|      cit.Next();
   81|   938k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   165k|    constexpr int64_t upper_bound = 1 << 29;
   85|   165k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 70.3k, False: 95.0k]
  ------------------
   86|  70.3k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  70.3k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 316, False: 70.0k]
  ------------------
   88|    316|        const int64_t quotient = abs_sum / upper_bound;
   89|    316|        normal = normal / quotient;
   90|    316|      }
   91|  95.0k|    } else {
   92|  95.0k|      const int64_t abs_sum = normal.AbsSum();
   93|  95.0k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 8.29k, False: 86.7k]
  ------------------
   94|  8.29k|        const int64_t quotient = abs_sum / upper_bound;
   95|  8.29k|        normal = normal / quotient;
   96|  8.29k|      }
   97|  95.0k|    }
   98|   165k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   165k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   165k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   165k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   165k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    122|      : Base(md) {
   35|    122|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    122|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     86|      : Base(md) {
   35|     86|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     86|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    112|      : Base(md) {
   35|    112|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    112|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    100|      : Base(md) {
   35|    100|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    100|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.96M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.96M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.96M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.96M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.96M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.96M|    return GetPositionForDataId(data_id);
   77|  1.96M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.96M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.96M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.96M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.96M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.96M|    VectorD<int64_t, 3> pos;
   68|  1.96M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.96M|    return pos;
   70|  1.96M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    122|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    122|    pos_attribute_ = &position_attribute;
   43|    122|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    112|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    112|    entry_to_point_id_map_ = map;
   46|    112|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   824k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   824k|    DRACO_DCHECK(this->IsInitialized());
   73|   824k|    const auto corner_table = mesh_data_.corner_table();
   74|   824k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   824k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   824k|    return GetPositionForDataId(data_id);
   77|   824k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|   824k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   824k|    DRACO_DCHECK(this->IsInitialized());
   65|   824k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   824k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   824k|    VectorD<int64_t, 3> pos;
   68|   824k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   824k|    return pos;
   70|   824k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     86|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     86|    pos_attribute_ = &position_attribute;
   43|     86|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     80|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     80|    entry_to_point_id_map_ = map;
   46|     80|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   701k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   701k|    DRACO_DCHECK(this->IsInitialized());
   73|   701k|    const auto corner_table = mesh_data_.corner_table();
   74|   701k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   701k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   701k|    return GetPositionForDataId(data_id);
   77|   701k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|   701k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   701k|    DRACO_DCHECK(this->IsInitialized());
   65|   701k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   701k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   701k|    VectorD<int64_t, 3> pos;
   68|   701k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   701k|    return pos;
   70|   701k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    110|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    110|    pos_attribute_ = &position_attribute;
   43|    110|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     95|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     95|    entry_to_point_id_map_ = map;
   46|     95|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.61M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.61M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.61M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.61M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.61M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.61M|    return GetPositionForDataId(data_id);
   77|  2.61M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.61M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.61M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.61M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.61M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.61M|    VectorD<int64_t, 3> pos;
   68|  2.61M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.61M|    return pos;
   70|  2.61M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     99|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     99|    pos_attribute_ = &position_attribute;
   43|     99|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     93|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     93|    entry_to_point_id_map_ = map;
   46|     93|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    124|      : pos_attribute_(nullptr),
   36|    124|        entry_to_point_id_map_(nullptr),
   37|    124|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    124|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   784k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   784k|    DRACO_DCHECK(this->IsInitialized());
   73|   784k|    const auto corner_table = mesh_data_.corner_table();
   74|   784k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   784k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   784k|    return GetPositionForDataId(data_id);
   77|   784k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|   784k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   784k|    DRACO_DCHECK(this->IsInitialized());
   65|   784k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   784k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   784k|    VectorD<int64_t, 3> pos;
   68|   784k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   784k|    return pos;
   70|   784k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    123|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    123|    pos_attribute_ = &position_attribute;
   43|    123|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    102|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    102|    entry_to_point_id_map_ = map;
   46|    102|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    359|      : pos_attribute_(nullptr),
   36|    359|        entry_to_point_id_map_(nullptr),
   37|    359|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    359|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.04M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.04M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.04M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.04M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.04M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.04M|    return GetPositionForDataId(data_id);
   77|  2.04M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.04M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.04M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.04M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.04M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.04M|    VectorD<int64_t, 3> pos;
   68|  2.04M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.04M|    return pos;
   70|  2.04M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    359|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    359|    pos_attribute_ = &position_attribute;
   43|    359|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    321|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    321|    entry_to_point_id_map_ = map;
   46|    321|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    122|      : pos_attribute_(nullptr),
   36|    122|        entry_to_point_id_map_(nullptr),
   37|    122|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    122|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|     86|      : pos_attribute_(nullptr),
   36|     86|        entry_to_point_id_map_(nullptr),
   37|     86|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|     86|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    112|      : pos_attribute_(nullptr),
   36|    112|        entry_to_point_id_map_(nullptr),
   37|    112|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    112|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    100|      : pos_attribute_(nullptr),
   36|    100|        entry_to_point_id_map_(nullptr),
   37|    100|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    100|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    131|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    131|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    127|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    127|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    127|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    127|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    127|      new DataTypeT[num_components]());
   70|       |
   71|    127|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    127|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    127|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    127|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    127|  const int corner_map_size =
   78|    127|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  89.0k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 88.9k, False: 127]
  ------------------
   80|  88.9k|    const CornerIndex start_corner_id =
   81|  88.9k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  88.9k|    CornerIndex corner_id(start_corner_id);
   84|  88.9k|    int num_parallelograms = 0;
   85|  3.42M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 3.33M, False: 88.9k]
  ------------------
   86|  3.33M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  3.33M|    }
   88|   251k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 162k, False: 88.9k]
  ------------------
   89|   162k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 34.9k, False: 127k]
  ------------------
   90|   162k|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|   162k|              num_components, parallelogram_pred_vals.get())) {
   92|  2.51M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 2.47M, False: 34.9k]
  ------------------
   93|  2.47M|          pred_vals[c] =
   94|  2.47M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  2.47M|        }
   96|  34.9k|        ++num_parallelograms;
   97|  34.9k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|   162k|      corner_id = table->SwingRight(corner_id);
  101|   162k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 14.0k, False: 148k]
  ------------------
  102|  14.0k|        corner_id = kInvalidCornerIndex;
  103|  14.0k|      }
  104|   162k|    }
  105|       |
  106|  88.9k|    const int dst_offset = p * num_components;
  107|  88.9k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 67.4k, False: 21.4k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  67.4k|      const int src_offset = (p - 1) * num_components;
  111|  67.4k|      this->transform().ComputeOriginalValue(
  112|  67.4k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  67.4k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  1.73M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 1.71M, False: 21.4k]
  ------------------
  116|  1.71M|        pred_vals[c] /= num_parallelograms;
  117|  1.71M|      }
  118|  21.4k|      this->transform().ComputeOriginalValue(
  119|  21.4k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  21.4k|    }
  121|  88.9k|  }
  122|    127|  return true;
  123|    127|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    190|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    190|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    185|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    185|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    185|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    185|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    185|      new DataTypeT[num_components]());
   70|       |
   71|    185|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    185|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    185|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    185|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    185|  const int corner_map_size =
   78|    185|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   307k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 307k, False: 185]
  ------------------
   80|   307k|    const CornerIndex start_corner_id =
   81|   307k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   307k|    CornerIndex corner_id(start_corner_id);
   84|   307k|    int num_parallelograms = 0;
   85|  5.08M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 4.78M, False: 307k]
  ------------------
   86|  4.78M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  4.78M|    }
   88|  2.13M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.82M, False: 307k]
  ------------------
   89|  1.82M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 594k, False: 1.23M]
  ------------------
   90|  1.82M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.82M|              num_components, parallelogram_pred_vals.get())) {
   92|  9.92M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 9.33M, False: 594k]
  ------------------
   93|  9.33M|          pred_vals[c] =
   94|  9.33M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  9.33M|        }
   96|   594k|        ++num_parallelograms;
   97|   594k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.82M|      corner_id = table->SwingRight(corner_id);
  101|  1.82M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 303k, False: 1.52M]
  ------------------
  102|   303k|        corner_id = kInvalidCornerIndex;
  103|   303k|      }
  104|  1.82M|    }
  105|       |
  106|   307k|    const int dst_offset = p * num_components;
  107|   307k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 556, False: 306k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|    556|      const int src_offset = (p - 1) * num_components;
  111|    556|      this->transform().ComputeOriginalValue(
  112|    556|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   306k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  5.08M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 4.77M, False: 306k]
  ------------------
  116|  4.77M|        pred_vals[c] /= num_parallelograms;
  117|  4.77M|      }
  118|   306k|      this->transform().ComputeOriginalValue(
  119|   306k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   306k|    }
  121|   307k|  }
  122|    185|  return true;
  123|    185|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  1.09M|    int num_components, DataTypeT *out_prediction) {
   49|  1.09M|  const CornerIndex oci = table->Opposite(ci);
   50|  1.09M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 773k, False: 322k]
  ------------------
   51|   773k|    return false;
   52|   773k|  }
   53|   322k|  int vert_opp, vert_next, vert_prev;
   54|   322k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   322k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   322k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 173k, False: 149k]
  |  Branch (56:35): [True: 135k, False: 37.3k]
  ------------------
   57|   135k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 129k, False: 6.50k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   129k|    const int v_opp_off = vert_opp * num_components;
   60|   129k|    const int v_next_off = vert_next * num_components;
   61|   129k|    const int v_prev_off = vert_prev * num_components;
   62|  7.69M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 7.56M, False: 129k]
  ------------------
   63|  7.56M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  7.56M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  7.56M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  7.56M|      const int64_t result =
   67|  7.56M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  7.56M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  7.56M|    }
   71|   129k|    return true;
   72|   129k|  }
   73|   193k|  return false;  // Not all data is available for prediction
   74|   322k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   322k|    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|   322k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   322k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   322k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   322k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  2.42M|    int num_components, DataTypeT *out_prediction) {
   49|  2.42M|  const CornerIndex oci = table->Opposite(ci);
   50|  2.42M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 49.0k, False: 2.37M]
  ------------------
   51|  49.0k|    return false;
   52|  49.0k|  }
   53|  2.37M|  int vert_opp, vert_next, vert_prev;
   54|  2.37M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  2.37M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  2.37M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 1.26M, False: 1.10M]
  |  Branch (56:35): [True: 959k, False: 308k]
  ------------------
   57|   959k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 899k, False: 59.0k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   899k|    const int v_opp_off = vert_opp * num_components;
   60|   899k|    const int v_next_off = vert_next * num_components;
   61|   899k|    const int v_prev_off = vert_prev * num_components;
   62|  32.0M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 31.1M, False: 899k]
  ------------------
   63|  31.1M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  31.1M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  31.1M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  31.1M|      const int64_t result =
   67|  31.1M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  31.1M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  31.1M|    }
   71|   899k|    return true;
   72|   899k|  }
   73|  1.47M|  return false;  // Not all data is available for prediction
   74|  2.37M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  2.37M|    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|  2.37M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  2.37M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  2.37M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  2.37M|}

_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|     92|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|     92|            attribute, transform, mesh_data),
   46|     92|        pos_attribute_(nullptr),
   47|     92|        entry_to_point_id_map_(nullptr),
   48|     92|        num_components_(0),
   49|     92|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   71|    183|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   73|     92|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|     92|    DRACO_DCHECK_EQ(i, 0);
   75|     92|    (void)i;
   76|     92|    return GeometryAttribute::POSITION;
   77|     92|  }
_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: 4, False: 85]
  ------------------
  157|      4|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 1, False: 3]
  ------------------
  158|      1|      return false;
  159|      1|    }
  160|     85|  } else {
  161|     85|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 0, False: 85]
  ------------------
  162|      0|      return false;
  163|      0|    }
  164|     85|  }
  165|     88|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 1, False: 87]
  ------------------
  166|      1|    return false;
  167|      1|  }
  168|     87|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 6, False: 81]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      6|    return false;
  172|      6|  }
  173|     81|  orientations_.resize(num_orientations);
  174|     81|  bool last_orientation = true;
  175|     81|  RAnsBitDecoder decoder;
  176|     81|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 0, False: 81]
  ------------------
  177|      0|    return false;
  178|      0|  }
  179|  42.0k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 41.9k, False: 81]
  ------------------
  180|  41.9k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 14.1k, False: 27.8k]
  ------------------
  181|  14.1k|      last_orientation = !last_orientation;
  182|  14.1k|    }
  183|  41.9k|    orientations_[i] = last_orientation;
  184|  41.9k|  }
  185|     81|  decoder.EndDecoding();
  186|     81|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|     81|                                     MeshDataT>::DecodePredictionData(buffer);
  188|     81|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|     63|                          const PointIndex *entry_to_point_id_map) {
  126|     63|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 2, False: 61]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      2|    return false;
  129|      2|  }
  130|     61|  num_components_ = num_components;
  131|     61|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|     61|  predicted_value_ =
  133|     61|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|     61|  this->transform().Init(num_components);
  135|       |
  136|     61|  const int corner_map_size =
  137|     61|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|   693k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 693k, False: 55]
  ------------------
  139|   693k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|   693k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 6, False: 693k]
  ------------------
  141|      6|      return false;
  142|      6|    }
  143|       |
  144|   693k|    const int dst_offset = p * num_components;
  145|   693k|    this->transform().ComputeOriginalValue(
  146|   693k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|   693k|  }
  148|     55|  return true;
  149|     61|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|   693k|                          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|   693k|  const CornerIndex next_corner_id =
  198|   693k|      this->mesh_data().corner_table()->Next(corner_id);
  199|   693k|  const CornerIndex prev_corner_id =
  200|   693k|      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|   693k|  int next_data_id, prev_data_id;
  204|       |
  205|   693k|  int next_vert_id, prev_vert_id;
  206|   693k|  next_vert_id =
  207|   693k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|   693k|  prev_vert_id =
  209|   693k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|   693k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|   693k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|   693k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 473k, False: 220k]
  |  Branch (214:33): [True: 253k, False: 220k]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|   253k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|   253k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|   253k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 241k, False: 11.7k]
  ------------------
  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|   482k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 482k, False: 241k]
  ------------------
  223|   482k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 482k]
  |  Branch (223:36): [True: 95, False: 482k]
  ------------------
  224|   482k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 482k]
  ------------------
  225|     95|          predicted_value_[i] = INT_MIN;
  226|   482k|        } else {
  227|   482k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   482k|        }
  229|   482k|      }
  230|   241k|      return true;
  231|   241k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  11.7k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  11.7k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  11.7k|    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|  11.7k|    const Vector3f pn = prev_pos - next_pos;
  261|  11.7k|    const Vector3f cn = tip_pos - next_pos;
  262|  11.7k|    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|  11.7k|    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|  11.7k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  23.5k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 11.7k]
  |  Branch (273:53): [True: 55, False: 11.7k]
  ------------------
  274|     55|      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|     55|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  11.7k|    } else {
  280|  11.7k|      s = 0;
  281|  11.7k|      t = 0;
  282|  11.7k|    }
  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|  11.7k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  11.7k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  11.7k|    const float pnut = pn_uv[0] * t;
  301|  11.7k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  11.7k|    const float pnvt = pn_uv[1] * t;
  303|  11.7k|    Vector2f predicted_uv;
  304|  11.7k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 6, False: 11.7k]
  ------------------
  305|      6|      return false;
  306|      6|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  11.7k|    const bool orientation = orientations_.back();
  310|  11.7k|    orientations_.pop_back();
  311|  11.7k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 9.27k, False: 2.49k]
  ------------------
  312|  9.27k|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|  9.27k|    } else {
  314|  2.49k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|  2.49k|    }
  316|  11.7k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 11.7k, 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|  11.7k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  11.7k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 11.7k]
  |  Branch (321:28): [True: 86, False: 11.6k]
  |  Branch (321:43): [True: 13, False: 11.6k]
  ------------------
  322|     99|        predicted_value_[0] = INT_MIN;
  323|  11.6k|      } else {
  324|  11.6k|        predicted_value_[0] = static_cast<int>(u);
  325|  11.6k|      }
  326|  11.7k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  11.7k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 11.7k]
  |  Branch (327:28): [True: 60, False: 11.7k]
  |  Branch (327:43): [True: 19, False: 11.6k]
  ------------------
  328|     79|        predicted_value_[1] = INT_MIN;
  329|  11.6k|      } else {
  330|  11.6k|        predicted_value_[1] = static_cast<int>(v);
  331|  11.6k|      }
  332|  11.7k|    } 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|  11.7k|    return true;
  338|  11.7k|  }
  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|   440k|  int data_offset = 0;
  343|   440k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 220k, False: 220k]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|   220k|    data_offset = prev_data_id * num_components_;
  346|   220k|  }
  347|   440k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 14, False: 440k]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|     14|    data_offset = next_data_id * num_components_;
  350|   440k|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|   440k|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 440k, False: 61]
  ------------------
  354|   440k|      data_offset = (data_id - 1) * num_components_;
  355|   440k|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    183|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 122, False: 61]
  ------------------
  358|    122|        predicted_value_[i] = 0;
  359|    122|      }
  360|     61|      return true;
  361|     61|    }
  362|   440k|  }
  363|  1.32M|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 880k, False: 440k]
  ------------------
  364|   880k|    predicted_value_[i] = data[data_offset + i];
  365|   880k|  }
  366|   440k|  return true;
  367|   440k|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   506k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   506k|    const int data_offset = entry_id * num_components_;
  104|   506k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   506k|                    static_cast<float>(data[data_offset + 1]));
  106|   506k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   94|  35.3k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  35.3k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  35.3k|    Vector3f pos;
   97|  35.3k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  35.3k|                                 &pos[0]);
   99|  35.3k|    return pos;
  100|  35.3k|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|     85|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|     85|            attribute, transform, mesh_data),
   46|     85|        pos_attribute_(nullptr),
   47|     85|        entry_to_point_id_map_(nullptr),
   48|     85|        num_components_(0),
   49|     85|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   71|    170|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   73|     85|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|     85|    DRACO_DCHECK_EQ(i, 0);
   75|     85|    (void)i;
   76|     85|    return GeometryAttribute::POSITION;
   77|     85|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|     85|  bool SetParentAttribute(const PointAttribute *att) override {
   80|     85|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 85]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|     85|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 85]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|     85|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 0, False: 85]
  ------------------
   87|      0|      return false;  // Currently works only for 3 component positions.
   88|      0|    }
   89|     85|    pos_attribute_ = att;
   90|     85|    return true;
   91|     85|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|     83|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|     83|  uint32_t num_orientations = 0;
  156|     83|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     83|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 2, False: 81]
  ------------------
  157|      2|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 1, False: 1]
  ------------------
  158|      1|      return false;
  159|      1|    }
  160|     81|  } else {
  161|     81|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 0, False: 81]
  ------------------
  162|      0|      return false;
  163|      0|    }
  164|     81|  }
  165|     82|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 3, False: 79]
  ------------------
  166|      3|    return false;
  167|      3|  }
  168|     79|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 5, False: 74]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      5|    return false;
  172|      5|  }
  173|     74|  orientations_.resize(num_orientations);
  174|     74|  bool last_orientation = true;
  175|     74|  RAnsBitDecoder decoder;
  176|     74|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 1, False: 73]
  ------------------
  177|      1|    return false;
  178|      1|  }
  179|  68.9k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 68.8k, False: 73]
  ------------------
  180|  68.8k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 39.3k, False: 29.4k]
  ------------------
  181|  39.3k|      last_orientation = !last_orientation;
  182|  39.3k|    }
  183|  68.8k|    orientations_[i] = last_orientation;
  184|  68.8k|  }
  185|     73|  decoder.EndDecoding();
  186|     73|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|     73|                                     MeshDataT>::DecodePredictionData(buffer);
  188|     74|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|     68|                          const PointIndex *entry_to_point_id_map) {
  126|     68|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 2, False: 66]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      2|    return false;
  129|      2|  }
  130|     66|  num_components_ = num_components;
  131|     66|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|     66|  predicted_value_ =
  133|     66|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|     66|  this->transform().Init(num_components);
  135|       |
  136|     66|  const int corner_map_size =
  137|     66|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|  97.2k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 97.1k, False: 46]
  ------------------
  139|  97.1k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|  97.1k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 20, False: 97.1k]
  ------------------
  141|     20|      return false;
  142|     20|    }
  143|       |
  144|  97.1k|    const int dst_offset = p * num_components;
  145|  97.1k|    this->transform().ComputeOriginalValue(
  146|  97.1k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|  97.1k|  }
  148|     46|  return true;
  149|     66|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|  97.1k|                          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|  97.1k|  const CornerIndex next_corner_id =
  198|  97.1k|      this->mesh_data().corner_table()->Next(corner_id);
  199|  97.1k|  const CornerIndex prev_corner_id =
  200|  97.1k|      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|  97.1k|  int next_data_id, prev_data_id;
  204|       |
  205|  97.1k|  int next_vert_id, prev_vert_id;
  206|  97.1k|  next_vert_id =
  207|  97.1k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|  97.1k|  prev_vert_id =
  209|  97.1k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|  97.1k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|  97.1k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|  97.1k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 96.9k, False: 284]
  |  Branch (214:33): [True: 96.6k, False: 269]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|  96.6k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|  96.6k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|  96.6k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 94.6k, False: 1.98k]
  ------------------
  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|   189k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 189k, False: 94.6k]
  ------------------
  223|   189k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 189k]
  |  Branch (223:36): [True: 124, False: 189k]
  ------------------
  224|   189k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 189k]
  ------------------
  225|    124|          predicted_value_[i] = INT_MIN;
  226|   189k|        } else {
  227|   189k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   189k|        }
  229|   189k|      }
  230|  94.6k|      return true;
  231|  94.6k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  1.98k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  1.98k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  1.98k|    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.98k|    const Vector3f pn = prev_pos - next_pos;
  261|  1.98k|    const Vector3f cn = tip_pos - next_pos;
  262|  1.98k|    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.98k|    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.98k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  3.96k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 1.98k]
  |  Branch (273:53): [True: 471, False: 1.51k]
  ------------------
  274|    471|      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|    471|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  1.51k|    } else {
  280|  1.51k|      s = 0;
  281|  1.51k|      t = 0;
  282|  1.51k|    }
  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.98k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  1.98k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  1.98k|    const float pnut = pn_uv[0] * t;
  301|  1.98k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  1.98k|    const float pnvt = pn_uv[1] * t;
  303|  1.98k|    Vector2f predicted_uv;
  304|  1.98k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 20, False: 1.96k]
  ------------------
  305|     20|      return false;
  306|     20|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  1.96k|    const bool orientation = orientations_.back();
  310|  1.96k|    orientations_.pop_back();
  311|  1.96k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 894, False: 1.07k]
  ------------------
  312|    894|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|  1.07k|    } else {
  314|  1.07k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|  1.07k|    }
  316|  1.96k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 1.96k, 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.96k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  1.96k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 1.96k]
  |  Branch (321:28): [True: 73, False: 1.89k]
  |  Branch (321:43): [True: 34, False: 1.85k]
  ------------------
  322|    107|        predicted_value_[0] = INT_MIN;
  323|  1.85k|      } else {
  324|  1.85k|        predicted_value_[0] = static_cast<int>(u);
  325|  1.85k|      }
  326|  1.96k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  1.96k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 1.96k]
  |  Branch (327:28): [True: 93, False: 1.87k]
  |  Branch (327:43): [True: 35, False: 1.83k]
  ------------------
  328|    128|        predicted_value_[1] = INT_MIN;
  329|  1.83k|      } else {
  330|  1.83k|        predicted_value_[1] = static_cast<int>(v);
  331|  1.83k|      }
  332|  1.96k|    } 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.96k|    return true;
  338|  1.98k|  }
  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|    553|  int data_offset = 0;
  343|    553|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 269, False: 284]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|    269|    data_offset = prev_data_id * num_components_;
  346|    269|  }
  347|    553|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 17, False: 536]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|     17|    data_offset = next_data_id * num_components_;
  350|    536|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|    536|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 470, False: 66]
  ------------------
  354|    470|      data_offset = (data_id - 1) * num_components_;
  355|    470|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    198|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 132, False: 66]
  ------------------
  358|    132|        predicted_value_[i] = 0;
  359|    132|      }
  360|     66|      return true;
  361|     66|    }
  362|    536|  }
  363|  1.46k|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 974, False: 487]
  ------------------
  364|    974|    predicted_value_[i] = data[data_offset + i];
  365|    974|  }
  366|    487|  return true;
  367|    553|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   193k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   193k|    const int data_offset = entry_id * num_components_;
  104|   193k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   193k|                    static_cast<float>(data[data_offset + 1]));
  106|   193k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   94|  5.95k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  5.95k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  5.95k|    Vector3f pos;
   97|  5.95k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  5.95k|                                 &pos[0]);
   99|  5.95k|    return pos;
  100|  5.95k|  }

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    101|      : pos_attribute_(nullptr),
   39|    101|        entry_to_point_id_map_(nullptr),
   40|    101|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    101|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    101|    pos_attribute_ = &position_attribute;
   43|    101|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|     98|  void ResizeOrientations(int num_orientations) {
   74|     98|    orientations_.resize(num_orientations);
   75|     98|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  3.89G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     89|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     89|    entry_to_point_id_map_ = map;
   46|     89|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   285k|                                                 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|   285k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   285k|  const CornerIndex prev_corner_id =
   99|   285k|      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|   285k|  int next_data_id, prev_data_id;
  103|       |
  104|   285k|  int next_vert_id, prev_vert_id;
  105|   285k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   285k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   285k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   285k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   285k|  typedef VectorD<int64_t, 2> Vec2;
  112|   285k|  typedef VectorD<int64_t, 3> Vec3;
  113|   285k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   285k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 204k, False: 80.9k]
  |  Branch (115:33): [True: 123k, False: 80.9k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   123k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   123k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   123k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 121k, False: 2.71k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   121k|      predicted_value_[0] = p_uv[0];
  122|   121k|      predicted_value_[1] = p_uv[1];
  123|   121k|      return true;
  124|   121k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  2.71k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  2.71k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  2.71k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  2.71k|    const Vec3 pn = prev_pos - next_pos;
  146|  2.71k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  2.71k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.71k, False: 1.00k]
  ------------------
  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.71k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.71k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.71k|      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.71k|      const int64_t n_uv_absmax_element =
  164|  1.71k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.71k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 9, False: 1.70k]
  ------------------
  166|  1.71k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|      9|        return false;
  169|      9|      }
  170|  1.70k|      const int64_t pn_uv_absmax_element =
  171|  1.70k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.70k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 5, False: 1.69k]
  ------------------
  173|  1.70k|          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|  1.69k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.69k|      const int64_t pn_absmax_element =
  179|  1.69k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.69k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 4, False: 1.69k]
  ------------------
  181|  1.69k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      4|        return false;
  184|      4|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.69k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.69k|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  189|       |
  190|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  191|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  192|       |      //
  193|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  194|       |      //
  195|       |      // To preserve precision, we perform all operations in scaled space as
  196|       |      // explained above, so we want the final vector to be:
  197|       |      //
  198|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  199|       |      //
  200|       |      // We can then rewrite the formula as:
  201|       |      //
  202|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  203|       |      //
  204|  1.69k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.69k|      const uint64_t norm_squared =
  207|  1.69k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.69k|      cx_uv = cx_uv * norm_squared;
  210|       |
  211|       |      // Predicted uv coordinate is then computed by either adding or
  212|       |      // subtracting CX_UV to/from X_UV.
  213|  1.69k|      Vec2 predicted_uv;
  214|  1.69k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.69k]
  ------------------
  215|       |        // When encoding, compute both possible vectors and determine which one
  216|       |        // results in a better prediction.
  217|       |        // Both vectors need to be transformed back from the scaled space to
  218|       |        // the real UV coordinate space.
  219|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  220|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  221|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  222|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  224|      0|          predicted_uv = predicted_uv_0;
  225|      0|          orientations_.push_back(true);
  226|      0|        } else {
  227|      0|          predicted_uv = predicted_uv_1;
  228|      0|          orientations_.push_back(false);
  229|      0|        }
  230|  1.69k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.69k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 6, False: 1.68k]
  ------------------
  233|      6|          return false;
  234|      6|        }
  235|  1.68k|        const bool orientation = orientations_.back();
  236|  1.68k|        orientations_.pop_back();
  237|       |        // Perform operations in unsigned type to avoid signed integer overflow.
  238|       |        // Note that the result will be the same (for non-overflowing values).
  239|  1.68k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 662, False: 1.02k]
  ------------------
  240|    662|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|  1.02k|        } else {
  242|  1.02k|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|  1.02k|        }
  244|  1.68k|      }
  245|  1.68k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.68k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.68k|      return true;
  248|  1.69k|    }
  249|  2.71k|  }
  250|       |  // Else we don't have available textures on both corners or the position data
  251|       |  // is invalid. For such cases we can't use positions for predicting the uv
  252|       |  // value and we resort to delta coding.
  253|   162k|  int data_offset = 0;
  254|   162k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 81.9k, False: 80.9k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  81.9k|    data_offset = prev_data_id * kNumComponents;
  257|  81.9k|  }
  258|   162k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 1.01k, False: 161k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  1.01k|    data_offset = next_data_id * kNumComponents;
  261|   161k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   161k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 161k, False: 89]
  ------------------
  265|   161k|      data_offset = (data_id - 1) * kNumComponents;
  266|   161k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    267|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 178, False: 89]
  ------------------
  269|    178|        predicted_value_[i] = 0;
  270|    178|      }
  271|     89|      return true;
  272|     89|    }
  273|   161k|  }
  274|   488k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 325k, False: 162k]
  ------------------
  275|   325k|    predicted_value_[i] = data[data_offset + i];
  276|   325k|  }
  277|   162k|  return true;
  278|   162k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   247k|                                            const DataTypeT *data) const {
   59|   247k|    const int data_offset = entry_id * kNumComponents;
   60|   247k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   247k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  8.13k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  8.13k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  8.13k|    VectorD<int64_t, 3> pos;
   52|  8.13k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  8.13k|                                 &pos[0]);
   54|  8.13k|    return pos;
   55|  8.13k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   285k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    115|      : pos_attribute_(nullptr),
   39|    115|        entry_to_point_id_map_(nullptr),
   40|    115|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    112|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    112|    pos_attribute_ = &position_attribute;
   43|    112|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    110|  void ResizeOrientations(int num_orientations) {
   74|    110|    orientations_.resize(num_orientations);
   75|    110|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  5.62G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     98|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     98|    entry_to_point_id_map_ = map;
   46|     98|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   145k|                                                 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|   145k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   145k|  const CornerIndex prev_corner_id =
   99|   145k|      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|   145k|  int next_data_id, prev_data_id;
  103|       |
  104|   145k|  int next_vert_id, prev_vert_id;
  105|   145k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   145k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   145k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   145k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   145k|  typedef VectorD<int64_t, 2> Vec2;
  112|   145k|  typedef VectorD<int64_t, 3> Vec3;
  113|   145k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   145k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 145k, False: 151]
  |  Branch (115:33): [True: 145k, False: 146]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   145k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   145k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   145k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 133k, False: 12.3k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   133k|      predicted_value_[0] = p_uv[0];
  122|   133k|      predicted_value_[1] = p_uv[1];
  123|   133k|      return true;
  124|   133k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  12.3k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  12.3k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  12.3k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  12.3k|    const Vec3 pn = prev_pos - next_pos;
  146|  12.3k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  12.3k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.62k, False: 10.7k]
  ------------------
  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.62k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.62k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.62k|      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.62k|      const int64_t n_uv_absmax_element =
  164|  1.62k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.62k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 10, False: 1.61k]
  ------------------
  166|  1.62k|          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|  1.61k|      const int64_t pn_uv_absmax_element =
  171|  1.61k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.61k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 5, False: 1.61k]
  ------------------
  173|  1.61k|          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|  1.61k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.61k|      const int64_t pn_absmax_element =
  179|  1.61k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.61k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 3, False: 1.60k]
  ------------------
  181|  1.61k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      3|        return false;
  184|      3|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.60k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.60k|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  189|       |
  190|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  191|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  192|       |      //
  193|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  194|       |      //
  195|       |      // To preserve precision, we perform all operations in scaled space as
  196|       |      // explained above, so we want the final vector to be:
  197|       |      //
  198|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  199|       |      //
  200|       |      // We can then rewrite the formula as:
  201|       |      //
  202|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  203|       |      //
  204|  1.60k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.60k|      const uint64_t norm_squared =
  207|  1.60k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.60k|      cx_uv = cx_uv * norm_squared;
  210|       |
  211|       |      // Predicted uv coordinate is then computed by either adding or
  212|       |      // subtracting CX_UV to/from X_UV.
  213|  1.60k|      Vec2 predicted_uv;
  214|  1.60k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.60k]
  ------------------
  215|       |        // When encoding, compute both possible vectors and determine which one
  216|       |        // results in a better prediction.
  217|       |        // Both vectors need to be transformed back from the scaled space to
  218|       |        // the real UV coordinate space.
  219|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  220|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  221|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  222|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  224|      0|          predicted_uv = predicted_uv_0;
  225|      0|          orientations_.push_back(true);
  226|      0|        } else {
  227|      0|          predicted_uv = predicted_uv_1;
  228|      0|          orientations_.push_back(false);
  229|      0|        }
  230|  1.60k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.60k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 9, False: 1.60k]
  ------------------
  233|      9|          return false;
  234|      9|        }
  235|  1.60k|        const bool orientation = orientations_.back();
  236|  1.60k|        orientations_.pop_back();
  237|       |        // Perform operations in unsigned type to avoid signed integer overflow.
  238|       |        // Note that the result will be the same (for non-overflowing values).
  239|  1.60k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 653, False: 947]
  ------------------
  240|    653|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    947|        } else {
  242|    947|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    947|        }
  244|  1.60k|      }
  245|  1.60k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.60k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.60k|      return true;
  248|  1.60k|    }
  249|  12.3k|  }
  250|       |  // Else we don't have available textures on both corners or the position data
  251|       |  // is invalid. For such cases we can't use positions for predicting the uv
  252|       |  // value and we resort to delta coding.
  253|  11.0k|  int data_offset = 0;
  254|  11.0k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 10.8k, False: 151]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  10.8k|    data_offset = prev_data_id * kNumComponents;
  257|  10.8k|  }
  258|  11.0k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 10.7k, False: 285]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  10.7k|    data_offset = next_data_id * kNumComponents;
  261|  10.7k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    285|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 187, False: 98]
  ------------------
  265|    187|      data_offset = (data_id - 1) * kNumComponents;
  266|    187|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    294|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 196, False: 98]
  ------------------
  269|    196|        predicted_value_[i] = 0;
  270|    196|      }
  271|     98|      return true;
  272|     98|    }
  273|    285|  }
  274|  32.7k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 21.8k, False: 10.9k]
  ------------------
  275|  21.8k|    predicted_value_[i] = data[data_offset + i];
  276|  21.8k|  }
  277|  10.9k|  return true;
  278|  11.0k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   291k|                                            const DataTypeT *data) const {
   59|   291k|    const int data_offset = entry_id * kNumComponents;
   60|   291k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   291k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  37.0k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  37.0k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  37.0k|    VectorD<int64_t, 3> pos;
   52|  37.0k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  37.0k|                                 &pos[0]);
   54|  37.0k|    return pos;
   55|  37.0k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   145k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     18|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    220|  bool AreCorrectionsPositive() override {
   71|    220|    return transform_.AreCorrectionsPositive();
   72|    220|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     12|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     12|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 1, False: 11]
  ------------------
   50|      1|      return false;
   51|      1|    }
   52|     11|    return true;
   53|     12|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   654k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     35|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    237|  bool AreCorrectionsPositive() override {
   71|    237|    return transform_.AreCorrectionsPositive();
   72|    237|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     28|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     28|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 9, False: 19]
  ------------------
   50|      9|      return false;
   51|      9|    }
   52|     19|    return true;
   53|     28|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  1.48M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  2.28k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  1.40k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  2.19k|  bool AreCorrectionsPositive() override {
   71|  2.19k|    return transform_.AreCorrectionsPositive();
   72|  2.19k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  1.63k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  1.63k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 72, False: 1.56k]
  ------------------
   50|     72|      return false;
   51|     72|    }
   52|  1.56k|    return true;
   53|  1.63k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  3.57M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    226|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    247|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    226|                                 const PointCloudDecoder *decoder) {
  188|    226|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    226|      method, att_id, decoder, TransformT());
  190|    226|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    226|                                 const TransformT &transform) {
  156|    226|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 226]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    226|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    226|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 226, 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|    226|    const MeshDecoder *const mesh_decoder =
  167|    226|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    226|    auto ret = CreateMeshPredictionScheme<
  170|    226|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    226|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    226|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    226|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 208, False: 18]
  ------------------
  174|    208|      return ret;
  175|    208|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    226|  }
  178|       |  // Create delta decoder.
  179|     18|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     18|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    226|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    125|      uint16_t bitstream_version) {
  143|    125|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    125|        method, attribute, transform, mesh_data, bitstream_version);
  145|    125|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    125|        uint16_t bitstream_version) {
  127|    125|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 122, False: 3]
  ------------------
  128|    122|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    122|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    122|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    122|                                                  mesh_data));
  132|    122|      }
  133|      3|      return nullptr;
  134|    125|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|     88|      uint16_t bitstream_version) {
  143|     88|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|     88|        method, attribute, transform, mesh_data, bitstream_version);
  145|     88|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|     88|        uint16_t bitstream_version) {
  127|     88|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 86, False: 2]
  ------------------
  128|     86|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|     86|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|     86|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|     86|                                                  mesh_data));
  132|     86|      }
  133|      2|      return nullptr;
  134|     88|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    247|                                 const PointCloudDecoder *decoder) {
  188|    247|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    247|      method, att_id, decoder, TransformT());
  190|    247|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    247|                                 const TransformT &transform) {
  156|    247|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 247]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    247|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    247|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 247, 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|    247|    const MeshDecoder *const mesh_decoder =
  167|    247|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    247|    auto ret = CreateMeshPredictionScheme<
  170|    247|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    247|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    247|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    247|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 212, False: 35]
  ------------------
  174|    212|      return ret;
  175|    212|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    247|  }
  178|       |  // Create delta decoder.
  179|     35|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     35|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    247|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    116|      uint16_t bitstream_version) {
  143|    116|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    116|        method, attribute, transform, mesh_data, bitstream_version);
  145|    116|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    116|        uint16_t bitstream_version) {
  111|    116|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 112, False: 4]
  ------------------
  112|    112|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    112|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    112|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    112|                                                  mesh_data));
  116|    112|      }
  117|      4|      return nullptr;
  118|    116|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    103|      uint16_t bitstream_version) {
  143|    103|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    103|        method, attribute, transform, mesh_data, bitstream_version);
  145|    103|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    103|        uint16_t bitstream_version) {
  111|    103|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 100, False: 3]
  ------------------
  112|    100|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    100|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    100|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    100|                                                  mesh_data));
  116|    100|      }
  117|      3|      return nullptr;
  118|    103|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  2.28k|                                 const PointCloudDecoder *decoder) {
  188|  2.28k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  2.28k|      method, att_id, decoder, TransformT());
  190|  2.28k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  2.28k|                                 const TransformT &transform) {
  156|  2.28k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 2.28k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  2.28k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  2.28k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 2.27k, False: 4]
  ------------------
  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|  2.27k|    const MeshDecoder *const mesh_decoder =
  167|  2.27k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  2.27k|    auto ret = CreateMeshPredictionScheme<
  170|  2.27k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  2.27k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  2.27k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  2.27k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 2.15k, False: 128]
  ------------------
  174|  2.15k|      return ret;
  175|  2.15k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  2.27k|  }
  178|       |  // Create delta decoder.
  179|    132|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    132|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  2.28k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    909|      uint16_t bitstream_version) {
  143|    909|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    909|        method, attribute, transform, mesh_data, bitstream_version);
  145|    909|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|    909|        uint16_t bitstream_version) {
   53|    909|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 268, False: 641]
  ------------------
   54|    268|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    268|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    268|                                                         MeshDataT>(
   57|    268|                attribute, transform, mesh_data));
   58|    268|      }
   59|    641|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|    641|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 131, False: 510]
  ------------------
   61|    131|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    131|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    131|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    131|                                                  mesh_data));
   65|    131|      }
   66|    510|#endif
   67|    510|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 193, False: 317]
  ------------------
   68|    193|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    193|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    193|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    193|                                                  mesh_data));
   72|    193|      }
   73|    317|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    317|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 92, False: 225]
  ------------------
   75|     92|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|     92|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|     92|                                                     MeshDataT>(
   78|     92|                attribute, transform, mesh_data, bitstream_version));
   79|     92|      }
   80|    225|#endif
   81|    225|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 101, False: 124]
  ------------------
   82|    101|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    101|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    101|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    101|                                                  mesh_data));
   86|    101|      }
   87|    124|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    124|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 124, False: 0]
  ------------------
   89|    124|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    124|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    124|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    124|                                                  mesh_data));
   93|    124|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|    909|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.24k|      uint16_t bitstream_version) {
  143|  1.24k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.24k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.24k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.24k|        uint16_t bitstream_version) {
   53|  1.24k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 288, False: 953]
  ------------------
   54|    288|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    288|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    288|                                                         MeshDataT>(
   57|    288|                attribute, transform, mesh_data));
   58|    288|      }
   59|    953|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|    953|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 190, False: 763]
  ------------------
   61|    190|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    190|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    190|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    190|                                                  mesh_data));
   65|    190|      }
   66|    763|#endif
   67|    763|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 204, False: 559]
  ------------------
   68|    204|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    204|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    204|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    204|                                                  mesh_data));
   72|    204|      }
   73|    559|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    559|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 85, False: 474]
  ------------------
   75|     85|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|     85|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|     85|                                                     MeshDataT>(
   78|     85|                attribute, transform, mesh_data, bitstream_version));
   79|     85|      }
   80|    474|#endif
   81|    474|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 115, False: 359]
  ------------------
   82|    115|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    115|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    115|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    115|                                                  mesh_data));
   86|    115|      }
   87|    359|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    359|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 359, False: 0]
  ------------------
   89|    359|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    359|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    359|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    359|                                                  mesh_data));
   93|    359|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.24k|    }

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    226|    uint16_t bitstream_version) {
   38|    226|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    226|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 226, False: 0]
  ------------------
   40|    226|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 4, False: 222]
  ------------------
   41|    222|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1, False: 221]
  ------------------
   42|    221|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 221]
  ------------------
   43|    221|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 4, False: 217]
  ------------------
   44|    217|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 208, False: 9]
  ------------------
   45|    217|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 0, False: 9]
  ------------------
   46|    217|    const CornerTable *const ct = source->GetCornerTable();
   47|    217|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    217|        source->GetAttributeEncodingData(att_id);
   49|    217|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 4, False: 213]
  |  Branch (49:26): [True: 0, False: 213]
  ------------------
   50|       |      // No connectivity data found.
   51|      4|      return nullptr;
   52|      4|    }
   53|       |    // Connectivity data exists.
   54|    213|    const MeshAttributeCornerTable *const att_ct =
   55|    213|        source->GetAttributeCornerTable(att_id);
   56|    213|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 125, False: 88]
  ------------------
   57|    125|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    125|      MeshData md;
   59|    125|      md.Set(source->mesh(), att_ct,
   60|    125|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    125|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    125|      MeshPredictionSchemeFactoryT factory;
   63|    125|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    125|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 122, False: 3]
  ------------------
   65|    122|        return ret;
   66|    122|      }
   67|    125|    } else {
   68|     88|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     88|      MeshData md;
   70|     88|      md.Set(source->mesh(), ct,
   71|     88|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     88|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     88|      MeshPredictionSchemeFactoryT factory;
   74|     88|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     88|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 86, False: 2]
  ------------------
   76|     86|        return ret;
   77|     86|      }
   78|     88|    }
   79|    213|  }
   80|     14|  return nullptr;
   81|    226|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    247|    uint16_t bitstream_version) {
   38|    247|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    247|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 247, False: 0]
  ------------------
   40|    247|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 8, False: 239]
  ------------------
   41|    239|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 0, False: 239]
  ------------------
   42|    239|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 3, False: 236]
  ------------------
   43|    236|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 2, False: 234]
  ------------------
   44|    234|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 212, False: 22]
  ------------------
   45|    226|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 1, False: 21]
  ------------------
   46|    226|    const CornerTable *const ct = source->GetCornerTable();
   47|    226|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    226|        source->GetAttributeEncodingData(att_id);
   49|    226|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 7, False: 219]
  |  Branch (49:26): [True: 0, False: 219]
  ------------------
   50|       |      // No connectivity data found.
   51|      7|      return nullptr;
   52|      7|    }
   53|       |    // Connectivity data exists.
   54|    219|    const MeshAttributeCornerTable *const att_ct =
   55|    219|        source->GetAttributeCornerTable(att_id);
   56|    219|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 116, False: 103]
  ------------------
   57|    116|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    116|      MeshData md;
   59|    116|      md.Set(source->mesh(), att_ct,
   60|    116|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    116|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    116|      MeshPredictionSchemeFactoryT factory;
   63|    116|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    116|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 112, False: 4]
  ------------------
   65|    112|        return ret;
   66|    112|      }
   67|    116|    } else {
   68|    103|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    103|      MeshData md;
   70|    103|      md.Set(source->mesh(), ct,
   71|    103|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    103|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    103|      MeshPredictionSchemeFactoryT factory;
   74|    103|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    103|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 100, False: 3]
  ------------------
   76|    100|        return ret;
   77|    100|      }
   78|    103|    }
   79|    219|  }
   80|     28|  return nullptr;
   81|    247|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  2.27k|    uint16_t bitstream_version) {
   38|  2.27k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  2.27k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 2.27k, False: 0]
  ------------------
   40|  2.27k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 562, False: 1.71k]
  ------------------
   41|  1.71k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 321, False: 1.39k]
  ------------------
   42|  1.39k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 402, False: 993]
  ------------------
   43|    993|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 216, False: 777]
  ------------------
   44|    777|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 483, False: 294]
  ------------------
   45|  2.16k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 177, False: 117]
  ------------------
   46|  2.16k|    const CornerTable *const ct = source->GetCornerTable();
   47|  2.16k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  2.16k|        source->GetAttributeEncodingData(att_id);
   49|  2.16k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 11, False: 2.15k]
  |  Branch (49:26): [True: 0, False: 2.15k]
  ------------------
   50|       |      // No connectivity data found.
   51|     11|      return nullptr;
   52|     11|    }
   53|       |    // Connectivity data exists.
   54|  2.15k|    const MeshAttributeCornerTable *const att_ct =
   55|  2.15k|        source->GetAttributeCornerTable(att_id);
   56|  2.15k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 909, False: 1.24k]
  ------------------
   57|    909|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    909|      MeshData md;
   59|    909|      md.Set(source->mesh(), att_ct,
   60|    909|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    909|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    909|      MeshPredictionSchemeFactoryT factory;
   63|    909|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    909|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 909, False: 0]
  ------------------
   65|    909|        return ret;
   66|    909|      }
   67|  1.24k|    } else {
   68|  1.24k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  1.24k|      MeshData md;
   70|  1.24k|      md.Set(source->mesh(), ct,
   71|  1.24k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  1.24k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  1.24k|      MeshPredictionSchemeFactoryT factory;
   74|  1.24k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  1.24k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 1.24k, False: 0]
  ------------------
   76|  1.24k|        return ret;
   77|  1.24k|      }
   78|  1.24k|    }
   79|  2.15k|  }
   80|    117|  return nullptr;
   81|  2.27k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  1.48M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  1.48M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 291k, False: 1.19M]
  |  Branch (93:22): [True: 287k, False: 4.33k]
  ------------------
   94|   287k|      return true;
   95|   287k|    }
   96|  1.19M|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 780k, False: 418k]
  |  Branch (96:25): [True: 393k, False: 387k]
  ------------------
   97|  1.48M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  1.48M|  int32_t GetRotationCount(Point2 pred) const {
   51|  1.48M|    const DataType sign_x = pred[0];
   52|  1.48M|    const DataType sign_y = pred[1];
   53|       |
   54|  1.48M|    int32_t rotation_count = 0;
   55|  1.48M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 291k, False: 1.19M]
  ------------------
   56|   291k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 287k, False: 4.33k]
  ------------------
   57|   287k|        rotation_count = 0;
   58|   287k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 2.27k, False: 2.06k]
  ------------------
   59|  2.27k|        rotation_count = 3;
   60|  2.27k|      } else {
   61|  2.06k|        rotation_count = 1;
   62|  2.06k|      }
   63|  1.19M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 414k, False: 780k]
  ------------------
   64|   414k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 384k, False: 29.6k]
  ------------------
   65|   384k|        rotation_count = 2;
   66|   384k|      } else {
   67|  29.6k|        rotation_count = 1;
   68|  29.6k|      }
   69|   780k|    } else {
   70|   780k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 393k, False: 387k]
  ------------------
   71|   393k|        rotation_count = 0;
   72|   393k|      } else {
   73|   387k|        rotation_count = 3;
   74|   387k|      }
   75|   780k|    }
   76|  1.48M|    return rotation_count;
   77|  1.48M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|  1.61M|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|  1.61M|    switch (rotation_count) {
   81|   421k|      case 1:
  ------------------
  |  Branch (81:7): [True: 421k, False: 1.19M]
  ------------------
   82|   421k|        return Point2(p[1], -p[0]);
   83|   769k|      case 2:
  ------------------
  |  Branch (83:7): [True: 769k, False: 842k]
  ------------------
   84|   769k|        return Point2(-p[0], -p[1]);
   85|   421k|      case 3:
  ------------------
  |  Branch (85:7): [True: 421k, False: 1.19M]
  ------------------
   86|   421k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 1.61M]
  ------------------
   88|      0|        return p;
   89|  1.61M|    }
   90|  1.61M|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    247|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

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

_ZN5draco26SequentialAttributeDecoderC2Ev:
   20|  10.8k|    : decoder_(nullptr), attribute_(nullptr), attribute_id_(-1) {}
_ZN5draco26SequentialAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   23|  10.8k|                                      int attribute_id) {
   24|  10.8k|  decoder_ = decoder;
   25|  10.8k|  attribute_ = decoder->point_cloud()->attribute(attribute_id);
   26|  10.8k|  attribute_id_ = attribute_id;
   27|  10.8k|  return true;
   28|  10.8k|}
_ZN5draco26SequentialAttributeDecoder23DecodePortableAttributeERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   38|  6.03k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   39|  6.03k|  if (attribute_->num_components() <= 0 ||
  ------------------
  |  Branch (39:7): [True: 0, False: 6.03k]
  ------------------
   40|  6.03k|      !attribute_->Reset(point_ids.size())) {
  ------------------
  |  Branch (40:7): [True: 0, False: 6.03k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  6.03k|  if (!DecodeValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (43:7): [True: 981, False: 5.05k]
  ------------------
   44|    981|    return false;
   45|    981|  }
   46|  5.05k|  return true;
   47|  6.03k|}
_ZN5draco26SequentialAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   50|  2.11k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   51|       |  // Default implementation does not apply any transform.
   52|  2.11k|  return true;
   53|  2.11k|}
_ZN5draco26SequentialAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   56|    395|    const std::vector<PointIndex> &point_ids) {
   57|       |  // Default implementation does not apply any transform.
   58|    395|  return true;
   59|    395|}
_ZN5draco26SequentialAttributeDecoder20GetPortableAttributeEv:
   61|  3.78k|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.78k|  if (!attribute_->is_mapping_identity() && portable_attribute_ &&
  ------------------
  |  Branch (64:7): [True: 3.26k, False: 517]
  |  Branch (64:45): [True: 2.87k, False: 392]
  ------------------
   65|  2.87k|      portable_attribute_->is_mapping_identity()) {
  ------------------
  |  Branch (65:7): [True: 2.08k, False: 783]
  ------------------
   66|  2.08k|    portable_attribute_->SetExplicitMapping(attribute_->indices_map_size());
   67|  2.08k|    for (PointIndex i(0);
   68|  13.1M|         i < static_cast<uint32_t>(attribute_->indices_map_size()); ++i) {
  ------------------
  |  Branch (68:10): [True: 13.1M, False: 2.08k]
  ------------------
   69|  13.1M|      portable_attribute_->SetPointMapEntry(i, attribute_->mapped_index(i));
   70|  13.1M|    }
   71|  2.08k|  }
   72|  3.78k|  return portable_attribute_.get();
   73|  3.78k|}
_ZN5draco26SequentialAttributeDecoder20InitPredictionSchemeEPNS_25PredictionSchemeInterfaceE:
   76|  2.75k|    PredictionSchemeInterface *ps) {
   77|  4.04k|  for (int i = 0; i < ps->GetNumParentAttributes(); ++i) {
  ------------------
  |  Branch (77:19): [True: 1.29k, False: 2.74k]
  ------------------
   78|  1.29k|    const int att_id = decoder_->point_cloud()->GetNamedAttributeId(
   79|  1.29k|        ps->GetParentAttributeType(i));
   80|  1.29k|    if (att_id == -1) {
  ------------------
  |  Branch (80:9): [True: 0, False: 1.29k]
  ------------------
   81|      0|      return false;  // Requested attribute does not exist.
   82|      0|    }
   83|  1.29k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   84|  1.29k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:9): [True: 0, False: 1.29k]
  ------------------
   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.29k|#endif
   90|  1.29k|    {
   91|  1.29k|      const PointAttribute *const pa = decoder_->GetPortableAttribute(att_id);
   92|  1.29k|      if (pa == nullptr || !ps->SetParentAttribute(pa)) {
  ------------------
  |  Branch (92:11): [True: 2, False: 1.29k]
  |  Branch (92:28): [True: 6, False: 1.28k]
  ------------------
   93|      8|        return false;
   94|      8|      }
   95|  1.29k|    }
   96|  1.29k|  }
   97|  2.74k|  return true;
   98|  2.75k|}
_ZN5draco26SequentialAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  101|    840|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  102|    840|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
  103|    840|  const int entry_size = static_cast<int>(attribute_->byte_stride());
  104|    840|  std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
  105|    840|  uint8_t *const value_data = value_data_ptr.get();
  106|    840|  int out_byte_pos = 0;
  107|       |  // Decode raw attribute values in their original format.
  108|  19.9k|  for (int i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (108:19): [True: 19.2k, False: 731]
  ------------------
  109|  19.2k|    if (!in_buffer->Decode(value_data, entry_size)) {
  ------------------
  |  Branch (109:9): [True: 109, False: 19.1k]
  ------------------
  110|    109|      return false;
  111|    109|    }
  112|  19.1k|    attribute_->buffer()->Write(out_byte_pos, value_data, entry_size);
  113|  19.1k|    out_byte_pos += entry_size;
  114|  19.1k|  }
  115|    731|  return true;
  116|    840|}

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  4.41k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  2.65M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  2.75k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  15.6k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  4.91k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  4.91k|    portable_attribute_ = std::move(att);
   71|  4.91k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  17.1k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  10.8k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  7.95k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  3.57k|    DecoderBuffer *buffer) {
   30|  3.57k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 61, False: 3.51k]
  ------------------
   31|     61|    return false;
   32|     61|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  3.51k|  const int32_t num_attributes = GetNumAttributes();
   35|  3.51k|  sequential_decoders_.resize(num_attributes);
   36|  14.3k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 10.8k, False: 3.50k]
  ------------------
   37|  10.8k|    uint8_t decoder_type;
   38|  10.8k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 3, False: 10.8k]
  ------------------
   39|      3|      return false;
   40|      3|    }
   41|       |    // Create the decoder from the id.
   42|  10.8k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  10.8k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 4, False: 10.8k]
  ------------------
   44|      4|      return false;
   45|      4|    }
   46|  10.8k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 3, False: 10.8k]
  ------------------
   47|      3|      return false;
   48|      3|    }
   49|  10.8k|  }
   50|  3.50k|  return true;
   51|  3.51k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  1.84k|    DecoderBuffer *buffer) {
   55|  1.84k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 1.84k]
  |  Branch (55:22): [True: 0, False: 1.84k]
  ------------------
   56|      0|    return false;
   57|      0|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  1.84k|  const int32_t num_attributes = GetNumAttributes();
   60|  10.8k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 8.99k, False: 1.84k]
  ------------------
   61|  8.99k|    PointAttribute *const pa =
   62|  8.99k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  8.99k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 0, False: 8.99k]
  ------------------
   64|      0|      return false;
   65|      0|    }
   66|  8.99k|  }
   67|  1.84k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  1.84k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  1.84k|    DecoderBuffer *in_buffer) {
   72|  1.84k|  const int32_t num_attributes = GetNumAttributes();
   73|  6.90k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 6.03k, False: 868]
  ------------------
   74|  6.03k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 981, False: 5.05k]
  ------------------
   75|  6.03k|                                                          in_buffer)) {
   76|    981|      return false;
   77|    981|    }
   78|  6.03k|  }
   79|    868|  return true;
   80|  1.84k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|    868|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|    868|  const int32_t num_attributes = GetNumAttributes();
   85|  3.14k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 2.47k, False: 672]
  ------------------
   86|  2.47k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 196, False: 2.27k]
  ------------------
   87|  2.47k|            point_ids_, in_buffer)) {
   88|    196|      return false;
   89|    196|    }
   90|  2.47k|  }
   91|    672|  return true;
   92|    868|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|    672|    TransformAttributesToOriginalFormat() {
   96|    672|  const int32_t num_attributes = GetNumAttributes();
   97|  2.39k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 1.96k, False: 433]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  1.96k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 1.96k, False: 0]
  ------------------
  100|  1.96k|      const PointAttribute *const attribute =
  101|  1.96k|          sequential_decoders_[i]->attribute();
  102|  1.96k|      const PointAttribute *const portable_attribute =
  103|  1.96k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  1.96k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 1.56k, False: 395]
  |  Branch (104:11): [True: 0, False: 1.96k]
  ------------------
  105|  1.56k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 0, False: 1.56k]
  ------------------
  106|  1.56k|              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.96k|    }
  116|  1.96k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 239, False: 1.72k]
  ------------------
  117|  1.96k|            point_ids_)) {
  118|    239|      return false;
  119|    239|    }
  120|  1.96k|  }
  121|    433|  return true;
  122|    672|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  10.8k|    uint8_t decoder_type) {
  127|  10.8k|  switch (decoder_type) {
  128|  1.73k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.73k, False: 9.16k]
  ------------------
  129|  1.73k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.73k|          new SequentialAttributeDecoder());
  131|  8.14k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 8.14k, False: 2.74k]
  ------------------
  132|  8.14k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  8.14k|          new SequentialIntegerAttributeDecoder());
  134|    377|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 377, False: 10.5k]
  ------------------
  135|    377|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    377|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|    633|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 633, False: 10.2k]
  ------------------
  139|    633|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|    633|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|      4|    default:
  ------------------
  |  Branch (142:5): [True: 4, False: 10.8k]
  ------------------
  143|      4|      break;
  144|  10.8k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|      4|  return nullptr;
  147|  10.8k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  9.15k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  9.15k|                                             int attribute_id) {
   27|  9.15k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 9.15k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  9.15k|  return true;
   31|  9.15k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  1.56k|    const std::vector<PointIndex> &point_ids) {
   35|  1.56k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  1.56k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 1.56k, False: 0]
  ------------------
   37|  1.56k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 0, False: 1.56k]
  ------------------
   38|      0|    return true;  // Don't revert the transform here for older files.
   39|      0|  }
   40|  1.56k|#endif
   41|  1.56k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  1.56k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  5.19k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  5.19k|  int8_t prediction_scheme_method;
   48|  5.19k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 76, False: 5.12k]
  ------------------
   49|     76|    return false;
   50|     76|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  5.12k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 35, False: 5.08k]
  ------------------
   53|  5.08k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 97, False: 4.98k]
  ------------------
   54|    132|    return false;
   55|    132|  }
   56|  4.98k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 4.92k, False: 61]
  ------------------
   57|  4.92k|    int8_t prediction_transform_type;
   58|  4.92k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 22, False: 4.90k]
  ------------------
   59|     22|      return false;
   60|     22|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  4.90k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 9, False: 4.89k]
  ------------------
   63|  4.89k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 30, False: 4.86k]
  ------------------
   64|     39|      return false;
   65|     39|    }
   66|  4.86k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  4.86k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  4.86k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  4.86k|  }
   70|       |
   71|  4.92k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 2.75k, False: 2.17k]
  ------------------
   72|  2.75k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 8, False: 2.74k]
  ------------------
   73|      8|      return false;
   74|      8|    }
   75|  2.75k|  }
   76|       |
   77|  4.91k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 595, False: 4.32k]
  ------------------
   78|    595|    return false;
   79|    595|  }
   80|       |
   81|  4.32k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  4.32k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  4.32k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 4.32k, False: 0]
  ------------------
   84|  4.32k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.32k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 0, False: 4.32k]
  ------------------
   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.32k|#endif
   91|  4.32k|  return true;
   92|  4.32k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  4.36k|    PredictionSchemeTransformType transform_type) {
   98|  4.36k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 2.07k, False: 2.28k]
  ------------------
   99|  2.07k|    return nullptr;  // For now we support only wrap transform.
  100|  2.07k|  }
  101|  2.28k|  return CreatePredictionSchemeForDecoder<
  102|  2.28k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  2.28k|      method, attribute_id(), decoder());
  104|  4.36k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  4.91k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  4.91k|  const int num_components = GetNumValueComponents();
  109|  4.91k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 4.91k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  4.91k|  const size_t num_entries = point_ids.size();
  113|  4.91k|  const size_t num_values = num_entries * num_components;
  114|  4.91k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  4.91k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  4.91k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 2, False: 4.91k]
  ------------------
  117|      2|    return false;
  118|      2|  }
  119|  4.91k|  uint8_t compressed;
  120|  4.91k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 2, False: 4.91k]
  ------------------
  121|      2|    return false;
  122|      2|  }
  123|  4.91k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 300, False: 4.61k]
  ------------------
  124|       |    // Decode compressed values.
  125|    300|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 130, False: 170]
  ------------------
  126|    300|                       in_buffer,
  127|    300|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    130|      return false;
  129|    130|    }
  130|  4.61k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  4.61k|    uint8_t num_bytes;
  134|  4.61k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 1, False: 4.61k]
  ------------------
  135|      1|      return false;
  136|      1|    }
  137|  4.61k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 169, False: 4.44k]
  ------------------
  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.44k|    } else {
  147|  4.44k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 10, False: 4.43k]
  ------------------
  148|  4.44k|          num_bytes * num_values) {
  149|     10|        return false;
  150|     10|      }
  151|  4.43k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 13, False: 4.42k]
  ------------------
  152|  4.43k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     13|        return false;
  154|     13|      }
  155|   186M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 186M, False: 4.42k]
  ------------------
  156|   186M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 186M]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|   186M|      }
  160|  4.42k|    }
  161|  4.61k|  }
  162|       |
  163|  4.76k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 4.76k, False: 0]
  |  Branch (163:26): [True: 2.10k, False: 2.65k]
  ------------------
  164|  4.30k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 2.19k, False: 457]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  4.30k|    ConvertSymbolsToSignedInts(
  167|  4.30k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  4.30k|        static_cast<int>(num_values), portable_attribute_data);
  169|  4.30k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  4.76k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 2.65k, False: 2.10k]
  ------------------
  173|  2.65k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 260, False: 2.39k]
  ------------------
  174|    260|      return false;
  175|    260|    }
  176|       |
  177|  2.39k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 2.39k, False: 0]
  ------------------
  178|  2.39k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 177, False: 2.21k]
  ------------------
  179|  2.39k|              portable_attribute_data, portable_attribute_data,
  180|  2.39k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    177|        return false;
  182|    177|      }
  183|  2.39k|    }
  184|  2.39k|  }
  185|  4.32k|  return true;
  186|  4.76k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  1.40k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  1.40k|  switch (attribute()->data_type()) {
  190|    153|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 153, False: 1.25k]
  ------------------
  191|    153|      StoreTypedValues<uint8_t>(num_values);
  192|    153|      break;
  193|    815|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 815, False: 594]
  ------------------
  194|    815|      StoreTypedValues<int8_t>(num_values);
  195|    815|      break;
  196|     40|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 40, False: 1.36k]
  ------------------
  197|     40|      StoreTypedValues<uint16_t>(num_values);
  198|     40|      break;
  199|    148|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 148, False: 1.26k]
  ------------------
  200|    148|      StoreTypedValues<int16_t>(num_values);
  201|    148|      break;
  202|    100|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 100, False: 1.30k]
  ------------------
  203|    100|      StoreTypedValues<uint32_t>(num_values);
  204|    100|      break;
  205|     20|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 20, False: 1.38k]
  ------------------
  206|     20|      StoreTypedValues<int32_t>(num_values);
  207|     20|      break;
  208|    133|    default:
  ------------------
  |  Branch (208:5): [True: 133, False: 1.27k]
  ------------------
  209|    133|      return false;
  210|  1.40k|  }
  211|  1.27k|  return true;
  212|  1.40k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  4.91k|    int num_entries, int num_components) {
  237|  4.91k|  GeometryAttribute ga;
  238|  4.91k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  4.91k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  4.91k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  4.91k|  port_att->SetIdentityMapping();
  242|  4.91k|  port_att->Reset(num_entries);
  243|  4.91k|  port_att->set_unique_id(attribute()->unique_id());
  244|  4.91k|  SetPortableAttribute(std::move(port_att));
  245|  4.91k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    153|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    153|  const int num_components = attribute()->num_components();
  217|    153|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    153|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    153|      new AttributeTypeT[num_components]);
  220|    153|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    153|  int val_id = 0;
  222|    153|  int out_byte_pos = 0;
  223|   162k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 162k, False: 153]
  ------------------
  224|  1.13M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 969k, False: 162k]
  ------------------
  225|   969k|      const AttributeTypeT value =
  226|   969k|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   969k|      att_val[c] = value;
  228|   969k|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   162k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   162k|    out_byte_pos += entry_size;
  232|   162k|  }
  233|    153|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|    815|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    815|  const int num_components = attribute()->num_components();
  217|    815|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    815|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    815|      new AttributeTypeT[num_components]);
  220|    815|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    815|  int val_id = 0;
  222|    815|  int out_byte_pos = 0;
  223|   377k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 376k, False: 815]
  ------------------
  224|  16.2M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 15.8M, False: 376k]
  ------------------
  225|  15.8M|      const AttributeTypeT value =
  226|  15.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  15.8M|      att_val[c] = value;
  228|  15.8M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   376k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   376k|    out_byte_pos += entry_size;
  232|   376k|  }
  233|    815|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|     40|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     40|  const int num_components = attribute()->num_components();
  217|     40|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     40|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     40|      new AttributeTypeT[num_components]);
  220|     40|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     40|  int val_id = 0;
  222|     40|  int out_byte_pos = 0;
  223|  71.0k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 71.0k, False: 40]
  ------------------
  224|  5.25M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 5.18M, False: 71.0k]
  ------------------
  225|  5.18M|      const AttributeTypeT value =
  226|  5.18M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  5.18M|      att_val[c] = value;
  228|  5.18M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  71.0k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  71.0k|    out_byte_pos += entry_size;
  232|  71.0k|  }
  233|     40|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    148|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    148|  const int num_components = attribute()->num_components();
  217|    148|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    148|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    148|      new AttributeTypeT[num_components]);
  220|    148|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    148|  int val_id = 0;
  222|    148|  int out_byte_pos = 0;
  223|   929k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 929k, False: 148]
  ------------------
  224|  6.95M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 6.02M, False: 929k]
  ------------------
  225|  6.02M|      const AttributeTypeT value =
  226|  6.02M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  6.02M|      att_val[c] = value;
  228|  6.02M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   929k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   929k|    out_byte_pos += entry_size;
  232|   929k|  }
  233|    148|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    100|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    100|  const int num_components = attribute()->num_components();
  217|    100|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    100|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    100|      new AttributeTypeT[num_components]);
  220|    100|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    100|  int val_id = 0;
  222|    100|  int out_byte_pos = 0;
  223|  1.09M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.09M, False: 100]
  ------------------
  224|  62.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 61.8M, False: 1.09M]
  ------------------
  225|  61.8M|      const AttributeTypeT value =
  226|  61.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  61.8M|      att_val[c] = value;
  228|  61.8M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.09M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.09M|    out_byte_pos += entry_size;
  232|  1.09M|  }
  233|    100|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|     20|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     20|  const int num_components = attribute()->num_components();
  217|     20|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     20|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     20|      new AttributeTypeT[num_components]);
  220|     20|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     20|  int val_id = 0;
  222|     20|  int out_byte_pos = 0;
  223|    472|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 452, False: 20]
  ------------------
  224|  11.9k|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 11.4k, False: 452]
  ------------------
  225|  11.4k|      const AttributeTypeT value =
  226|  11.4k|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  11.4k|      att_val[c] = value;
  228|  11.4k|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|    452|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|    452|    out_byte_pos += entry_size;
  232|    452|  }
  233|     20|}

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

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

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

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

_ZN5draco16DirectBitDecoderC2Ev:
   19|  2.34k|DirectBitDecoder::DirectBitDecoder() : pos_(bits_.end()), num_used_bits_(0) {}
_ZN5draco16DirectBitDecoderD2Ev:
   21|  2.34k|DirectBitDecoder::~DirectBitDecoder() { Clear(); }
_ZN5draco16DirectBitDecoder13StartDecodingEPNS_13DecoderBufferE:
   23|  1.63k|bool DirectBitDecoder::StartDecoding(DecoderBuffer *source_buffer) {
   24|  1.63k|  Clear();
   25|  1.63k|  uint32_t size_in_bytes;
   26|  1.63k|  if (!source_buffer->Decode(&size_in_bytes)) {
  ------------------
  |  Branch (26:7): [True: 2, False: 1.63k]
  ------------------
   27|      2|    return false;
   28|      2|  }
   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.63k|  if (size_in_bytes == 0 || size_in_bytes & 0x3) {
  ------------------
  |  Branch (32:7): [True: 2, False: 1.62k]
  |  Branch (32:29): [True: 16, False: 1.61k]
  ------------------
   33|     18|    return false;
   34|     18|  }
   35|  1.61k|  if (size_in_bytes > source_buffer->remaining_size()) {
  ------------------
  |  Branch (35:7): [True: 21, False: 1.59k]
  ------------------
   36|     21|    return false;
   37|     21|  }
   38|  1.59k|  const uint32_t num_32bit_elements = size_in_bytes / 4;
   39|  1.59k|  bits_.resize(num_32bit_elements);
   40|  1.59k|  if (!source_buffer->Decode(bits_.data(), size_in_bytes)) {
  ------------------
  |  Branch (40:7): [True: 0, False: 1.59k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  1.59k|  pos_ = bits_.begin();
   44|  1.59k|  num_used_bits_ = 0;
   45|  1.59k|  return true;
   46|  1.59k|}
_ZN5draco16DirectBitDecoder5ClearEv:
   48|  3.97k|void DirectBitDecoder::Clear() {
   49|  3.97k|  bits_.clear();
   50|  3.97k|  num_used_bits_ = 0;
   51|  3.97k|  pos_ = bits_.end();
   52|  3.97k|}

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  3.74M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  3.74M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  3.74M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  3.74M|    const int remaining = 32 - num_used_bits_;
   54|  3.74M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 3.52M, False: 223k]
  ------------------
   55|  3.52M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 3.13M, False: 386k]
  ------------------
   56|  3.13M|        return false;
   57|  3.13M|      }
   58|   386k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   386k|      num_used_bits_ += nbits;
   60|   386k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 13.2k, False: 373k]
  ------------------
   61|  13.2k|        ++pos_;
   62|  13.2k|        num_used_bits_ = 0;
   63|  13.2k|      }
   64|   386k|    } else {
   65|   223k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 212k, False: 11.1k]
  ------------------
   66|   212k|        return false;
   67|   212k|      }
   68|  11.1k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  11.1k|      num_used_bits_ = nbits - remaining;
   70|  11.1k|      ++pos_;
   71|  11.1k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  11.1k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  11.1k|    }
   74|   397k|    return true;
   75|  3.74M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  4.48M|  bool DecodeNextBit() {
   35|  4.48M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  4.48M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 4.11M, False: 371k]
  ------------------
   37|  4.11M|      return false;
   38|  4.11M|    }
   39|   371k|    const bool bit = *pos_ & selector;
   40|   371k|    ++num_used_bits_;
   41|   371k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 11.5k, False: 360k]
  ------------------
   42|  11.5k|      ++pos_;
   43|  11.5k|      num_used_bits_ = 0;
   44|  11.5k|    }
   45|   371k|    return bit;
   46|  4.48M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    359|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    342|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    296|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  8.91k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 8.65k, False: 262]
  ------------------
   35|  8.65k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 34, False: 8.62k]
  ------------------
   36|     34|        return false;
   37|     34|      }
   38|  8.65k|    }
   39|    262|    return bit_decoder_.StartDecoding(source_buffer);
   40|    296|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  2.68M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  2.68M|    uint32_t result = 0;
   49|  16.8M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 14.2M, False: 2.68M]
  ------------------
   50|  14.2M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  14.2M|      result = (result << 1) + bit;
   52|  14.2M|    }
   53|  2.68M|    *value = result;
   54|  2.68M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     70|  void EndDecoding() {
   57|  2.31k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 2.24k, False: 70]
  ------------------
   58|  2.24k|      folded_number_decoders_[i].EndDecoding();
   59|  2.24k|    }
   60|     70|    bit_decoder_.EndDecoding();
   61|     70|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    342|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  24.4k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  18.5k|                                const uint8_t *const buf, int offset) {
  301|  18.5k|  unsigned x;
  302|  18.5k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 20, False: 18.4k]
  ------------------
  303|     20|    return 1;
  304|     20|  }
  305|  18.4k|  ans->buf = buf;
  306|  18.4k|  x = buf[offset - 1] >> 6;
  307|  18.4k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 16.4k, False: 2.09k]
  ------------------
  308|  16.4k|    ans->buf_offset = offset - 1;
  309|  16.4k|    ans->state = buf[offset - 1] & 0x3F;
  310|  16.4k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 1.87k, False: 219]
  ------------------
  311|  1.87k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 0, False: 1.87k]
  ------------------
  312|      0|      return 1;
  313|      0|    }
  314|  1.87k|    ans->buf_offset = offset - 2;
  315|  1.87k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  1.87k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 216, False: 3]
  ------------------
  317|    216|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 1, False: 215]
  ------------------
  318|      1|      return 1;
  319|      1|    }
  320|    215|    ans->buf_offset = offset - 3;
  321|    215|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    215|  } else {
  323|      3|    return 1;
  324|      3|  }
  325|  18.4k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  18.4k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  18.4k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  18.4k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  18.4k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 4, False: 18.4k]
  ------------------
  327|      4|    return 1;
  328|      4|  }
  329|  18.4k|  return 0;
  330|  18.4k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  1.87k|static uint32_t mem_get_le16(const void *vmem) {
   68|  1.87k|  uint32_t val;
   69|  1.87k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  1.87k|  val = mem[1] << 8;
   72|  1.87k|  val |= mem[0];
   73|  1.87k|  return val;
   74|  1.87k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    215|static uint32_t mem_get_le24(const void *vmem) {
   77|    215|  uint32_t val;
   78|    215|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    215|  val = mem[2] << 16;
   81|    215|  val |= mem[1] << 8;
   82|    215|  val |= mem[0];
   83|    215|  return val;
   84|    215|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  9.57G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  9.57G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  9.57G|  unsigned quot, rem, x, xn;
  172|  9.57G|#endif
  173|  9.57G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  9.57G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  9.57G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  19.1G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 8.91G, False: 659M]
  |  Branch (174:40): [True: 72.6k, False: 8.91G]
  ------------------
  175|  72.6k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  72.6k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  72.6k|  }
  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|  9.57G|  x = ans->state;
  184|  9.57G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  9.57G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  9.57G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  9.57G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  9.57G|  xn = quot * p;
  187|  9.57G|  val = rem < p;
  188|  9.57G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  19.1G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 8.91G, False: 655M]
  |  |  ------------------
  ------------------
  189|  8.91G|    ans->state = xn + rem;
  190|  8.91G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   655M|    ans->state = x - xn - p;
  193|   655M|  }
  194|  9.57G|#endif
  195|  9.57G|  return val;
  196|  9.57G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  40.7k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  40.7k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  40.7k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  40.7k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  1.42k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|    794|                                       uint32_t num_symbols) {
  482|    794|    lut_table_.resize(rans_precision);
  483|    794|    probability_table_.resize(num_symbols);
  484|    794|    uint32_t cum_prob = 0;
  485|    794|    uint32_t act_prob = 0;
  486|  6.30k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 5.59k, False: 704]
  ------------------
  487|  5.59k|      probability_table_[i].prob = token_probs[i];
  488|  5.59k|      probability_table_[i].cum_prob = cum_prob;
  489|  5.59k|      cum_prob += token_probs[i];
  490|  5.59k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 90, False: 5.50k]
  ------------------
  491|     90|        return false;
  492|     90|      }
  493|  2.58M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 2.57M, False: 5.50k]
  ------------------
  494|  2.57M|        lut_table_[j] = i;
  495|  2.57M|      }
  496|  5.50k|      act_prob = cum_prob;
  497|  5.50k|    }
  498|    704|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 92, False: 612]
  ------------------
  499|     92|      return false;
  500|     92|    }
  501|    612|    return true;
  502|    704|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|    584|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    584|    unsigned x;
  423|    584|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 38, False: 546]
  ------------------
  424|     38|      return 1;
  425|     38|    }
  426|    546|    ans_.buf = buf;
  427|    546|    x = buf[offset - 1] >> 6;
  428|    546|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 335, False: 211]
  ------------------
  429|    335|      ans_.buf_offset = offset - 1;
  430|    335|      ans_.state = buf[offset - 1] & 0x3F;
  431|    335|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 68, False: 143]
  ------------------
  432|     68|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 2, False: 66]
  ------------------
  433|      2|        return 1;
  434|      2|      }
  435|     66|      ans_.buf_offset = offset - 2;
  436|     66|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    143|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 86, False: 57]
  ------------------
  438|     86|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 86]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|     86|      ans_.buf_offset = offset - 3;
  442|     86|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     86|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 57, False: 0]
  ------------------
  444|     57|      ans_.buf_offset = offset - 4;
  445|     57|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     57|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    544|    ans_.state += l_rans_base;
  450|    544|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    544|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 56, False: 488]
  ------------------
  451|     56|      return 1;
  452|     56|    }
  453|    488|    return 0;
  454|    544|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    106|static uint32_t mem_get_le16(const void *vmem) {
   68|    106|  uint32_t val;
   69|    106|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    106|  val = mem[1] << 8;
   72|    106|  val |= mem[0];
   73|    106|  return val;
   74|    106|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    139|static uint32_t mem_get_le24(const void *vmem) {
   77|    139|  uint32_t val;
   78|    139|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    139|  val = mem[2] << 16;
   81|    139|  val |= mem[1] << 8;
   82|    139|  val |= mem[0];
   83|    139|  return val;
   84|    139|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    125|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    125|  uint32_t val;
   88|    125|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    125|  val = mem[3] << 24;
   91|    125|  val |= mem[2] << 16;
   92|    125|  val |= mem[1] << 8;
   93|    125|  val |= mem[0];
   94|    125|  return val;
   95|    125|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  46.8M|  inline int rans_read() {
  463|  46.8M|    unsigned rem;
  464|  46.8M|    unsigned quo;
  465|  46.8M|    struct rans_dec_sym sym;
  466|  46.9M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 34.4M, False: 12.5M]
  |  Branch (466:40): [True: 17.7k, False: 34.3M]
  ------------------
  467|  17.7k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  17.7k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  17.7k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  46.8M|    quo = ans_.state / rans_precision;
  472|  46.8M|    rem = ans_.state % rans_precision;
  473|  46.8M|    fetch_sym(&sym, rem);
  474|  46.8M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  46.8M|    return sym.val;
  476|  46.8M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  46.8M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  46.8M|    uint32_t symbol = lut_table_[rem];
  507|  46.8M|    out->val = symbol;
  508|  46.8M|    out->prob = probability_table_[symbol].prob;
  509|  46.8M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  46.8M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|    459|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    106|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|     68|                                       uint32_t num_symbols) {
  482|     68|    lut_table_.resize(rans_precision);
  483|     68|    probability_table_.resize(num_symbols);
  484|     68|    uint32_t cum_prob = 0;
  485|     68|    uint32_t act_prob = 0;
  486|  2.64k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.58k, False: 58]
  ------------------
  487|  2.58k|      probability_table_[i].prob = token_probs[i];
  488|  2.58k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.58k|      cum_prob += token_probs[i];
  490|  2.58k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 10, False: 2.57k]
  ------------------
  491|     10|        return false;
  492|     10|      }
  493|   487k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 484k, False: 2.57k]
  ------------------
  494|   484k|        lut_table_[j] = i;
  495|   484k|      }
  496|  2.57k|      act_prob = cum_prob;
  497|  2.57k|    }
  498|     58|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 3, False: 55]
  ------------------
  499|      3|      return false;
  500|      3|    }
  501|     55|    return true;
  502|     58|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     39|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     39|    unsigned x;
  423|     39|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 36]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|     36|    ans_.buf = buf;
  427|     36|    x = buf[offset - 1] >> 6;
  428|     36|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 26, False: 10]
  ------------------
  429|     26|      ans_.buf_offset = offset - 1;
  430|     26|      ans_.state = buf[offset - 1] & 0x3F;
  431|     26|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 1, False: 9]
  ------------------
  432|      1|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 1]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      1|      ans_.buf_offset = offset - 2;
  436|      1|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      9|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 3, False: 6]
  ------------------
  438|      3|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 3]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      3|      ans_.buf_offset = offset - 3;
  442|      3|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      6|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 6, False: 0]
  ------------------
  444|      6|      ans_.buf_offset = offset - 4;
  445|      6|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      6|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     36|    ans_.state += l_rans_base;
  450|     36|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     36|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 5, False: 31]
  ------------------
  451|      5|      return 1;
  452|      5|    }
  453|     31|    return 0;
  454|     36|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  5.24M|  inline int rans_read() {
  463|  5.24M|    unsigned rem;
  464|  5.24M|    unsigned quo;
  465|  5.24M|    struct rans_dec_sym sym;
  466|  5.24M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 5.23M, False: 18.0k]
  |  Branch (466:40): [True: 1.85k, False: 5.22M]
  ------------------
  467|  1.85k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.85k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.85k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  5.24M|    quo = ans_.state / rans_precision;
  472|  5.24M|    rem = ans_.state % rans_precision;
  473|  5.24M|    fetch_sym(&sym, rem);
  474|  5.24M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  5.24M|    return sym.val;
  476|  5.24M|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  5.24M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  5.24M|    uint32_t symbol = lut_table_[rem];
  507|  5.24M|    out->val = symbol;
  508|  5.24M|    out->prob = probability_table_[symbol].prob;
  509|  5.24M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  5.24M|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     31|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|     90|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|     60|                                       uint32_t num_symbols) {
  482|     60|    lut_table_.resize(rans_precision);
  483|     60|    probability_table_.resize(num_symbols);
  484|     60|    uint32_t cum_prob = 0;
  485|     60|    uint32_t act_prob = 0;
  486|  1.55k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.49k, False: 57]
  ------------------
  487|  1.49k|      probability_table_[i].prob = token_probs[i];
  488|  1.49k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.49k|      cum_prob += token_probs[i];
  490|  1.49k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 3, False: 1.49k]
  ------------------
  491|      3|        return false;
  492|      3|      }
  493|  1.65M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.65M, False: 1.49k]
  ------------------
  494|  1.65M|        lut_table_[j] = i;
  495|  1.65M|      }
  496|  1.49k|      act_prob = cum_prob;
  497|  1.49k|    }
  498|     57|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 9, False: 48]
  ------------------
  499|      9|      return false;
  500|      9|    }
  501|     48|    return true;
  502|     57|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     29|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     29|    unsigned x;
  423|     29|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 29]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     29|    ans_.buf = buf;
  427|     29|    x = buf[offset - 1] >> 6;
  428|     29|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 4, False: 25]
  ------------------
  429|      4|      ans_.buf_offset = offset - 1;
  430|      4|      ans_.state = buf[offset - 1] & 0x3F;
  431|     25|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 13, False: 12]
  ------------------
  432|     13|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 13]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     13|      ans_.buf_offset = offset - 2;
  436|     13|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     13|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 1, False: 11]
  ------------------
  438|      1|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 1]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      1|      ans_.buf_offset = offset - 3;
  442|      1|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     11|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 11, False: 0]
  ------------------
  444|     11|      ans_.buf_offset = offset - 4;
  445|     11|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     11|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     29|    ans_.state += l_rans_base;
  450|     29|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     29|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 10, False: 19]
  ------------------
  451|     10|      return 1;
  452|     10|    }
  453|     19|    return 0;
  454|     29|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|  79.1k|  inline int rans_read() {
  463|  79.1k|    unsigned rem;
  464|  79.1k|    unsigned quo;
  465|  79.1k|    struct rans_dec_sym sym;
  466|  82.2k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 58.1k, False: 24.0k]
  |  Branch (466:40): [True: 3.05k, False: 55.0k]
  ------------------
  467|  3.05k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  3.05k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  3.05k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  79.1k|    quo = ans_.state / rans_precision;
  472|  79.1k|    rem = ans_.state % rans_precision;
  473|  79.1k|    fetch_sym(&sym, rem);
  474|  79.1k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  79.1k|    return sym.val;
  476|  79.1k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|  79.1k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  79.1k|    uint32_t symbol = lut_table_[rem];
  507|  79.1k|    out->val = symbol;
  508|  79.1k|    out->prob = probability_table_[symbol].prob;
  509|  79.1k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  79.1k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     19|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|     65|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|     24|                                       uint32_t num_symbols) {
  482|     24|    lut_table_.resize(rans_precision);
  483|     24|    probability_table_.resize(num_symbols);
  484|     24|    uint32_t cum_prob = 0;
  485|     24|    uint32_t act_prob = 0;
  486|  1.55k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.54k, False: 15]
  ------------------
  487|  1.54k|      probability_table_[i].prob = token_probs[i];
  488|  1.54k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.54k|      cum_prob += token_probs[i];
  490|  1.54k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 9, False: 1.53k]
  ------------------
  491|      9|        return false;
  492|      9|      }
  493|  1.07M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.06M, False: 1.53k]
  ------------------
  494|  1.06M|        lut_table_[j] = i;
  495|  1.06M|      }
  496|  1.53k|      act_prob = cum_prob;
  497|  1.53k|    }
  498|     15|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 3, False: 12]
  ------------------
  499|      3|      return false;
  500|      3|    }
  501|     12|    return true;
  502|     15|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|      5|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      5|    unsigned x;
  423|      5|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 5]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      5|    ans_.buf = buf;
  427|      5|    x = buf[offset - 1] >> 6;
  428|      5|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 3, False: 2]
  ------------------
  429|      3|      ans_.buf_offset = offset - 1;
  430|      3|      ans_.state = buf[offset - 1] & 0x3F;
  431|      3|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 2]
  ------------------
  432|      0|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      0|      ans_.buf_offset = offset - 2;
  436|      0|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      2|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 2, False: 0]
  ------------------
  438|      2|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 2]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      2|      ans_.buf_offset = offset - 3;
  442|      2|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      2|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      5|    ans_.state += l_rans_base;
  450|      5|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      5|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 5]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      5|    return 0;
  454|      5|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|  15.0k|  inline int rans_read() {
  463|  15.0k|    unsigned rem;
  464|  15.0k|    unsigned quo;
  465|  15.0k|    struct rans_dec_sym sym;
  466|  15.3k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 3.82k, False: 11.5k]
  |  Branch (466:40): [True: 333, False: 3.48k]
  ------------------
  467|    333|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    333|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    333|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  15.0k|    quo = ans_.state / rans_precision;
  472|  15.0k|    rem = ans_.state % rans_precision;
  473|  15.0k|    fetch_sym(&sym, rem);
  474|  15.0k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  15.0k|    return sym.val;
  476|  15.0k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|  15.0k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  15.0k|    uint32_t symbol = lut_table_[rem];
  507|  15.0k|    out->val = symbol;
  508|  15.0k|    out->prob = probability_table_[symbol].prob;
  509|  15.0k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  15.0k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|      5|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|     76|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|     31|                                       uint32_t num_symbols) {
  482|     31|    lut_table_.resize(rans_precision);
  483|     31|    probability_table_.resize(num_symbols);
  484|     31|    uint32_t cum_prob = 0;
  485|     31|    uint32_t act_prob = 0;
  486|  5.50k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 5.47k, False: 30]
  ------------------
  487|  5.47k|      probability_table_[i].prob = token_probs[i];
  488|  5.47k|      probability_table_[i].cum_prob = cum_prob;
  489|  5.47k|      cum_prob += token_probs[i];
  490|  5.47k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 1, False: 5.47k]
  ------------------
  491|      1|        return false;
  492|      1|      }
  493|  6.78M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 6.78M, False: 5.47k]
  ------------------
  494|  6.78M|        lut_table_[j] = i;
  495|  6.78M|      }
  496|  5.47k|      act_prob = cum_prob;
  497|  5.47k|    }
  498|     30|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 8, False: 22]
  ------------------
  499|      8|      return false;
  500|      8|    }
  501|     22|    return true;
  502|     30|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|      8|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      8|    unsigned x;
  423|      8|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 7]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|      7|    ans_.buf = buf;
  427|      7|    x = buf[offset - 1] >> 6;
  428|      7|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 2, False: 5]
  ------------------
  429|      2|      ans_.buf_offset = offset - 1;
  430|      2|      ans_.state = buf[offset - 1] & 0x3F;
  431|      5|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 2, False: 3]
  ------------------
  432|      2|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 2]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      2|      ans_.buf_offset = offset - 2;
  436|      2|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      3|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 3, False: 0]
  ------------------
  438|      3|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 3]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      3|      ans_.buf_offset = offset - 3;
  442|      3|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      3|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      7|    ans_.state += l_rans_base;
  450|      7|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      7|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 7]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      7|    return 0;
  454|      7|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  23.5k|  inline int rans_read() {
  463|  23.5k|    unsigned rem;
  464|  23.5k|    unsigned quo;
  465|  23.5k|    struct rans_dec_sym sym;
  466|  23.5k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 22.5k, False: 1.00k]
  |  Branch (466:40): [True: 34, False: 22.5k]
  ------------------
  467|     34|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|     34|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|     34|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  23.5k|    quo = ans_.state / rans_precision;
  472|  23.5k|    rem = ans_.state % rans_precision;
  473|  23.5k|    fetch_sym(&sym, rem);
  474|  23.5k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  23.5k|    return sym.val;
  476|  23.5k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  23.5k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  23.5k|    uint32_t symbol = lut_table_[rem];
  507|  23.5k|    out->val = symbol;
  508|  23.5k|    out->prob = probability_table_[symbol].prob;
  509|  23.5k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  23.5k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|      7|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|     99|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|     59|                                       uint32_t num_symbols) {
  482|     59|    lut_table_.resize(rans_precision);
  483|     59|    probability_table_.resize(num_symbols);
  484|     59|    uint32_t cum_prob = 0;
  485|     59|    uint32_t act_prob = 0;
  486|  6.57k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.52k, False: 49]
  ------------------
  487|  6.52k|      probability_table_[i].prob = token_probs[i];
  488|  6.52k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.52k|      cum_prob += token_probs[i];
  490|  6.52k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 10, False: 6.51k]
  ------------------
  491|     10|        return false;
  492|     10|      }
  493|  23.9M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 23.9M, False: 6.51k]
  ------------------
  494|  23.9M|        lut_table_[j] = i;
  495|  23.9M|      }
  496|  6.51k|      act_prob = cum_prob;
  497|  6.51k|    }
  498|     49|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 10, False: 39]
  ------------------
  499|     10|      return false;
  500|     10|    }
  501|     39|    return true;
  502|     49|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     38|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     38|    unsigned x;
  423|     38|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 38]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     38|    ans_.buf = buf;
  427|     38|    x = buf[offset - 1] >> 6;
  428|     38|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 9, False: 29]
  ------------------
  429|      9|      ans_.buf_offset = offset - 1;
  430|      9|      ans_.state = buf[offset - 1] & 0x3F;
  431|     29|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 7, False: 22]
  ------------------
  432|      7|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 7]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      7|      ans_.buf_offset = offset - 2;
  436|      7|      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: 2, False: 12]
  ------------------
  439|      2|        return 1;
  440|      2|      }
  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: 8, False: 0]
  ------------------
  444|      8|      ans_.buf_offset = offset - 4;
  445|      8|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      8|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     36|    ans_.state += l_rans_base;
  450|     36|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     36|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 3, False: 33]
  ------------------
  451|      3|      return 1;
  452|      3|    }
  453|     33|    return 0;
  454|     36|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|  74.8k|  inline int rans_read() {
  463|  74.8k|    unsigned rem;
  464|  74.8k|    unsigned quo;
  465|  74.8k|    struct rans_dec_sym sym;
  466|  75.0k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 39.2k, False: 35.7k]
  |  Branch (466:40): [True: 164, False: 39.0k]
  ------------------
  467|    164|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    164|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    164|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  74.8k|    quo = ans_.state / rans_precision;
  472|  74.8k|    rem = ans_.state % rans_precision;
  473|  74.8k|    fetch_sym(&sym, rem);
  474|  74.8k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  74.8k|    return sym.val;
  476|  74.8k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|  74.8k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  74.8k|    uint32_t symbol = lut_table_[rem];
  507|  74.8k|    out->val = symbol;
  508|  74.8k|    out->prob = probability_table_[symbol].prob;
  509|  74.8k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  74.8k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     33|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|    398|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    223|                                       uint32_t num_symbols) {
  482|    223|    lut_table_.resize(rans_precision);
  483|    223|    probability_table_.resize(num_symbols);
  484|    223|    uint32_t cum_prob = 0;
  485|    223|    uint32_t act_prob = 0;
  486|  15.2k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 15.0k, False: 205]
  ------------------
  487|  15.0k|      probability_table_[i].prob = token_probs[i];
  488|  15.0k|      probability_table_[i].cum_prob = cum_prob;
  489|  15.0k|      cum_prob += token_probs[i];
  490|  15.0k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 18, False: 15.0k]
  ------------------
  491|     18|        return false;
  492|     18|      }
  493|   207M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 207M, False: 15.0k]
  ------------------
  494|   207M|        lut_table_[j] = i;
  495|   207M|      }
  496|  15.0k|      act_prob = cum_prob;
  497|  15.0k|    }
  498|    205|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 14, False: 191]
  ------------------
  499|     14|      return false;
  500|     14|    }
  501|    191|    return true;
  502|    205|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    126|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    126|    unsigned x;
  423|    126|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 2, False: 124]
  ------------------
  424|      2|      return 1;
  425|      2|    }
  426|    124|    ans_.buf = buf;
  427|    124|    x = buf[offset - 1] >> 6;
  428|    124|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 32, False: 92]
  ------------------
  429|     32|      ans_.buf_offset = offset - 1;
  430|     32|      ans_.state = buf[offset - 1] & 0x3F;
  431|     92|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 17, False: 75]
  ------------------
  432|     17|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 17]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     17|      ans_.buf_offset = offset - 2;
  436|     17|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     75|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 32, False: 43]
  ------------------
  438|     32|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 32]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|     32|      ans_.buf_offset = offset - 3;
  442|     32|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     43|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 43, False: 0]
  ------------------
  444|     43|      ans_.buf_offset = offset - 4;
  445|     43|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     43|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    124|    ans_.state += l_rans_base;
  450|    124|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    124|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 24, False: 100]
  ------------------
  451|     24|      return 1;
  452|     24|    }
  453|    100|    return 0;
  454|    124|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  17.0M|  inline int rans_read() {
  463|  17.0M|    unsigned rem;
  464|  17.0M|    unsigned quo;
  465|  17.0M|    struct rans_dec_sym sym;
  466|  17.0M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 12.4M, False: 4.60M]
  |  Branch (466:40): [True: 5.05k, False: 12.4M]
  ------------------
  467|  5.05k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  5.05k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  5.05k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  17.0M|    quo = ans_.state / rans_precision;
  472|  17.0M|    rem = ans_.state % rans_precision;
  473|  17.0M|    fetch_sym(&sym, rem);
  474|  17.0M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  17.0M|    return sym.val;
  476|  17.0M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  17.0M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  17.0M|    uint32_t symbol = lut_table_[rem];
  507|  17.0M|    out->val = symbol;
  508|  17.0M|    out->prob = probability_table_[symbol].prob;
  509|  17.0M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  17.0M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    100|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    438|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    438|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    438|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 438]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    438|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    438|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    438|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 28, False: 410]
  ------------------
   67|     28|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 27]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     28|  } else
   72|    410|#endif
   73|    410|  {
   74|    410|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 410]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    410|  }
   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|    437|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 426]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    426|  probability_table_.resize(num_symbols_);
   86|    426|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 195, False: 231]
  ------------------
   87|    195|    return true;
   88|    195|  }
   89|       |  // Decode the table.
   90|   594k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 593k, False: 138]
  ------------------
   91|   593k|    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|   593k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 9, False: 593k]
  ------------------
   95|      9|      return false;
   96|      9|    }
   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|   593k|    const int token = prob_data & 3;
  102|   593k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 13.9k, False: 580k]
  ------------------
  103|  13.9k|      const uint32_t offset = prob_data >> 2;
  104|  13.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 75, False: 13.8k]
  ------------------
  105|     75|        return false;
  106|     75|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   558k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 544k, False: 13.8k]
  ------------------
  109|   544k|        probability_table_[i + j] = 0;
  110|   544k|      }
  111|  13.8k|      i += offset;
  112|   580k|    } else {
  113|   580k|      const int extra_bytes = token;
  114|   580k|      uint32_t prob = prob_data >> 2;
  115|   590k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.0k, False: 580k]
  ------------------
  116|  10.0k|        uint8_t eb;
  117|  10.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 9, False: 10.0k]
  ------------------
  118|      9|          return false;
  119|      9|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.0k|      }
  124|   580k|      probability_table_[i] = prob;
  125|   580k|    }
  126|   593k|  }
  127|    138|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 70, False: 68]
  ------------------
  128|     70|    return false;
  129|     70|  }
  130|     68|  return true;
  131|    138|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    167|    DecoderBuffer *buffer) {
  136|    167|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    167|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    167|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    167|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 17, False: 150]
  ------------------
  140|     17|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 16]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     17|  } else
  145|    150|#endif
  146|    150|  {
  147|    150|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 149]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    150|  }
  151|    165|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 23, False: 142]
  ------------------
  152|     23|    return false;
  153|     23|  }
  154|    142|  const uint8_t *const data_head =
  155|    142|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    142|  buffer->Advance(bytes_encoded);
  158|    142|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 46, False: 96]
  ------------------
  159|     46|    return false;
  160|     46|  }
  161|     96|  return true;
  162|    142|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    192|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  8.19M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|     67|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     67|  ans_.read_end();
  167|     67|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    245|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_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: 13, False: 232]
  ------------------
   67|     13|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 13]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     13|  } else
   72|    232|#endif
   73|    232|  {
   74|    232|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 227]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    232|  }
   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: 10, False: 230]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    230|  probability_table_.resize(num_symbols_);
   86|    230|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 226]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|   977k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 976k, False: 168]
  ------------------
   91|   976k|    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|   976k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 18, False: 976k]
  ------------------
   95|     18|      return false;
   96|     18|    }
   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|   976k|    const int token = prob_data & 3;
  102|   976k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 581k, False: 395k]
  ------------------
  103|   581k|      const uint32_t offset = prob_data >> 2;
  104|   581k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 581k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  34.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 34.2M, False: 581k]
  ------------------
  109|  34.2M|        probability_table_[i + j] = 0;
  110|  34.2M|      }
  111|   581k|      i += offset;
  112|   581k|    } else {
  113|   395k|      const int extra_bytes = token;
  114|   395k|      uint32_t prob = prob_data >> 2;
  115|   523k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 128k, False: 395k]
  ------------------
  116|   128k|        uint8_t eb;
  117|   128k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 128k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   128k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   128k|      }
  124|   395k|      probability_table_[i] = prob;
  125|   395k|    }
  126|   976k|  }
  127|    168|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 76, False: 92]
  ------------------
  128|     76|    return false;
  129|     76|  }
  130|     92|  return true;
  131|    168|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|     96|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|     92|    DecoderBuffer *buffer) {
  136|     92|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     92|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     92|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     92|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 91]
  ------------------
  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|     91|#endif
  146|     91|  {
  147|     91|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 91]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     91|  }
  151|     92|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 91]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|     91|  const uint8_t *const data_head =
  155|     91|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     91|  buffer->Advance(bytes_encoded);
  158|     91|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 3, False: 88]
  ------------------
  159|      3|    return false;
  160|      3|  }
  161|     88|  return true;
  162|     91|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  9.35M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|     88|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     88|  ans_.read_end();
  167|     88|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    148|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    148|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    148|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 148]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    148|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    148|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    148|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 20, False: 128]
  ------------------
   67|     20|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 20]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     20|  } else
   72|    128|#endif
   73|    128|  {
   74|    128|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 128]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    128|  }
   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|    148|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 143]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    143|  probability_table_.resize(num_symbols_);
   86|    143|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 142]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   330k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 330k, False: 90]
  ------------------
   91|   330k|    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|   330k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 19, False: 330k]
  ------------------
   95|     19|      return false;
   96|     19|    }
   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|   330k|    const int token = prob_data & 3;
  102|   330k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 34.1k, False: 296k]
  ------------------
  103|  34.1k|      const uint32_t offset = prob_data >> 2;
  104|  34.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 34.1k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   579k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 545k, False: 34.1k]
  ------------------
  109|   545k|        probability_table_[i + j] = 0;
  110|   545k|      }
  111|  34.1k|      i += offset;
  112|   296k|    } else {
  113|   296k|      const int extra_bytes = token;
  114|   296k|      uint32_t prob = prob_data >> 2;
  115|   530k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 233k, False: 296k]
  ------------------
  116|   233k|        uint8_t eb;
  117|   233k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 233k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   233k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   233k|      }
  124|   296k|      probability_table_[i] = prob;
  125|   296k|    }
  126|   330k|  }
  127|     90|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 77]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|     77|  return true;
  131|     90|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|     78|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|     77|    DecoderBuffer *buffer) {
  136|     77|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     77|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     77|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     77|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 73]
  ------------------
  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|     73|#endif
  146|     73|  {
  147|     73|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 73]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     73|  }
  151|     77|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 20, False: 57]
  ------------------
  152|     20|    return false;
  153|     20|  }
  154|     57|  const uint8_t *const data_head =
  155|     57|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     57|  buffer->Advance(bytes_encoded);
  158|     57|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 15, False: 42]
  ------------------
  159|     15|    return false;
  160|     15|  }
  161|     42|  return true;
  162|     57|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  6.91M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|     42|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     42|  ans_.read_end();
  167|     42|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    182|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    182|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    182|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 182]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    182|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    182|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    182|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 26, False: 156]
  ------------------
   67|     26|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 26]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     26|  } else
   72|    156|#endif
   73|    156|  {
   74|    156|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 156]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    156|  }
   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|    182|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 179]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    179|  probability_table_.resize(num_symbols_);
   86|    179|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 178]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  14.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 14.5k, False: 147]
  ------------------
   91|  14.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|  14.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 11, False: 14.5k]
  ------------------
   95|     11|      return false;
   96|     11|    }
   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.5k|    const int token = prob_data & 3;
  102|  14.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.57k, False: 10.9k]
  ------------------
  103|  3.57k|      const uint32_t offset = prob_data >> 2;
  104|  3.57k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 3.56k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   110k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 106k, False: 3.56k]
  ------------------
  109|   106k|        probability_table_[i + j] = 0;
  110|   106k|      }
  111|  3.56k|      i += offset;
  112|  10.9k|    } else {
  113|  10.9k|      const int extra_bytes = token;
  114|  10.9k|      uint32_t prob = prob_data >> 2;
  115|  20.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 9.50k, False: 10.9k]
  ------------------
  116|  9.50k|        uint8_t eb;
  117|  9.50k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 9.49k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  9.49k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  9.49k|      }
  124|  10.9k|      probability_table_[i] = prob;
  125|  10.9k|    }
  126|  14.5k|  }
  127|    147|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 143]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|    143|  return true;
  131|    147|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    144|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    143|    DecoderBuffer *buffer) {
  136|    143|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    143|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    143|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    143|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 22, False: 121]
  ------------------
  140|     22|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 21]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     22|  } else
  145|    121|#endif
  146|    121|  {
  147|    121|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 118]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    121|  }
  151|    139|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 25, False: 114]
  ------------------
  152|     25|    return false;
  153|     25|  }
  154|    114|  const uint8_t *const data_head =
  155|    114|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    114|  buffer->Advance(bytes_encoded);
  158|    114|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 11, False: 103]
  ------------------
  159|     11|    return false;
  160|     11|  }
  161|    103|  return true;
  162|    114|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  6.01M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    103|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    103|  ans_.read_end();
  167|    103|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|     86|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|     86|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     86|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 86]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     86|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     86|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     86|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 8, False: 78]
  ------------------
   67|      8|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 8]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      8|  } else
   72|     78|#endif
   73|     78|  {
   74|     78|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 78]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     78|  }
   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|     86|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 79]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|     79|  probability_table_.resize(num_symbols_);
   86|     79|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 79]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  12.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 12.0k, False: 54]
  ------------------
   91|  12.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  12.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 11.9k]
  ------------------
   95|     14|      return false;
   96|     14|    }
   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|  11.9k|    const int token = prob_data & 3;
  102|  11.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.83k, False: 8.15k]
  ------------------
  103|  3.83k|      const uint32_t offset = prob_data >> 2;
  104|  3.83k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 5, False: 3.83k]
  ------------------
  105|      5|        return false;
  106|      5|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   170k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 166k, False: 3.83k]
  ------------------
  109|   166k|        probability_table_[i + j] = 0;
  110|   166k|      }
  111|  3.83k|      i += offset;
  112|  8.15k|    } else {
  113|  8.15k|      const int extra_bytes = token;
  114|  8.15k|      uint32_t prob = prob_data >> 2;
  115|  12.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.70k, False: 8.15k]
  ------------------
  116|  4.70k|        uint8_t eb;
  117|  4.70k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 4.70k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.70k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.70k|      }
  124|  8.15k|      probability_table_[i] = prob;
  125|  8.15k|    }
  126|  11.9k|  }
  127|     54|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 51]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|     51|  return true;
  131|     54|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|     51|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|     51|    DecoderBuffer *buffer) {
  136|     51|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     51|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     51|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     51|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 51]
  ------------------
  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|     51|#endif
  146|     51|  {
  147|     51|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 51]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     51|  }
  151|     51|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 51]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|     51|  const uint8_t *const data_head =
  155|     51|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     51|  buffer->Advance(bytes_encoded);
  158|     51|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 51]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|     51|  return true;
  162|     51|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|   525k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     51|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     51|  ans_.read_end();
  167|     51|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|     74|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|     74|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     74|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 74]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     74|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     74|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     74|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 24, False: 50]
  ------------------
   67|     24|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 24]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     24|  } else
   72|     50|#endif
   73|     50|  {
   74|     50|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 50]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     50|  }
   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|     74|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 68]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|     68|  probability_table_.resize(num_symbols_);
   86|     68|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 67]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  8.04k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 8.00k, False: 43]
  ------------------
   91|  8.00k|    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|  8.00k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 10, False: 7.99k]
  ------------------
   95|     10|      return false;
   96|     10|    }
   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.99k|    const int token = prob_data & 3;
  102|  7.99k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.05k, False: 5.93k]
  ------------------
  103|  2.05k|      const uint32_t offset = prob_data >> 2;
  104|  2.05k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 12, False: 2.04k]
  ------------------
  105|     12|        return false;
  106|     12|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  79.7k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 77.7k, False: 2.04k]
  ------------------
  109|  77.7k|        probability_table_[i + j] = 0;
  110|  77.7k|      }
  111|  2.04k|      i += offset;
  112|  5.93k|    } else {
  113|  5.93k|      const int extra_bytes = token;
  114|  5.93k|      uint32_t prob = prob_data >> 2;
  115|  9.69k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.76k, False: 5.93k]
  ------------------
  116|  3.76k|        uint8_t eb;
  117|  3.76k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 3.76k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.76k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.76k|      }
  124|  5.93k|      probability_table_[i] = prob;
  125|  5.93k|    }
  126|  7.99k|  }
  127|     43|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 40]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|     40|  return true;
  131|     43|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|     41|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|     40|    DecoderBuffer *buffer) {
  136|     40|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     40|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     40|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     40|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 18, False: 22]
  ------------------
  140|     18|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 18]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     18|  } else
  145|     22|#endif
  146|     22|  {
  147|     22|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 22]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     22|  }
  151|     40|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 19, False: 21]
  ------------------
  152|     19|    return false;
  153|     19|  }
  154|     21|  const uint8_t *const data_head =
  155|     21|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     21|  buffer->Advance(bytes_encoded);
  158|     21|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 9, False: 12]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|     12|  return true;
  162|     21|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  9.77M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|     12|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     12|  ans_.read_end();
  167|     12|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    142|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    142|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    142|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 142]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    142|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    142|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    142|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 21, False: 121]
  ------------------
   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|    121|#endif
   73|    121|  {
   74|    121|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 118]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    121|  }
   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|    139|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 136]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    136|  probability_table_.resize(num_symbols_);
   86|    136|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 136]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   516k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 516k, False: 85]
  ------------------
   91|   516k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   516k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 28, False: 516k]
  ------------------
   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|   516k|    const int token = prob_data & 3;
  102|   516k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 195k, False: 320k]
  ------------------
  103|   195k|      const uint32_t offset = prob_data >> 2;
  104|   195k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 195k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  7.73M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.54M, False: 195k]
  ------------------
  109|  7.54M|        probability_table_[i + j] = 0;
  110|  7.54M|      }
  111|   195k|      i += offset;
  112|   320k|    } else {
  113|   320k|      const int extra_bytes = token;
  114|   320k|      uint32_t prob = prob_data >> 2;
  115|   604k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 283k, False: 320k]
  ------------------
  116|   283k|        uint8_t eb;
  117|   283k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 283k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   283k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   283k|      }
  124|   320k|      probability_table_[i] = prob;
  125|   320k|    }
  126|   516k|  }
  127|     85|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 6, False: 79]
  ------------------
  128|      6|    return false;
  129|      6|  }
  130|     79|  return true;
  131|     85|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|     79|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|     79|    DecoderBuffer *buffer) {
  136|     79|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     79|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     79|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     79|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 6, False: 73]
  ------------------
  140|      6|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 6]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      6|  } else
  145|     73|#endif
  146|     73|  {
  147|     73|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 73]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     73|  }
  151|     79|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 7, False: 72]
  ------------------
  152|      7|    return false;
  153|      7|  }
  154|     72|  const uint8_t *const data_head =
  155|     72|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     72|  buffer->Advance(bytes_encoded);
  158|     72|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 2, False: 70]
  ------------------
  159|      2|    return false;
  160|      2|  }
  161|     70|  return true;
  162|     72|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  4.36M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     70|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     70|  ans_.read_end();
  167|     70|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    110|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    110|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    110|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 110]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    110|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    110|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    110|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 38, False: 72]
  ------------------
   67|     38|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 38]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     38|  } else
   72|     72|#endif
   73|     72|  {
   74|     72|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 72]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     72|  }
   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|    110|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 106]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|    106|  probability_table_.resize(num_symbols_);
   86|    106|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 105]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   804k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 804k, False: 69]
  ------------------
   91|   804k|    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|   804k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 8, False: 804k]
  ------------------
   95|      8|      return false;
   96|      8|    }
   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|   804k|    const int token = prob_data & 3;
  102|   804k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 134k, False: 669k]
  ------------------
  103|   134k|      const uint32_t offset = prob_data >> 2;
  104|   134k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 134k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.07M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.94M, False: 134k]
  ------------------
  109|  3.94M|        probability_table_[i + j] = 0;
  110|  3.94M|      }
  111|   134k|      i += offset;
  112|   669k|    } else {
  113|   669k|      const int extra_bytes = token;
  114|   669k|      uint32_t prob = prob_data >> 2;
  115|  1.31M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 640k, False: 669k]
  ------------------
  116|   640k|        uint8_t eb;
  117|   640k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 640k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   640k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   640k|      }
  124|   669k|      probability_table_[i] = prob;
  125|   669k|    }
  126|   804k|  }
  127|     69|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 7, False: 62]
  ------------------
  128|      7|    return false;
  129|      7|  }
  130|     62|  return true;
  131|     69|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|     63|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_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: 28, False: 34]
  ------------------
  140|     28|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 27]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     28|  } else
  145|     34|#endif
  146|     34|  {
  147|     34|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 34]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     34|  }
  151|     61|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 25, False: 36]
  ------------------
  152|     25|    return false;
  153|     25|  }
  154|     36|  const uint8_t *const data_head =
  155|     36|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     36|  buffer->Advance(bytes_encoded);
  158|     36|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 10, False: 26]
  ------------------
  159|     10|    return false;
  160|     10|  }
  161|     26|  return true;
  162|     36|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  1.73M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     26|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     26|  ans_.read_end();
  167|     26|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    106|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    106|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    106|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 106]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    106|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    106|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    106|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 24, False: 82]
  ------------------
   67|     24|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 24]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     24|  } else
   72|     82|#endif
   73|     82|  {
   74|     82|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 82]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     82|  }
   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|    106|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 103]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    103|  probability_table_.resize(num_symbols_);
   86|    103|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 103]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  26.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 26.6k, False: 68]
  ------------------
   91|  26.6k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  26.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 13, False: 26.6k]
  ------------------
   95|     13|      return false;
   96|     13|    }
   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|  26.6k|    const int token = prob_data & 3;
  102|  26.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.53k, False: 21.0k]
  ------------------
  103|  5.53k|      const uint32_t offset = prob_data >> 2;
  104|  5.53k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 16, False: 5.52k]
  ------------------
  105|     16|        return false;
  106|     16|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   225k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 220k, False: 5.52k]
  ------------------
  109|   220k|        probability_table_[i + j] = 0;
  110|   220k|      }
  111|  5.52k|      i += offset;
  112|  21.0k|    } else {
  113|  21.0k|      const int extra_bytes = token;
  114|  21.0k|      uint32_t prob = prob_data >> 2;
  115|  34.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 13.2k, False: 21.0k]
  ------------------
  116|  13.2k|        uint8_t eb;
  117|  13.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 13.2k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  13.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  13.2k|      }
  124|  21.0k|      probability_table_[i] = prob;
  125|  21.0k|    }
  126|  26.6k|  }
  127|     68|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 55]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|     55|  return true;
  131|     68|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|     55|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|     55|    DecoderBuffer *buffer) {
  136|     55|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     55|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     55|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     55|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 46]
  ------------------
  140|      9|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 9]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      9|  } else
  145|     46|#endif
  146|     46|  {
  147|     46|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 46]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     46|  }
  151|     55|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 16, False: 39]
  ------------------
  152|     16|    return false;
  153|     16|  }
  154|     39|  const uint8_t *const data_head =
  155|     39|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     39|  buffer->Advance(bytes_encoded);
  158|     39|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 8, False: 31]
  ------------------
  159|      8|    return false;
  160|      8|  }
  161|     31|  return true;
  162|     39|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  5.24M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     31|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     31|  ans_.read_end();
  167|     31|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|     90|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|     90|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     90|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 90]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     90|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     90|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     90|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 27, False: 63]
  ------------------
   67|     27|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 26]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     27|  } else
   72|     63|#endif
   73|     63|  {
   74|     63|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 62]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|     63|  }
   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|     88|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 88]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     88|  probability_table_.resize(num_symbols_);
   86|     88|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 88]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   536k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 536k, False: 60]
  ------------------
   91|   536k|    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|   536k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 17, False: 536k]
  ------------------
   95|     17|      return false;
   96|     17|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   536k|    const int token = prob_data & 3;
  102|   536k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 69.8k, False: 466k]
  ------------------
  103|  69.8k|      const uint32_t offset = prob_data >> 2;
  104|  69.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 69.8k]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.70M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.63M, False: 69.8k]
  ------------------
  109|  1.63M|        probability_table_[i + j] = 0;
  110|  1.63M|      }
  111|  69.8k|      i += offset;
  112|   466k|    } else {
  113|   466k|      const int extra_bytes = token;
  114|   466k|      uint32_t prob = prob_data >> 2;
  115|   877k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 411k, False: 466k]
  ------------------
  116|   411k|        uint8_t eb;
  117|   411k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 411k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   411k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   411k|      }
  124|   466k|      probability_table_[i] = prob;
  125|   466k|    }
  126|   536k|  }
  127|     60|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 48]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|     48|  return true;
  131|     60|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|     48|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|     48|    DecoderBuffer *buffer) {
  136|     48|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     48|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     48|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     48|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 32]
  ------------------
  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|     32|#endif
  146|     32|  {
  147|     32|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 32]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     32|  }
  151|     47|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 18, False: 29]
  ------------------
  152|     18|    return false;
  153|     18|  }
  154|     29|  const uint8_t *const data_head =
  155|     29|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     29|  buffer->Advance(bytes_encoded);
  158|     29|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 10, False: 19]
  ------------------
  159|     10|    return false;
  160|     10|  }
  161|     19|  return true;
  162|     29|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|  79.1k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     19|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     19|  ans_.read_end();
  167|     19|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|     65|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|     65|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     65|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 65]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     65|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     65|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     65|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 55]
  ------------------
   67|     10|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 10]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     10|  } else
   72|     55|#endif
   73|     55|  {
   74|     55|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 55]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     55|  }
   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|     65|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 63]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|     63|  probability_table_.resize(num_symbols_);
   86|     63|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 61]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  49.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 49.8k, False: 24]
  ------------------
   91|  49.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|  49.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 9, False: 49.8k]
  ------------------
   95|      9|      return false;
   96|      9|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  49.8k|    const int token = prob_data & 3;
  102|  49.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 12.3k, False: 37.5k]
  ------------------
  103|  12.3k|      const uint32_t offset = prob_data >> 2;
  104|  12.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 12.2k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   454k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 441k, False: 12.2k]
  ------------------
  109|   441k|        probability_table_[i + j] = 0;
  110|   441k|      }
  111|  12.2k|      i += offset;
  112|  37.5k|    } else {
  113|  37.5k|      const int extra_bytes = token;
  114|  37.5k|      uint32_t prob = prob_data >> 2;
  115|  72.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 34.9k, False: 37.5k]
  ------------------
  116|  34.9k|        uint8_t eb;
  117|  34.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 34.9k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  34.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  34.9k|      }
  124|  37.5k|      probability_table_[i] = prob;
  125|  37.5k|    }
  126|  49.8k|  }
  127|     24|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 12]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|     12|  return true;
  131|     24|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|     14|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|     12|    DecoderBuffer *buffer) {
  136|     12|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     12|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     12|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     12|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 12]
  ------------------
  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|     12|#endif
  146|     12|  {
  147|     12|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 11]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     12|  }
  151|     11|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 6, False: 5]
  ------------------
  152|      6|    return false;
  153|      6|  }
  154|      5|  const uint8_t *const data_head =
  155|      5|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      5|  buffer->Advance(bytes_encoded);
  158|      5|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 5]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      5|  return true;
  162|      5|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  15.0k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|      5|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      5|  ans_.read_end();
  167|      5|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|     76|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|     76|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     76|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 76]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     76|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     76|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     76|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 9, False: 67]
  ------------------
   67|      9|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 9]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      9|  } else
   72|     67|#endif
   73|     67|  {
   74|     67|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 66]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|     67|  }
   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|     75|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 74]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|     74|  probability_table_.resize(num_symbols_);
   86|     74|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 65]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  83.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 83.4k, False: 31]
  ------------------
   91|  83.4k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  83.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 20, False: 83.4k]
  ------------------
   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|  83.4k|    const int token = prob_data & 3;
  102|  83.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 20.5k, False: 62.9k]
  ------------------
  103|  20.5k|      const uint32_t offset = prob_data >> 2;
  104|  20.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 7, False: 20.5k]
  ------------------
  105|      7|        return false;
  106|      7|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   762k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 742k, False: 20.5k]
  ------------------
  109|   742k|        probability_table_[i + j] = 0;
  110|   742k|      }
  111|  20.5k|      i += offset;
  112|  62.9k|    } else {
  113|  62.9k|      const int extra_bytes = token;
  114|  62.9k|      uint32_t prob = prob_data >> 2;
  115|   126k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 63.1k, False: 62.9k]
  ------------------
  116|  63.1k|        uint8_t eb;
  117|  63.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 63.1k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  63.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  63.1k|      }
  124|  62.9k|      probability_table_[i] = prob;
  125|  62.9k|    }
  126|  83.4k|  }
  127|     31|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 9, False: 22]
  ------------------
  128|      9|    return false;
  129|      9|  }
  130|     22|  return true;
  131|     31|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|     31|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|     22|    DecoderBuffer *buffer) {
  136|     22|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     22|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     22|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     22|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 13]
  ------------------
  140|      9|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 9]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      9|  } else
  145|     13|#endif
  146|     13|  {
  147|     13|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 13]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     13|  }
  151|     22|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 14, False: 8]
  ------------------
  152|     14|    return false;
  153|     14|  }
  154|      8|  const uint8_t *const data_head =
  155|      8|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      8|  buffer->Advance(bytes_encoded);
  158|      8|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 7]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      7|  return true;
  162|      8|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  23.5k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|      7|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      7|  ans_.read_end();
  167|      7|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|     99|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|     99|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     99|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 99]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     99|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     99|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     99|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 97]
  ------------------
   67|      2|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 2]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      2|  } else
   72|     97|#endif
   73|     97|  {
   74|     97|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 97]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     97|  }
   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|     99|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 93]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|     93|  probability_table_.resize(num_symbols_);
   86|     93|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 93]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   695k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 695k, False: 59]
  ------------------
   91|   695k|    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|   695k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 13, False: 695k]
  ------------------
   95|     13|      return false;
   96|     13|    }
   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|   695k|    const int token = prob_data & 3;
  102|   695k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 390k, False: 305k]
  ------------------
  103|   390k|      const uint32_t offset = prob_data >> 2;
  104|   390k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 390k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  13.0M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 12.6M, False: 390k]
  ------------------
  109|  12.6M|        probability_table_[i + j] = 0;
  110|  12.6M|      }
  111|   390k|      i += offset;
  112|   390k|    } else {
  113|   305k|      const int extra_bytes = token;
  114|   305k|      uint32_t prob = prob_data >> 2;
  115|   517k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 211k, False: 305k]
  ------------------
  116|   211k|        uint8_t eb;
  117|   211k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 211k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   211k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   211k|      }
  124|   305k|      probability_table_[i] = prob;
  125|   305k|    }
  126|   695k|  }
  127|     59|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 39]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|     39|  return true;
  131|     59|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|     39|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|     39|    DecoderBuffer *buffer) {
  136|     39|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     39|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     39|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     39|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 39]
  ------------------
  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|     39|#endif
  146|     39|  {
  147|     39|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 39]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     39|  }
  151|     39|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 38]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|     38|  const uint8_t *const data_head =
  155|     38|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     38|  buffer->Advance(bytes_encoded);
  158|     38|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 5, False: 33]
  ------------------
  159|      5|    return false;
  160|      5|  }
  161|     33|  return true;
  162|     38|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|  74.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     33|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     33|  ans_.read_end();
  167|     33|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|     88|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|     88|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     88|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 88]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     88|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     88|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     88|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 20, False: 68]
  ------------------
   67|     20|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 20]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     20|  } else
   72|     68|#endif
   73|     68|  {
   74|     68|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 62]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|     68|  }
   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|     82|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 77]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|     77|  probability_table_.resize(num_symbols_);
   86|     77|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 77]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   137k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 137k, False: 38]
  ------------------
   91|   137k|    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|   137k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 137k]
  ------------------
   95|     14|      return false;
   96|     14|    }
   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|   137k|    const int token = prob_data & 3;
  102|   137k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 67.7k, False: 69.6k]
  ------------------
  103|  67.7k|      const uint32_t offset = prob_data >> 2;
  104|  67.7k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 14, False: 67.7k]
  ------------------
  105|     14|        return false;
  106|     14|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.58M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.51M, False: 67.7k]
  ------------------
  109|  3.51M|        probability_table_[i + j] = 0;
  110|  3.51M|      }
  111|  67.7k|      i += offset;
  112|  69.6k|    } else {
  113|  69.6k|      const int extra_bytes = token;
  114|  69.6k|      uint32_t prob = prob_data >> 2;
  115|   167k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 98.1k, False: 69.6k]
  ------------------
  116|  98.1k|        uint8_t eb;
  117|  98.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 98.1k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  98.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  98.1k|      }
  124|  69.6k|      probability_table_[i] = prob;
  125|  69.6k|    }
  126|   137k|  }
  127|     38|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 35]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|     35|  return true;
  131|     38|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|     35|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|     35|    DecoderBuffer *buffer) {
  136|     35|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     35|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     35|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     35|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 31]
  ------------------
  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|     31|#endif
  146|     31|  {
  147|     31|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 31]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     31|  }
  151|     35|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 7, False: 28]
  ------------------
  152|      7|    return false;
  153|      7|  }
  154|     28|  const uint8_t *const data_head =
  155|     28|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     28|  buffer->Advance(bytes_encoded);
  158|     28|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 9, False: 19]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|     19|  return true;
  162|     28|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  48.6k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     19|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     19|  ans_.read_end();
  167|     19|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|     67|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|     67|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     67|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 67]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     67|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     67|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     67|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 16, False: 51]
  ------------------
   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|     51|#endif
   73|     51|  {
   74|     51|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 51]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     51|  }
   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|     67|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 65]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|     65|  probability_table_.resize(num_symbols_);
   86|     65|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 65]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  36.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 36.1k, False: 38]
  ------------------
   91|  36.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|  36.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 15, False: 36.1k]
  ------------------
   95|     15|      return false;
   96|     15|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  36.1k|    const int token = prob_data & 3;
  102|  36.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 8.78k, False: 27.3k]
  ------------------
  103|  8.78k|      const uint32_t offset = prob_data >> 2;
  104|  8.78k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 6, False: 8.77k]
  ------------------
  105|      6|        return false;
  106|      6|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   318k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 310k, False: 8.77k]
  ------------------
  109|   310k|        probability_table_[i + j] = 0;
  110|   310k|      }
  111|  8.77k|      i += offset;
  112|  27.3k|    } else {
  113|  27.3k|      const int extra_bytes = token;
  114|  27.3k|      uint32_t prob = prob_data >> 2;
  115|  40.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 12.7k, False: 27.3k]
  ------------------
  116|  12.7k|        uint8_t eb;
  117|  12.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 12.7k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  12.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  12.7k|      }
  124|  27.3k|      probability_table_[i] = prob;
  125|  27.3k|    }
  126|  36.1k|  }
  127|     38|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 8, False: 30]
  ------------------
  128|      8|    return false;
  129|      8|  }
  130|     30|  return true;
  131|     38|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|     30|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|     30|    DecoderBuffer *buffer) {
  136|     30|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     30|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     30|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     30|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 8, False: 22]
  ------------------
  140|      8|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 8]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      8|  } else
  145|     22|#endif
  146|     22|  {
  147|     22|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 22]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     22|  }
  151|     30|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 10, False: 20]
  ------------------
  152|     10|    return false;
  153|     10|  }
  154|     20|  const uint8_t *const data_head =
  155|     20|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     20|  buffer->Advance(bytes_encoded);
  158|     20|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 5, False: 15]
  ------------------
  159|      5|    return false;
  160|      5|  }
  161|     15|  return true;
  162|     20|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  4.22M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     15|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     15|  ans_.read_end();
  167|     15|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|     53|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|     53|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     53|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 53]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     53|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     53|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     53|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 5, False: 48]
  ------------------
   67|      5|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 5]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      5|  } else
   72|     48|#endif
   73|     48|  {
   74|     48|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 48]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     48|  }
   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|     53|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 49]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|     49|  probability_table_.resize(num_symbols_);
   86|     49|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 49]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  18.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 18.4k, False: 23]
  ------------------
   91|  18.4k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  18.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 7, False: 18.3k]
  ------------------
   95|      7|      return false;
   96|      7|    }
   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|  18.3k|    const int token = prob_data & 3;
  102|  18.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.67k, False: 12.7k]
  ------------------
  103|  5.67k|      const uint32_t offset = prob_data >> 2;
  104|  5.67k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 7, False: 5.66k]
  ------------------
  105|      7|        return false;
  106|      7|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   221k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 215k, False: 5.66k]
  ------------------
  109|   215k|        probability_table_[i + j] = 0;
  110|   215k|      }
  111|  5.66k|      i += offset;
  112|  12.7k|    } else {
  113|  12.7k|      const int extra_bytes = token;
  114|  12.7k|      uint32_t prob = prob_data >> 2;
  115|  22.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 9.78k, False: 12.7k]
  ------------------
  116|  9.78k|        uint8_t eb;
  117|  9.78k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 9.76k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  9.76k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  9.76k|      }
  124|  12.7k|      probability_table_[i] = prob;
  125|  12.7k|    }
  126|  18.3k|  }
  127|     23|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 18]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|     18|  return true;
  131|     23|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|     18|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|     18|    DecoderBuffer *buffer) {
  136|     18|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     18|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     18|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     18|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 18]
  ------------------
  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|     18|#endif
  146|     18|  {
  147|     18|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 18]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     18|  }
  151|     18|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 6, False: 12]
  ------------------
  152|      6|    return false;
  153|      6|  }
  154|     12|  const uint8_t *const data_head =
  155|     12|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     12|  buffer->Advance(bytes_encoded);
  158|     12|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 12]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|     12|  return true;
  162|     12|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  9.46M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     12|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     12|  ans_.read_end();
  167|     12|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    109|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    109|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    109|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 109]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    109|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    109|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    109|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 9, False: 100]
  ------------------
   67|      9|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 9]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      9|  } else
   72|    100|#endif
   73|    100|  {
   74|    100|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 99]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    100|  }
   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|    108|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 99]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|     99|  probability_table_.resize(num_symbols_);
   86|     99|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 99]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   111k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 111k, False: 64]
  ------------------
   91|   111k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   111k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 111k]
  ------------------
   95|     16|      return false;
   96|     16|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   111k|    const int token = prob_data & 3;
  102|   111k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 91.9k, False: 19.8k]
  ------------------
  103|  91.9k|      const uint32_t offset = prob_data >> 2;
  104|  91.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 12, False: 91.8k]
  ------------------
  105|     12|        return false;
  106|     12|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.53M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.43M, False: 91.8k]
  ------------------
  109|  4.43M|        probability_table_[i + j] = 0;
  110|  4.43M|      }
  111|  91.8k|      i += offset;
  112|  91.8k|    } else {
  113|  19.8k|      const int extra_bytes = token;
  114|  19.8k|      uint32_t prob = prob_data >> 2;
  115|  24.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.37k, False: 19.8k]
  ------------------
  116|  4.37k|        uint8_t eb;
  117|  4.37k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 4.36k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.36k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.36k|      }
  124|  19.8k|      probability_table_[i] = prob;
  125|  19.8k|    }
  126|   111k|  }
  127|     64|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 8, False: 56]
  ------------------
  128|      8|    return false;
  129|      8|  }
  130|     56|  return true;
  131|     64|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|     56|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|     56|    DecoderBuffer *buffer) {
  136|     56|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     56|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     56|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     56|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 52]
  ------------------
  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|     52|#endif
  146|     52|  {
  147|     52|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 50]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|     52|  }
  151|     54|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 9, False: 45]
  ------------------
  152|      9|    return false;
  153|      9|  }
  154|     45|  const uint8_t *const data_head =
  155|     45|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     45|  buffer->Advance(bytes_encoded);
  158|     45|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 9, False: 36]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|     36|  return true;
  162|     45|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  3.27M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     36|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     36|  ans_.read_end();
  167|     36|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|     81|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|     81|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     81|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 81]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     81|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     81|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     81|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 25, False: 56]
  ------------------
   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|     56|#endif
   73|     56|  {
   74|     56|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 56]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     56|  }
   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|     81|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 80]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|     80|  probability_table_.resize(num_symbols_);
   86|     80|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 80]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  11.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 11.1k, False: 60]
  ------------------
   91|  11.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|  11.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 7, False: 11.1k]
  ------------------
   95|      7|      return false;
   96|      7|    }
   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|  11.1k|    const int token = prob_data & 3;
  102|  11.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.24k, False: 8.86k]
  ------------------
  103|  2.24k|      const uint32_t offset = prob_data >> 2;
  104|  2.24k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 2.24k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  92.4k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 90.1k, False: 2.24k]
  ------------------
  109|  90.1k|        probability_table_[i + j] = 0;
  110|  90.1k|      }
  111|  2.24k|      i += offset;
  112|  8.86k|    } else {
  113|  8.86k|      const int extra_bytes = token;
  114|  8.86k|      uint32_t prob = prob_data >> 2;
  115|  17.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.65k, False: 8.86k]
  ------------------
  116|  8.65k|        uint8_t eb;
  117|  8.65k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 5, False: 8.65k]
  ------------------
  118|      5|          return false;
  119|      5|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.65k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.65k|      }
  124|  8.86k|      probability_table_[i] = prob;
  125|  8.86k|    }
  126|  11.1k|  }
  127|     60|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 8, False: 52]
  ------------------
  128|      8|    return false;
  129|      8|  }
  130|     52|  return true;
  131|     60|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|     52|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|     52|    DecoderBuffer *buffer) {
  136|     52|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     52|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     52|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     52|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 32]
  ------------------
  140|     20|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 19]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     20|  } else
  145|     32|#endif
  146|     32|  {
  147|     32|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 28]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|     32|  }
  151|     47|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 26, False: 21]
  ------------------
  152|     26|    return false;
  153|     26|  }
  154|     21|  const uint8_t *const data_head =
  155|     21|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     21|  buffer->Advance(bytes_encoded);
  158|     21|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 3, False: 18]
  ------------------
  159|      3|    return false;
  160|      3|  }
  161|     18|  return true;
  162|     21|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  57.5k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     18|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     18|  ans_.read_end();
  167|     18|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  3.35k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  3.35k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 1, False: 3.35k]
  ------------------
   35|      1|    return true;
   36|      1|  }
   37|       |  // Decode which scheme to use.
   38|  3.35k|  uint8_t scheme;
   39|  3.35k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 17, False: 3.34k]
  ------------------
   40|     17|    return false;
   41|     17|  }
   42|  3.34k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 318, False: 3.02k]
  ------------------
   43|    318|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    318|                                                  src_buffer, out_values);
   45|  3.02k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 2.04k, False: 978]
  ------------------
   46|  2.04k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  2.04k|                                               out_values);
   48|  2.04k|  }
   49|    978|  return false;
   50|  3.34k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    318|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    318|  SymbolDecoderT<5> tag_decoder;
   57|    318|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 170, False: 148]
  ------------------
   58|    170|    return false;
   59|    170|  }
   60|       |
   61|    148|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 71, False: 77]
  ------------------
   62|     71|    return false;
   63|     71|  }
   64|       |
   65|     77|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 77, False: 0]
  |  Branch (65:25): [True: 29, False: 48]
  ------------------
   66|     29|    return false;  // Wrong number of symbols.
   67|     29|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|     48|  src_buffer->StartBitDecoding(false, nullptr);
   72|     48|  int value_id = 0;
   73|  18.6k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 18.6k, False: 48]
  ------------------
   74|       |    // Decode the tag.
   75|  18.6k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  48.0k|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 29.4k, False: 18.6k]
  ------------------
   78|  29.4k|      uint32_t val;
   79|  29.4k|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 29.4k]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|  29.4k|      out_values[value_id++] = val;
   83|  29.4k|    }
   84|  18.6k|  }
   85|     48|  tag_decoder.EndDecoding();
   86|     48|  src_buffer->EndBitDecoding();
   87|     48|  return true;
   88|     48|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  2.04k|                      uint32_t *out_values) {
  117|  2.04k|  uint8_t max_bit_length;
  118|  2.04k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 1, False: 2.04k]
  ------------------
  119|      1|    return false;
  120|      1|  }
  121|  2.04k|  switch (max_bit_length) {
  122|    245|    case 1:
  ------------------
  |  Branch (122:5): [True: 245, False: 1.79k]
  ------------------
  123|    245|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    245|                                                         out_values);
  125|    148|    case 2:
  ------------------
  |  Branch (125:5): [True: 148, False: 1.89k]
  ------------------
  126|    148|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    148|                                                         out_values);
  128|    182|    case 3:
  ------------------
  |  Branch (128:5): [True: 182, False: 1.86k]
  ------------------
  129|    182|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    182|                                                         out_values);
  131|     86|    case 4:
  ------------------
  |  Branch (131:5): [True: 86, False: 1.95k]
  ------------------
  132|     86|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|     86|                                                         out_values);
  134|    120|    case 5:
  ------------------
  |  Branch (134:5): [True: 120, False: 1.92k]
  ------------------
  135|    120|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    120|                                                         out_values);
  137|     74|    case 6:
  ------------------
  |  Branch (137:5): [True: 74, False: 1.97k]
  ------------------
  138|     74|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|     74|                                                         out_values);
  140|    142|    case 7:
  ------------------
  |  Branch (140:5): [True: 142, False: 1.90k]
  ------------------
  141|    142|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    142|                                                         out_values);
  143|    110|    case 8:
  ------------------
  |  Branch (143:5): [True: 110, False: 1.93k]
  ------------------
  144|    110|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    110|                                                         out_values);
  146|    106|    case 9:
  ------------------
  |  Branch (146:5): [True: 106, False: 1.93k]
  ------------------
  147|    106|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    106|                                                         out_values);
  149|     90|    case 10:
  ------------------
  |  Branch (149:5): [True: 90, False: 1.95k]
  ------------------
  150|     90|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|     90|          num_values, src_buffer, out_values);
  152|     65|    case 11:
  ------------------
  |  Branch (152:5): [True: 65, False: 1.97k]
  ------------------
  153|     65|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|     65|          num_values, src_buffer, out_values);
  155|     76|    case 12:
  ------------------
  |  Branch (155:5): [True: 76, False: 1.96k]
  ------------------
  156|     76|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|     76|          num_values, src_buffer, out_values);
  158|     99|    case 13:
  ------------------
  |  Branch (158:5): [True: 99, False: 1.94k]
  ------------------
  159|     99|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|     99|          num_values, src_buffer, out_values);
  161|     88|    case 14:
  ------------------
  |  Branch (161:5): [True: 88, False: 1.95k]
  ------------------
  162|     88|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|     88|          num_values, src_buffer, out_values);
  164|     67|    case 15:
  ------------------
  |  Branch (164:5): [True: 67, False: 1.97k]
  ------------------
  165|     67|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|     67|          num_values, src_buffer, out_values);
  167|     53|    case 16:
  ------------------
  |  Branch (167:5): [True: 53, False: 1.99k]
  ------------------
  168|     53|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|     53|          num_values, src_buffer, out_values);
  170|    109|    case 17:
  ------------------
  |  Branch (170:5): [True: 109, False: 1.93k]
  ------------------
  171|    109|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    109|          num_values, src_buffer, out_values);
  173|     81|    case 18:
  ------------------
  |  Branch (173:5): [True: 81, False: 1.96k]
  ------------------
  174|     81|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|     81|          num_values, src_buffer, out_values);
  176|    103|    default:
  ------------------
  |  Branch (176:5): [True: 103, False: 1.94k]
  ------------------
  177|    103|      return false;
  178|  2.04k|  }
  179|  2.04k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    245|                              uint32_t *out_values) {
   93|    245|  SymbolDecoderT decoder;
   94|    245|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 149, False: 96]
  ------------------
   95|    149|    return false;
   96|    149|  }
   97|       |
   98|     96|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 96, False: 0]
  |  Branch (98:25): [True: 4, False: 92]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|     92|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 4, False: 88]
  ------------------
  103|      4|    return false;
  104|      4|  }
  105|  9.35M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.35M, False: 88]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.35M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.35M|    out_values[i] = value;
  109|  9.35M|  }
  110|     88|  decoder.EndDecoding();
  111|     88|  return true;
  112|     92|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    148|                              uint32_t *out_values) {
   93|    148|  SymbolDecoderT decoder;
   94|    148|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 70, False: 78]
  ------------------
   95|     70|    return false;
   96|     70|  }
   97|       |
   98|     78|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 78, False: 0]
  |  Branch (98:25): [True: 1, False: 77]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     77|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 35, False: 42]
  ------------------
  103|     35|    return false;
  104|     35|  }
  105|  6.91M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.91M, False: 42]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.91M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.91M|    out_values[i] = value;
  109|  6.91M|  }
  110|     42|  decoder.EndDecoding();
  111|     42|  return true;
  112|     77|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    182|                              uint32_t *out_values) {
   93|    182|  SymbolDecoderT decoder;
   94|    182|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 38, False: 144]
  ------------------
   95|     38|    return false;
   96|     38|  }
   97|       |
   98|    144|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 144, False: 0]
  |  Branch (98:25): [True: 1, False: 143]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    143|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 40, False: 103]
  ------------------
  103|     40|    return false;
  104|     40|  }
  105|  6.01M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.01M, False: 103]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.01M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.01M|    out_values[i] = value;
  109|  6.01M|  }
  110|    103|  decoder.EndDecoding();
  111|    103|  return true;
  112|    143|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|     86|                              uint32_t *out_values) {
   93|     86|  SymbolDecoderT decoder;
   94|     86|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 35, False: 51]
  ------------------
   95|     35|    return false;
   96|     35|  }
   97|       |
   98|     51|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 51, False: 0]
  |  Branch (98:25): [True: 0, False: 51]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     51|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 51]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|   525k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 525k, False: 51]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   525k|    const uint32_t value = decoder.DecodeSymbol();
  108|   525k|    out_values[i] = value;
  109|   525k|  }
  110|     51|  decoder.EndDecoding();
  111|     51|  return true;
  112|     51|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    120|                              uint32_t *out_values) {
   93|    120|  SymbolDecoderT decoder;
   94|    120|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 5, False: 115]
  ------------------
   95|      5|    return false;
   96|      5|  }
   97|       |
   98|    115|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 115, False: 0]
  |  Branch (98:25): [True: 96, False: 19]
  ------------------
   99|     96|    return false;  // Wrong number of symbols.
  100|     96|  }
  101|       |
  102|     19|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 19]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  8.17M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.17M, False: 19]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.17M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.17M|    out_values[i] = value;
  109|  8.17M|  }
  110|     19|  decoder.EndDecoding();
  111|     19|  return true;
  112|     19|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|     74|                              uint32_t *out_values) {
   93|     74|  SymbolDecoderT decoder;
   94|     74|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 33, False: 41]
  ------------------
   95|     33|    return false;
   96|     33|  }
   97|       |
   98|     41|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 41, False: 0]
  |  Branch (98:25): [True: 1, False: 40]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     40|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 28, False: 12]
  ------------------
  103|     28|    return false;
  104|     28|  }
  105|  9.77M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.77M, False: 12]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.77M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.77M|    out_values[i] = value;
  109|  9.77M|  }
  110|     12|  decoder.EndDecoding();
  111|     12|  return true;
  112|     40|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    142|                              uint32_t *out_values) {
   93|    142|  SymbolDecoderT decoder;
   94|    142|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 63, False: 79]
  ------------------
   95|     63|    return false;
   96|     63|  }
   97|       |
   98|     79|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 79, False: 0]
  |  Branch (98:25): [True: 0, False: 79]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     79|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 9, False: 70]
  ------------------
  103|      9|    return false;
  104|      9|  }
  105|  4.36M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.36M, False: 70]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.36M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.36M|    out_values[i] = value;
  109|  4.36M|  }
  110|     70|  decoder.EndDecoding();
  111|     70|  return true;
  112|     79|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    110|                              uint32_t *out_values) {
   93|    110|  SymbolDecoderT decoder;
   94|    110|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 47, False: 63]
  ------------------
   95|     47|    return false;
   96|     47|  }
   97|       |
   98|     63|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 63, False: 0]
  |  Branch (98:25): [True: 1, False: 62]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     62|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 36, False: 26]
  ------------------
  103|     36|    return false;
  104|     36|  }
  105|  1.73M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.73M, False: 26]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.73M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.73M|    out_values[i] = value;
  109|  1.73M|  }
  110|     26|  decoder.EndDecoding();
  111|     26|  return true;
  112|     62|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    106|                              uint32_t *out_values) {
   93|    106|  SymbolDecoderT decoder;
   94|    106|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 51, False: 55]
  ------------------
   95|     51|    return false;
   96|     51|  }
   97|       |
   98|     55|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 55, False: 0]
  |  Branch (98:25): [True: 0, False: 55]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     55|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 24, False: 31]
  ------------------
  103|     24|    return false;
  104|     24|  }
  105|  5.24M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.24M, False: 31]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.24M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.24M|    out_values[i] = value;
  109|  5.24M|  }
  110|     31|  decoder.EndDecoding();
  111|     31|  return true;
  112|     55|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|     90|                              uint32_t *out_values) {
   93|     90|  SymbolDecoderT decoder;
   94|     90|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 42, False: 48]
  ------------------
   95|     42|    return false;
   96|     42|  }
   97|       |
   98|     48|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 48, False: 0]
  |  Branch (98:25): [True: 0, False: 48]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     48|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 29, False: 19]
  ------------------
  103|     29|    return false;
  104|     29|  }
  105|  79.1k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 79.1k, False: 19]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  79.1k|    const uint32_t value = decoder.DecodeSymbol();
  108|  79.1k|    out_values[i] = value;
  109|  79.1k|  }
  110|     19|  decoder.EndDecoding();
  111|     19|  return true;
  112|     48|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|     65|                              uint32_t *out_values) {
   93|     65|  SymbolDecoderT decoder;
   94|     65|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 51, False: 14]
  ------------------
   95|     51|    return false;
   96|     51|  }
   97|       |
   98|     14|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 14, False: 0]
  |  Branch (98:25): [True: 2, False: 12]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|     12|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 7, False: 5]
  ------------------
  103|      7|    return false;
  104|      7|  }
  105|  15.0k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 15.0k, False: 5]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  15.0k|    const uint32_t value = decoder.DecodeSymbol();
  108|  15.0k|    out_values[i] = value;
  109|  15.0k|  }
  110|      5|  decoder.EndDecoding();
  111|      5|  return true;
  112|     12|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|     76|                              uint32_t *out_values) {
   93|     76|  SymbolDecoderT decoder;
   94|     76|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 45, False: 31]
  ------------------
   95|     45|    return false;
   96|     45|  }
   97|       |
   98|     31|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 31, False: 0]
  |  Branch (98:25): [True: 9, False: 22]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|     22|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 15, False: 7]
  ------------------
  103|     15|    return false;
  104|     15|  }
  105|  23.5k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 23.5k, False: 7]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  23.5k|    const uint32_t value = decoder.DecodeSymbol();
  108|  23.5k|    out_values[i] = value;
  109|  23.5k|  }
  110|      7|  decoder.EndDecoding();
  111|      7|  return true;
  112|     22|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|     99|                              uint32_t *out_values) {
   93|     99|  SymbolDecoderT decoder;
   94|     99|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 60, False: 39]
  ------------------
   95|     60|    return false;
   96|     60|  }
   97|       |
   98|     39|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 39, False: 0]
  |  Branch (98:25): [True: 0, False: 39]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     39|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 6, False: 33]
  ------------------
  103|      6|    return false;
  104|      6|  }
  105|  74.8k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 74.8k, False: 33]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  74.8k|    const uint32_t value = decoder.DecodeSymbol();
  108|  74.8k|    out_values[i] = value;
  109|  74.8k|  }
  110|     33|  decoder.EndDecoding();
  111|     33|  return true;
  112|     39|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|     88|                              uint32_t *out_values) {
   93|     88|  SymbolDecoderT decoder;
   94|     88|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 53, False: 35]
  ------------------
   95|     53|    return false;
   96|     53|  }
   97|       |
   98|     35|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 35, False: 0]
  |  Branch (98:25): [True: 0, False: 35]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     35|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 16, False: 19]
  ------------------
  103|     16|    return false;
  104|     16|  }
  105|  48.6k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 48.6k, False: 19]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  48.6k|    const uint32_t value = decoder.DecodeSymbol();
  108|  48.6k|    out_values[i] = value;
  109|  48.6k|  }
  110|     19|  decoder.EndDecoding();
  111|     19|  return true;
  112|     35|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|     67|                              uint32_t *out_values) {
   93|     67|  SymbolDecoderT decoder;
   94|     67|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 37, False: 30]
  ------------------
   95|     37|    return false;
   96|     37|  }
   97|       |
   98|     30|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 30, False: 0]
  |  Branch (98:25): [True: 0, False: 30]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     30|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 15, False: 15]
  ------------------
  103|     15|    return false;
  104|     15|  }
  105|  4.22M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.22M, False: 15]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.22M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.22M|    out_values[i] = value;
  109|  4.22M|  }
  110|     15|  decoder.EndDecoding();
  111|     15|  return true;
  112|     30|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|     53|                              uint32_t *out_values) {
   93|     53|  SymbolDecoderT decoder;
   94|     53|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 35, False: 18]
  ------------------
   95|     35|    return false;
   96|     35|  }
   97|       |
   98|     18|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 18, False: 0]
  |  Branch (98:25): [True: 0, False: 18]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     18|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 6, False: 12]
  ------------------
  103|      6|    return false;
  104|      6|  }
  105|  9.46M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.46M, False: 12]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.46M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.46M|    out_values[i] = value;
  109|  9.46M|  }
  110|     12|  decoder.EndDecoding();
  111|     12|  return true;
  112|     18|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    109|                              uint32_t *out_values) {
   93|    109|  SymbolDecoderT decoder;
   94|    109|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 53, False: 56]
  ------------------
   95|     53|    return false;
   96|     53|  }
   97|       |
   98|     56|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 56, False: 0]
  |  Branch (98:25): [True: 0, False: 56]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     56|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 20, False: 36]
  ------------------
  103|     20|    return false;
  104|     20|  }
  105|  3.27M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.27M, False: 36]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.27M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.27M|    out_values[i] = value;
  109|  3.27M|  }
  110|     36|  decoder.EndDecoding();
  111|     36|  return true;
  112|     56|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|     81|                              uint32_t *out_values) {
   93|     81|  SymbolDecoderT decoder;
   94|     81|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 29, False: 52]
  ------------------
   95|     29|    return false;
   96|     29|  }
   97|       |
   98|     52|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 52, False: 0]
  |  Branch (98:25): [True: 0, False: 52]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     52|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 34, False: 18]
  ------------------
  103|     34|    return false;
  104|     34|  }
  105|  57.5k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 57.5k, False: 18]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  57.5k|    const uint32_t value = decoder.DecodeSymbol();
  108|  57.5k|    out_values[i] = value;
  109|  57.5k|  }
  110|     18|  decoder.EndDecoding();
  111|     18|  return true;
  112|     52|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  3.09k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  1.27k|  const CornerTable *GetCornerTable() const override {
   67|  1.27k|    return corner_table_.get();
   68|  1.27k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  2.44M|                       int *out_encoder_split_symbol_id) {
   87|  2.44M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 2.20M, False: 242k]
  ------------------
   88|  2.20M|      return false;
   89|  2.20M|    }
   90|   242k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 5, False: 242k]
  ------------------
   91|   242k|        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|      5|      *out_encoder_split_symbol_id = -1;
   98|      5|      return true;
   99|      5|    }
  100|   242k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 241k, False: 640]
  ------------------
  101|   241k|      return false;
  102|   241k|    }
  103|    640|    *out_face_edge =
  104|    640|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    640|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    640|    topology_split_data_.pop_back();
  108|    640|    return true;
  109|   242k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  10.4M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  10.4M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  10.4M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  10.4M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  5.15k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  2.37k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  1.88k|  const CornerTable *GetCornerTable() const override {
   67|  1.88k|    return corner_table_.get();
   68|  1.88k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  12.7M|                       int *out_encoder_split_symbol_id) {
   87|  12.7M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 12.5M, False: 232k]
  ------------------
   88|  12.5M|      return false;
   89|  12.5M|    }
   90|   232k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 20, False: 232k]
  ------------------
   91|   232k|        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|     20|      *out_encoder_split_symbol_id = -1;
   98|     20|      return true;
   99|     20|    }
  100|   232k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 231k, False: 917]
  ------------------
  101|   231k|      return false;
  102|   231k|    }
  103|    917|    *out_face_edge =
  104|    917|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    917|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    917|    topology_split_data_.pop_back();
  108|    917|    return true;
  109|   232k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  37.9M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  37.9M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  37.9M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  37.9M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  2.58k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  3.53k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|    837|  const CornerTable *GetCornerTable() const override {
   67|    837|    return corner_table_.get();
   68|    837|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  24.2M|                       int *out_encoder_split_symbol_id) {
   87|  24.2M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 23.9M, False: 320k]
  ------------------
   88|  23.9M|      return false;
   89|  23.9M|    }
   90|   320k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 15, False: 320k]
  ------------------
   91|   320k|        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|     15|      *out_encoder_split_symbol_id = -1;
   98|     15|      return true;
   99|     15|    }
  100|   320k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 319k, False: 835]
  ------------------
  101|   319k|      return false;
  102|   319k|    }
  103|    835|    *out_face_edge =
  104|    835|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    835|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    835|    topology_split_data_.pop_back();
  108|    835|    return true;
  109|   320k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  27.1M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  27.1M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  27.1M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  27.1M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  1.04k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  2.62k|      : attribute_connectivity_decoders_(nullptr),
   34|  2.62k|        num_attribute_data_(0),
   35|  2.62k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  2.44k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  2.44k|    decoder_impl_ = decoder;
   38|  2.44k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  2.44k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  2.44k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  2.44k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  1.66k|  uint16_t BitstreamVersion() const {
   45|  1.66k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  1.66k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  1.03k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  2.44k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  1.82k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  1.82k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 14, False: 1.80k]
  ------------------
   63|     14|      return false;
   64|     14|    }
   65|       |
   66|  1.80k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 22, False: 1.78k]
  ------------------
   67|     22|      return false;
   68|     22|    }
   69|       |
   70|  1.78k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 7, False: 1.78k]
  ------------------
   71|      7|      return false;
   72|      7|    }
   73|  1.78k|    *out_buffer = buffer_;
   74|  1.78k|    return true;
   75|  1.78k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  2.85M|  inline bool DecodeStartFaceConfiguration() {
   79|  2.85M|    uint32_t face_configuration;
   80|  2.85M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  2.85M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.85M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 445, False: 2.85M]
  ------------------
   82|    445|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    445|    } else
   85|  2.85M|#endif
   86|  2.85M|    {
   87|  2.85M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  2.85M|    }
   89|  2.85M|    return face_configuration;
   90|  2.85M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  7.16M|  inline uint32_t DecodeSymbol() {
   94|  7.16M|    uint32_t symbol;
   95|  7.16M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  7.16M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 3.52M, False: 3.64M]
  ------------------
   97|  3.52M|      return symbol;
   98|  3.52M|    }
   99|       |    // Else decode two additional bits.
  100|  3.64M|    uint32_t symbol_suffix;
  101|  3.64M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  3.64M|    symbol |= (symbol_suffix << 1);
  103|  3.64M|    return symbol;
  104|  7.16M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  7.10M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  1.17M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  10.3M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  10.3M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  10.3M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  1.76k|  void Done() {
  123|  1.76k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 1.62k, False: 144]
  ------------------
  124|  1.62k|      symbol_buffer_.EndBitDecoding();
  125|  1.62k|    }
  126|  1.76k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  1.76k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.76k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 276, False: 1.49k]
  ------------------
  128|    276|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    276|    } else
  131|  1.49k|#endif
  132|  1.49k|    {
  133|  1.49k|      start_face_decoder_.EndDecoding();
  134|  1.49k|    }
  135|  1.76k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|    595|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  1.89k|  bool DecodeTraversalSymbols() {
  141|  1.89k|    uint64_t traversal_size;
  142|  1.89k|    symbol_buffer_ = buffer_;
  143|  1.89k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 3, False: 1.89k]
  ------------------
  144|      3|      return false;
  145|      3|    }
  146|  1.89k|    buffer_ = symbol_buffer_;
  147|  1.89k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 24, False: 1.86k]
  ------------------
  148|     24|      return false;
  149|     24|    }
  150|  1.86k|    buffer_.Advance(traversal_size);
  151|  1.86k|    return true;
  152|  1.89k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  2.42k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  2.42k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  2.42k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.42k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 366, False: 2.05k]
  ------------------
  158|    366|      start_face_buffer_ = buffer_;
  159|    366|      uint64_t traversal_size;
  160|    366|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 0, False: 366]
  ------------------
  161|      0|        return false;
  162|      0|      }
  163|    366|      buffer_ = start_face_buffer_;
  164|    366|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 32, False: 334]
  ------------------
  165|     32|        return false;
  166|     32|      }
  167|    334|      buffer_.Advance(traversal_size);
  168|    334|      return true;
  169|    366|    }
  170|  2.05k|#endif
  171|  2.05k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  2.42k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  2.38k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  2.38k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 1.80k, False: 582]
  ------------------
  177|  1.80k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  1.80k|          new BinaryDecoder[num_attribute_data_]);
  179|  6.59k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 4.80k, False: 1.79k]
  ------------------
  180|  4.80k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 8, False: 4.79k]
  ------------------
  181|      8|          return false;
  182|      8|        }
  183|  4.80k|      }
  184|  1.80k|    }
  185|  2.37k|    return true;
  186|  2.38k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|    846|MeshSequentialDecoder::MeshSequentialDecoder() {}
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|    745|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|    745|  uint32_t num_faces;
   31|    745|  uint32_t num_points;
   32|    745|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|    745|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    745|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 221, False: 524]
  ------------------
   34|    221|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 0, False: 221]
  ------------------
   35|      0|      return false;
   36|      0|    }
   37|    221|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 0, False: 221]
  ------------------
   38|      0|      return false;
   39|      0|    }
   40|       |
   41|    221|  } else
   42|    524|#endif
   43|    524|  {
   44|    524|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 0, False: 524]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|    524|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 0, False: 524]
  ------------------
   48|      0|      return false;
   49|      0|    }
   50|    524|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|    745|  const uint64_t faces_64 = static_cast<uint64_t>(num_faces);
   54|       |  // Compressed sequential encoding can only handle (2^32 - 1) / 3 indices.
   55|    745|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 0, False: 745]
  ------------------
   56|      0|    return false;
   57|      0|  }
   58|    745|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 0, False: 745]
  ------------------
   59|       |    // The number of faces is unreasonably high, because face indices do not
   60|       |    // fit in the remaining size of the buffer.
   61|      0|    return false;
   62|      0|  }
   63|    745|  uint8_t connectivity_method;
   64|    745|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 0, False: 745]
  ------------------
   65|      0|    return false;
   66|      0|  }
   67|    745|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 613, False: 132]
  ------------------
   68|    613|    if (!DecodeAndDecompressIndices(num_faces)) {
  ------------------
  |  Branch (68:9): [True: 596, False: 17]
  ------------------
   69|    596|      return false;
   70|    596|    }
   71|    613|  } else {
   72|    132|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 60, False: 72]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|  1.64k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 1.58k, False: 60]
  ------------------
   75|  1.58k|        Mesh::Face face;
   76|  6.33k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 4.74k, False: 1.58k]
  ------------------
   77|  4.74k|          uint8_t val;
   78|  4.74k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 0, False: 4.74k]
  ------------------
   79|      0|            return false;
   80|      0|          }
   81|  4.74k|          face[j] = val;
   82|  4.74k|        }
   83|  1.58k|        mesh()->AddFace(face);
   84|  1.58k|      }
   85|     72|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (85:16): [True: 30, False: 42]
  ------------------
   86|       |      // Decode indices as uint16_t.
   87|    681|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (87:28): [True: 658, False: 23]
  ------------------
   88|    658|        Mesh::Face face;
   89|  2.61k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (89:25): [True: 1.96k, False: 651]
  ------------------
   90|  1.96k|          uint16_t val;
   91|  1.96k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (91:15): [True: 7, False: 1.95k]
  ------------------
   92|      7|            return false;
   93|      7|          }
   94|  1.95k|          face[j] = val;
   95|  1.95k|        }
   96|    651|        mesh()->AddFace(face);
   97|    651|      }
   98|     42|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (98:16): [True: 20, False: 22]
  ------------------
   99|     20|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     20|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (99:16): [True: 19, False: 1]
  ------------------
  100|       |      // Decode indices as uint32_t.
  101|  9.60k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (101:28): [True: 9.59k, False: 13]
  ------------------
  102|  9.59k|        Mesh::Face face;
  103|  38.3k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (103:25): [True: 28.7k, False: 9.58k]
  ------------------
  104|  28.7k|          uint32_t val;
  105|  28.7k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (105:15): [True: 6, False: 28.7k]
  ------------------
  106|      6|            return false;
  107|      6|          }
  108|  28.7k|          face[j] = val;
  109|  28.7k|        }
  110|  9.58k|        mesh()->AddFace(face);
  111|  9.58k|      }
  112|     23|    } else {
  113|       |      // Decode faces as uint32_t (default).
  114|    861|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (114:28): [True: 847, False: 14]
  ------------------
  115|    847|        Mesh::Face face;
  116|  3.36k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (116:25): [True: 2.52k, False: 838]
  ------------------
  117|  2.52k|          uint32_t val;
  118|  2.52k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (118:15): [True: 9, False: 2.51k]
  ------------------
  119|      9|            return false;
  120|      9|          }
  121|  2.51k|          face[j] = val;
  122|  2.51k|        }
  123|    838|        mesh()->AddFace(face);
  124|    838|      }
  125|     23|    }
  126|    132|  }
  127|    127|  point_cloud()->set_num_points(num_points);
  128|    127|  return true;
  129|    745|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  131|  5.59k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  132|       |  // Always create the basic attribute decoder.
  133|  5.59k|  return SetAttributesDecoder(
  134|  5.59k|      att_decoder_id,
  135|  5.59k|      std::unique_ptr<AttributesDecoder>(
  136|  5.59k|          new SequentialAttributeDecodersController(
  137|  5.59k|              std::unique_ptr<PointsSequencer>(
  138|  5.59k|                  new LinearSequencer(point_cloud()->num_points())))));
  139|  5.59k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEj:
  141|    613|bool MeshSequentialDecoder::DecodeAndDecompressIndices(uint32_t num_faces) {
  142|       |  // Get decoded indices differences that were encoded with an entropy code.
  143|    613|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  144|    613|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (144:7): [True: 583, False: 30]
  ------------------
  145|    583|    return false;
  146|    583|  }
  147|       |  // Reconstruct the indices from the differences.
  148|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  149|     30|  int32_t last_index_value = 0;  // This will always be >= 0.
  150|     30|  int vertex_index = 0;
  151|    513|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (151:24): [True: 496, False: 17]
  ------------------
  152|    496|    Mesh::Face face;
  153|  1.95k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (153:21): [True: 1.46k, False: 483]
  ------------------
  154|  1.46k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  155|  1.46k|      int32_t index_diff = (encoded_val >> 1);
  156|  1.46k|      if (encoded_val & 1) {
  ------------------
  |  Branch (156:11): [True: 453, False: 1.01k]
  ------------------
  157|    453|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (157:13): [True: 9, False: 444]
  ------------------
  158|       |          // Subtracting index_diff would result in a negative index.
  159|      9|          return false;
  160|      9|        }
  161|    444|        index_diff = -index_diff;
  162|  1.01k|      } else {
  163|  1.01k|        if (index_diff >
  ------------------
  |  Branch (163:13): [True: 4, False: 1.01k]
  ------------------
  164|  1.01k|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  165|       |          // Adding index_diff to last_index_value would overflow.
  166|      4|          return false;
  167|      4|        }
  168|  1.01k|      }
  169|  1.45k|      const int32_t index_value = index_diff + last_index_value;
  170|  1.45k|      face[j] = index_value;
  171|  1.45k|      last_index_value = index_value;
  172|  1.45k|    }
  173|    483|    mesh()->AddFace(face);
  174|    483|  }
  175|     17|  return true;
  176|     30|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    638|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.37M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.37M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.31M, False: 57.5k]
  ------------------
   61|  1.31M|      return true;  // Already traversed.
   62|  1.31M|    }
   63|       |
   64|  57.5k|    corner_traversal_stack_.clear();
   65|  57.5k|    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|  57.5k|    const VertexIndex next_vert =
   69|  57.5k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  57.5k|    const VertexIndex prev_vert =
   71|  57.5k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  57.5k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 57.5k]
  |  Branch (72:45): [True: 0, False: 57.5k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  57.5k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 57.0k, False: 501]
  ------------------
   76|  57.0k|      this->MarkVertexVisited(next_vert);
   77|  57.0k|      this->traversal_observer().OnNewVertexVisited(
   78|  57.0k|          next_vert, this->corner_table()->Next(corner_id));
   79|  57.0k|    }
   80|  57.5k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.36k, False: 55.1k]
  ------------------
   81|  2.36k|      this->MarkVertexVisited(prev_vert);
   82|  2.36k|      this->traversal_observer().OnNewVertexVisited(
   83|  2.36k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.36k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|   125k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 67.8k, False: 57.5k]
  ------------------
   88|       |      // Currently processed corner.
   89|  67.8k|      corner_id = corner_traversal_stack_.back();
   90|  67.8k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  67.8k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 67.8k]
  |  Branch (92:47): [True: 526, False: 67.2k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    526|        corner_traversal_stack_.pop_back();
   95|    526|        continue;
   96|    526|      }
   97|  1.37M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.37M, Folded]
  ------------------
   98|  1.37M|        this->MarkFaceVisited(face_id);
   99|  1.37M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.37M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.37M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.37M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.37M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 666k, False: 704k]
  ------------------
  105|   666k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   666k|          this->MarkVertexVisited(vert_id);
  107|   666k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   666k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 647k, False: 19.4k]
  ------------------
  109|   647k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   647k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   647k|            continue;
  112|   647k|          }
  113|   666k|        }
  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|   723k|        const CornerIndex right_corner_id =
  118|   723k|            this->corner_table()->GetRightCorner(corner_id);
  119|   723k|        const CornerIndex left_corner_id =
  120|   723k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   723k|        const FaceIndex right_face_id(
  122|   723k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 14.5k, False: 709k]
  ------------------
  123|   723k|                 ? kInvalidFaceIndex
  124|   723k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   723k|        const FaceIndex left_face_id(
  126|   723k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 61.4k, False: 662k]
  ------------------
  127|   723k|                 ? kInvalidFaceIndex
  128|   723k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   723k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 674k, False: 49.0k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   674k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 62.1k, False: 612k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  62.1k|            corner_traversal_stack_.pop_back();
  134|  62.1k|            break;  // Break from the while (true) loop.
  135|   612k|          } else {
  136|       |            // Go to the left face.
  137|   612k|            corner_id = left_corner_id;
  138|   612k|            face_id = left_face_id;
  139|   612k|          }
  140|   674k|        } else {
  141|       |          // Right face was not visited.
  142|  49.0k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 43.8k, False: 5.14k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  43.8k|            corner_id = right_corner_id;
  145|  43.8k|            face_id = right_face_id;
  146|  43.8k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  5.14k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  5.14k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  5.14k|            break;
  159|  5.14k|          }
  160|  49.0k|        }
  161|   723k|      }
  162|  67.2k|    }
  163|  57.5k|    return true;
  164|  57.5k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    638|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  1.31k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    814|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.88M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.88M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 684k, False: 1.20M]
  ------------------
   61|   684k|      return true;  // Already traversed.
   62|   684k|    }
   63|       |
   64|  1.20M|    corner_traversal_stack_.clear();
   65|  1.20M|    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.20M|    const VertexIndex next_vert =
   69|  1.20M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  1.20M|    const VertexIndex prev_vert =
   71|  1.20M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  1.20M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 1.20M]
  |  Branch (72:45): [True: 0, False: 1.20M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  1.20M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 1.20M, False: 696]
  ------------------
   76|  1.20M|      this->MarkVertexVisited(next_vert);
   77|  1.20M|      this->traversal_observer().OnNewVertexVisited(
   78|  1.20M|          next_vert, this->corner_table()->Next(corner_id));
   79|  1.20M|    }
   80|  1.20M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 1.17M, False: 28.5k]
  ------------------
   81|  1.17M|      this->MarkVertexVisited(prev_vert);
   82|  1.17M|      this->traversal_observer().OnNewVertexVisited(
   83|  1.17M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  1.17M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  2.44M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 1.24M, False: 1.20M]
  ------------------
   88|       |      // Currently processed corner.
   89|  1.24M|      corner_id = corner_traversal_stack_.back();
   90|  1.24M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  1.24M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 1.24M]
  |  Branch (92:47): [True: 2.63k, False: 1.23M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  2.63k|        corner_traversal_stack_.pop_back();
   95|  2.63k|        continue;
   96|  2.63k|      }
   97|  1.88M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.88M, Folded]
  ------------------
   98|  1.88M|        this->MarkFaceVisited(face_id);
   99|  1.88M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.88M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.88M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.88M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.88M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.53M, False: 356k]
  ------------------
  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: 321k, False: 1.20M]
  ------------------
  109|   321k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   321k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   321k|            continue;
  112|   321k|          }
  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.56M|        const CornerIndex right_corner_id =
  118|  1.56M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.56M|        const CornerIndex left_corner_id =
  120|  1.56M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.56M|        const FaceIndex right_face_id(
  122|  1.56M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 1.19M, False: 371k]
  ------------------
  123|  1.56M|                 ? kInvalidFaceIndex
  124|  1.56M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.56M|        const FaceIndex left_face_id(
  126|  1.56M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 1.21M, False: 348k]
  ------------------
  127|  1.56M|                 ? kInvalidFaceIndex
  128|  1.56M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.56M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.51M, False: 52.0k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.51M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 1.21M, False: 293k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  1.21M|            corner_traversal_stack_.pop_back();
  134|  1.21M|            break;  // Break from the while (true) loop.
  135|  1.21M|          } else {
  136|       |            // Go to the left face.
  137|   293k|            corner_id = left_corner_id;
  138|   293k|            face_id = left_face_id;
  139|   293k|          }
  140|  1.51M|        } else {
  141|       |          // Right face was not visited.
  142|  52.0k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 32.5k, False: 19.5k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  32.5k|            corner_id = right_corner_id;
  145|  32.5k|            face_id = right_face_id;
  146|  32.5k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  19.5k|            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|  19.5k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  19.5k|            break;
  159|  19.5k|          }
  160|  52.0k|        }
  161|  1.56M|      }
  162|  1.23M|    }
  163|  1.20M|    return true;
  164|  1.20M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    814|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  1.65k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    163|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    396|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    396|    const auto *corner_table = traverser_.corner_table();
   50|    396|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    396|    const size_t num_faces = mesh_->num_faces();
   52|    396|    const size_t num_points = mesh_->num_points();
   53|  2.02M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 2.02M, False: 396]
  ------------------
   54|  2.02M|      const auto &face = mesh_->face(f);
   55|  8.08M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 6.06M, False: 2.02M]
  ------------------
   56|  6.06M|        const PointIndex point_id = face[p];
   57|  6.06M|        const VertexIndex vert_id =
   58|  6.06M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  6.06M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 6.06M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  6.06M|        const AttributeValueIndex att_entry_id(
   63|  6.06M|            encoding_data_
   64|  6.06M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  6.06M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 6.06M]
  |  Branch (65:13): [True: 0, False: 6.06M]
  |  Branch (65:39): [True: 0, False: 6.06M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  6.06M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  6.06M|      }
   71|  2.02M|    }
   72|    396|    return true;
   73|    396|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    160|  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|    160|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    160|    traverser_.OnTraversalStart();
   82|    160|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 160]
  ------------------
   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|    160|    } else {
   89|    160|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|   767k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 767k, False: 160]
  ------------------
   91|   767k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 767k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|   767k|      }
   95|    160|    }
   96|    160|    traverser_.OnTraversalEnd();
   97|    160|    return true;
   98|    160|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   767k|  bool ProcessCorner(CornerIndex corner_id) {
  102|   767k|    return traverser_.TraverseFromCorner(corner_id);
  103|   767k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    163|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    656|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  4.57k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  4.57k|    const auto *corner_table = traverser_.corner_table();
   50|  4.57k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  4.57k|    const size_t num_faces = mesh_->num_faces();
   52|  4.57k|    const size_t num_points = mesh_->num_points();
   53|  2.70M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 2.69M, False: 4.57k]
  ------------------
   54|  2.69M|      const auto &face = mesh_->face(f);
   55|  10.7M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 8.08M, False: 2.69M]
  ------------------
   56|  8.08M|        const PointIndex point_id = face[p];
   57|  8.08M|        const VertexIndex vert_id =
   58|  8.08M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  8.08M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 8.08M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  8.08M|        const AttributeValueIndex att_entry_id(
   63|  8.08M|            encoding_data_
   64|  8.08M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  8.08M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 8.08M]
  |  Branch (65:13): [True: 0, False: 8.08M]
  |  Branch (65:39): [True: 0, False: 8.08M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  8.08M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  8.08M|      }
   71|  2.69M|    }
   72|  4.57k|    return true;
   73|  4.57k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    638|  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|    638|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    638|    traverser_.OnTraversalStart();
   82|    638|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 638]
  ------------------
   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|    638|    } else {
   89|    638|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  1.37M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 1.37M, False: 638]
  ------------------
   91|  1.37M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 1.37M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  1.37M|      }
   95|    638|    }
   96|    638|    traverser_.OnTraversalEnd();
   97|    638|    return true;
   98|    638|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.37M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  1.37M|    return traverser_.TraverseFromCorner(corner_id);
  103|  1.37M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    656|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    826|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  3.40k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  3.40k|    const auto *corner_table = traverser_.corner_table();
   50|  3.40k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  3.40k|    const size_t num_faces = mesh_->num_faces();
   52|  3.40k|    const size_t num_points = mesh_->num_points();
   53|  3.51M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 3.50M, False: 3.40k]
  ------------------
   54|  3.50M|      const auto &face = mesh_->face(f);
   55|  14.0M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 10.5M, False: 3.50M]
  ------------------
   56|  10.5M|        const PointIndex point_id = face[p];
   57|  10.5M|        const VertexIndex vert_id =
   58|  10.5M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  10.5M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 10.5M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  10.5M|        const AttributeValueIndex att_entry_id(
   63|  10.5M|            encoding_data_
   64|  10.5M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  10.5M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 10.5M]
  |  Branch (65:13): [True: 0, False: 10.5M]
  |  Branch (65:39): [True: 0, False: 10.5M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  10.5M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  10.5M|      }
   71|  3.50M|    }
   72|  3.40k|    return true;
   73|  3.40k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    814|  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|    814|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    814|    traverser_.OnTraversalStart();
   82|    814|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 814]
  ------------------
   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|    814|    } else {
   89|    814|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  1.88M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 1.88M, False: 814]
  ------------------
   91|  1.88M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 1.88M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  1.88M|      }
   95|    814|    }
   96|    814|    traverser_.OnTraversalEnd();
   97|    814|    return true;
   98|    814|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.88M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  1.88M|    return traverser_.TraverseFromCorner(corner_id);
  103|  1.88M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    826|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  1.65k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  11.7M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  5.67M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  5.67M|    return is_vertex_visited_[vert_id.value()];
   65|  5.67M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  1.12M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  1.12M|    is_vertex_visited_[vert_id.value()] = true;
   68|  1.12M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  3.26M|  inline TraversalObserverT &traversal_observer() {
   75|  3.26M|    return traversal_observer_;
   76|  3.26M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  4.49M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  4.49M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 108k, False: 4.38M]
  ------------------
   47|   108k|      return true;  // Invalid faces are always considered as visited.
   48|   108k|    }
   49|  4.38M|    return is_face_visited_[face_id.value()];
   50|  4.49M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.13M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.13M|    is_face_visited_[face_id.value()] = true;
   62|  2.13M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  1.63k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  1.63k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    819|                    TraversalObserver traversal_observer) {
   37|    819|    corner_table_ = corner_table;
   38|    819|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    819|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    819|    traversal_observer_ = traversal_observer;
   41|    819|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.37M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.37M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.37M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.37M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.37M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  14.0M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.88M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.88M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.88M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.88M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.88M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  4.29M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  4.29M|    return is_vertex_visited_[vert_id.value()];
   65|  4.29M|  }
_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.79M|  inline TraversalObserverT &traversal_observer() {
   75|  5.79M|    return traversal_observer_;
   76|  5.79M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  4.37M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  4.37M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 2.41M, False: 1.96M]
  ------------------
   47|  2.41M|      return true;  // Invalid faces are always considered as visited.
   48|  2.41M|    }
   49|  1.96M|    return is_face_visited_[face_id.value()];
   50|  4.37M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  1.88M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  1.88M|    is_face_visited_[face_id.value()] = true;
   62|  1.88M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  1.65k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    826|                    TraversalObserver traversal_observer) {
   37|    826|    corner_table_ = corner_table;
   38|    826|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    826|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    826|    traversal_observer_ = traversal_observer;
   41|    826|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_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: 4, False: 85]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|     85|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 78]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|     78|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 77]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     77|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 50, False: 27]
  ------------------
  196|     50|    return true;
  197|     50|  }
  198|     27|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 25]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|     25|  num_decoded_points_ = 0;
  202|       |
  203|     25|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 23]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     23|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 22]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     22|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 21]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     21|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 21]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     21|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 16, False: 5]
  ------------------
  217|     16|    return false;
  218|     16|  }
  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|     21|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     21|    uint32_t num_points, OutputIteratorT &oit) {
  254|     21|  typedef DecodingStatus Status;
  255|     21|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     21|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     21|  DecodingStatus init_status(num_points, 0, 0);
  258|     21|  std::stack<Status> status_stack;
  259|     21|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  30.6k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 30.6k, False: 5]
  ------------------
  263|  30.6k|    const DecodingStatus status = status_stack.top();
  264|  30.6k|    status_stack.pop();
  265|       |
  266|  30.6k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  30.6k|    const uint32_t last_axis = status.last_axis;
  268|  30.6k|    const uint32_t stack_pos = status.stack_pos;
  269|  30.6k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  30.6k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  30.6k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 30.6k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  30.6k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  30.6k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 30.6k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  30.6k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  30.6k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 12.9k, False: 17.7k]
  ------------------
  285|  17.5M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 17.5M, False: 12.9k]
  ------------------
  286|  17.5M|        *oit = old_base;
  287|  17.5M|        ++oit;
  288|  17.5M|        ++num_decoded_points_;
  289|  17.5M|      }
  290|  12.9k|      continue;
  291|  12.9k|    }
  292|       |
  293|  17.7k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  17.7k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 2.14k, False: 15.5k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  2.14k|      axes_[0] = axis;
  300|  6.82k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 4.68k, False: 2.14k]
  ------------------
  301|  4.68k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  4.68k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.32k, False: 3.36k]
  |  |  ------------------
  ------------------
  302|  4.68k|      }
  303|  5.71k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.57k, False: 2.14k]
  ------------------
  304|  14.3k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 10.7k, False: 3.56k]
  ------------------
  305|  10.7k|          p_[axes_[j]] = 0;
  306|  10.7k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  10.7k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 9.55k, False: 1.24k]
  ------------------
  308|  9.55k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 5, False: 9.54k]
  ------------------
  309|  9.55k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      5|              return false;
  311|      5|            }
  312|  9.55k|          }
  313|  10.7k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  10.7k|        }
  315|  3.56k|        *oit = p_;
  316|  3.56k|        ++oit;
  317|  3.56k|        ++num_decoded_points_;
  318|  3.56k|      }
  319|  2.14k|      continue;
  320|  2.14k|    }
  321|       |
  322|  15.5k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 15.5k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  15.5k|    const int num_remaining_bits = bit_length_ - level;
  327|  15.5k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  15.5k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  15.5k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  15.5k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  15.5k|    uint32_t number = 0;
  334|  15.5k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  15.5k|    uint32_t first_half = num_remaining_points / 2;
  337|  15.5k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 11, False: 15.5k]
  ------------------
  338|       |      // Invalid |number|.
  339|     11|      return false;
  340|     11|    }
  341|  15.5k|    first_half -= number;
  342|  15.5k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  15.5k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 5.84k, False: 9.72k]
  ------------------
  345|  5.84k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 4.78k, False: 1.05k]
  ------------------
  346|  4.78k|        std::swap(first_half, second_half);
  347|  4.78k|      }
  348|  5.84k|    }
  349|       |
  350|  15.5k|    levels_stack_[stack_pos][axis] += 1;
  351|  15.5k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  15.5k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 15.5k, False: 57]
  ------------------
  353|  15.5k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  15.5k|    }
  355|  15.5k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 15.3k, False: 179]
  ------------------
  356|  15.3k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  15.3k|    }
  358|  15.5k|  }
  359|      5|  return true;
  360|     21|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  1.62M|        : num_remaining_points(num_remaining_points_),
  135|  1.62M|          last_axis(last_axis_),
  136|  1.62M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|   813k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   813k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   813k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     50|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    129|      : bit_length_(0),
   87|    129|        num_points_(0),
   88|    129|        num_decoded_points_(0),
   89|    129|        dimension_(dimension),
   90|    129|        p_(dimension, 0),
   91|    129|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    129|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    129|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     32|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     32|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 31]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     31|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 28]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     28|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 28]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     28|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 27]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     27|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 1, False: 26]
  ------------------
  199|      1|    return false;
  200|      1|  }
  201|     26|  num_decoded_points_ = 0;
  202|       |
  203|     26|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 24]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     24|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 21]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     21|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 21]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     21|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 21]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     21|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 15, False: 6]
  ------------------
  217|     15|    return false;
  218|     15|  }
  219|       |
  220|      6|  numbers_decoder_.EndDecoding();
  221|      6|  remaining_bits_decoder_.EndDecoding();
  222|      6|  axis_decoder_.EndDecoding();
  223|      6|  half_decoder_.EndDecoding();
  224|       |
  225|      6|  return true;
  226|     21|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     21|    uint32_t num_points, OutputIteratorT &oit) {
  254|     21|  typedef DecodingStatus Status;
  255|     21|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     21|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     21|  DecodingStatus init_status(num_points, 0, 0);
  258|     21|  std::stack<Status> status_stack;
  259|     21|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.16M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.16M, False: 6]
  ------------------
  263|  1.16M|    const DecodingStatus status = status_stack.top();
  264|  1.16M|    status_stack.pop();
  265|       |
  266|  1.16M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.16M|    const uint32_t last_axis = status.last_axis;
  268|  1.16M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.16M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.16M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.16M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.16M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.16M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.16M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.16M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.16M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.16M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 582k, False: 584k]
  ------------------
  285|  14.5M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 13.9M, False: 582k]
  ------------------
  286|  13.9M|        *oit = old_base;
  287|  13.9M|        ++oit;
  288|  13.9M|        ++num_decoded_points_;
  289|  13.9M|      }
  290|   582k|      continue;
  291|   582k|    }
  292|       |
  293|   584k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   584k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.07k, False: 583k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.07k|      axes_[0] = axis;
  300|  7.66k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 6.58k, False: 1.07k]
  ------------------
  301|  6.58k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  6.58k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 339, False: 6.24k]
  |  |  ------------------
  ------------------
  302|  6.58k|      }
  303|  2.94k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.87k, False: 1.07k]
  ------------------
  304|  14.9k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 13.1k, False: 1.86k]
  ------------------
  305|  13.1k|          p_[axes_[j]] = 0;
  306|  13.1k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  13.1k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.29k, False: 8.80k]
  ------------------
  308|  4.29k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 3, False: 4.29k]
  ------------------
  309|  4.29k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      3|              return false;
  311|      3|            }
  312|  4.29k|          }
  313|  13.1k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  13.1k|        }
  315|  1.86k|        *oit = p_;
  316|  1.86k|        ++oit;
  317|  1.86k|        ++num_decoded_points_;
  318|  1.86k|      }
  319|  1.07k|      continue;
  320|  1.07k|    }
  321|       |
  322|   583k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 583k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   583k|    const int num_remaining_bits = bit_length_ - level;
  327|   583k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   583k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   583k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   583k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   583k|    uint32_t number = 0;
  334|   583k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   583k|    uint32_t first_half = num_remaining_points / 2;
  337|   583k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 12, False: 583k]
  ------------------
  338|       |      // Invalid |number|.
  339|     12|      return false;
  340|     12|    }
  341|   583k|    first_half -= number;
  342|   583k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   583k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 304k, False: 278k]
  ------------------
  345|   304k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 300k, False: 3.86k]
  ------------------
  346|   300k|        std::swap(first_half, second_half);
  347|   300k|      }
  348|   304k|    }
  349|       |
  350|   583k|    levels_stack_[stack_pos][axis] += 1;
  351|   583k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   583k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 583k, False: 36]
  ------------------
  353|   583k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   583k|    }
  355|   583k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 583k, False: 151]
  ------------------
  356|   583k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   583k|    }
  358|   583k|  }
  359|      6|  return true;
  360|     21|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  5.08M|        : num_remaining_points(num_remaining_points_),
  135|  5.08M|          last_axis(last_axis_),
  136|  5.08M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  5.08M|    uint32_t last_axis) {
  232|  5.08M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 5.08M, Folded]
  ------------------
  233|  5.08M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  5.08M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.19M, False: 2.88M]
  |  |  ------------------
  ------------------
  234|  5.08M|  }
  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|  5.08M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  2.54M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.54M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.54M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|      1|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     33|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     33|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 33]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     33|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 30]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     30|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 30]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     30|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 7, False: 23]
  ------------------
  196|      7|    return true;
  197|      7|  }
  198|     23|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 3, False: 20]
  ------------------
  199|      3|    return false;
  200|      3|  }
  201|     20|  num_decoded_points_ = 0;
  202|       |
  203|     20|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 18]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     18|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 15]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     15|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 14]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     14|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 14]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     14|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 14, False: 0]
  ------------------
  217|     14|    return false;
  218|     14|  }
  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|     14|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     14|    uint32_t num_points, OutputIteratorT &oit) {
  254|     14|  typedef DecodingStatus Status;
  255|     14|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     14|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     14|  DecodingStatus init_status(num_points, 0, 0);
  258|     14|  std::stack<Status> status_stack;
  259|     14|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  23.6k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 23.6k, False: 0]
  ------------------
  263|  23.6k|    const DecodingStatus status = status_stack.top();
  264|  23.6k|    status_stack.pop();
  265|       |
  266|  23.6k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  23.6k|    const uint32_t last_axis = status.last_axis;
  268|  23.6k|    const uint32_t stack_pos = status.stack_pos;
  269|  23.6k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  23.6k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  23.6k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 23.6k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  23.6k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  23.6k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 23.6k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  23.6k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  23.6k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.27k, False: 22.4k]
  ------------------
  285|  5.74k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 4.47k, False: 1.27k]
  ------------------
  286|  4.47k|        *oit = old_base;
  287|  4.47k|        ++oit;
  288|  4.47k|        ++num_decoded_points_;
  289|  4.47k|      }
  290|  1.27k|      continue;
  291|  1.27k|    }
  292|       |
  293|  22.4k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  22.4k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 97, False: 22.3k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     97|      axes_[0] = axis;
  300|    327|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 230, False: 97]
  ------------------
  301|    230|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    230|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 21, False: 209]
  |  |  ------------------
  ------------------
  302|    230|      }
  303|    259|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 167, False: 92]
  ------------------
  304|    703|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 541, False: 162]
  ------------------
  305|    541|          p_[axes_[j]] = 0;
  306|    541|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|    541|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 512, False: 29]
  ------------------
  308|    512|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 5, False: 507]
  ------------------
  309|    512|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      5|              return false;
  311|      5|            }
  312|    512|          }
  313|    536|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|    536|        }
  315|    162|        *oit = p_;
  316|    162|        ++oit;
  317|    162|        ++num_decoded_points_;
  318|    162|      }
  319|     92|      continue;
  320|     97|    }
  321|       |
  322|  22.3k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 22.3k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  22.3k|    const int num_remaining_bits = bit_length_ - level;
  327|  22.3k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  22.3k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  22.3k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  22.3k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  22.3k|    uint32_t number = 0;
  334|  22.3k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  22.3k|    uint32_t first_half = num_remaining_points / 2;
  337|  22.3k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 9, False: 22.3k]
  ------------------
  338|       |      // Invalid |number|.
  339|      9|      return false;
  340|      9|    }
  341|  22.3k|    first_half -= number;
  342|  22.3k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  22.3k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 21.5k, False: 753]
  ------------------
  345|  21.5k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 19.1k, False: 2.41k]
  ------------------
  346|  19.1k|        std::swap(first_half, second_half);
  347|  19.1k|      }
  348|  21.5k|    }
  349|       |
  350|  22.3k|    levels_stack_[stack_pos][axis] += 1;
  351|  22.3k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  22.3k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 19.9k, False: 2.33k]
  ------------------
  353|  19.9k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  19.9k|    }
  355|  22.3k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 3.82k, False: 18.4k]
  ------------------
  356|  3.82k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  3.82k|    }
  358|  22.3k|  }
  359|      0|  return true;
  360|     14|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  52.1k|        : num_remaining_points(num_remaining_points_),
  135|  52.1k|          last_axis(last_axis_),
  136|  52.1k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  36.5k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  36.5k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  36.5k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|      7|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|     86|      : bit_length_(0),
   87|     86|        num_points_(0),
   88|     86|        num_decoded_points_(0),
   89|     86|        dimension_(dimension),
   90|     86|        p_(dimension, 0),
   91|     86|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     86|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     86|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     31|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     31|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 31]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     31|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 5, False: 26]
  ------------------
  190|      5|    return false;
  191|      5|  }
  192|     26|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 26]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     26|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 8, False: 18]
  ------------------
  196|      8|    return true;
  197|      8|  }
  198|     18|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 1, False: 17]
  ------------------
  199|      1|    return false;
  200|      1|  }
  201|     17|  num_decoded_points_ = 0;
  202|       |
  203|     17|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 17]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|     17|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 15]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     15|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 15]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     15|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 15]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     15|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 15, False: 0]
  ------------------
  217|     15|    return false;
  218|     15|  }
  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|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     15|    uint32_t num_points, OutputIteratorT &oit) {
  254|     15|  typedef DecodingStatus Status;
  255|     15|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     15|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     15|  DecodingStatus init_status(num_points, 0, 0);
  258|     15|  std::stack<Status> status_stack;
  259|     15|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  17.0k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 17.0k, False: 0]
  ------------------
  263|  17.0k|    const DecodingStatus status = status_stack.top();
  264|  17.0k|    status_stack.pop();
  265|       |
  266|  17.0k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  17.0k|    const uint32_t last_axis = status.last_axis;
  268|  17.0k|    const uint32_t stack_pos = status.stack_pos;
  269|  17.0k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  17.0k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  17.0k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 17.0k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  17.0k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  17.0k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 17.0k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  17.0k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  17.0k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 27, False: 17.0k]
  ------------------
  285|  3.65k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 3.62k, False: 27]
  ------------------
  286|  3.62k|        *oit = old_base;
  287|  3.62k|        ++oit;
  288|  3.62k|        ++num_decoded_points_;
  289|  3.62k|      }
  290|     27|      continue;
  291|     27|    }
  292|       |
  293|  17.0k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  17.0k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.13k, False: 15.9k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.13k|      axes_[0] = axis;
  300|  2.33k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.20k, False: 1.13k]
  ------------------
  301|  1.20k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.20k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 600, False: 602]
  |  |  ------------------
  ------------------
  302|  1.20k|      }
  303|  2.95k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.81k, False: 1.13k]
  ------------------
  304|  5.55k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.73k, False: 1.81k]
  ------------------
  305|  3.73k|          p_[axes_[j]] = 0;
  306|  3.73k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.73k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.70k, False: 33]
  ------------------
  308|  3.70k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 1, False: 3.70k]
  ------------------
  309|  3.70k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      1|              return false;
  311|      1|            }
  312|  3.70k|          }
  313|  3.73k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  3.73k|        }
  315|  1.81k|        *oit = p_;
  316|  1.81k|        ++oit;
  317|  1.81k|        ++num_decoded_points_;
  318|  1.81k|      }
  319|  1.13k|      continue;
  320|  1.13k|    }
  321|       |
  322|  15.9k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 15.9k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  15.9k|    const int num_remaining_bits = bit_length_ - level;
  327|  15.9k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  15.9k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  15.9k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  15.9k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  15.9k|    uint32_t number = 0;
  334|  15.9k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  15.9k|    uint32_t first_half = num_remaining_points / 2;
  337|  15.9k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 14, False: 15.8k]
  ------------------
  338|       |      // Invalid |number|.
  339|     14|      return false;
  340|     14|    }
  341|  15.8k|    first_half -= number;
  342|  15.8k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  15.8k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 15.4k, False: 403]
  ------------------
  345|  15.4k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 13.7k, False: 1.72k]
  ------------------
  346|  13.7k|        std::swap(first_half, second_half);
  347|  13.7k|      }
  348|  15.4k|    }
  349|       |
  350|  15.8k|    levels_stack_[stack_pos][axis] += 1;
  351|  15.8k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  15.8k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 14.2k, False: 1.66k]
  ------------------
  353|  14.2k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  14.2k|    }
  355|  15.8k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 3.00k, False: 12.8k]
  ------------------
  356|  3.00k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  3.00k|    }
  358|  15.8k|  }
  359|      0|  return true;
  360|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  52.1k|        : num_remaining_points(num_remaining_points_),
  135|  52.1k|          last_axis(last_axis_),
  136|  52.1k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  50.9k|    uint32_t last_axis) {
  232|  50.9k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 50.9k, Folded]
  ------------------
  233|  50.9k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  50.9k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 11.4k, False: 39.4k]
  |  |  ------------------
  ------------------
  234|  50.9k|  }
  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|  50.9k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  33.4k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  33.4k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  33.4k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|      8|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    115|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    115|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 115]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    115|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 4, False: 111]
  ------------------
  190|      4|    return false;
  191|      4|  }
  192|    111|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 111]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    111|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 18, False: 93]
  ------------------
  196|     18|    return true;
  197|     18|  }
  198|     93|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 3, False: 90]
  ------------------
  199|      3|    return false;
  200|      3|  }
  201|     90|  num_decoded_points_ = 0;
  202|       |
  203|     90|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 88]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     88|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 88]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     88|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 4, False: 84]
  ------------------
  210|      4|    return false;
  211|      4|  }
  212|     84|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 83]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     83|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 59, False: 24]
  ------------------
  217|     59|    return false;
  218|     59|  }
  219|       |
  220|     24|  numbers_decoder_.EndDecoding();
  221|     24|  remaining_bits_decoder_.EndDecoding();
  222|     24|  axis_decoder_.EndDecoding();
  223|     24|  half_decoder_.EndDecoding();
  224|       |
  225|     24|  return true;
  226|     83|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     83|    uint32_t num_points, OutputIteratorT &oit) {
  254|     83|  typedef DecodingStatus Status;
  255|     83|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     83|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     83|  DecodingStatus init_status(num_points, 0, 0);
  258|     83|  std::stack<Status> status_stack;
  259|     83|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.95M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.95M, False: 24]
  ------------------
  263|  2.95M|    const DecodingStatus status = status_stack.top();
  264|  2.95M|    status_stack.pop();
  265|       |
  266|  2.95M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.95M|    const uint32_t last_axis = status.last_axis;
  268|  2.95M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.95M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.95M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.95M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.95M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.95M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.95M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.95M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.95M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.95M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.38M, False: 1.56M]
  ------------------
  285|  69.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 67.7M, False: 1.38M]
  ------------------
  286|  67.7M|        *oit = old_base;
  287|  67.7M|        ++oit;
  288|  67.7M|        ++num_decoded_points_;
  289|  67.7M|      }
  290|  1.38M|      continue;
  291|  1.38M|    }
  292|       |
  293|  1.56M|    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.56M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 73.7k, False: 1.49M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  73.7k|      axes_[0] = axis;
  300|   121k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 47.9k, False: 73.7k]
  ------------------
  301|  47.9k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  47.9k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 17.5k, False: 30.4k]
  |  |  ------------------
  ------------------
  302|  47.9k|      }
  303|   186k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 112k, False: 73.6k]
  ------------------
  304|   290k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 177k, False: 112k]
  ------------------
  305|   177k|          p_[axes_[j]] = 0;
  306|   177k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   177k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 156k, False: 20.9k]
  ------------------
  308|   156k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 47, False: 156k]
  ------------------
  309|   156k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     47|              return false;
  311|     47|            }
  312|   156k|          }
  313|   177k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   177k|        }
  315|   112k|        *oit = p_;
  316|   112k|        ++oit;
  317|   112k|        ++num_decoded_points_;
  318|   112k|      }
  319|  73.6k|      continue;
  320|  73.7k|    }
  321|       |
  322|  1.49M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.49M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.49M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.49M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.49M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.49M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.49M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.49M|    uint32_t number = 0;
  334|  1.49M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.49M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.49M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 12, False: 1.49M]
  ------------------
  338|       |      // Invalid |number|.
  339|     12|      return false;
  340|     12|    }
  341|  1.49M|    first_half -= number;
  342|  1.49M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.49M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.44M, False: 45.4k]
  ------------------
  345|  1.44M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.41M, False: 28.9k]
  ------------------
  346|  1.41M|        std::swap(first_half, second_half);
  347|  1.41M|      }
  348|  1.44M|    }
  349|       |
  350|  1.49M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.49M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.49M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.47M, False: 10.9k]
  ------------------
  353|  1.47M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.47M|    }
  355|  1.49M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.47M, False: 19.5k]
  ------------------
  356|  1.47M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.47M|    }
  358|  1.49M|  }
  359|     24|  return true;
  360|     83|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  2.95M|        : num_remaining_points(num_remaining_points_),
  135|  2.95M|          last_axis(last_axis_),
  136|  2.95M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  1.49M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.49M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.49M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     42|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    130|      : bit_length_(0),
   87|    130|        num_points_(0),
   88|    130|        num_decoded_points_(0),
   89|    130|        dimension_(dimension),
   90|    130|        p_(dimension, 0),
   91|    130|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    130|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    130|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    114|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    114|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 114]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    114|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 112]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|    112|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 112]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    112|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 3, False: 109]
  ------------------
  196|      3|    return true;
  197|      3|  }
  198|    109|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 4, False: 105]
  ------------------
  199|      4|    return false;
  200|      4|  }
  201|    105|  num_decoded_points_ = 0;
  202|       |
  203|    105|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 12, False: 93]
  ------------------
  204|     12|    return false;
  205|     12|  }
  206|     93|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 5, False: 88]
  ------------------
  207|      5|    return false;
  208|      5|  }
  209|     88|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 86]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     86|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 83]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     83|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 50, False: 33]
  ------------------
  217|     50|    return false;
  218|     50|  }
  219|       |
  220|     33|  numbers_decoder_.EndDecoding();
  221|     33|  remaining_bits_decoder_.EndDecoding();
  222|     33|  axis_decoder_.EndDecoding();
  223|     33|  half_decoder_.EndDecoding();
  224|       |
  225|     33|  return true;
  226|     83|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     83|    uint32_t num_points, OutputIteratorT &oit) {
  254|     83|  typedef DecodingStatus Status;
  255|     83|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     83|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     83|  DecodingStatus init_status(num_points, 0, 0);
  258|     83|  std::stack<Status> status_stack;
  259|     83|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.01M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.01M, False: 33]
  ------------------
  263|  2.01M|    const DecodingStatus status = status_stack.top();
  264|  2.01M|    status_stack.pop();
  265|       |
  266|  2.01M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.01M|    const uint32_t last_axis = status.last_axis;
  268|  2.01M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.01M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.01M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.01M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.01M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.01M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.01M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.01M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.01M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.01M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 928k, False: 1.08M]
  ------------------
  285|  91.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 90.8M, False: 928k]
  ------------------
  286|  90.8M|        *oit = old_base;
  287|  90.8M|        ++oit;
  288|  90.8M|        ++num_decoded_points_;
  289|  90.8M|      }
  290|   928k|      continue;
  291|   928k|    }
  292|       |
  293|  1.08M|    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.08M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 64.1k, False: 1.02M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  64.1k|      axes_[0] = axis;
  300|   203k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 139k, False: 64.1k]
  ------------------
  301|   139k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   139k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 19.3k, False: 120k]
  |  |  ------------------
  ------------------
  302|   139k|      }
  303|   158k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 94.7k, False: 64.0k]
  ------------------
  304|   415k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 320k, False: 94.7k]
  ------------------
  305|   320k|          p_[axes_[j]] = 0;
  306|   320k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   320k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 148k, False: 172k]
  ------------------
  308|   148k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 48, False: 148k]
  ------------------
  309|   148k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     48|              return false;
  311|     48|            }
  312|   148k|          }
  313|   320k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   320k|        }
  315|  94.7k|        *oit = p_;
  316|  94.7k|        ++oit;
  317|  94.7k|        ++num_decoded_points_;
  318|  94.7k|      }
  319|  64.0k|      continue;
  320|  64.1k|    }
  321|       |
  322|  1.02M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.02M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.02M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.02M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.02M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.02M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.02M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.02M|    uint32_t number = 0;
  334|  1.02M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.02M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.02M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 2, False: 1.02M]
  ------------------
  338|       |      // Invalid |number|.
  339|      2|      return false;
  340|      2|    }
  341|  1.02M|    first_half -= number;
  342|  1.02M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.02M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 993k, False: 30.7k]
  ------------------
  345|   993k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 954k, False: 38.7k]
  ------------------
  346|   954k|        std::swap(first_half, second_half);
  347|   954k|      }
  348|   993k|    }
  349|       |
  350|  1.02M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.02M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.02M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.01M, False: 12.2k]
  ------------------
  353|  1.01M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.01M|    }
  355|  1.02M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.00M, False: 18.5k]
  ------------------
  356|  1.00M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.00M|    }
  358|  1.02M|  }
  359|     33|  return true;
  360|     83|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  2.01M|        : num_remaining_points(num_remaining_points_),
  135|  2.01M|          last_axis(last_axis_),
  136|  2.01M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.01M|    uint32_t last_axis) {
  232|  2.01M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.01M, Folded]
  ------------------
  233|  2.01M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.01M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 894k, False: 1.12M]
  |  |  ------------------
  ------------------
  234|  2.01M|  }
  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.01M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.02M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.02M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.02M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     36|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     91|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     91|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 91]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     91|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 91]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     91|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 91]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     91|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 8, False: 83]
  ------------------
  196|      8|    return true;
  197|      8|  }
  198|     83|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 81]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|     81|  num_decoded_points_ = 0;
  202|       |
  203|     81|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 79]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     79|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 78]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     78|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 77]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     77|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 76]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     76|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 63, False: 13]
  ------------------
  217|     63|    return false;
  218|     63|  }
  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|     76|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     76|    uint32_t num_points, OutputIteratorT &oit) {
  254|     76|  typedef DecodingStatus Status;
  255|     76|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     76|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     76|  DecodingStatus init_status(num_points, 0, 0);
  258|     76|  std::stack<Status> status_stack;
  259|     76|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   171k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 171k, False: 13]
  ------------------
  263|   171k|    const DecodingStatus status = status_stack.top();
  264|   171k|    status_stack.pop();
  265|       |
  266|   171k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   171k|    const uint32_t last_axis = status.last_axis;
  268|   171k|    const uint32_t stack_pos = status.stack_pos;
  269|   171k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   171k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   171k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 171k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   171k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   171k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 6, False: 171k]
  ------------------
  278|      6|      return false;
  279|      6|    }
  280|       |
  281|   171k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   171k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 455, False: 170k]
  ------------------
  285|  60.2k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 59.8k, False: 455]
  ------------------
  286|  59.8k|        *oit = old_base;
  287|  59.8k|        ++oit;
  288|  59.8k|        ++num_decoded_points_;
  289|  59.8k|      }
  290|    455|      continue;
  291|    455|    }
  292|       |
  293|   170k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   170k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 580, False: 170k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    580|      axes_[0] = axis;
  300|  41.8k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 41.2k, False: 580]
  ------------------
  301|  41.2k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  41.2k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 563, False: 40.6k]
  |  |  ------------------
  ------------------
  302|  41.2k|      }
  303|  1.30k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 765, False: 543]
  ------------------
  304|  52.3k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 51.5k, False: 728]
  ------------------
  305|  51.5k|          p_[axes_[j]] = 0;
  306|  51.5k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  51.5k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 51.4k, False: 153]
  ------------------
  308|  51.4k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 37, False: 51.3k]
  ------------------
  309|  51.4k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     37|              return false;
  311|     37|            }
  312|  51.4k|          }
  313|  51.5k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  51.5k|        }
  315|    728|        *oit = p_;
  316|    728|        ++oit;
  317|    728|        ++num_decoded_points_;
  318|    728|      }
  319|    543|      continue;
  320|    580|    }
  321|       |
  322|   170k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 170k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   170k|    const int num_remaining_bits = bit_length_ - level;
  327|   170k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   170k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   170k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   170k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   170k|    uint32_t number = 0;
  334|   170k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   170k|    uint32_t first_half = num_remaining_points / 2;
  337|   170k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 20, False: 170k]
  ------------------
  338|       |      // Invalid |number|.
  339|     20|      return false;
  340|     20|    }
  341|   170k|    first_half -= number;
  342|   170k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   170k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 170k, False: 63]
  ------------------
  345|   170k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 124k, False: 46.1k]
  ------------------
  346|   124k|        std::swap(first_half, second_half);
  347|   124k|      }
  348|   170k|    }
  349|       |
  350|   170k|    levels_stack_[stack_pos][axis] += 1;
  351|   170k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   170k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 124k, False: 45.7k]
  ------------------
  353|   124k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   124k|    }
  355|   170k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 46.9k, False: 123k]
  ------------------
  356|  46.9k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  46.9k|    }
  358|   170k|  }
  359|     13|  return true;
  360|     76|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   171k|        : num_remaining_points(num_remaining_points_),
  135|   171k|          last_axis(last_axis_),
  136|   171k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   170k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   170k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   170k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     21|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|     95|      : bit_length_(0),
   87|     95|        num_points_(0),
   88|     95|        num_decoded_points_(0),
   89|     95|        dimension_(dimension),
   90|     95|        p_(dimension, 0),
   91|     95|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     95|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     95|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     24|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     24|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     24|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|     67|      : bit_length_(0),
   87|     67|        num_points_(0),
   88|     67|        num_decoded_points_(0),
   89|     67|        dimension_(dimension),
   90|     67|        p_(dimension, 0),
   91|     67|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     67|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     67|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     25|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     25|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     25|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      6|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      6|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      6|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|     92|      : bit_length_(0),
   87|     92|        num_points_(0),
   88|     92|        num_decoded_points_(0),
   89|     92|        dimension_(dimension),
   90|     92|        p_(dimension, 0),
   91|     92|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     92|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     92|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     11|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     11|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     11|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    117|      : bit_length_(0),
   87|    117|        num_points_(0),
   88|    117|        num_decoded_points_(0),
   89|    117|        dimension_(dimension),
   90|    117|        p_(dimension, 0),
   91|    117|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    117|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    117|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.62M|    uint32_t last_axis) {
  232|  1.62M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.62M, Folded]
  ------------------
  233|  1.62M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.62M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 464k, False: 1.16M]
  |  |  ------------------
  ------------------
  234|  1.62M|  }
  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.62M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  51.2k|    uint32_t last_axis) {
  232|  51.2k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 51.2k, Folded]
  ------------------
  233|  51.2k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  51.2k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 9.34k, False: 41.8k]
  |  |  ------------------
  ------------------
  234|  51.2k|  }
  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|  51.2k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.95M|    uint32_t last_axis) {
  232|  2.95M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.95M, Folded]
  ------------------
  233|  2.95M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.95M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.82M, False: 129k]
  |  |  ------------------
  ------------------
  234|  2.95M|  }
  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.95M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   171k|    uint32_t last_axis) {
  232|   171k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 171k]
  ------------------
  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|   171k|  uint32_t best_axis = 0;
  237|   171k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 170k, False: 593]
  ------------------
  238|  20.6M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 20.4M, False: 170k]
  ------------------
  239|  20.4M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 203k, False: 20.2M]
  ------------------
  240|   203k|        best_axis = axis;
  241|   203k|      }
  242|  20.4M|    }
  243|   170k|  } else {
  244|    593|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|    593|  }
  246|       |
  247|   171k|  return best_axis;
  248|   171k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     40|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     40|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     40|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     40|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     40|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 40]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     40|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 40]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     40|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 40]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     40|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 40]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     40|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 40]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     40|  num_decoded_points_ = 0;
  202|       |
  203|     40|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 39]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|     39|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 37]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     37|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 37]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     37|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 37]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     37|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 26, False: 11]
  ------------------
  217|     26|    return false;
  218|     26|  }
  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|     37|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     37|    uint32_t num_points, OutputIteratorT &oit) {
  254|     37|  typedef DecodingStatus Status;
  255|     37|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     37|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     37|  DecodingStatus init_status(num_points, 0, 0);
  258|     37|  std::stack<Status> status_stack;
  259|     37|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.59M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.59M, False: 11]
  ------------------
  263|  1.59M|    const DecodingStatus status = status_stack.top();
  264|  1.59M|    status_stack.pop();
  265|       |
  266|  1.59M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.59M|    const uint32_t last_axis = status.last_axis;
  268|  1.59M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.59M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.59M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.59M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.59M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.59M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.59M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.59M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.59M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.59M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 795k, False: 798k]
  ------------------
  285|   110M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 110M, False: 795k]
  ------------------
  286|   110M|        *oit = old_base;
  287|   110M|        ++oit;
  288|   110M|        ++num_decoded_points_;
  289|   110M|      }
  290|   795k|      continue;
  291|   795k|    }
  292|       |
  293|   798k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   798k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.26k, False: 797k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.26k|      axes_[0] = axis;
  300|  3.80k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.53k, False: 1.26k]
  ------------------
  301|  2.53k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.53k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 276, False: 2.25k]
  |  |  ------------------
  ------------------
  302|  2.53k|      }
  303|  3.51k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.25k, False: 1.25k]
  ------------------
  304|  8.99k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.75k, False: 2.24k]
  ------------------
  305|  6.75k|          p_[axes_[j]] = 0;
  306|  6.75k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.75k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.10k, False: 3.64k]
  ------------------
  308|  3.10k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 14, False: 3.09k]
  ------------------
  309|  3.10k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     14|              return false;
  311|     14|            }
  312|  3.10k|          }
  313|  6.74k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.74k|        }
  315|  2.24k|        *oit = p_;
  316|  2.24k|        ++oit;
  317|  2.24k|        ++num_decoded_points_;
  318|  2.24k|      }
  319|  1.25k|      continue;
  320|  1.26k|    }
  321|       |
  322|   797k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 797k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   797k|    const int num_remaining_bits = bit_length_ - level;
  327|   797k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   797k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   797k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   797k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   797k|    uint32_t number = 0;
  334|   797k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   797k|    uint32_t first_half = num_remaining_points / 2;
  337|   797k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 12, False: 797k]
  ------------------
  338|       |      // Invalid |number|.
  339|     12|      return false;
  340|     12|    }
  341|   797k|    first_half -= number;
  342|   797k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   797k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 381k, False: 415k]
  ------------------
  345|   381k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 364k, False: 17.4k]
  ------------------
  346|   364k|        std::swap(first_half, second_half);
  347|   364k|      }
  348|   381k|    }
  349|       |
  350|   797k|    levels_stack_[stack_pos][axis] += 1;
  351|   797k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   797k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 797k, False: 63]
  ------------------
  353|   797k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   797k|    }
  355|   797k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 797k, False: 114]
  ------------------
  356|   797k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   797k|    }
  358|   797k|  }
  359|     11|  return true;
  360|     37|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     35|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     35|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     35|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     35|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     35|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 35]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     35|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 33]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|     33|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 33]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     33|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 33]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     33|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 33]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     33|  num_decoded_points_ = 0;
  202|       |
  203|     33|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 33]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|     33|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 33]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     33|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 33]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     33|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 33]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     33|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 23, False: 10]
  ------------------
  217|     23|    return false;
  218|     23|  }
  219|       |
  220|     10|  numbers_decoder_.EndDecoding();
  221|     10|  remaining_bits_decoder_.EndDecoding();
  222|     10|  axis_decoder_.EndDecoding();
  223|     10|  half_decoder_.EndDecoding();
  224|       |
  225|     10|  return true;
  226|     33|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     33|    uint32_t num_points, OutputIteratorT &oit) {
  254|     33|  typedef DecodingStatus Status;
  255|     33|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     33|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     33|  DecodingStatus init_status(num_points, 0, 0);
  258|     33|  std::stack<Status> status_stack;
  259|     33|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.91M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.91M, False: 10]
  ------------------
  263|  3.91M|    const DecodingStatus status = status_stack.top();
  264|  3.91M|    status_stack.pop();
  265|       |
  266|  3.91M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.91M|    const uint32_t last_axis = status.last_axis;
  268|  3.91M|    const uint32_t stack_pos = status.stack_pos;
  269|  3.91M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.91M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.91M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.91M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.91M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.91M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.91M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.91M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.91M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.95M, False: 1.96M]
  ------------------
  285|  29.8M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 27.9M, False: 1.95M]
  ------------------
  286|  27.9M|        *oit = old_base;
  287|  27.9M|        ++oit;
  288|  27.9M|        ++num_decoded_points_;
  289|  27.9M|      }
  290|  1.95M|      continue;
  291|  1.95M|    }
  292|       |
  293|  1.96M|    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.96M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.38k, False: 1.95M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.38k|      axes_[0] = axis;
  300|  4.14k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.76k, False: 1.38k]
  ------------------
  301|  2.76k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.76k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 332, False: 2.43k]
  |  |  ------------------
  ------------------
  302|  2.76k|      }
  303|  3.86k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.50k, False: 1.36k]
  ------------------
  304|  9.96k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 7.47k, False: 2.48k]
  ------------------
  305|  7.47k|          p_[axes_[j]] = 0;
  306|  7.47k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  7.47k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.48k, False: 3.99k]
  ------------------
  308|  3.48k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 16, False: 3.47k]
  ------------------
  309|  3.48k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     16|              return false;
  311|     16|            }
  312|  3.48k|          }
  313|  7.46k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  7.46k|        }
  315|  2.48k|        *oit = p_;
  316|  2.48k|        ++oit;
  317|  2.48k|        ++num_decoded_points_;
  318|  2.48k|      }
  319|  1.36k|      continue;
  320|  1.38k|    }
  321|       |
  322|  1.95M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.95M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.95M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.95M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.95M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.95M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.95M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.95M|    uint32_t number = 0;
  334|  1.95M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.95M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.95M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 7, False: 1.95M]
  ------------------
  338|       |      // Invalid |number|.
  339|      7|      return false;
  340|      7|    }
  341|  1.95M|    first_half -= number;
  342|  1.95M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.95M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.13M, False: 828k]
  ------------------
  345|  1.13M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.12M, False: 2.20k]
  ------------------
  346|  1.12M|        std::swap(first_half, second_half);
  347|  1.12M|      }
  348|  1.13M|    }
  349|       |
  350|  1.95M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.95M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.95M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.95M, False: 79]
  ------------------
  353|  1.95M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.95M|    }
  355|  1.95M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.95M, False: 66]
  ------------------
  356|  1.95M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.95M|    }
  358|  1.95M|  }
  359|     10|  return true;
  360|     33|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     53|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     53|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     53|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     53|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     53|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 53]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     53|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 53]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     53|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 53]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     53|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 53]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     53|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 53]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     53|  num_decoded_points_ = 0;
  202|       |
  203|     53|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 48]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     48|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 48]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     48|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 47]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     47|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 47]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     47|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 43, False: 4]
  ------------------
  217|     43|    return false;
  218|     43|  }
  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|     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|  27.5k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 27.5k, False: 4]
  ------------------
  263|  27.5k|    const DecodingStatus status = status_stack.top();
  264|  27.5k|    status_stack.pop();
  265|       |
  266|  27.5k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  27.5k|    const uint32_t last_axis = status.last_axis;
  268|  27.5k|    const uint32_t stack_pos = status.stack_pos;
  269|  27.5k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  27.5k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  27.5k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 27.5k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  27.5k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  27.5k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 27.5k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  27.5k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  27.5k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 12.2k, False: 15.3k]
  ------------------
  285|  25.8M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 25.8M, False: 12.2k]
  ------------------
  286|  25.8M|        *oit = old_base;
  287|  25.8M|        ++oit;
  288|  25.8M|        ++num_decoded_points_;
  289|  25.8M|      }
  290|  12.2k|      continue;
  291|  12.2k|    }
  292|       |
  293|  15.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|  15.3k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.04k, False: 14.2k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.04k|      axes_[0] = axis;
  300|  3.12k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.08k, False: 1.04k]
  ------------------
  301|  2.08k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.08k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 209, False: 1.87k]
  |  |  ------------------
  ------------------
  302|  2.08k|      }
  303|  2.81k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.77k, False: 1.03k]
  ------------------
  304|  7.10k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 5.32k, False: 1.77k]
  ------------------
  305|  5.32k|          p_[axes_[j]] = 0;
  306|  5.32k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  5.32k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.47k, False: 2.85k]
  ------------------
  308|  2.47k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 6, False: 2.46k]
  ------------------
  309|  2.47k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      6|              return false;
  311|      6|            }
  312|  2.47k|          }
  313|  5.32k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  5.32k|        }
  315|  1.77k|        *oit = p_;
  316|  1.77k|        ++oit;
  317|  1.77k|        ++num_decoded_points_;
  318|  1.77k|      }
  319|  1.03k|      continue;
  320|  1.04k|    }
  321|       |
  322|  14.2k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 14.2k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  14.2k|    const int num_remaining_bits = bit_length_ - level;
  327|  14.2k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  14.2k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  14.2k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  14.2k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  14.2k|    uint32_t number = 0;
  334|  14.2k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  14.2k|    uint32_t first_half = num_remaining_points / 2;
  337|  14.2k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 37, False: 14.2k]
  ------------------
  338|       |      // Invalid |number|.
  339|     37|      return false;
  340|     37|    }
  341|  14.2k|    first_half -= number;
  342|  14.2k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  14.2k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 8.02k, False: 6.20k]
  ------------------
  345|  8.02k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 4.07k, False: 3.95k]
  ------------------
  346|  4.07k|        std::swap(first_half, second_half);
  347|  4.07k|      }
  348|  8.02k|    }
  349|       |
  350|  14.2k|    levels_stack_[stack_pos][axis] += 1;
  351|  14.2k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  14.2k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 14.1k, False: 94]
  ------------------
  353|  14.1k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  14.1k|    }
  355|  14.2k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 14.1k, False: 134]
  ------------------
  356|  14.1k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  14.1k|    }
  358|  14.2k|  }
  359|      4|  return true;
  360|     47|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     61|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     61|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     61|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     61|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     61|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 61]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     61|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 60]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     60|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 60]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     60|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 60]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     60|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 60]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     60|  num_decoded_points_ = 0;
  202|       |
  203|     60|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 57]
  ------------------
  204|      3|    return false;
  205|      3|  }
  206|     57|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 56]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     56|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 54]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     54|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 53]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     53|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 50, False: 3]
  ------------------
  217|     50|    return false;
  218|     50|  }
  219|       |
  220|      3|  numbers_decoder_.EndDecoding();
  221|      3|  remaining_bits_decoder_.EndDecoding();
  222|      3|  axis_decoder_.EndDecoding();
  223|      3|  half_decoder_.EndDecoding();
  224|       |
  225|      3|  return true;
  226|     53|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     53|    uint32_t num_points, OutputIteratorT &oit) {
  254|     53|  typedef DecodingStatus Status;
  255|     53|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     53|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     53|  DecodingStatus init_status(num_points, 0, 0);
  258|     53|  std::stack<Status> status_stack;
  259|     53|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  33.8k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 33.8k, False: 3]
  ------------------
  263|  33.8k|    const DecodingStatus status = status_stack.top();
  264|  33.8k|    status_stack.pop();
  265|       |
  266|  33.8k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  33.8k|    const uint32_t last_axis = status.last_axis;
  268|  33.8k|    const uint32_t stack_pos = status.stack_pos;
  269|  33.8k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  33.8k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  33.8k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 33.8k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  33.8k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  33.8k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 33.8k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  33.8k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  33.8k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 14.6k, False: 19.2k]
  ------------------
  285|  9.03M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 9.01M, False: 14.6k]
  ------------------
  286|  9.01M|        *oit = old_base;
  287|  9.01M|        ++oit;
  288|  9.01M|        ++num_decoded_points_;
  289|  9.01M|      }
  290|  14.6k|      continue;
  291|  14.6k|    }
  292|       |
  293|  19.2k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  19.2k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.64k, False: 17.5k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.64k|      axes_[0] = axis;
  300|  4.94k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 3.29k, False: 1.64k]
  ------------------
  301|  3.29k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  3.29k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 629, False: 2.66k]
  |  |  ------------------
  ------------------
  302|  3.29k|      }
  303|  4.50k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.87k, False: 1.63k]
  ------------------
  304|  11.4k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 8.60k, False: 2.86k]
  ------------------
  305|  8.60k|          p_[axes_[j]] = 0;
  306|  8.60k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  8.60k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 5.67k, False: 2.93k]
  ------------------
  308|  5.67k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 17, False: 5.65k]
  ------------------
  309|  5.67k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     17|              return false;
  311|     17|            }
  312|  5.67k|          }
  313|  8.59k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  8.59k|        }
  315|  2.86k|        *oit = p_;
  316|  2.86k|        ++oit;
  317|  2.86k|        ++num_decoded_points_;
  318|  2.86k|      }
  319|  1.63k|      continue;
  320|  1.64k|    }
  321|       |
  322|  17.5k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 17.5k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  17.5k|    const int num_remaining_bits = bit_length_ - level;
  327|  17.5k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  17.5k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  17.5k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  17.5k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  17.5k|    uint32_t number = 0;
  334|  17.5k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  17.5k|    uint32_t first_half = num_remaining_points / 2;
  337|  17.5k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 33, False: 17.5k]
  ------------------
  338|       |      // Invalid |number|.
  339|     33|      return false;
  340|     33|    }
  341|  17.5k|    first_half -= number;
  342|  17.5k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  17.5k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 10.4k, False: 7.05k]
  ------------------
  345|  10.4k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 7.16k, False: 3.32k]
  ------------------
  346|  7.16k|        std::swap(first_half, second_half);
  347|  7.16k|      }
  348|  10.4k|    }
  349|       |
  350|  17.5k|    levels_stack_[stack_pos][axis] += 1;
  351|  17.5k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  17.5k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 17.4k, False: 72]
  ------------------
  353|  17.4k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  17.4k|    }
  355|  17.5k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 17.3k, False: 183]
  ------------------
  356|  17.3k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  17.3k|    }
  358|  17.5k|  }
  359|      3|  return true;
  360|     53|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     15|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     15|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     15|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     15|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 15]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     15|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 13]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|     13|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 13]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     13|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 13]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     13|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 13]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     13|  num_decoded_points_ = 0;
  202|       |
  203|     13|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 13, False: 0]
  ------------------
  204|     13|    return false;
  205|     13|  }
  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|      3|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      3|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      3|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      3|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      3|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 3]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      3|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 3]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      3|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 3]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      3|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 3]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      3|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 3]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      3|  num_decoded_points_ = 0;
  202|       |
  203|      3|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 0]
  ------------------
  204|      3|    return false;
  205|      3|  }
  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|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      4|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      4|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 4]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      4|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 4]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      4|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 4]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      4|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 4]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      4|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 4]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      4|  num_decoded_points_ = 0;
  202|       |
  203|      4|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 0]
  ------------------
  204|      4|    return false;
  205|      4|  }
  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|    218|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    218|  qinfo_.quantization_bits = 0;
   67|    218|  qinfo_.range = 0;
   68|    218|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    213|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    213|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 213]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|    213|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 0, False: 213]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|    213|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 213]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|    213|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 213]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|    213|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 7, False: 206]
  |  Branch (84:38): [True: 0, False: 7]
  ------------------
   85|      0|    return false;
   86|      0|  }
   87|    213|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 213]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    213|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 2, False: 211]
  ------------------
   93|      2|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      2|#define DRACO_LOGE printf
  ------------------
   94|      2|               compression_level_);
   95|      2|    return false;
   96|      2|  }
   97|       |
   98|    211|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    211|      std::back_inserter(*qpoints);
  100|    211|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    211|                           Converter>
  102|    211|      oit(oit_qpoints);
  103|    211|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 211, False: 0]
  ------------------
  104|    211|    qpoints->reserve(num_points_);
  105|    211|    switch (compression_level_) {
  106|     40|      case 0: {
  ------------------
  |  Branch (106:7): [True: 40, False: 171]
  ------------------
  107|     40|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|     40|        qpoints_decoder.DecodePoints(buffer, oit);
  109|     40|        break;
  110|      0|      }
  111|     35|      case 1: {
  ------------------
  |  Branch (111:7): [True: 35, False: 176]
  ------------------
  112|     35|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     35|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     35|        break;
  115|      0|      }
  116|     53|      case 2: {
  ------------------
  |  Branch (116:7): [True: 53, False: 158]
  ------------------
  117|     53|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     53|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     53|        break;
  120|      0|      }
  121|     61|      case 3: {
  ------------------
  |  Branch (121:7): [True: 61, False: 150]
  ------------------
  122|     61|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|     61|        qpoints_decoder.DecodePoints(buffer, oit);
  124|     61|        break;
  125|      0|      }
  126|     15|      case 4: {
  ------------------
  |  Branch (126:7): [True: 15, False: 196]
  ------------------
  127|     15|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     15|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     15|        break;
  130|      0|      }
  131|      3|      case 5: {
  ------------------
  |  Branch (131:7): [True: 3, False: 208]
  ------------------
  132|      3|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|      3|        qpoints_decoder.DecodePoints(buffer, oit);
  134|      3|        break;
  135|      0|      }
  136|      4|      case 6: {
  ------------------
  |  Branch (136:7): [True: 4, False: 207]
  ------------------
  137|      4|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|      4|        qpoints_decoder.DecodePoints(buffer, oit);
  139|      4|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 211]
  ------------------
  142|      0|        return false;
  143|    211|    }
  144|    211|  }
  145|       |
  146|    211|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 207, False: 4]
  ------------------
  147|    207|    return false;
  148|    207|  }
  149|      4|  return true;
  150|    211|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    211|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   172M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   172M|  const Self &operator=(const SourceType &source) {
   56|   172M|    *oit_ = Converter()(source);
   57|   172M|    return *this;
   58|   172M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   172M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   172M|    return Point3ui(v[0], v[1], v[2]);
   31|   172M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   172M|  const Self &operator++() {
   46|   172M|    ++oit_;
   47|   172M|    return *this;
   48|   172M|  }

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  10.8M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  10.8M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 10.8M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  10.8M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  10.8M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   187M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   187M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 218, False: 187M]
  ------------------
   78|    218|      return false;  // Buffer overflow.
   79|    218|    }
   80|   187M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   187M|    pos_ += size_to_decode;
   82|   187M|    return true;
   83|   187M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  21.7k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  4.41k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  27.3k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   211k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  2.44k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  10.8M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  2.88M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  3.23k|    inline void reset(const void *b, size_t s) {
  131|  3.23k|      bit_offset_ = 0;
  132|  3.23k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  3.23k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  3.23k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  2.87k|    inline uint64_t BitsDecoded() const {
  138|  2.87k|      return static_cast<uint64_t>(bit_offset_);
  139|  2.87k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  10.8M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  10.8M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 10.8M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  10.8M|      uint32_t value = 0;
  165|  25.3M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 14.5M, False: 10.8M]
  ------------------
  166|  14.5M|        value |= GetBit() << bit;
  167|  14.5M|      }
  168|  10.8M|      *x = value;
  169|  10.8M|      return true;
  170|  10.8M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  14.5M|    inline int GetBit() {
  176|  14.5M|      const size_t off = bit_offset_;
  177|  14.5M|      const size_t byte_offset = off >> 3;
  178|  14.5M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  14.5M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 14.3M, False: 141k]
  ------------------
  180|  14.3M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  14.3M|        bit_offset_ = off + 1;
  182|  14.3M|        return bit;
  183|  14.3M|      }
  184|   141k|      return 0;
  185|  14.5M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  7.96M|  bool Decode(T *out_val) {
   69|  7.96M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 932, False: 7.96M]
  ------------------
   70|    932|      return false;
   71|    932|    }
   72|  7.96M|    pos_ += sizeof(T);
   73|  7.96M|    return true;
   74|  7.96M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  7.96M|  bool Peek(T *out_val) {
   88|  7.96M|    const size_t size_to_decode = sizeof(T);
   89|  7.96M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 932, False: 7.96M]
  ------------------
   90|    932|      return false;  // Buffer overflow.
   91|    932|    }
   92|  7.96M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  7.96M|    return true;
   94|  7.96M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  6.68k|  bool Decode(T *out_val) {
   69|  6.68k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 29, False: 6.65k]
  ------------------
   70|     29|      return false;
   71|     29|    }
   72|  6.65k|    pos_ += sizeof(T);
   73|  6.65k|    return true;
   74|  6.68k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  6.68k|  bool Peek(T *out_val) {
   88|  6.68k|    const size_t size_to_decode = sizeof(T);
   89|  6.68k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 29, False: 6.65k]
  ------------------
   90|     29|      return false;  // Buffer overflow.
   91|     29|    }
   92|  6.65k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  6.65k|    return true;
   94|  6.68k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   176k|  bool Decode(T *out_val) {
   69|   176k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 66, False: 176k]
  ------------------
   70|     66|      return false;
   71|     66|    }
   72|   176k|    pos_ += sizeof(T);
   73|   176k|    return true;
   74|   176k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   176k|  bool Peek(T *out_val) {
   88|   176k|    const size_t size_to_decode = sizeof(T);
   89|   176k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 66, False: 176k]
  ------------------
   90|     66|      return false;  // Buffer overflow.
   91|     66|    }
   92|   176k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   176k|    return true;
   94|   176k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  11.9k|  bool Decode(T *out_val) {
   69|  11.9k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 101, False: 11.8k]
  ------------------
   70|    101|      return false;
   71|    101|    }
   72|  11.8k|    pos_ += sizeof(T);
   73|  11.8k|    return true;
   74|  11.9k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  11.9k|  bool Peek(T *out_val) {
   88|  11.9k|    const size_t size_to_decode = sizeof(T);
   89|  11.9k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 101, False: 11.8k]
  ------------------
   90|    101|      return false;  // Buffer overflow.
   91|    101|    }
   92|  11.8k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  11.8k|    return true;
   94|  11.9k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   268k|  bool Decode(T *out_val) {
   69|   268k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 54, False: 268k]
  ------------------
   70|     54|      return false;
   71|     54|    }
   72|   268k|    pos_ += sizeof(T);
   73|   268k|    return true;
   74|   268k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   268k|  bool Peek(T *out_val) {
   88|   268k|    const size_t size_to_decode = sizeof(T);
   89|   268k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 54, False: 268k]
  ------------------
   90|     54|      return false;  // Buffer overflow.
   91|     54|    }
   92|   268k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   268k|    return true;
   94|   268k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  15.2k|  bool Decode(T *out_val) {
   69|  15.2k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 7, False: 15.2k]
  ------------------
   70|      7|      return false;
   71|      7|    }
   72|  15.2k|    pos_ += sizeof(T);
   73|  15.2k|    return true;
   74|  15.2k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  15.2k|  bool Peek(T *out_val) {
   88|  15.2k|    const size_t size_to_decode = sizeof(T);
   89|  15.2k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 7, False: 15.2k]
  ------------------
   90|      7|      return false;  // Buffer overflow.
   91|      7|    }
   92|  15.2k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  15.2k|    return true;
   94|  15.2k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|    920|  bool Decode(T *out_val) {
   69|    920|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 5, False: 915]
  ------------------
   70|      5|      return false;
   71|      5|    }
   72|    915|    pos_ += sizeof(T);
   73|    915|    return true;
   74|    920|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|    920|  bool Peek(T *out_val) {
   88|    920|    const size_t size_to_decode = sizeof(T);
   89|    920|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 5, False: 915]
  ------------------
   90|      5|      return false;  // Buffer overflow.
   91|      5|    }
   92|    915|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    915|    return true;
   94|    920|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    358|  bool Decode(T *out_val) {
   69|    358|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 1, False: 357]
  ------------------
   70|      1|      return false;
   71|      1|    }
   72|    357|    pos_ += sizeof(T);
   73|    357|    return true;
   74|    358|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    358|  bool Peek(T *out_val) {
   88|    358|    const size_t size_to_decode = sizeof(T);
   89|    358|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 1, False: 357]
  ------------------
   90|      1|      return false;  // Buffer overflow.
   91|      1|    }
   92|    357|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    357|    return true;
   94|    358|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   298M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   305M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  4.89M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  4.89M|    return value_ >= val;
  100|  4.89M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   127M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  1.52G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  13.1M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  50.0M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  50.0M|    value_ = i.value_;
  153|  50.0M|    return *this;
  154|  50.0M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   348M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   348M|    value_ = i.value_;
  153|   348M|    return *this;
  154|   348M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  13.1M|  inline ThisIndexType &operator++() {
  103|  13.1M|    ++value_;
  104|  13.1M|    return *this;
  105|  13.1M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  1.13G|  constexpr bool operator==(const IndexType &i) const {
   76|  1.13G|    return value_ == i.value_;
   77|  1.13G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   454M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  5.77k|  constexpr bool operator<(const IndexType &i) const {
   88|  5.77k|    return value_ < i.value_;
   89|  5.77k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|  64.0M|  constexpr bool operator==(const IndexType &i) const {
   76|  64.0M|    return value_ == i.value_;
   77|  64.0M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|  93.7M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|  93.7M|    return ThisIndexType(value_ - val);
  133|  93.7M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   350M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   350M|    return ThisIndexType(value_ + val);
  127|   350M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  8.86M|  constexpr bool operator==(const IndexType &i) const {
   76|  8.86M|    return value_ == i.value_;
   77|  8.86M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   120M|  constexpr bool operator!=(const IndexType &i) const {
   82|   120M|    return value_ != i.value_;
   83|   120M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   168M|  constexpr bool operator!=(const IndexType &i) const {
   82|   168M|    return value_ != i.value_;
   83|   168M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   248M|  inline ThisIndexType &operator++() {
  103|   248M|    ++value_;
  104|   248M|    return *this;
  105|   248M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   205M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   205M|    value_ = i.value_;
  153|   205M|    return *this;
  154|   205M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   483M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   483M|    value_ = i.value_;
  153|   483M|    return *this;
  154|   483M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  24.6M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  24.6M|    return value_ >= val;
  100|  24.6M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  4.65M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   541M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  6.40G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|  90.0M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  4.07G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   101M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  15.7M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  15.7M|    return ThisIndexType(value_ + val);
  127|  15.7M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|  94.0M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  12.5M|  constexpr bool operator<(const IndexType &i) const {
   88|  12.5M|    return value_ < i.value_;
   89|  12.5M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   369M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   348M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  32.5M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   286M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   404M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  2.71M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  2.71M|    value_ = i.value_;
  153|  2.71M|    return *this;
  154|  2.71M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  4.65M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  4.65M|    value_ += val;
  141|  4.65M|    return *this;
  142|  4.65M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  14.7M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  14.7M|    value_ = val;
  157|  14.7M|    return *this;
  158|  14.7M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   333M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  3.84M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  3.83M|  inline ThisIndexType &operator++() {
  103|  3.83M|    ++value_;
  104|  3.83M|    return *this;
  105|  3.83M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  13.1M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|    159|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   203M|  inline ThisIndexType &operator++() {
  103|   203M|    ++value_;
  104|   203M|    return *this;
  105|   203M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|     76|  inline ThisIndexType &operator++() {
  103|     76|    ++value_;
  104|     76|    return *this;
  105|     76|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   245M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   245M|    return value_ >= val;
  100|   245M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  22.1M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  22.1M|    return vector_[index.value()];
   75|  22.1M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  13.1M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  7.16k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  10.4k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  37.7M|  inline reference operator[](const IndexTypeT &index) {
   71|  37.7M|    return vector_[index.value()];
   72|  37.7M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  13.1k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  9.80M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  1.76k|  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|  4.89M|  inline reference operator[](const IndexTypeT &index) {
   71|  4.89M|    return vector_[index.value()];
   72|  4.89M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  13.2M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  13.2M|    return vector_[index.value()];
   75|  13.2M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   101M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  7.34M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   152M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   152M|    return vector_[index.value()];
   75|   152M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   389M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   389M|    return vector_[index.value()];
   75|   389M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   185M|  inline reference operator[](const IndexTypeT &index) {
   71|   185M|    return vector_[index.value()];
   72|   185M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  30.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  30.3M|    return vector_[index.value()];
   75|  30.3M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   151M|  inline reference operator[](const IndexTypeT &index) {
   71|   151M|    return vector_[index.value()];
   72|   151M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  55.2M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   107M|  inline reference operator[](const IndexTypeT &index) {
   71|   107M|    return vector_[index.value()];
   72|   107M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|    754|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|  99.9M|  inline reference operator[](const IndexTypeT &index) {
   71|  99.9M|    return vector_[index.value()];
   72|  99.9M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  18.9k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|   767k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  17.9k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  2.60k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  2.60k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  2.60k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  2.60k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  6.61k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  6.61k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  6.61k|    vector_.swap(arg.vector_);
   57|  6.61k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  6.61k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  6.61k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  6.61k|    vector_.swap(arg.vector_);
   57|  6.61k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  2.60k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  2.60k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  2.60k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  3.62k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  24.1k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  42.7k|int32_t DataTypeLength(DataType dt) {
   20|  42.7k|  switch (dt) {
   21|  13.0k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 13.0k, False: 29.7k]
  ------------------
   22|  15.7k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 2.74k, False: 40.0k]
  ------------------
   23|  15.7k|      return 1;
   24|  2.41k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 2.41k, False: 40.3k]
  ------------------
   25|  7.48k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 5.06k, False: 37.6k]
  ------------------
   26|  7.48k|      return 2;
   27|  15.1k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 15.1k, False: 27.6k]
  ------------------
   28|  16.1k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 967, False: 41.7k]
  ------------------
   29|  16.1k|      return 4;
   30|    305|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 305, False: 42.4k]
  ------------------
   31|    613|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 308, False: 42.4k]
  ------------------
   32|    613|      return 8;
   33|  2.43k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 2.43k, False: 40.3k]
  ------------------
   34|  2.43k|      return 4;
   35|     56|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 56, False: 42.7k]
  ------------------
   36|     56|      return 8;
   37|    272|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 272, False: 42.4k]
  ------------------
   38|    272|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 42.7k]
  ------------------
   40|      0|      return -1;
   41|  42.7k|  }
   42|  42.7k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    794|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  3.62k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  4.41k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  4.41k|  bool ok() const { return status_.ok(); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  4.10k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  4.41k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    317|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|    794|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|    794|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  3.62k|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  3.62k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   358k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   358k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 358k, Folded]
  ------------------
   65|   358k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 280, False: 358k]
  ------------------
   66|    280|      return false;
   67|    280|    }
   68|   358k|  } 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|   358k|  return true;
   77|   358k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  67.1k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  67.1k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  67.1k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 43, False: 67.1k]
  ------------------
   33|     43|    return false;
   34|     43|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  67.1k|  uint8_t in;
   39|  67.1k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 143, False: 66.9k]
  ------------------
   40|    143|    return false;
   41|    143|  }
   42|  66.9k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 8.35k, False: 58.6k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  8.35k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 224, False: 8.13k]
  ------------------
   45|    224|      return false;
   46|    224|    }
   47|       |    // Append decoded info from this byte.
   48|  8.13k|    *out_val <<= 7;
   49|  8.13k|    *out_val |= in & ((1 << 7) - 1);
   50|  58.6k|  } else {
   51|       |    // Last byte reached
   52|  58.6k|    *out_val = in;
   53|  58.6k|  }
   54|  66.7k|  return true;
   55|  66.9k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  30.2k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  30.2k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  30.2k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 30.2k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  30.2k|  uint8_t in;
   39|  30.2k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 3, False: 30.2k]
  ------------------
   40|      3|    return false;
   41|      3|  }
   42|  30.2k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 455, False: 29.8k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    455|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 16, False: 439]
  ------------------
   45|     16|      return false;
   46|     16|    }
   47|       |    // Append decoded info from this byte.
   48|    439|    *out_val <<= 7;
   49|    439|    *out_val |= in & ((1 << 7) - 1);
   50|  29.8k|  } else {
   51|       |    // Last byte reached
   52|  29.8k|    *out_val = in;
   53|  29.8k|  }
   54|  30.2k|  return true;
   55|  30.2k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  2.42k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.42k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 2.42k, Folded]
  ------------------
   65|  2.42k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 14, False: 2.40k]
  ------------------
   66|     14|      return false;
   67|     14|    }
   68|  2.42k|  } 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|  2.40k|  return true;
   77|  2.42k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  1.51k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.51k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.51k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 1.51k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.51k|  uint8_t in;
   39|  1.51k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 3, False: 1.51k]
  ------------------
   40|      3|    return false;
   41|      3|  }
   42|  1.51k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 9, False: 1.50k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|      9|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 9]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|      9|    *out_val <<= 7;
   49|      9|    *out_val |= in & ((1 << 7) - 1);
   50|  1.50k|  } else {
   51|       |    // Last byte reached
   52|  1.50k|    *out_val = in;
   53|  1.50k|  }
   54|  1.51k|  return true;
   55|  1.51k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   224k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   224k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   224k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 8, False: 224k]
  ------------------
   33|      8|    return false;
   34|      8|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   224k|  uint8_t in;
   39|   224k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 42, False: 224k]
  ------------------
   40|     42|    return false;
   41|     42|  }
   42|   224k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 880, False: 223k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    880|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 47, False: 833]
  ------------------
   45|     47|      return false;
   46|     47|    }
   47|       |    // Append decoded info from this byte.
   48|    833|    *out_val <<= 7;
   49|    833|    *out_val |= in & ((1 << 7) - 1);
   50|   223k|  } else {
   51|       |    // Last byte reached
   52|   223k|    *out_val = in;
   53|   223k|  }
   54|   224k|  return true;
   55|   224k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  2.28k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.28k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 2.28k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  2.28k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  2.28k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  2.28k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 16, False: 2.27k]
  ------------------
   72|     16|      return false;
   73|     16|    }
   74|  2.27k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  2.27k|  }
   76|  2.27k|  return true;
   77|  2.28k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.63k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.63k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.63k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 2.62k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.62k|  uint8_t in;
   39|  2.62k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 12, False: 2.61k]
  ------------------
   40|     12|    return false;
   41|     12|  }
   42|  2.61k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 344, False: 2.27k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    344|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 26, False: 318]
  ------------------
   45|     26|      return false;
   46|     26|    }
   47|       |    // Append decoded info from this byte.
   48|    318|    *out_val <<= 7;
   49|    318|    *out_val |= in & ((1 << 7) - 1);
   50|  2.27k|  } else {
   51|       |    // Last byte reached
   52|  2.27k|    *out_val = in;
   53|  2.27k|  }
   54|  2.58k|  return true;
   55|  2.61k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  1.99k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.99k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.99k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 1.99k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.99k|  uint8_t in;
   39|  1.99k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 7, False: 1.99k]
  ------------------
   40|      7|    return false;
   41|      7|  }
   42|  1.99k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 357, False: 1.63k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    357|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 3, False: 354]
  ------------------
   45|      3|      return false;
   46|      3|    }
   47|       |    // Append decoded info from this byte.
   48|    354|    *out_val <<= 7;
   49|    354|    *out_val |= in & ((1 << 7) - 1);
   50|  1.63k|  } else {
   51|       |    // Last byte reached
   52|  1.63k|    *out_val = in;
   53|  1.63k|  }
   54|  1.98k|  return true;
   55|  1.99k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  18.2k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  18.2k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  18.2k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 18.2k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  18.2k|  uint8_t in;
   39|  18.2k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 4, False: 18.2k]
  ------------------
   40|      4|    return false;
   41|      4|  }
   42|  18.2k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 495, False: 17.7k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    495|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 10, False: 485]
  ------------------
   45|     10|      return false;
   46|     10|    }
   47|       |    // Append decoded info from this byte.
   48|    485|    *out_val <<= 7;
   49|    485|    *out_val |= in & ((1 << 7) - 1);
   50|  17.7k|  } else {
   51|       |    // Last byte reached
   52|  17.7k|    *out_val = in;
   53|  17.7k|  }
   54|  18.2k|  return true;
   55|  18.2k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.63k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.63k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.63k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 11, False: 2.62k]
  ------------------
   33|     11|    return false;
   34|     11|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.62k|  uint8_t in;
   39|  2.62k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 6, False: 2.61k]
  ------------------
   40|      6|    return false;
   41|      6|  }
   42|  2.61k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 700, False: 1.91k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    700|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 59, False: 641]
  ------------------
   45|     59|      return false;
   46|     59|    }
   47|       |    // Append decoded info from this byte.
   48|    641|    *out_val <<= 7;
   49|    641|    *out_val |= in & ((1 << 7) - 1);
   50|  1.91k|  } else {
   51|       |    // Last byte reached
   52|  1.91k|    *out_val = in;
   53|  1.91k|  }
   54|  2.55k|  return true;
   55|  2.61k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  1.49k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.49k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.49k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 9, False: 1.48k]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.48k|  uint8_t in;
   39|  1.48k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 2, False: 1.47k]
  ------------------
   40|      2|    return false;
   41|      2|  }
   42|  1.47k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 578, False: 901]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    578|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 98, False: 480]
  ------------------
   45|     98|      return false;
   46|     98|    }
   47|       |    // Append decoded info from this byte.
   48|    480|    *out_val <<= 7;
   49|    480|    *out_val |= in & ((1 << 7) - 1);
   50|    901|  } else {
   51|       |    // Last byte reached
   52|    901|    *out_val = in;
   53|    901|  }
   54|  1.38k|  return true;
   55|  1.47k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  27.2k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  27.2k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  27.2k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 27.2k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  27.2k|  uint8_t in;
   39|  27.2k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 8, False: 27.2k]
  ------------------
   40|      8|    return false;
   41|      8|  }
   42|  27.2k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.31k, False: 24.9k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.31k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 9, False: 2.30k]
  ------------------
   45|      9|      return false;
   46|      9|    }
   47|       |    // Append decoded info from this byte.
   48|  2.30k|    *out_val <<= 7;
   49|  2.30k|    *out_val |= in & ((1 << 7) - 1);
   50|  24.9k|  } else {
   51|       |    // Last byte reached
   52|  24.9k|    *out_val = in;
   53|  24.9k|  }
   54|  27.2k|  return true;
   55|  27.2k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   258k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   336k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  28.0k|  Self operator-(const Self &o) const {
  138|  28.0k|    Self ret;
  139|   112k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 84.1k, False: 28.0k]
  ------------------
  140|  84.1k|      ret[i] = (*this)[i] - o[i];
  141|  84.1k|    }
  142|  28.0k|    return ret;
  143|  28.0k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  69.8k|  VectorD() {
   41|   279k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 209k, False: 69.8k]
  ------------------
   42|   209k|      (*this)[i] = Scalar(0);
   43|   209k|    }
   44|  69.8k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  1.18G|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|     12|      : v_({{c0, c1, c2}}) {
   60|     12|    DRACO_DCHECK_EQ(dimension, 3);
   61|     12|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|  93.0M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  7.70M|  Self operator-(const Self &o) const {
  138|  7.70M|    Self ret;
  139|  30.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 23.1M, False: 7.70M]
  ------------------
  140|  23.1M|      ret[i] = (*this)[i] - o[i];
  141|  23.1M|    }
  142|  7.70M|    return ret;
  143|  7.70M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  3.84M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  3.84M|  static_assert(std::is_signed<ScalarT>::value,
  321|  3.84M|                "ScalarT must be a signed type. ");
  322|  3.84M|  VectorD<ScalarT, 3> r;
  323|  3.84M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  3.84M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  3.84M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  3.84M|  return r;
  327|  3.84M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  3.84M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  3.84M|  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: 8.53k, False: 3.74M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  8.53k|        return std::numeric_limits<Scalar>::max();
  244|  8.53k|      }
  245|  3.74M|      result += next_value;
  246|  3.74M|    }
  247|  1.24M|    return result;
  248|  1.25M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   178k|  Self operator/(const Scalar &o) const {
  183|   178k|    Self ret;
  184|   714k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 536k, False: 178k]
  ------------------
  185|   536k|      ret[i] = (*this)[i] / o;
  186|   536k|    }
  187|   178k|    return ret;
  188|   178k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   113M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  6.94M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  3.75M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.15M|  Self operator-() const {
  121|  1.15M|    Self ret;
  122|  4.62M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 3.46M, False: 1.15M]
  ------------------
  123|  3.46M|      ret[i] = -(*this)[i];
  124|  3.46M|    }
  125|  1.15M|    return ret;
  126|  1.15M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  3.46M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   653k|  Self operator-(const Self &o) const {
  138|   653k|    Self ret;
  139|  1.96M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.30M, False: 653k]
  ------------------
  140|  1.30M|      ret[i] = (*this)[i] - o[i];
  141|  1.30M|    }
  142|   653k|    return ret;
  143|   653k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  7.84M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  11.7M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  52.4M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  1.30M|  Self operator+(const Self &o) const {
  130|  1.30M|    Self ret;
  131|  3.92M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.61M, False: 1.30M]
  ------------------
  132|  2.61M|      ret[i] = (*this)[i] + o[i];
  133|  2.61M|    }
  134|  1.30M|    return ret;
  135|  1.30M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  41.2M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  1.48M|  Self operator-(const Self &o) const {
  138|  1.48M|    Self ret;
  139|  4.45M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.97M, False: 1.48M]
  ------------------
  140|  2.97M|      ret[i] = (*this)[i] - o[i];
  141|  2.97M|    }
  142|  1.48M|    return ret;
  143|  1.48M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  1.48M|  Self operator+(const Self &o) const {
  130|  1.48M|    Self ret;
  131|  4.45M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.97M, False: 1.48M]
  ------------------
  132|  2.97M|      ret[i] = (*this)[i] + o[i];
  133|  2.97M|    }
  134|  1.48M|    return ret;
  135|  1.48M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   349k|  bool operator==(const Self &o) const {
  207|  1.02M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 686k, False: 335k]
  ------------------
  208|   686k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 13.7k, False: 672k]
  ------------------
  209|  13.7k|        return false;
  210|  13.7k|      }
  211|   686k|    }
  212|   335k|    return true;
  213|   349k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  4.19M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  14.2k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  14.8k|  Scalar Dot(const Self &o) const {
  251|  14.8k|    Scalar ret(0);
  252|  59.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 44.4k, False: 14.8k]
  ------------------
  253|  44.4k|      ret += (*this)[i] * o[i];
  254|  44.4k|    }
  255|  14.8k|    return ret;
  256|  14.8k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    526|  Self operator*(const Scalar &o) const {
  175|    526|    Self ret;
  176|  2.10k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.57k, False: 526]
  ------------------
  177|  1.57k|      ret[i] = (*this)[i] * o;
  178|  1.57k|    }
  179|    526|    return ret;
  180|    526|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  13.7k|  Self operator-(const Self &o) const {
  138|  13.7k|    Self ret;
  139|  41.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 27.5k, False: 13.7k]
  ------------------
  140|  27.5k|      ret[i] = (*this)[i] - o[i];
  141|  27.5k|    }
  142|  13.7k|    return ret;
  143|  13.7k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  27.5k|  VectorD() {
   41|  82.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 55.0k, False: 27.5k]
  ------------------
   42|  55.0k|      (*this)[i] = Scalar(0);
   43|  55.0k|    }
   44|  27.5k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   713k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   713k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   713k|    v_[0] = c0;
   55|   713k|    v_[1] = c1;
   56|   713k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|   110k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   269k|  bool operator==(const Self &o) const {
  207|   778k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 524k, False: 254k]
  ------------------
  208|   524k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 15.0k, False: 509k]
  ------------------
  209|  15.0k|        return false;
  210|  15.0k|      }
  211|   524k|    }
  212|   254k|    return true;
  213|   269k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.64M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  21.9M|  VectorD() {
   41|  87.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 65.8M, False: 21.9M]
  ------------------
   42|  65.8M|      (*this)[i] = Scalar(0);
   43|  65.8M|    }
   44|  21.9M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  18.3k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  21.7k|  Scalar Dot(const Self &o) const {
  251|  21.7k|    Scalar ret(0);
  252|  86.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 65.1k, False: 21.7k]
  ------------------
  253|  65.1k|      ret += (*this)[i] * o[i];
  254|  65.1k|    }
  255|  21.7k|    return ret;
  256|  21.7k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  3.33k|  Self operator-(const Self &o) const {
  138|  3.33k|    Self ret;
  139|  10.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 6.67k, False: 3.33k]
  ------------------
  140|  6.67k|      ret[i] = (*this)[i] - o[i];
  141|  6.67k|    }
  142|  3.33k|    return ret;
  143|  3.33k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  9.91k|  Self operator*(const Scalar &o) const {
  175|  9.91k|    Self ret;
  176|  29.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 19.8k, False: 9.91k]
  ------------------
  177|  19.8k|      ret[i] = (*this)[i] * o;
  178|  19.8k|    }
  179|  9.91k|    return ret;
  180|  9.91k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  3.30k|  Self operator+(const Self &o) const {
  130|  3.30k|    Self ret;
  131|  9.92k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 6.61k, False: 3.30k]
  ------------------
  132|  6.61k|      ret[i] = (*this)[i] + o[i];
  133|  6.61k|    }
  134|  3.30k|    return ret;
  135|  3.30k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.30k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.30k|  return v * o;
  294|  3.30k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  3.30k|  Self operator+(const Self &o) const {
  130|  3.30k|    Self ret;
  131|  13.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 9.90k, False: 3.30k]
  ------------------
  132|  9.90k|      ret[i] = (*this)[i] + o[i];
  133|  9.90k|    }
  134|  3.30k|    return ret;
  135|  3.30k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.30k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.30k|  return v * o;
  294|  3.30k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  3.30k|  Self operator*(const Scalar &o) const {
  175|  3.30k|    Self ret;
  176|  13.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 9.90k, False: 3.30k]
  ------------------
  177|  9.90k|      ret[i] = (*this)[i] * o;
  178|  9.90k|    }
  179|  3.30k|    return ret;
  180|  3.30k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   541k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   541k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   541k|    v_[0] = c0;
   55|   541k|    v_[1] = c1;
   56|   541k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  23.1k|  VectorD() {
   41|  69.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 46.2k, False: 23.1k]
  ------------------
   42|  46.2k|      (*this)[i] = Scalar(0);
   43|  46.2k|    }
   44|  23.1k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  6.57k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  19.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 13.1k, False: 6.57k]
  ------------------
  104|  13.1k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 13.1k, False: 0]
  ------------------
  105|  13.1k|        v_[i] = Scalar(src_vector[i]);
  106|  13.1k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  13.1k|    }
  110|  6.57k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|  1.31k|  Self operator+(const Self &o) const {
  130|  1.31k|    Self ret;
  131|  3.94k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.63k, False: 1.31k]
  ------------------
  132|  2.63k|      ret[i] = (*this)[i] + o[i];
  133|  2.63k|    }
  134|  1.31k|    return ret;
  135|  1.31k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  3.28k|  VectorD() {
   41|  9.85k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.57k, False: 3.28k]
  ------------------
   42|  6.57k|      (*this)[i] = Scalar(0);
   43|  6.57k|    }
   44|  3.28k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  19.7k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  13.1k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  3.28k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  9.85k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 6.57k, False: 3.28k]
  ------------------
  104|  6.57k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 6.57k, False: 0]
  ------------------
  105|  6.57k|        v_[i] = Scalar(src_vector[i]);
  106|  6.57k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  6.57k|    }
  110|  3.28k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  3.28k|  Self operator/(const Scalar &o) const {
  183|  3.28k|    Self ret;
  184|  9.85k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 6.57k, False: 3.28k]
  ------------------
  185|  6.57k|      ret[i] = (*this)[i] / o;
  186|  6.57k|    }
  187|  3.28k|    return ret;
  188|  3.28k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.97k|  Self operator-(const Self &o) const {
  138|  1.97k|    Self ret;
  139|  5.91k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.94k, False: 1.97k]
  ------------------
  140|  3.94k|      ret[i] = (*this)[i] - o[i];
  141|  3.94k|    }
  142|  1.97k|    return ret;
  143|  1.97k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  92.5k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.15M|  VectorD() {
   41|  4.62M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.47M, False: 1.15M]
  ------------------
   42|  3.47M|      (*this)[i] = Scalar(0);
   43|  3.47M|    }
   44|  1.15M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  9.51M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  9.51M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  9.51M|    v_[0] = c0;
   55|  9.51M|    v_[1] = c1;
   56|  9.51M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  3.92M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  11.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 7.84M, False: 3.92M]
  ------------------
  104|  7.84M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 7.84M, False: 0]
  ------------------
  105|  7.84M|        v_[i] = Scalar(src_vector[i]);
  106|  7.84M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  7.84M|    }
  110|  3.92M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  1.96M|  VectorD() {
   41|  5.88M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.92M, False: 1.96M]
  ------------------
   42|  3.92M|      (*this)[i] = Scalar(0);
   43|  3.92M|    }
   44|  1.96M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  1.96M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  5.88M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 3.92M, False: 1.96M]
  ------------------
  104|  3.92M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 3.92M, False: 0]
  ------------------
  105|  3.92M|        v_[i] = Scalar(src_vector[i]);
  106|  3.92M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  3.92M|    }
  110|  1.96M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  6.72M|  VectorD(const Self &o) {
   89|  20.1M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 13.4M, False: 6.72M]
  ------------------
   90|  13.4M|      (*this)[i] = o[i];
   91|  13.4M|    }
   92|  6.72M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  2.97M|  VectorD() {
   41|  8.91M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.94M, False: 2.97M]
  ------------------
   42|  5.94M|      (*this)[i] = Scalar(0);
   43|  5.94M|    }
   44|  2.97M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   395M|  VectorD(const Self &o) {
   89|  1.58G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 1.18G, False: 395M]
  ------------------
   90|  1.18G|      (*this)[i] = o[i];
   91|  1.18G|    }
   92|   395M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  1.18G|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   172M|      : v_({{c0, c1, c2}}) {
   60|   172M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   172M|  }

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

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

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  5.30k|      : corner_table_(table),
  229|  5.30k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  5.30k|        corner_(start_corner_),
  231|  5.30k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  2.97M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  17.7k|  VertexCornersIterator &operator++() {
  268|  17.7k|    Next();
  269|  17.7k|    return *this;
  270|  17.7k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  2.54M|  void Next() {
  248|  2.54M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.51M, False: 27.2k]
  ------------------
  249|  2.51M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.51M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 21.2k, False: 2.49M]
  ------------------
  251|       |        // Open boundary reached.
  252|  21.2k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  21.2k|        left_traversal_ = false;
  254|  2.49M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 415k, False: 2.07M]
  ------------------
  255|       |        // End reached.
  256|   415k|        corner_ = kInvalidCornerIndex;
  257|   415k|      }
  258|  2.51M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  27.2k|      corner_ = corner_table_->SwingRight(corner_);
  262|  27.2k|    }
  263|  2.54M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  4.24M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  2.13M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  2.22M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  1.31M|  void Next() {
  248|  1.31M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 1.30M, False: 15.8k]
  ------------------
  249|  1.30M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  1.30M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 725k, False: 575k]
  ------------------
  251|       |        // Open boundary reached.
  252|   725k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|   725k|        left_traversal_ = false;
  254|   725k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 94.6k, False: 481k]
  ------------------
  255|       |        // End reached.
  256|  94.6k|        corner_ = kInvalidCornerIndex;
  257|  94.6k|      }
  258|  1.30M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  15.8k|      corner_ = corner_table_->SwingRight(corner_);
  262|  15.8k|    }
  263|  1.31M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   820k|      : corner_table_(table),
  236|   820k|        start_corner_(corner_id),
  237|   820k|        corner_(start_corner_),
  238|   820k|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   431k|      : corner_table_(table),
  236|   431k|        start_corner_(corner_id),
  237|   431k|        corner_(start_corner_),
  238|   431k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  29.1M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  29.1M|    return is_edge_on_seam_[corner.value()];
   47|  29.1M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  12.3M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  12.3M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 12.3M]
  |  Branch (50:42): [True: 9.69M, False: 2.65M]
  ------------------
   51|  9.69M|      return kInvalidCornerIndex;
   52|  9.69M|    }
   53|  2.65M|    return corner_table_->Opposite(corner);
   54|  12.3M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  19.9M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  19.9M|    return corner_table_->Next(corner);
   58|  19.9M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  9.12M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  9.12M|    return corner_table_->Previous(corner);
   62|  9.12M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  2.35M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  2.35M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  2.35M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.56M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  1.56M|    return Opposite(Previous(corner));
   73|  1.56M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  1.88M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  1.88M|    return Opposite(Next(corner));
   76|  1.88M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  1.28M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  1.28M|    return Previous(Opposite(Previous(corner)));
   81|  1.28M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  6.52M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  6.52M|    return Next(Opposite(Next(corner)));
   86|  6.52M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  5.65k|  int num_vertices() const {
   89|  5.65k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  5.65k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  1.64k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|    770|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  50.1M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  50.1M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  50.1M|    return ConfidentVertex(corner);
   97|  50.1M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  50.1M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  50.1M|    return corner_to_vertex_map_[corner.value()];
  100|  50.1M|  }
_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.20M, False: 321k]
  ------------------
  128|  1.20M|      return true;
  129|  1.20M|    }
  130|   321k|    return false;
  131|  1.53M|  }

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

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

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

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

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

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

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

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

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

