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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.16k|      : quantization_bits_(-1),
   54|  2.16k|        max_quantized_value_(-1),
   55|  2.16k|        max_value_(-1),
   56|  2.16k|        dequantization_scale_(1.f),
   57|  2.16k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  1.93k|  bool SetQuantizationBits(int32_t q) {
   60|  1.93k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 532, False: 1.40k]
  |  Branch (60:18): [True: 109, False: 1.29k]
  ------------------
   61|    641|      return false;
   62|    641|    }
   63|  1.29k|    quantization_bits_ = q;
   64|  1.29k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.29k|    max_value_ = max_quantized_value_ - 1;
   66|  1.29k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.29k|    center_value_ = max_value_ / 2;
   68|  1.29k|    return true;
   69|  1.93k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  1.18M|                                           int32_t *out_t) const {
   77|  1.18M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 1.81k, False: 1.17M]
  |  Branch (77:20): [True: 0, False: 1.81k]
  |  Branch (77:32): [True: 1.81k, False: 1.17M]
  |  Branch (77:42): [True: 0, False: 1.81k]
  ------------------
   78|  1.18M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.00M, False: 175k]
  |  Branch (78:29): [True: 5.72k, False: 998k]
  ------------------
   79|  5.72k|      s = max_value_;
   80|  5.72k|      t = max_value_;
   81|  1.17M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 1.81k, False: 1.17M]
  |  Branch (81:26): [True: 546, False: 1.26k]
  ------------------
   82|    546|      t = center_value_ - (t - center_value_);
   83|  1.17M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 998k, False: 175k]
  |  Branch (83:35): [True: 5.80k, False: 992k]
  ------------------
   84|  5.80k|      t = center_value_ + (center_value_ - t);
   85|  1.16M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 994k, False: 173k]
  |  Branch (85:35): [True: 289, False: 994k]
  ------------------
   86|    289|      s = center_value_ + (center_value_ - s);
   87|  1.16M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 2.52k, False: 1.16M]
  |  Branch (87:26): [True: 985, False: 1.53k]
  ------------------
   88|    985|      s = center_value_ - (s - center_value_);
   89|    985|    }
   90|       |
   91|  1.18M|    *out_s = s;
   92|  1.18M|    *out_t = t;
   93|  1.18M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  1.18M|                                                       int32_t *out_t) const {
  100|  1.18M|    DRACO_DCHECK_EQ(
  101|  1.18M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  1.18M|        center_value_);
  103|  1.18M|    int32_t s, t;
  104|  1.18M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 483k, False: 696k]
  ------------------
  105|       |      // Right hemisphere.
  106|   483k|      s = (int_vec[1] + center_value_);
  107|   483k|      t = (int_vec[2] + center_value_);
  108|   696k|    } else {
  109|       |      // Left hemisphere.
  110|   696k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 27.3k, False: 668k]
  ------------------
  111|  27.3k|        s = std::abs(int_vec[2]);
  112|   668k|      } else {
  113|   668k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   668k|      }
  115|   696k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 27.9k, False: 668k]
  ------------------
  116|  27.9k|        t = std::abs(int_vec[1]);
  117|   668k|      } else {
  118|   668k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   668k|      }
  120|   696k|    }
  121|  1.18M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  1.18M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  6.30M|                                                    float *out_vector) const {
  199|  6.30M|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  6.30M|                                 in_t * dequantization_scale_ - 1.f,
  201|  6.30M|                                 out_vector);
  202|  6.30M|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  40.1M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  40.1M|    DRACO_DCHECK_LE(s, center_value_);
  208|  40.1M|    DRACO_DCHECK_LE(t, center_value_);
  209|  40.1M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  40.1M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  40.1M|    const uint32_t st =
  212|  40.1M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  40.1M|    return st <= center_value_;
  214|  40.1M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  47.5M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  47.5M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  47.5M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  47.5M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  47.5M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  47.5M|    int32_t sign_s = 0;
  223|  47.5M|    int32_t sign_t = 0;
  224|  47.5M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 41.2M, False: 6.31M]
  |  Branch (224:20): [True: 39.1M, False: 2.13M]
  ------------------
  225|  39.1M|      sign_s = 1;
  226|  39.1M|      sign_t = 1;
  227|  39.1M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 6.66M, False: 1.78M]
  |  Branch (227:27): [True: 1.78M, False: 4.88M]
  ------------------
  228|  1.78M|      sign_s = -1;
  229|  1.78M|      sign_t = -1;
  230|  6.66M|    } else {
  231|  6.66M|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 1.78M, False: 4.88M]
  ------------------
  232|  6.66M|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 4.88M, False: 1.78M]
  ------------------
  233|  6.66M|    }
  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|  47.5M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  47.5M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  47.5M|    uint32_t us = *s;
  241|  47.5M|    uint32_t ut = *t;
  242|  47.5M|    us = us + us - corner_point_s;
  243|  47.5M|    ut = ut + ut - corner_point_t;
  244|  47.5M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 40.9M, False: 6.66M]
  ------------------
  245|  40.9M|      uint32_t temp = us;
  246|  40.9M|      us = -ut;
  247|  40.9M|      ut = -temp;
  248|  40.9M|    } else {
  249|  6.66M|      std::swap(us, ut);
  250|  6.66M|    }
  251|  47.5M|    us = us + corner_point_s;
  252|  47.5M|    ut = ut + corner_point_t;
  253|       |
  254|  47.5M|    *s = us;
  255|  47.5M|    *t = ut;
  256|  47.5M|    *s /= 2;
  257|  47.5M|    *t /= 2;
  258|  47.5M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  80.2M|  int32_t ModMax(int32_t x) const {
  273|  80.2M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 7.34k, False: 80.2M]
  ------------------
  274|  7.34k|      return x - this->max_quantized_value();
  275|  7.34k|    }
  276|  80.2M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 2.56k, False: 80.2M]
  ------------------
  277|  2.56k|      return x + this->max_quantized_value();
  278|  2.56k|    }
  279|  80.2M|    return x;
  280|  80.2M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.25k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  9.91k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|   240M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  6.30M|                                           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|  6.30M|    float y = in_s_scaled;
  329|  6.30M|    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|  6.30M|    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|  6.30M|    float x_offset = -x;
  342|  6.30M|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 557, False: 6.30M]
  ------------------
  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|  6.30M|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 19.7k, False: 6.28M]
  ------------------
  348|  6.30M|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 19.8k, False: 6.28M]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  6.30M|    const float norm_squared = x * x + y * y + z * z;
  352|  6.30M|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 6.30M]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  6.30M|    } else {
  357|  6.30M|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  6.30M|      out_vector[0] = x * d;
  359|  6.30M|      out_vector[1] = y * d;
  360|  6.30M|      out_vector[2] = z * d;
  361|  6.30M|    }
  362|  6.30M|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  1.18M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  1.18M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  1.18M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  1.18M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  1.18M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  1.18M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  1.18M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 1.03M, False: 146k]
  ------------------
  181|  1.03M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.03M|    } else {
  183|   146k|      vec[0] =
  184|   146k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   146k|          abs_sum;
  186|   146k|      vec[1] =
  187|   146k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   146k|          abs_sum;
  189|   146k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 77.8k, False: 68.6k]
  ------------------
  190|  77.8k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|  77.8k|      } else {
  192|  68.6k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|  68.6k|      }
  194|   146k|    }
  195|  1.18M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    298|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    298|            attribute, transform, mesh_data),
   52|    298|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    287|                                                                *buffer) {
  194|    287|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    287|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    287|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 6, False: 281]
  ------------------
  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: 4, False: 2]
  ------------------
  203|       |      // Unsupported mode.
  204|      4|      return false;
  205|      4|    }
  206|      6|  }
  207|    283|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.26k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.05k, False: 217]
  ------------------
  211|  1.05k|    uint32_t num_flags;
  212|  1.05k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 16, False: 1.03k]
  ------------------
  213|     16|      return false;
  214|     16|    }
  215|  1.03k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 35, False: 1.00k]
  ------------------
  216|     35|      return false;
  217|     35|    }
  218|  1.00k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 404, False: 597]
  ------------------
  219|    404|      is_crease_edge_[i].resize(num_flags);
  220|    404|      RAnsBitDecoder decoder;
  221|    404|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 15, False: 389]
  ------------------
  222|     15|        return false;
  223|     15|      }
  224|   496k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 495k, False: 389]
  ------------------
  225|   495k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   495k|      }
  227|    389|      decoder.EndDecoding();
  228|    389|    }
  229|  1.00k|  }
  230|    217|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    217|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    283|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    205|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    205|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    205|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.02k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 820, False: 205]
  ------------------
   93|    820|    pred_vals[i].resize(num_components, 0);
   94|    820|  }
   95|    205|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    205|                                         out_data);
   97|       |
   98|    205|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    205|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    205|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    205|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    205|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    205|  const int corner_map_size =
  109|    205|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   303k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 303k, False: 123]
  ------------------
  111|   303k|    const CornerIndex start_corner_id =
  112|   303k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   303k|    CornerIndex corner_id(start_corner_id);
  115|   303k|    int num_parallelograms = 0;
  116|   303k|    bool first_pass = true;
  117|   731k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 450k, False: 280k]
  ------------------
  118|   450k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 51.6k, False: 399k]
  ------------------
  119|   450k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   450k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  51.6k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  51.6k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 577, False: 51.1k]
  ------------------
  127|    577|          break;
  128|    577|        }
  129|  51.6k|      }
  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|   450k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 440k, False: 9.86k]
  ------------------
  134|   440k|        corner_id = table->SwingLeft(corner_id);
  135|   440k|      } else {
  136|  9.86k|        corner_id = table->SwingRight(corner_id);
  137|  9.86k|      }
  138|   450k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 22.3k, False: 427k]
  ------------------
  139|  22.3k|        break;
  140|  22.3k|      }
  141|   427k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 286k, False: 141k]
  |  Branch (141:47): [True: 280k, False: 5.29k]
  ------------------
  142|   280k|        first_pass = false;
  143|   280k|        corner_id = table->SwingRight(start_corner_id);
  144|   280k|      }
  145|   427k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   303k|    int num_used_parallelograms = 0;
  150|   303k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 29.9k, False: 273k]
  ------------------
  151|  1.60M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 1.57M, False: 29.9k]
  ------------------
  152|  1.57M|        multi_pred_vals[i] = 0;
  153|  1.57M|      }
  154|       |      // Check which parallelograms are actually used.
  155|  81.5k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 51.6k, False: 29.8k]
  ------------------
  156|  51.6k|        const int context = num_parallelograms - 1;
  157|  51.6k|        const int pos = is_crease_edge_pos[context]++;
  158|  51.6k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 82, False: 51.5k]
  ------------------
  159|     82|          return false;
  160|     82|        }
  161|  51.5k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  51.5k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 5.54k, False: 46.0k]
  ------------------
  163|  5.54k|          ++num_used_parallelograms;
  164|   315k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 310k, False: 5.54k]
  ------------------
  165|   310k|            multi_pred_vals[j] =
  166|   310k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   310k|          }
  168|  5.54k|        }
  169|  51.5k|      }
  170|  29.9k|    }
  171|   303k|    const int dst_offset = p * num_components;
  172|   303k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 300k, False: 2.91k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   300k|      const int src_offset = (p - 1) * num_components;
  176|   300k|      this->transform().ComputeOriginalValue(
  177|   300k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   300k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   180k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 178k, False: 2.91k]
  ------------------
  181|   178k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   178k|      }
  183|  2.91k|      this->transform().ComputeOriginalValue(
  184|  2.91k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  2.91k|    }
  186|   303k|  }
  187|    123|  return true;
  188|    205|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    289|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    289|            attribute, transform, mesh_data),
   52|    289|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    269|                                                                *buffer) {
  194|    269|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    269|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    269|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 2, False: 267]
  ------------------
  196|       |    // Decode prediction mode.
  197|      2|    uint8_t mode;
  198|      2|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 2]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      2|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 1, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      1|      return false;
  205|      1|    }
  206|      2|  }
  207|    268|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.21k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 998, False: 215]
  ------------------
  211|    998|    uint32_t num_flags;
  212|    998|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 10, False: 988]
  ------------------
  213|     10|      return false;
  214|     10|    }
  215|    988|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 26, False: 962]
  ------------------
  216|     26|      return false;
  217|     26|    }
  218|    962|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 390, False: 572]
  ------------------
  219|    390|      is_crease_edge_[i].resize(num_flags);
  220|    390|      RAnsBitDecoder decoder;
  221|    390|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 17, False: 373]
  ------------------
  222|     17|        return false;
  223|     17|      }
  224|   537k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 537k, False: 373]
  ------------------
  225|   537k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   537k|      }
  227|    373|      decoder.EndDecoding();
  228|    373|    }
  229|    962|  }
  230|    215|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    215|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    268|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    197|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    197|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    197|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    985|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 788, False: 197]
  ------------------
   93|    788|    pred_vals[i].resize(num_components, 0);
   94|    788|  }
   95|    197|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    197|                                         out_data);
   97|       |
   98|    197|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    197|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    197|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    197|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    197|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    197|  const int corner_map_size =
  109|    197|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  67.6k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 67.5k, False: 104]
  ------------------
  111|  67.5k|    const CornerIndex start_corner_id =
  112|  67.5k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  67.5k|    CornerIndex corner_id(start_corner_id);
  115|  67.5k|    int num_parallelograms = 0;
  116|  67.5k|    bool first_pass = true;
  117|   393k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 389k, False: 3.91k]
  ------------------
  118|   389k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 127k, False: 261k]
  ------------------
  119|   389k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   389k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   127k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   127k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 274, False: 127k]
  ------------------
  127|    274|          break;
  128|    274|        }
  129|   127k|      }
  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|   389k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 385k, False: 3.29k]
  ------------------
  134|   385k|        corner_id = table->SwingLeft(corner_id);
  135|   385k|      } else {
  136|  3.29k|        corner_id = table->SwingRight(corner_id);
  137|  3.29k|      }
  138|   389k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 63.3k, False: 325k]
  ------------------
  139|  63.3k|        break;
  140|  63.3k|      }
  141|   325k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 5.56k, False: 320k]
  |  Branch (141:47): [True: 3.92k, False: 1.64k]
  ------------------
  142|  3.92k|        first_pass = false;
  143|  3.92k|        corner_id = table->SwingRight(start_corner_id);
  144|  3.92k|      }
  145|   325k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  67.5k|    int num_used_parallelograms = 0;
  150|  67.5k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 65.3k, False: 2.23k]
  ------------------
  151|  10.1M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 10.1M, False: 65.3k]
  ------------------
  152|  10.1M|        multi_pred_vals[i] = 0;
  153|  10.1M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   192k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 127k, False: 65.2k]
  ------------------
  156|   127k|        const int context = num_parallelograms - 1;
  157|   127k|        const int pos = is_crease_edge_pos[context]++;
  158|   127k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 93, False: 127k]
  ------------------
  159|     93|          return false;
  160|     93|        }
  161|   127k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   127k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 5.10k, False: 122k]
  ------------------
  163|  5.10k|          ++num_used_parallelograms;
  164|   778k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 773k, False: 5.10k]
  ------------------
  165|   773k|            multi_pred_vals[j] =
  166|   773k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   773k|          }
  168|  5.10k|        }
  169|   127k|      }
  170|  65.3k|    }
  171|  67.4k|    const int dst_offset = p * num_components;
  172|  67.4k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 64.2k, False: 3.23k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  64.2k|      const int src_offset = (p - 1) * num_components;
  176|  64.2k|      this->transform().ComputeOriginalValue(
  177|  64.2k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  64.2k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   459k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 456k, False: 3.23k]
  ------------------
  181|   456k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   456k|      }
  183|  3.23k|      this->transform().ComputeOriginalValue(
  184|  3.23k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  3.23k|    }
  186|  67.4k|  }
  187|    104|  return true;
  188|    197|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.64k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.64k|    mesh_ = mesh;
   39|  1.64k|    corner_table_ = table;
   40|  1.64k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.64k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.64k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  6.02M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  3.99M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  3.99M|    return vertex_to_data_map_;
   48|  3.99M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  2.91M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  2.91M|    return data_to_corner_map_;
   51|  2.91M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.80k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.80k|    mesh_ = mesh;
   39|  1.80k|    corner_table_ = table;
   40|  1.80k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.80k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.80k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  7.08M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  6.26M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  6.26M|    return vertex_to_data_map_;
   48|  6.26M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  1.55M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  1.55M|    return data_to_corner_map_;
   51|  1.55M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  1.64k|      : mesh_(nullptr),
   31|  1.64k|        corner_table_(nullptr),
   32|  1.64k|        vertex_to_data_map_(nullptr),
   33|  1.64k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  1.80k|      : mesh_(nullptr),
   31|  1.80k|        corner_table_(nullptr),
   32|  1.80k|        vertex_to_data_map_(nullptr),
   33|  1.80k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   326k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   174k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   125k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   139k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.34k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.34k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  4.63M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.58k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.58k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  1.63M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    130|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    130|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    111|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    111|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    159|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    159|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    109|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    109|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    259|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    130|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    130|    DRACO_DCHECK_EQ(i, 0);
   70|    130|    (void)i;
   71|    130|    return GeometryAttribute::POSITION;
   72|    130|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    130|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    130|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 130]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    130|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 129]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    129|    predictor_.SetPositionAttribute(*att);
   82|    129|    return true;
   83|    130|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    129|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    129|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 6, False: 123]
  ------------------
  145|      6|    return false;
  146|      6|  }
  147|       |
  148|    123|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    123|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    123|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 28, False: 95]
  ------------------
  150|     28|    uint8_t prediction_mode;
  151|     28|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 28]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     28|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 26]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|     26|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 26]
  ------------------
  160|     26|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     26|  }
  164|    121|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    121|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 118]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|    118|  return true;
  172|    121|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    118|                                      const PointIndex *entry_to_point_id_map) {
  103|    118|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    118|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    118|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    118|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    118|  const int corner_map_size =
  111|    118|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    118|  VectorD<int32_t, 3> pred_normal_3d;
  114|    118|  int32_t pred_normal_oct[2];
  115|       |
  116|   326k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 326k, False: 118]
  ------------------
  117|   326k|    const CornerIndex corner_id =
  118|   326k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   326k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   326k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   326k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   326k|                    octahedron_tool_box_.center_value());
  125|   326k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 325k, False: 1.32k]
  ------------------
  126|   325k|      pred_normal_3d = -pred_normal_3d;
  127|   325k|    }
  128|   326k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   326k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   326k|    const int data_offset = data_id * 2;
  132|   326k|    this->transform().ComputeOriginalValue(
  133|   326k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   326k|  }
  135|    118|  flip_normal_bit_decoder_.EndDecoding();
  136|    118|  return true;
  137|    118|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    118|  void SetQuantizationBits(int q) {
   85|    118|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    118|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    219|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    111|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    111|    DRACO_DCHECK_EQ(i, 0);
   70|    111|    (void)i;
   71|    111|    return GeometryAttribute::POSITION;
   72|    111|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    110|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    110|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 110]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    110|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 108]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    108|    predictor_.SetPositionAttribute(*att);
   82|    108|    return true;
   83|    110|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    107|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    107|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 6, False: 101]
  ------------------
  145|      6|    return false;
  146|      6|  }
  147|       |
  148|    101|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    101|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    101|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 15, False: 86]
  ------------------
  150|     15|    uint8_t prediction_mode;
  151|     15|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 15]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     15|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 14]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     14|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 14]
  ------------------
  160|     14|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     14|  }
  164|    100|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    100|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 97]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|     97|  return true;
  172|    100|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     97|                                      const PointIndex *entry_to_point_id_map) {
  103|     97|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     97|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     97|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     97|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     97|  const int corner_map_size =
  111|     97|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     97|  VectorD<int32_t, 3> pred_normal_3d;
  114|     97|  int32_t pred_normal_oct[2];
  115|       |
  116|   174k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 174k, False: 97]
  ------------------
  117|   174k|    const CornerIndex corner_id =
  118|   174k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   174k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   174k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   174k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   174k|                    octahedron_tool_box_.center_value());
  125|   174k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 139k, False: 35.4k]
  ------------------
  126|   139k|      pred_normal_3d = -pred_normal_3d;
  127|   139k|    }
  128|   174k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   174k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   174k|    const int data_offset = data_id * 2;
  132|   174k|    this->transform().ComputeOriginalValue(
  133|   174k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   174k|  }
  135|     97|  flip_normal_bit_decoder_.EndDecoding();
  136|     97|  return true;
  137|     97|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     97|  void SetQuantizationBits(int q) {
   85|     97|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     97|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    315|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    159|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    159|    DRACO_DCHECK_EQ(i, 0);
   70|    159|    (void)i;
   71|    159|    return GeometryAttribute::POSITION;
   72|    159|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    159|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    159|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 159]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    159|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 156]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    156|    predictor_.SetPositionAttribute(*att);
   82|    156|    return true;
   83|    159|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    156|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    156|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 9, False: 147]
  ------------------
  145|      9|    return false;
  146|      9|  }
  147|       |
  148|    147|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    147|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    147|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 42, False: 105]
  ------------------
  150|     42|    uint8_t prediction_mode;
  151|     42|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 41]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     41|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 6, False: 35]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      6|      return false;
  157|      6|    }
  158|       |
  159|     35|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 35]
  ------------------
  160|     35|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     35|  }
  164|    140|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    140|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 6, False: 134]
  ------------------
  168|      6|    return false;
  169|      6|  }
  170|       |
  171|    134|  return true;
  172|    140|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    134|                                      const PointIndex *entry_to_point_id_map) {
  103|    134|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    134|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    134|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    134|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    134|  const int corner_map_size =
  111|    134|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    134|  VectorD<int32_t, 3> pred_normal_3d;
  114|    134|  int32_t pred_normal_oct[2];
  115|       |
  116|   125k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 125k, False: 134]
  ------------------
  117|   125k|    const CornerIndex corner_id =
  118|   125k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   125k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   125k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   125k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   125k|                    octahedron_tool_box_.center_value());
  125|   125k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 123k, False: 1.92k]
  ------------------
  126|   123k|      pred_normal_3d = -pred_normal_3d;
  127|   123k|    }
  128|   125k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   125k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   125k|    const int data_offset = data_id * 2;
  132|   125k|    this->transform().ComputeOriginalValue(
  133|   125k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   125k|  }
  135|    134|  flip_normal_bit_decoder_.EndDecoding();
  136|    134|  return true;
  137|    134|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    134|  void SetQuantizationBits(int q) {
   85|    134|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    134|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    217|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    109|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    109|    DRACO_DCHECK_EQ(i, 0);
   70|    109|    (void)i;
   71|    109|    return GeometryAttribute::POSITION;
   72|    109|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    109|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    109|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 109]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    109|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 108]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    108|    predictor_.SetPositionAttribute(*att);
   82|    108|    return true;
   83|    109|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    108|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    108|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 103]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    103|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    103|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    103|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 25, False: 78]
  ------------------
  150|     25|    uint8_t prediction_mode;
  151|     25|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 25]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     25|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 24]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     24|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 24]
  ------------------
  160|     24|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     24|  }
  164|    102|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    102|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 4, False: 98]
  ------------------
  168|      4|    return false;
  169|      4|  }
  170|       |
  171|     98|  return true;
  172|    102|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     98|                                      const PointIndex *entry_to_point_id_map) {
  103|     98|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     98|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     98|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     98|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     98|  const int corner_map_size =
  111|     98|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     98|  VectorD<int32_t, 3> pred_normal_3d;
  114|     98|  int32_t pred_normal_oct[2];
  115|       |
  116|   139k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 139k, False: 98]
  ------------------
  117|   139k|    const CornerIndex corner_id =
  118|   139k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   139k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   139k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   139k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   139k|                    octahedron_tool_box_.center_value());
  125|   139k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 131k, False: 8.07k]
  ------------------
  126|   131k|      pred_normal_3d = -pred_normal_3d;
  127|   131k|    }
  128|   139k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   139k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   139k|    const int data_offset = data_id * 2;
  132|   139k|    this->transform().ComputeOriginalValue(
  133|   139k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   139k|  }
  135|     98|  flip_normal_bit_decoder_.EndDecoding();
  136|     98|  return true;
  137|     98|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     98|  void SetQuantizationBits(int q) {
   85|     98|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     98|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    130|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    130|            attribute, transform, mesh_data),
   37|    130|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    257|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    130|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    130|    DRACO_DCHECK_EQ(i, 0);
   70|    130|    (void)i;
   71|    130|    return GeometryAttribute::POSITION;
   72|    130|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    129|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    129|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 129]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    129|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 127]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    127|    predictor_.SetPositionAttribute(*att);
   82|    127|    return true;
   83|    129|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    127|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    127|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 17, False: 110]
  ------------------
  145|     17|    return false;
  146|     17|  }
  147|       |
  148|    110|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    110|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    110|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 38, False: 72]
  ------------------
  150|     38|    uint8_t prediction_mode;
  151|     38|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 38]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     38|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 36]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|     36|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 36]
  ------------------
  160|     36|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     36|  }
  164|    108|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    108|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 9, False: 99]
  ------------------
  168|      9|    return false;
  169|      9|  }
  170|       |
  171|     99|  return true;
  172|    108|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     99|                                      const PointIndex *entry_to_point_id_map) {
  103|     99|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     99|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     99|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     99|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     99|  const int corner_map_size =
  111|     99|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     99|  VectorD<int32_t, 3> pred_normal_3d;
  114|     99|  int32_t pred_normal_oct[2];
  115|       |
  116|   264k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 264k, False: 99]
  ------------------
  117|   264k|    const CornerIndex corner_id =
  118|   264k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   264k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   264k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   264k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   264k|                    octahedron_tool_box_.center_value());
  125|   264k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 243k, False: 20.7k]
  ------------------
  126|   243k|      pred_normal_3d = -pred_normal_3d;
  127|   243k|    }
  128|   264k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   264k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   264k|    const int data_offset = data_id * 2;
  132|   264k|    this->transform().ComputeOriginalValue(
  133|   264k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   264k|  }
  135|     99|  flip_normal_bit_decoder_.EndDecoding();
  136|     99|  return true;
  137|     99|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|     99|  void SetQuantizationBits(int q) {
   85|     99|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     99|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    347|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    347|            attribute, transform, mesh_data),
   37|    347|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    693|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    347|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    347|    DRACO_DCHECK_EQ(i, 0);
   70|    347|    (void)i;
   71|    347|    return GeometryAttribute::POSITION;
   72|    347|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    347|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    347|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 347]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    347|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 346]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    346|    predictor_.SetPositionAttribute(*att);
   82|    346|    return true;
   83|    347|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    346|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    346|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 20, False: 326]
  ------------------
  145|     20|    return false;
  146|     20|  }
  147|       |
  148|    326|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    326|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    326|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 76, False: 250]
  ------------------
  150|     76|    uint8_t prediction_mode;
  151|     76|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 75]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     75|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 0, False: 75]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      0|      return false;
  157|      0|    }
  158|       |
  159|     75|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 75]
  ------------------
  160|     75|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     75|  }
  164|    325|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    325|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 15, False: 310]
  ------------------
  168|     15|    return false;
  169|     15|  }
  170|       |
  171|    310|  return true;
  172|    325|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    310|                                      const PointIndex *entry_to_point_id_map) {
  103|    310|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    310|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    310|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    310|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    310|  const int corner_map_size =
  111|    310|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    310|  VectorD<int32_t, 3> pred_normal_3d;
  114|    310|  int32_t pred_normal_oct[2];
  115|       |
  116|   149k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 149k, False: 310]
  ------------------
  117|   149k|    const CornerIndex corner_id =
  118|   149k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   149k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   149k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   149k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   149k|                    octahedron_tool_box_.center_value());
  125|   149k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 122k, False: 26.4k]
  ------------------
  126|   122k|      pred_normal_3d = -pred_normal_3d;
  127|   122k|    }
  128|   149k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   149k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   149k|    const int data_offset = data_id * 2;
  132|   149k|    this->transform().ComputeOriginalValue(
  133|   149k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   149k|  }
  135|    310|  flip_normal_bit_decoder_.EndDecoding();
  136|    310|  return true;
  137|    310|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    310|  void SetQuantizationBits(int q) {
   85|    310|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    310|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    130|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    130|            attribute, transform, mesh_data),
   37|    130|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    111|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    111|            attribute, transform, mesh_data),
   37|    111|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    159|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    159|            attribute, transform, mesh_data),
   37|    159|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    109|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    109|            attribute, transform, mesh_data),
   37|    109|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    156|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    156|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 23, False: 133]
  ------------------
  105|     23|      this->normal_prediction_mode_ = mode;
  106|     23|      return true;
  107|    133|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 133, False: 0]
  ------------------
  108|    133|      this->normal_prediction_mode_ = mode;
  109|    133|      return true;
  110|    133|    }
  111|      0|    return false;
  112|    156|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   326k|                             DataTypeT *prediction) override {
   42|   326k|    DRACO_DCHECK(this->IsInitialized());
   43|   326k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   326k|    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|   326k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   326k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   326k|    VectorD<int64_t, 3> normal;
   53|   326k|    CornerIndex c_next, c_prev;
   54|   747k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 420k, False: 326k]
  ------------------
   55|       |      // Getting corners.
   56|   420k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 132, False: 420k]
  ------------------
   57|    132|        c_next = corner_table->Next(corner_id);
   58|    132|        c_prev = corner_table->Previous(corner_id);
   59|   420k|      } else {
   60|   420k|        c_next = corner_table->Next(cit.Corner());
   61|   420k|        c_prev = corner_table->Previous(cit.Corner());
   62|   420k|      }
   63|   420k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   420k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   420k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   420k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   420k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   420k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   420k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   420k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   420k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   420k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   420k|      cit.Next();
   81|   420k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   326k|    constexpr int64_t upper_bound = 1 << 29;
   85|   326k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 96, False: 326k]
  ------------------
   86|     96|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     96|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 32, False: 64]
  ------------------
   88|     32|        const int64_t quotient = abs_sum / upper_bound;
   89|     32|        normal = normal / quotient;
   90|     32|      }
   91|   326k|    } else {
   92|   326k|      const int64_t abs_sum = normal.AbsSum();
   93|   326k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.31k, False: 325k]
  ------------------
   94|  1.31k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.31k|        normal = normal / quotient;
   96|  1.31k|      }
   97|   326k|    }
   98|   326k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   326k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   326k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   326k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   326k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    125|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    125|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 13, False: 112]
  ------------------
  105|     13|      this->normal_prediction_mode_ = mode;
  106|     13|      return true;
  107|    112|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 112, False: 0]
  ------------------
  108|    112|      this->normal_prediction_mode_ = mode;
  109|    112|      return true;
  110|    112|    }
  111|      0|    return false;
  112|    125|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   174k|                             DataTypeT *prediction) override {
   42|   174k|    DRACO_DCHECK(this->IsInitialized());
   43|   174k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   174k|    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|   174k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   174k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   174k|    VectorD<int64_t, 3> normal;
   53|   174k|    CornerIndex c_next, c_prev;
   54|  1.21M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.03M, False: 174k]
  ------------------
   55|       |      // Getting corners.
   56|  1.03M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 72, False: 1.03M]
  ------------------
   57|     72|        c_next = corner_table->Next(corner_id);
   58|     72|        c_prev = corner_table->Previous(corner_id);
   59|  1.03M|      } else {
   60|  1.03M|        c_next = corner_table->Next(cit.Corner());
   61|  1.03M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.03M|      }
   63|  1.03M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.03M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.03M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.03M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.03M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.03M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.03M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.03M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.03M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.03M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.03M|      cit.Next();
   81|  1.03M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   174k|    constexpr int64_t upper_bound = 1 << 29;
   85|   174k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 48, False: 174k]
  ------------------
   86|     48|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     48|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 16, False: 32]
  ------------------
   88|     16|        const int64_t quotient = abs_sum / upper_bound;
   89|     16|        normal = normal / quotient;
   90|     16|      }
   91|   174k|    } else {
   92|   174k|      const int64_t abs_sum = normal.AbsSum();
   93|   174k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 60.8k, False: 113k]
  ------------------
   94|  60.8k|        const int64_t quotient = abs_sum / upper_bound;
   95|  60.8k|        normal = normal / quotient;
   96|  60.8k|      }
   97|   174k|    }
   98|   174k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   174k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   174k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   174k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   174k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    194|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    194|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 33, False: 161]
  ------------------
  105|     33|      this->normal_prediction_mode_ = mode;
  106|     33|      return true;
  107|    161|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 161, False: 0]
  ------------------
  108|    161|      this->normal_prediction_mode_ = mode;
  109|    161|      return true;
  110|    161|    }
  111|      0|    return false;
  112|    194|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   125k|                             DataTypeT *prediction) override {
   42|   125k|    DRACO_DCHECK(this->IsInitialized());
   43|   125k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   125k|    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|   125k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   125k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   125k|    VectorD<int64_t, 3> normal;
   53|   125k|    CornerIndex c_next, c_prev;
   54|   300k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 174k, False: 125k]
  ------------------
   55|       |      // Getting corners.
   56|   174k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 192, False: 174k]
  ------------------
   57|    192|        c_next = corner_table->Next(corner_id);
   58|    192|        c_prev = corner_table->Previous(corner_id);
   59|   174k|      } else {
   60|   174k|        c_next = corner_table->Next(cit.Corner());
   61|   174k|        c_prev = corner_table->Previous(cit.Corner());
   62|   174k|      }
   63|   174k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   174k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   174k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   174k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   174k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   174k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   174k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   174k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   174k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   174k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   174k|      cit.Next();
   81|   174k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   125k|    constexpr int64_t upper_bound = 1 << 29;
   85|   125k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 128, False: 125k]
  ------------------
   86|    128|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    128|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 32, False: 96]
  ------------------
   88|     32|        const int64_t quotient = abs_sum / upper_bound;
   89|     32|        normal = normal / quotient;
   90|     32|      }
   91|   125k|    } else {
   92|   125k|      const int64_t abs_sum = normal.AbsSum();
   93|   125k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.35k, False: 123k]
  ------------------
   94|  1.35k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.35k|        normal = normal / quotient;
   96|  1.35k|      }
   97|   125k|    }
   98|   125k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   125k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   125k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   125k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   125k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    133|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    133|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 23, False: 110]
  ------------------
  105|     23|      this->normal_prediction_mode_ = mode;
  106|     23|      return true;
  107|    110|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 110, False: 0]
  ------------------
  108|    110|      this->normal_prediction_mode_ = mode;
  109|    110|      return true;
  110|    110|    }
  111|      0|    return false;
  112|    133|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   139k|                             DataTypeT *prediction) override {
   42|   139k|    DRACO_DCHECK(this->IsInitialized());
   43|   139k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   139k|    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|   139k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   139k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   139k|    VectorD<int64_t, 3> normal;
   53|   139k|    CornerIndex c_next, c_prev;
   54|   971k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 831k, False: 139k]
  ------------------
   55|       |      // Getting corners.
   56|   831k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 126, False: 831k]
  ------------------
   57|    126|        c_next = corner_table->Next(corner_id);
   58|    126|        c_prev = corner_table->Previous(corner_id);
   59|   831k|      } else {
   60|   831k|        c_next = corner_table->Next(cit.Corner());
   61|   831k|        c_prev = corner_table->Previous(cit.Corner());
   62|   831k|      }
   63|   831k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   831k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   831k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   831k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   831k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   831k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   831k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   831k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   831k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   831k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   831k|      cit.Next();
   81|   831k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   139k|    constexpr int64_t upper_bound = 1 << 29;
   85|   139k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 84, False: 139k]
  ------------------
   86|     84|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     84|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 30, False: 54]
  ------------------
   88|     30|        const int64_t quotient = abs_sum / upper_bound;
   89|     30|        normal = normal / quotient;
   90|     30|      }
   91|   139k|    } else {
   92|   139k|      const int64_t abs_sum = normal.AbsSum();
   93|   139k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 63.4k, False: 76.3k]
  ------------------
   94|  63.4k|        const int64_t quotient = abs_sum / upper_bound;
   95|  63.4k|        normal = normal / quotient;
   96|  63.4k|      }
   97|   139k|    }
   98|   139k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   139k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   139k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   139k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   139k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    130|      : Base(md) {
   35|    130|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    130|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    166|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    166|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 34, False: 132]
  ------------------
  105|     34|      this->normal_prediction_mode_ = mode;
  106|     34|      return true;
  107|    132|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 132, False: 0]
  ------------------
  108|    132|      this->normal_prediction_mode_ = mode;
  109|    132|      return true;
  110|    132|    }
  111|      0|    return false;
  112|    166|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   264k|                             DataTypeT *prediction) override {
   42|   264k|    DRACO_DCHECK(this->IsInitialized());
   43|   264k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   264k|    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|   264k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   264k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   264k|    VectorD<int64_t, 3> normal;
   53|   264k|    CornerIndex c_next, c_prev;
   54|   655k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 390k, False: 264k]
  ------------------
   55|       |      // Getting corners.
   56|   390k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 112k, False: 278k]
  ------------------
   57|   112k|        c_next = corner_table->Next(corner_id);
   58|   112k|        c_prev = corner_table->Previous(corner_id);
   59|   278k|      } else {
   60|   278k|        c_next = corner_table->Next(cit.Corner());
   61|   278k|        c_prev = corner_table->Previous(cit.Corner());
   62|   278k|      }
   63|   390k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   390k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   390k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   390k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   390k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   390k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   390k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   390k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   390k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   390k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   390k|      cit.Next();
   81|   390k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   264k|    constexpr int64_t upper_bound = 1 << 29;
   85|   264k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 19.0k, False: 245k]
  ------------------
   86|  19.0k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  19.0k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 75, False: 18.9k]
  ------------------
   88|     75|        const int64_t quotient = abs_sum / upper_bound;
   89|     75|        normal = normal / quotient;
   90|     75|      }
   91|   245k|    } else {
   92|   245k|      const int64_t abs_sum = normal.AbsSum();
   93|   245k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.03k, False: 244k]
  ------------------
   94|  1.03k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.03k|        normal = normal / quotient;
   96|  1.03k|      }
   97|   245k|    }
   98|   264k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   264k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   264k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   264k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   264k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    347|      : Base(md) {
   35|    347|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    347|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    422|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    422|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 74, False: 348]
  ------------------
  105|     74|      this->normal_prediction_mode_ = mode;
  106|     74|      return true;
  107|    348|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 348, False: 0]
  ------------------
  108|    348|      this->normal_prediction_mode_ = mode;
  109|    348|      return true;
  110|    348|    }
  111|      0|    return false;
  112|    422|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   149k|                             DataTypeT *prediction) override {
   42|   149k|    DRACO_DCHECK(this->IsInitialized());
   43|   149k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   149k|    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|   149k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   149k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   149k|    VectorD<int64_t, 3> normal;
   53|   149k|    CornerIndex c_next, c_prev;
   54|   997k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 848k, False: 149k]
  ------------------
   55|       |      // Getting corners.
   56|   848k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 315k, False: 533k]
  ------------------
   57|   315k|        c_next = corner_table->Next(corner_id);
   58|   315k|        c_prev = corner_table->Previous(corner_id);
   59|   533k|      } else {
   60|   533k|        c_next = corner_table->Next(cit.Corner());
   61|   533k|        c_prev = corner_table->Previous(cit.Corner());
   62|   533k|      }
   63|   848k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   848k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   848k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   848k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   848k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   848k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   848k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   848k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   848k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   848k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   848k|      cit.Next();
   81|   848k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   149k|    constexpr int64_t upper_bound = 1 << 29;
   85|   149k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 53.8k, False: 95.2k]
  ------------------
   86|  53.8k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  53.8k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 192, False: 53.6k]
  ------------------
   88|    192|        const int64_t quotient = abs_sum / upper_bound;
   89|    192|        normal = normal / quotient;
   90|    192|      }
   91|  95.2k|    } else {
   92|  95.2k|      const int64_t abs_sum = normal.AbsSum();
   93|  95.2k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 8.68k, False: 86.5k]
  ------------------
   94|  8.68k|        const int64_t quotient = abs_sum / upper_bound;
   95|  8.68k|        normal = normal / quotient;
   96|  8.68k|      }
   97|  95.2k|    }
   98|   149k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   149k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   149k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   149k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   149k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    130|      : Base(md) {
   35|    130|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    130|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    111|      : Base(md) {
   35|    111|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    111|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    159|      : Base(md) {
   35|    159|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    159|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    109|      : Base(md) {
   35|    109|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    109|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.16M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.16M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.16M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.16M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.16M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.16M|    return GetPositionForDataId(data_id);
   77|  1.16M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.16M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.16M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.16M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.16M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.16M|    VectorD<int64_t, 3> pos;
   68|  1.16M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.16M|    return pos;
   70|  1.16M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    129|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    129|    pos_attribute_ = &position_attribute;
   43|    129|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    118|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    118|    entry_to_point_id_map_ = map;
   46|    118|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.25M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.25M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.25M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.25M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.25M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.25M|    return GetPositionForDataId(data_id);
   77|  2.25M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.25M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.25M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.25M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.25M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.25M|    VectorD<int64_t, 3> pos;
   68|  2.25M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.25M|    return pos;
   70|  2.25M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    108|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    108|    pos_attribute_ = &position_attribute;
   43|    108|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     97|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     97|    entry_to_point_id_map_ = map;
   46|     97|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   475k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   475k|    DRACO_DCHECK(this->IsInitialized());
   73|   475k|    const auto corner_table = mesh_data_.corner_table();
   74|   475k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   475k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   475k|    return GetPositionForDataId(data_id);
   77|   475k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|   475k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   475k|    DRACO_DCHECK(this->IsInitialized());
   65|   475k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   475k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   475k|    VectorD<int64_t, 3> pos;
   68|   475k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   475k|    return pos;
   70|   475k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    156|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    156|    pos_attribute_ = &position_attribute;
   43|    156|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    134|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    134|    entry_to_point_id_map_ = map;
   46|    134|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.80M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.80M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.80M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.80M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.80M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.80M|    return GetPositionForDataId(data_id);
   77|  1.80M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.80M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.80M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.80M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.80M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.80M|    VectorD<int64_t, 3> pos;
   68|  1.80M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.80M|    return pos;
   70|  1.80M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    108|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    108|    pos_attribute_ = &position_attribute;
   43|    108|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     98|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     98|    entry_to_point_id_map_ = map;
   46|     98|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    130|      : pos_attribute_(nullptr),
   36|    130|        entry_to_point_id_map_(nullptr),
   37|    130|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    130|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.04M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.04M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.04M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.04M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.04M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.04M|    return GetPositionForDataId(data_id);
   77|  1.04M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.04M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.04M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.04M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.04M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.04M|    VectorD<int64_t, 3> pos;
   68|  1.04M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.04M|    return pos;
   70|  1.04M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    127|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    127|    pos_attribute_ = &position_attribute;
   43|    127|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     99|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     99|    entry_to_point_id_map_ = map;
   46|     99|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    347|      : pos_attribute_(nullptr),
   36|    347|        entry_to_point_id_map_(nullptr),
   37|    347|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    347|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.84M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.84M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.84M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.84M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.84M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.84M|    return GetPositionForDataId(data_id);
   77|  1.84M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.84M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.84M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.84M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.84M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.84M|    VectorD<int64_t, 3> pos;
   68|  1.84M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.84M|    return pos;
   70|  1.84M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    346|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    346|    pos_attribute_ = &position_attribute;
   43|    346|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    310|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    310|    entry_to_point_id_map_ = map;
   46|    310|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    130|      : pos_attribute_(nullptr),
   36|    130|        entry_to_point_id_map_(nullptr),
   37|    130|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    130|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    111|      : pos_attribute_(nullptr),
   36|    111|        entry_to_point_id_map_(nullptr),
   37|    111|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    111|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    159|      : pos_attribute_(nullptr),
   36|    159|        entry_to_point_id_map_(nullptr),
   37|    159|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    159|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    109|      : pos_attribute_(nullptr),
   36|    109|        entry_to_point_id_map_(nullptr),
   37|    109|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    109|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    252|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    252|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    239|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    239|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    239|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    239|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    239|      new DataTypeT[num_components]());
   70|       |
   71|    239|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    239|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    239|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    239|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    239|  const int corner_map_size =
   78|    239|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   667k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 666k, False: 239]
  ------------------
   80|   666k|    const CornerIndex start_corner_id =
   81|   666k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   666k|    CornerIndex corner_id(start_corner_id);
   84|   666k|    int num_parallelograms = 0;
   85|  36.4M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 35.8M, False: 666k]
  ------------------
   86|  35.8M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  35.8M|    }
   88|  1.70M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.04M, False: 666k]
  ------------------
   89|  1.04M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 150k, False: 889k]
  ------------------
   90|  1.04M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.04M|              num_components, parallelogram_pred_vals.get())) {
   92|  6.90M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 6.75M, False: 150k]
  ------------------
   93|  6.75M|          pred_vals[c] =
   94|  6.75M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  6.75M|        }
   96|   150k|        ++num_parallelograms;
   97|   150k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.04M|      corner_id = table->SwingRight(corner_id);
  101|  1.04M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 73.5k, False: 966k]
  ------------------
  102|  73.5k|        corner_id = kInvalidCornerIndex;
  103|  73.5k|      }
  104|  1.04M|    }
  105|       |
  106|   666k|    const int dst_offset = p * num_components;
  107|   666k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 588k, False: 78.7k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|   588k|      const int src_offset = (p - 1) * num_components;
  111|   588k|      this->transform().ComputeOriginalValue(
  112|   588k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   588k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  3.58M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 3.50M, False: 78.7k]
  ------------------
  116|  3.50M|        pred_vals[c] /= num_parallelograms;
  117|  3.50M|      }
  118|  78.7k|      this->transform().ComputeOriginalValue(
  119|  78.7k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  78.7k|    }
  121|   666k|  }
  122|    239|  return true;
  123|    239|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    281|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    281|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    264|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    264|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    264|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    264|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    264|      new DataTypeT[num_components]());
   70|       |
   71|    264|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    264|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    264|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    264|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    264|  const int corner_map_size =
   78|    264|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   536k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 536k, False: 264]
  ------------------
   80|   536k|    const CornerIndex start_corner_id =
   81|   536k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   536k|    CornerIndex corner_id(start_corner_id);
   84|   536k|    int num_parallelograms = 0;
   85|  16.0M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 15.5M, False: 536k]
  ------------------
   86|  15.5M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  15.5M|    }
   88|  3.70M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 3.17M, False: 536k]
  ------------------
   89|  3.17M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.04M, False: 2.12M]
  ------------------
   90|  3.17M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  3.17M|              num_components, parallelogram_pred_vals.get())) {
   92|  31.3M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 30.2M, False: 1.04M]
  ------------------
   93|  30.2M|          pred_vals[c] =
   94|  30.2M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  30.2M|        }
   96|  1.04M|        ++num_parallelograms;
   97|  1.04M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  3.17M|      corner_id = table->SwingRight(corner_id);
  101|  3.17M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 525k, False: 2.64M]
  ------------------
  102|   525k|        corner_id = kInvalidCornerIndex;
  103|   525k|      }
  104|  3.17M|    }
  105|       |
  106|   536k|    const int dst_offset = p * num_components;
  107|   536k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.28k, False: 535k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.28k|      const int src_offset = (p - 1) * num_components;
  111|  1.28k|      this->transform().ComputeOriginalValue(
  112|  1.28k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   535k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  15.9M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 15.4M, False: 535k]
  ------------------
  116|  15.4M|        pred_vals[c] /= num_parallelograms;
  117|  15.4M|      }
  118|   535k|      this->transform().ComputeOriginalValue(
  119|   535k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   535k|    }
  121|   536k|  }
  122|    264|  return true;
  123|    264|}

_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|    403|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|    403|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|    375|                          const PointIndex * /* entry_to_point_id_map */) {
   61|    375|  this->transform().Init(num_components);
   62|       |
   63|    375|  const CornerTable *const table = this->mesh_data().corner_table();
   64|    375|  const std::vector<int32_t> *const vertex_to_data_map =
   65|    375|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|    375|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|    375|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    375|  const int corner_map_size =
   74|    375|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|   573k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (75:19): [True: 572k, False: 375]
  ------------------
   76|   572k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   77|   572k|    const int dst_offset = p * num_components;
   78|   572k|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (78:9): [True: 520k, False: 52.2k]
  ------------------
   79|   572k|                                        *vertex_to_data_map, out_data,
   80|   572k|                                        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|   520k|      const int src_offset = (p - 1) * num_components;
   85|   520k|      this->transform().ComputeOriginalValue(
   86|   520k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   87|   520k|    } else {
   88|       |      // Apply the parallelogram prediction.
   89|  52.2k|      this->transform().ComputeOriginalValue(
   90|  52.2k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   91|  52.2k|    }
   92|   572k|  }
   93|    375|  return true;
   94|    375|}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|    412|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|    412|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|    371|                          const PointIndex * /* entry_to_point_id_map */) {
   61|    371|  this->transform().Init(num_components);
   62|       |
   63|    371|  const CornerTable *const table = this->mesh_data().corner_table();
   64|    371|  const std::vector<int32_t> *const vertex_to_data_map =
   65|    371|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|    371|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|    371|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    371|  const int corner_map_size =
   74|    371|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|   304k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (75:19): [True: 303k, False: 371]
  ------------------
   76|   303k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   77|   303k|    const int dst_offset = p * num_components;
   78|   303k|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (78:9): [True: 8.09k, False: 295k]
  ------------------
   79|   303k|                                        *vertex_to_data_map, out_data,
   80|   303k|                                        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|  8.09k|      const int src_offset = (p - 1) * num_components;
   85|  8.09k|      this->transform().ComputeOriginalValue(
   86|  8.09k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   87|   295k|    } else {
   88|       |      // Apply the parallelogram prediction.
   89|   295k|      this->transform().ComputeOriginalValue(
   90|   295k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   91|   295k|    }
   92|   303k|  }
   93|    371|  return true;
   94|    371|}

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  2.06M|    int num_components, DataTypeT *out_prediction) {
   49|  2.06M|  const CornerIndex oci = table->Opposite(ci);
   50|  2.06M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 1.40M, False: 661k]
  ------------------
   51|  1.40M|    return false;
   52|  1.40M|  }
   53|   661k|  int vert_opp, vert_next, vert_prev;
   54|   661k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   661k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   661k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 349k, False: 312k]
  |  Branch (56:35): [True: 264k, False: 84.8k]
  ------------------
   57|   264k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 254k, False: 9.63k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   254k|    const int v_opp_off = vert_opp * num_components;
   60|   254k|    const int v_next_off = vert_next * num_components;
   61|   254k|    const int v_prev_off = vert_prev * num_components;
   62|  10.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 10.3M, False: 254k]
  ------------------
   63|  10.3M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  10.3M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  10.3M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  10.3M|      const int64_t result =
   67|  10.3M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  10.3M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  10.3M|    }
   71|   254k|    return true;
   72|   254k|  }
   73|   406k|  return false;  // Not all data is available for prediction
   74|   661k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   661k|    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|   661k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   661k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   661k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   661k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  3.86M|    int num_components, DataTypeT *out_prediction) {
   49|  3.86M|  const CornerIndex oci = table->Opposite(ci);
   50|  3.86M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 15.4k, False: 3.84M]
  ------------------
   51|  15.4k|    return false;
   52|  15.4k|  }
   53|  3.84M|  int vert_opp, vert_next, vert_prev;
   54|  3.84M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  3.84M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  3.84M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 2.06M, False: 1.78M]
  |  Branch (56:35): [True: 1.60M, False: 453k]
  ------------------
   57|  1.60M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 1.46M, False: 139k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  1.46M|    const int v_opp_off = vert_opp * num_components;
   60|  1.46M|    const int v_next_off = vert_next * num_components;
   61|  1.46M|    const int v_prev_off = vert_prev * num_components;
   62|  62.3M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 60.8M, False: 1.46M]
  ------------------
   63|  60.8M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  60.8M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  60.8M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  60.8M|      const int64_t result =
   67|  60.8M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  60.8M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  60.8M|    }
   71|  1.46M|    return true;
   72|  1.46M|  }
   73|  2.37M|  return false;  // Not all data is available for prediction
   74|  3.84M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  3.84M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  3.84M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  3.84M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  3.84M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  3.84M|}

_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    102|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    102|            attribute, transform, mesh_data),
   46|    102|        pos_attribute_(nullptr),
   47|    102|        entry_to_point_id_map_(nullptr),
   48|    102|        num_components_(0),
   49|    102|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   71|    200|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   73|    102|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    102|    DRACO_DCHECK_EQ(i, 0);
   75|    102|    (void)i;
   76|    102|    return GeometryAttribute::POSITION;
   77|    102|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    101|  bool SetParentAttribute(const PointAttribute *att) override {
   80|    101|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 101]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    101|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 101]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    101|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 3, False: 98]
  ------------------
   87|      3|      return false;  // Currently works only for 3 component positions.
   88|      3|    }
   89|     98|    pos_attribute_ = att;
   90|     98|    return true;
   91|    101|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|     96|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|     96|  uint32_t num_orientations = 0;
  156|     96|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     96|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 3, False: 93]
  ------------------
  157|      3|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 1, False: 2]
  ------------------
  158|      1|      return false;
  159|      1|    }
  160|     93|  } else {
  161|     93|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 1, False: 92]
  ------------------
  162|      1|      return false;
  163|      1|    }
  164|     93|  }
  165|     94|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 1, False: 93]
  ------------------
  166|      1|    return false;
  167|      1|  }
  168|     93|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 5, False: 88]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      5|    return false;
  172|      5|  }
  173|     88|  orientations_.resize(num_orientations);
  174|     88|  bool last_orientation = true;
  175|     88|  RAnsBitDecoder decoder;
  176|     88|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 1, False: 87]
  ------------------
  177|      1|    return false;
  178|      1|  }
  179|  41.7k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 41.6k, False: 87]
  ------------------
  180|  41.6k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 29.1k, False: 12.5k]
  ------------------
  181|  29.1k|      last_orientation = !last_orientation;
  182|  29.1k|    }
  183|  41.6k|    orientations_[i] = last_orientation;
  184|  41.6k|  }
  185|     87|  decoder.EndDecoding();
  186|     87|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|     87|                                     MeshDataT>::DecodePredictionData(buffer);
  188|     88|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|     61|                          const PointIndex *entry_to_point_id_map) {
  126|     61|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 2, False: 59]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      2|    return false;
  129|      2|  }
  130|     59|  num_components_ = num_components;
  131|     59|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|     59|  predicted_value_ =
  133|     59|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|     59|  this->transform().Init(num_components);
  135|       |
  136|     59|  const int corner_map_size =
  137|     59|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|   360k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 360k, False: 48]
  ------------------
  139|   360k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|   360k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 11, False: 360k]
  ------------------
  141|     11|      return false;
  142|     11|    }
  143|       |
  144|   360k|    const int dst_offset = p * num_components;
  145|   360k|    this->transform().ComputeOriginalValue(
  146|   360k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|   360k|  }
  148|     48|  return true;
  149|     59|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|   360k|                          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|   360k|  const CornerIndex next_corner_id =
  198|   360k|      this->mesh_data().corner_table()->Next(corner_id);
  199|   360k|  const CornerIndex prev_corner_id =
  200|   360k|      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|   360k|  int next_data_id, prev_data_id;
  204|       |
  205|   360k|  int next_vert_id, prev_vert_id;
  206|   360k|  next_vert_id =
  207|   360k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|   360k|  prev_vert_id =
  209|   360k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|   360k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|   360k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|   360k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 246k, False: 114k]
  |  Branch (214:33): [True: 132k, False: 114k]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|   132k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|   132k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|   132k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 131k, False: 1.36k]
  ------------------
  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|   262k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 262k, False: 131k]
  ------------------
  223|   262k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 262k]
  |  Branch (223:36): [True: 87, False: 261k]
  ------------------
  224|   261k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 261k]
  ------------------
  225|     87|          predicted_value_[i] = INT_MIN;
  226|   261k|        } else {
  227|   261k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   261k|        }
  229|   262k|      }
  230|   131k|      return true;
  231|   131k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  1.36k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  1.36k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  1.36k|    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.36k|    const Vector3f pn = prev_pos - next_pos;
  261|  1.36k|    const Vector3f cn = tip_pos - next_pos;
  262|  1.36k|    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.36k|    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.36k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  2.72k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 1.36k]
  |  Branch (273:53): [True: 25, False: 1.33k]
  ------------------
  274|     25|      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|     25|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  1.33k|    } else {
  280|  1.33k|      s = 0;
  281|  1.33k|      t = 0;
  282|  1.33k|    }
  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.36k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  1.36k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  1.36k|    const float pnut = pn_uv[0] * t;
  301|  1.36k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  1.36k|    const float pnvt = pn_uv[1] * t;
  303|  1.36k|    Vector2f predicted_uv;
  304|  1.36k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 11, False: 1.35k]
  ------------------
  305|     11|      return false;
  306|     11|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  1.35k|    const bool orientation = orientations_.back();
  310|  1.35k|    orientations_.pop_back();
  311|  1.35k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 662, False: 688]
  ------------------
  312|    662|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|    688|    } else {
  314|    688|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|    688|    }
  316|  1.35k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 1.35k, 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.35k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  1.35k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 1.35k]
  |  Branch (321:28): [True: 88, False: 1.26k]
  |  Branch (321:43): [True: 9, False: 1.25k]
  ------------------
  322|     97|        predicted_value_[0] = INT_MIN;
  323|  1.25k|      } else {
  324|  1.25k|        predicted_value_[0] = static_cast<int>(u);
  325|  1.25k|      }
  326|  1.35k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  1.35k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 1.35k]
  |  Branch (327:28): [True: 62, False: 1.28k]
  |  Branch (327:43): [True: 10, False: 1.27k]
  ------------------
  328|     72|        predicted_value_[1] = INT_MIN;
  329|  1.27k|      } else {
  330|  1.27k|        predicted_value_[1] = static_cast<int>(v);
  331|  1.27k|      }
  332|  1.35k|    } 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.35k|    return true;
  338|  1.36k|  }
  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|   228k|  int data_offset = 0;
  343|   228k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 114k, False: 114k]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|   114k|    data_offset = prev_data_id * num_components_;
  346|   114k|  }
  347|   228k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 9, False: 228k]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|      9|    data_offset = next_data_id * num_components_;
  350|   228k|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|   228k|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 228k, False: 59]
  ------------------
  354|   228k|      data_offset = (data_id - 1) * num_components_;
  355|   228k|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    177|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 118, False: 59]
  ------------------
  358|    118|        predicted_value_[i] = 0;
  359|    118|      }
  360|     59|      return true;
  361|     59|    }
  362|   228k|  }
  363|   684k|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 456k, False: 228k]
  ------------------
  364|   456k|    predicted_value_[i] = data[data_offset + i];
  365|   456k|  }
  366|   228k|  return true;
  367|   228k|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   264k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   264k|    const int data_offset = entry_id * num_components_;
  104|   264k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   264k|                    static_cast<float>(data[data_offset + 1]));
  106|   264k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   94|  4.08k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  4.08k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  4.08k|    Vector3f pos;
   97|  4.08k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  4.08k|                                 &pos[0]);
   99|  4.08k|    return pos;
  100|  4.08k|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    103|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    103|            attribute, transform, mesh_data),
   46|    103|        pos_attribute_(nullptr),
   47|    103|        entry_to_point_id_map_(nullptr),
   48|    103|        num_components_(0),
   49|    103|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   71|    201|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   73|    103|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    103|    DRACO_DCHECK_EQ(i, 0);
   75|    103|    (void)i;
   76|    103|    return GeometryAttribute::POSITION;
   77|    103|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    103|  bool SetParentAttribute(const PointAttribute *att) override {
   80|    103|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 103]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    103|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 103]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    103|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 5, False: 98]
  ------------------
   87|      5|      return false;  // Currently works only for 3 component positions.
   88|      5|    }
   89|     98|    pos_attribute_ = att;
   90|     98|    return true;
   91|    103|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|     94|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|     94|  uint32_t num_orientations = 0;
  156|     94|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     94|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 2, False: 92]
  ------------------
  157|      2|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 1, False: 1]
  ------------------
  158|      1|      return false;
  159|      1|    }
  160|     92|  } else {
  161|     92|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 1, False: 91]
  ------------------
  162|      1|      return false;
  163|      1|    }
  164|     92|  }
  165|     92|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 3, False: 89]
  ------------------
  166|      3|    return false;
  167|      3|  }
  168|     89|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 7, False: 82]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      7|    return false;
  172|      7|  }
  173|     82|  orientations_.resize(num_orientations);
  174|     82|  bool last_orientation = true;
  175|     82|  RAnsBitDecoder decoder;
  176|     82|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 1, False: 81]
  ------------------
  177|      1|    return false;
  178|      1|  }
  179|  44.3k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 44.2k, False: 81]
  ------------------
  180|  44.2k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 27.1k, False: 17.0k]
  ------------------
  181|  27.1k|      last_orientation = !last_orientation;
  182|  27.1k|    }
  183|  44.2k|    orientations_[i] = last_orientation;
  184|  44.2k|  }
  185|     81|  decoder.EndDecoding();
  186|     81|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|     81|                                     MeshDataT>::DecodePredictionData(buffer);
  188|     82|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|     67|                          const PointIndex *entry_to_point_id_map) {
  126|     67|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 4, False: 63]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      4|    return false;
  129|      4|  }
  130|     63|  num_components_ = num_components;
  131|     63|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|     63|  predicted_value_ =
  133|     63|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|     63|  this->transform().Init(num_components);
  135|       |
  136|     63|  const int corner_map_size =
  137|     63|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|  65.6k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 65.5k, False: 48]
  ------------------
  139|  65.5k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|  65.5k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 15, False: 65.5k]
  ------------------
  141|     15|      return false;
  142|     15|    }
  143|       |
  144|  65.5k|    const int dst_offset = p * num_components;
  145|  65.5k|    this->transform().ComputeOriginalValue(
  146|  65.5k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|  65.5k|  }
  148|     48|  return true;
  149|     63|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|  65.5k|                          int data_id) {
  194|       |  // Compute the predicted UV coordinate from the positions on all corners
  195|       |  // of the processed triangle. For the best prediction, the UV coordinates
  196|       |  // on the next/previous corners need to be already encoded/decoded.
  197|  65.5k|  const CornerIndex next_corner_id =
  198|  65.5k|      this->mesh_data().corner_table()->Next(corner_id);
  199|  65.5k|  const CornerIndex prev_corner_id =
  200|  65.5k|      this->mesh_data().corner_table()->Previous(corner_id);
  201|       |  // Get the encoded data ids from the next and previous corners.
  202|       |  // The data id is the encoding order of the UV coordinates.
  203|  65.5k|  int next_data_id, prev_data_id;
  204|       |
  205|  65.5k|  int next_vert_id, prev_vert_id;
  206|  65.5k|  next_vert_id =
  207|  65.5k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|  65.5k|  prev_vert_id =
  209|  65.5k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|  65.5k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|  65.5k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|  65.5k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 65.3k, False: 231]
  |  Branch (214:33): [True: 65.1k, False: 222]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|  65.1k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|  65.1k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|  65.1k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 63.9k, False: 1.12k]
  ------------------
  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|   127k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 127k, False: 63.9k]
  ------------------
  223|   127k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 127k]
  |  Branch (223:36): [True: 108, False: 127k]
  ------------------
  224|   127k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 127k]
  ------------------
  225|    108|          predicted_value_[i] = INT_MIN;
  226|   127k|        } else {
  227|   127k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   127k|        }
  229|   127k|      }
  230|  63.9k|      return true;
  231|  63.9k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  1.12k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  1.12k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  1.12k|    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.12k|    const Vector3f pn = prev_pos - next_pos;
  261|  1.12k|    const Vector3f cn = tip_pos - next_pos;
  262|  1.12k|    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.12k|    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.12k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  2.24k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 1.12k]
  |  Branch (273:53): [True: 276, False: 844]
  ------------------
  274|    276|      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|    276|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|    844|    } else {
  280|    844|      s = 0;
  281|    844|      t = 0;
  282|    844|    }
  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.12k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  1.12k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  1.12k|    const float pnut = pn_uv[0] * t;
  301|  1.12k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  1.12k|    const float pnvt = pn_uv[1] * t;
  303|  1.12k|    Vector2f predicted_uv;
  304|  1.12k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 15, False: 1.10k]
  ------------------
  305|     15|      return false;
  306|     15|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  1.10k|    const bool orientation = orientations_.back();
  310|  1.10k|    orientations_.pop_back();
  311|  1.10k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 585, False: 520]
  ------------------
  312|    585|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|    585|    } else {
  314|    520|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|    520|    }
  316|  1.10k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 1.10k, 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.10k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  1.10k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 1.10k]
  |  Branch (321:28): [True: 59, False: 1.04k]
  |  Branch (321:43): [True: 21, False: 1.02k]
  ------------------
  322|     80|        predicted_value_[0] = INT_MIN;
  323|  1.02k|      } else {
  324|  1.02k|        predicted_value_[0] = static_cast<int>(u);
  325|  1.02k|      }
  326|  1.10k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  1.10k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 1.10k]
  |  Branch (327:28): [True: 64, False: 1.04k]
  |  Branch (327:43): [True: 20, False: 1.02k]
  ------------------
  328|     84|        predicted_value_[1] = INT_MIN;
  329|  1.02k|      } else {
  330|  1.02k|        predicted_value_[1] = static_cast<int>(v);
  331|  1.02k|      }
  332|  1.10k|    } 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.10k|    return true;
  338|  1.12k|  }
  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|    453|  int data_offset = 0;
  343|    453|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 222, False: 231]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|    222|    data_offset = prev_data_id * num_components_;
  346|    222|  }
  347|    453|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 13, False: 440]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|     13|    data_offset = next_data_id * num_components_;
  350|    440|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|    440|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 377, False: 63]
  ------------------
  354|    377|      data_offset = (data_id - 1) * num_components_;
  355|    377|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    189|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 126, False: 63]
  ------------------
  358|    126|        predicted_value_[i] = 0;
  359|    126|      }
  360|     63|      return true;
  361|     63|    }
  362|    440|  }
  363|  1.17k|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 780, False: 390]
  ------------------
  364|    780|    predicted_value_[i] = data[data_offset + i];
  365|    780|  }
  366|    390|  return true;
  367|    453|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   130k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   130k|    const int data_offset = entry_id * num_components_;
  104|   130k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   130k|                    static_cast<float>(data[data_offset + 1]));
  106|   130k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   94|  3.36k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  3.36k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  3.36k|    Vector3f pos;
   97|  3.36k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  3.36k|                                 &pos[0]);
   99|  3.36k|    return pos;
  100|  3.36k|  }

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    160|      : pos_attribute_(nullptr),
   39|    160|        entry_to_point_id_map_(nullptr),
   40|    160|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    159|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    159|    pos_attribute_ = &position_attribute;
   43|    159|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    150|  void ResizeOrientations(int num_orientations) {
   74|    150|    orientations_.resize(num_orientations);
   75|    150|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  5.35G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    124|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    124|    entry_to_point_id_map_ = map;
   46|    124|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   293k|                                                 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|   293k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   293k|  const CornerIndex prev_corner_id =
   99|   293k|      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|   293k|  int next_data_id, prev_data_id;
  103|       |
  104|   293k|  int next_vert_id, prev_vert_id;
  105|   293k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   293k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   293k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   293k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   293k|  typedef VectorD<int64_t, 2> Vec2;
  112|   293k|  typedef VectorD<int64_t, 3> Vec3;
  113|   293k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   293k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 208k, False: 84.2k]
  |  Branch (115:33): [True: 124k, False: 84.2k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   124k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   124k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   124k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 122k, False: 2.09k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   122k|      predicted_value_[0] = p_uv[0];
  122|   122k|      predicted_value_[1] = p_uv[1];
  123|   122k|      return true;
  124|   122k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  2.09k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  2.09k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  2.09k|    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.09k|    const Vec3 pn = prev_pos - next_pos;
  146|  2.09k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  2.09k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.47k, False: 621]
  ------------------
  148|       |      // Compute the projection of C onto PN by computing dot product of CN with
  149|       |      // PN and normalizing it by length of PN. This gives us a factor |s| where
  150|       |      // |s = PN.Dot(CN) / PN.SquaredNorm2()|. This factor can be used to
  151|       |      // compute X in UV space |X_UV| as |X_UV = N_UV + s * PN_UV|.
  152|  1.47k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.47k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.47k|      const Vec2 pn_uv = p_uv - n_uv;
  156|       |      // Because we perform all computations with integers, we don't explicitly
  157|       |      // compute the normalized factor |s|, but rather we perform all operations
  158|       |      // over UV vectors in a non-normalized coordinate system scaled with a
  159|       |      // scaling factor |pn_norm2_squared|:
  160|       |      //
  161|       |      //      x_uv = X_UV * PN.Norm2Squared()
  162|       |      //
  163|  1.47k|      const int64_t n_uv_absmax_element =
  164|  1.47k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.47k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 24, False: 1.45k]
  ------------------
  166|  1.47k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     24|        return false;
  169|     24|      }
  170|  1.45k|      const int64_t pn_uv_absmax_element =
  171|  1.45k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.45k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 7, False: 1.44k]
  ------------------
  173|  1.45k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      7|        return false;
  176|      7|      }
  177|  1.44k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.44k|      const int64_t pn_absmax_element =
  179|  1.44k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.44k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 10, False: 1.43k]
  ------------------
  181|  1.44k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|     10|        return false;
  184|     10|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.43k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.43k|      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.43k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.43k|      const uint64_t norm_squared =
  207|  1.43k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.43k|      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.43k|      Vec2 predicted_uv;
  214|  1.43k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.43k]
  ------------------
  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.43k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.43k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 10, False: 1.42k]
  ------------------
  233|     10|          return false;
  234|     10|        }
  235|  1.42k|        const bool orientation = orientations_.back();
  236|  1.42k|        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.42k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 847, False: 577]
  ------------------
  240|    847|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    847|        } else {
  242|    577|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    577|        }
  244|  1.42k|      }
  245|  1.42k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.42k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.42k|      return true;
  248|  1.43k|    }
  249|  2.09k|  }
  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|   169k|  int data_offset = 0;
  254|   169k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 84.9k, False: 84.2k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  84.9k|    data_offset = prev_data_id * kNumComponents;
  257|  84.9k|  }
  258|   169k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 628, False: 168k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|    628|    data_offset = next_data_id * kNumComponents;
  261|   168k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   168k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 168k, False: 124]
  ------------------
  265|   168k|      data_offset = (data_id - 1) * kNumComponents;
  266|   168k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    372|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 248, False: 124]
  ------------------
  269|    248|        predicted_value_[i] = 0;
  270|    248|      }
  271|    124|      return true;
  272|    124|    }
  273|   168k|  }
  274|   507k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 338k, False: 169k]
  ------------------
  275|   338k|    predicted_value_[i] = data[data_offset + i];
  276|   338k|  }
  277|   169k|  return true;
  278|   169k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   249k|                                            const DataTypeT *data) const {
   59|   249k|    const int data_offset = entry_id * kNumComponents;
   60|   249k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   249k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  6.28k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  6.28k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  6.28k|    VectorD<int64_t, 3> pos;
   52|  6.28k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  6.28k|                                 &pos[0]);
   54|  6.28k|    return pos;
   55|  6.28k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   293k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    150|      : pos_attribute_(nullptr),
   39|    150|        entry_to_point_id_map_(nullptr),
   40|    150|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    147|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    147|    pos_attribute_ = &position_attribute;
   43|    147|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    142|  void ResizeOrientations(int num_orientations) {
   74|    142|    orientations_.resize(num_orientations);
   75|    142|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  5.07G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    105|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    105|    entry_to_point_id_map_ = map;
   46|    105|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   114k|                                                 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|   114k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   114k|  const CornerIndex prev_corner_id =
   99|   114k|      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|   114k|  int next_data_id, prev_data_id;
  103|       |
  104|   114k|  int next_vert_id, prev_vert_id;
  105|   114k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   114k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   114k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   114k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   114k|  typedef VectorD<int64_t, 2> Vec2;
  112|   114k|  typedef VectorD<int64_t, 3> Vec3;
  113|   114k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   114k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 114k, False: 186]
  |  Branch (115:33): [True: 113k, False: 181]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   113k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   113k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   113k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 103k, False: 10.8k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   103k|      predicted_value_[0] = p_uv[0];
  122|   103k|      predicted_value_[1] = p_uv[1];
  123|   103k|      return true;
  124|   103k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  10.8k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  10.8k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  10.8k|    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|  10.8k|    const Vec3 pn = prev_pos - next_pos;
  146|  10.8k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  10.8k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 677, False: 10.1k]
  ------------------
  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|    677|      const Vec3 cn = tip_pos - next_pos;
  153|    677|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    677|      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|    677|      const int64_t n_uv_absmax_element =
  164|    677|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    677|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 10, False: 667]
  ------------------
  166|    677|          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|    667|      const int64_t pn_uv_absmax_element =
  171|    667|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    667|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 8, False: 659]
  ------------------
  173|    667|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      8|        return false;
  176|      8|      }
  177|    659|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|    659|      const int64_t pn_absmax_element =
  179|    659|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|    659|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 8, False: 651]
  ------------------
  181|    659|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      8|        return false;
  184|      8|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|    651|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|    651|      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|    651|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|    651|      const uint64_t norm_squared =
  207|    651|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|    651|      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|    651|      Vec2 predicted_uv;
  214|    651|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 651]
  ------------------
  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|    651|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|    651|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 13, False: 638]
  ------------------
  233|     13|          return false;
  234|     13|        }
  235|    638|        const bool orientation = orientations_.back();
  236|    638|        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|    638|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 329, False: 309]
  ------------------
  240|    329|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    329|        } else {
  242|    309|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    309|        }
  244|    638|      }
  245|    638|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|    638|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|    638|      return true;
  248|    651|    }
  249|  10.8k|  }
  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|  10.5k|  int data_offset = 0;
  254|  10.5k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 10.3k, False: 186]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  10.3k|    data_offset = prev_data_id * kNumComponents;
  257|  10.3k|  }
  258|  10.5k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 10.1k, False: 359]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  10.1k|    data_offset = next_data_id * kNumComponents;
  261|  10.1k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    359|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 254, False: 105]
  ------------------
  265|    254|      data_offset = (data_id - 1) * kNumComponents;
  266|    254|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    315|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 210, False: 105]
  ------------------
  269|    210|        predicted_value_[i] = 0;
  270|    210|      }
  271|    105|      return true;
  272|    105|    }
  273|    359|  }
  274|  31.3k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 20.8k, False: 10.4k]
  ------------------
  275|  20.8k|    predicted_value_[i] = data[data_offset + i];
  276|  20.8k|  }
  277|  10.4k|  return true;
  278|  10.5k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   227k|                                            const DataTypeT *data) const {
   59|   227k|    const int data_offset = entry_id * kNumComponents;
   60|   227k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   227k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  32.5k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  32.5k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  32.5k|    VectorD<int64_t, 3> pos;
   52|  32.5k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  32.5k|                                 &pos[0]);
   54|  32.5k|    return pos;
   55|  32.5k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   114k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    143|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    360|  bool AreCorrectionsPositive() override {
   71|    360|    return transform_.AreCorrectionsPositive();
   72|    360|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    124|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    124|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 19, False: 105]
  ------------------
   50|     19|      return false;
   51|     19|    }
   52|    105|    return true;
   53|    124|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  34.1M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    206|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    443|  bool AreCorrectionsPositive() override {
   71|    443|    return transform_.AreCorrectionsPositive();
   72|    443|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    179|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    179|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 23, False: 156]
  ------------------
   50|     23|      return false;
   51|     23|    }
   52|    156|    return true;
   53|    179|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  5.96M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  3.19k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  2.20k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  3.03k|  bool AreCorrectionsPositive() override {
   71|  3.03k|    return transform_.AreCorrectionsPositive();
   72|  3.03k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  2.40k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  2.40k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 171, False: 2.22k]
  ------------------
   50|    171|      return false;
   51|    171|    }
   52|  2.22k|    return true;
   53|  2.40k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  95.6M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    384|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    474|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    384|                                 const PointCloudDecoder *decoder) {
  188|    384|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    384|      method, att_id, decoder, TransformT());
  190|    384|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    384|                                 const TransformT &transform) {
  156|    384|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 384]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    384|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    384|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 361, False: 23]
  ------------------
  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|    361|    const MeshDecoder *const mesh_decoder =
  167|    361|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    361|    auto ret = CreateMeshPredictionScheme<
  170|    361|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    361|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    361|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    361|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 241, False: 120]
  ------------------
  174|    241|      return ret;
  175|    241|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    361|  }
  178|       |  // Create delta decoder.
  179|    143|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    143|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    384|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    134|      uint16_t bitstream_version) {
  143|    134|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    134|        method, attribute, transform, mesh_data, bitstream_version);
  145|    134|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    134|        uint16_t bitstream_version) {
  127|    134|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 130, False: 4]
  ------------------
  128|    130|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    130|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    130|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    130|                                                  mesh_data));
  132|    130|      }
  133|      4|      return nullptr;
  134|    134|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    113|      uint16_t bitstream_version) {
  143|    113|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    113|        method, attribute, transform, mesh_data, bitstream_version);
  145|    113|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    113|        uint16_t bitstream_version) {
  127|    113|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 111, False: 2]
  ------------------
  128|    111|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    111|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    111|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    111|                                                  mesh_data));
  132|    111|      }
  133|      2|      return nullptr;
  134|    113|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    474|                                 const PointCloudDecoder *decoder) {
  188|    474|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    474|      method, att_id, decoder, TransformT());
  190|    474|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    474|                                 const TransformT &transform) {
  156|    474|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 474]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    474|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    474|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 473, False: 1]
  ------------------
  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|    473|    const MeshDecoder *const mesh_decoder =
  167|    473|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    473|    auto ret = CreateMeshPredictionScheme<
  170|    473|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    473|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    473|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    473|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 268, False: 205]
  ------------------
  174|    268|      return ret;
  175|    268|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    473|  }
  178|       |  // Create delta decoder.
  179|    206|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    206|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    474|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    163|      uint16_t bitstream_version) {
  143|    163|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    163|        method, attribute, transform, mesh_data, bitstream_version);
  145|    163|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    163|        uint16_t bitstream_version) {
  111|    163|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 159, False: 4]
  ------------------
  112|    159|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    159|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    159|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    159|                                                  mesh_data));
  116|    159|      }
  117|      4|      return nullptr;
  118|    163|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    113|      uint16_t bitstream_version) {
  143|    113|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    113|        method, attribute, transform, mesh_data, bitstream_version);
  145|    113|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    113|        uint16_t bitstream_version) {
  111|    113|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 109, False: 4]
  ------------------
  112|    109|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    109|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    109|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    109|                                                  mesh_data));
  116|    109|      }
  117|      4|      return nullptr;
  118|    113|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  3.19k|                                 const PointCloudDecoder *decoder) {
  188|  3.19k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  3.19k|      method, att_id, decoder, TransformT());
  190|  3.19k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  3.19k|                                 const TransformT &transform) {
  156|  3.19k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 3.19k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  3.19k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  3.19k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 3.16k, False: 36]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|  3.16k|    const MeshDecoder *const mesh_decoder =
  167|  3.16k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  3.16k|    auto ret = CreateMeshPredictionScheme<
  170|  3.16k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  3.16k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  3.16k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  3.16k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 2.92k, False: 236]
  ------------------
  174|  2.92k|      return ret;
  175|  2.92k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  3.16k|  }
  178|       |  // Create delta decoder.
  179|    272|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    272|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  3.19k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.34k|      uint16_t bitstream_version) {
  143|  1.34k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.34k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.34k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.34k|        uint16_t bitstream_version) {
   53|  1.34k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 403, False: 942]
  ------------------
   54|    403|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    403|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    403|                                                         MeshDataT>(
   57|    403|                attribute, transform, mesh_data));
   58|    403|      }
   59|    942|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|    942|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 252, False: 690]
  ------------------
   61|    252|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    252|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    252|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    252|                                                  mesh_data));
   65|    252|      }
   66|    690|#endif
   67|    690|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 298, False: 392]
  ------------------
   68|    298|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    298|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    298|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    298|                                                  mesh_data));
   72|    298|      }
   73|    392|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    392|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 102, False: 290]
  ------------------
   75|    102|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    102|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    102|                                                     MeshDataT>(
   78|    102|                attribute, transform, mesh_data, bitstream_version));
   79|    102|      }
   80|    290|#endif
   81|    290|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 160, False: 130]
  ------------------
   82|    160|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    160|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    160|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    160|                                                  mesh_data));
   86|    160|      }
   87|    130|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    130|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 130, False: 0]
  ------------------
   89|    130|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    130|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    130|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    130|                                                  mesh_data));
   93|    130|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.34k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.58k|      uint16_t bitstream_version) {
  143|  1.58k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.58k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.58k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.58k|        uint16_t bitstream_version) {
   53|  1.58k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 412, False: 1.17k]
  ------------------
   54|    412|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    412|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    412|                                                         MeshDataT>(
   57|    412|                attribute, transform, mesh_data));
   58|    412|      }
   59|  1.17k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.17k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 281, False: 889]
  ------------------
   61|    281|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    281|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    281|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    281|                                                  mesh_data));
   65|    281|      }
   66|    889|#endif
   67|    889|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 289, False: 600]
  ------------------
   68|    289|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    289|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    289|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    289|                                                  mesh_data));
   72|    289|      }
   73|    600|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    600|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 103, False: 497]
  ------------------
   75|    103|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    103|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    103|                                                     MeshDataT>(
   78|    103|                attribute, transform, mesh_data, bitstream_version));
   79|    103|      }
   80|    497|#endif
   81|    497|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 150, False: 347]
  ------------------
   82|    150|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    150|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    150|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    150|                                                  mesh_data));
   86|    150|      }
   87|    347|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    347|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 347, False: 0]
  ------------------
   89|    347|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    347|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    347|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    347|                                                  mesh_data));
   93|    347|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.58k|    }

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    361|    uint16_t bitstream_version) {
   38|    361|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    361|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 361, False: 0]
  ------------------
   40|    361|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 8, False: 353]
  ------------------
   41|    353|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 16, False: 337]
  ------------------
   42|    337|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 1, False: 336]
  ------------------
   43|    336|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 27, False: 309]
  ------------------
   44|    309|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 241, False: 68]
  ------------------
   45|    297|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 4, False: 64]
  ------------------
   46|    297|    const CornerTable *const ct = source->GetCornerTable();
   47|    297|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    297|        source->GetAttributeEncodingData(att_id);
   49|    297|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 50, False: 247]
  |  Branch (49:26): [True: 0, False: 247]
  ------------------
   50|       |      // No connectivity data found.
   51|     50|      return nullptr;
   52|     50|    }
   53|       |    // Connectivity data exists.
   54|    247|    const MeshAttributeCornerTable *const att_ct =
   55|    247|        source->GetAttributeCornerTable(att_id);
   56|    247|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 134, False: 113]
  ------------------
   57|    134|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    134|      MeshData md;
   59|    134|      md.Set(source->mesh(), att_ct,
   60|    134|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    134|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    134|      MeshPredictionSchemeFactoryT factory;
   63|    134|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    134|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 130, False: 4]
  ------------------
   65|    130|        return ret;
   66|    130|      }
   67|    134|    } else {
   68|    113|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    113|      MeshData md;
   70|    113|      md.Set(source->mesh(), ct,
   71|    113|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    113|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    113|      MeshPredictionSchemeFactoryT factory;
   74|    113|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    113|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 111, False: 2]
  ------------------
   76|    111|        return ret;
   77|    111|      }
   78|    113|    }
   79|    247|  }
   80|     70|  return nullptr;
   81|    361|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    473|    uint16_t bitstream_version) {
   38|    473|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    473|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 473, False: 0]
  ------------------
   40|    473|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 41, False: 432]
  ------------------
   41|    432|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 35, False: 397]
  ------------------
   42|    397|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 19, False: 378]
  ------------------
   43|    378|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 377]
  ------------------
   44|    377|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 268, False: 109]
  ------------------
   45|    367|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 3, False: 106]
  ------------------
   46|    367|    const CornerTable *const ct = source->GetCornerTable();
   47|    367|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    367|        source->GetAttributeEncodingData(att_id);
   49|    367|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 91, False: 276]
  |  Branch (49:26): [True: 0, False: 276]
  ------------------
   50|       |      // No connectivity data found.
   51|     91|      return nullptr;
   52|     91|    }
   53|       |    // Connectivity data exists.
   54|    276|    const MeshAttributeCornerTable *const att_ct =
   55|    276|        source->GetAttributeCornerTable(att_id);
   56|    276|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 163, False: 113]
  ------------------
   57|    163|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    163|      MeshData md;
   59|    163|      md.Set(source->mesh(), att_ct,
   60|    163|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    163|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    163|      MeshPredictionSchemeFactoryT factory;
   63|    163|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    163|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 159, False: 4]
  ------------------
   65|    159|        return ret;
   66|    159|      }
   67|    163|    } else {
   68|    113|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    113|      MeshData md;
   70|    113|      md.Set(source->mesh(), ct,
   71|    113|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    113|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    113|      MeshPredictionSchemeFactoryT factory;
   74|    113|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    113|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 109, False: 4]
  ------------------
   76|    109|        return ret;
   77|    109|      }
   78|    113|    }
   79|    276|  }
   80|    114|  return nullptr;
   81|    473|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  3.16k|    uint16_t bitstream_version) {
   38|  3.16k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  3.16k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 3.16k, False: 0]
  ------------------
   40|  3.16k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 847, False: 2.31k]
  ------------------
   41|  2.31k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 549, False: 1.76k]
  ------------------
   42|  1.76k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 602, False: 1.16k]
  ------------------
   43|  1.16k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 321, False: 844]
  ------------------
   44|    844|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 484, False: 360]
  ------------------
   45|  3.01k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 211, False: 149]
  ------------------
   46|  3.01k|    const CornerTable *const ct = source->GetCornerTable();
   47|  3.01k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  3.01k|        source->GetAttributeEncodingData(att_id);
   49|  3.01k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 87, False: 2.92k]
  |  Branch (49:26): [True: 0, False: 2.92k]
  ------------------
   50|       |      // No connectivity data found.
   51|     87|      return nullptr;
   52|     87|    }
   53|       |    // Connectivity data exists.
   54|  2.92k|    const MeshAttributeCornerTable *const att_ct =
   55|  2.92k|        source->GetAttributeCornerTable(att_id);
   56|  2.92k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.34k, False: 1.58k]
  ------------------
   57|  1.34k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.34k|      MeshData md;
   59|  1.34k|      md.Set(source->mesh(), att_ct,
   60|  1.34k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.34k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.34k|      MeshPredictionSchemeFactoryT factory;
   63|  1.34k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.34k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.34k, False: 0]
  ------------------
   65|  1.34k|        return ret;
   66|  1.34k|      }
   67|  1.58k|    } else {
   68|  1.58k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  1.58k|      MeshData md;
   70|  1.58k|      md.Set(source->mesh(), ct,
   71|  1.58k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  1.58k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  1.58k|      MeshPredictionSchemeFactoryT factory;
   74|  1.58k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  1.58k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 1.58k, False: 0]
  ------------------
   76|  1.58k|        return ret;
   77|  1.58k|      }
   78|  1.58k|    }
   79|  2.92k|  }
   80|    149|  return nullptr;
   81|  3.16k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  5.96M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  5.96M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 2.00M, False: 3.96M]
  |  Branch (93:22): [True: 919k, False: 1.08M]
  ------------------
   94|   919k|      return true;
   95|   919k|    }
   96|  5.04M|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 746k, False: 4.29M]
  |  Branch (96:25): [True: 366k, False: 380k]
  ------------------
   97|  5.96M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  5.96M|  int32_t GetRotationCount(Point2 pred) const {
   51|  5.96M|    const DataType sign_x = pred[0];
   52|  5.96M|    const DataType sign_y = pred[1];
   53|       |
   54|  5.96M|    int32_t rotation_count = 0;
   55|  5.96M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 2.00M, False: 3.96M]
  ------------------
   56|  2.00M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 919k, False: 1.08M]
  ------------------
   57|   919k|        rotation_count = 0;
   58|  1.08M|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 723k, False: 361k]
  ------------------
   59|   723k|        rotation_count = 3;
   60|   723k|      } else {
   61|   361k|        rotation_count = 1;
   62|   361k|      }
   63|  3.96M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 3.21M, False: 746k]
  ------------------
   64|  3.21M|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 2.49M, False: 714k]
  ------------------
   65|  2.49M|        rotation_count = 2;
   66|  2.49M|      } else {
   67|   714k|        rotation_count = 1;
   68|   714k|      }
   69|  3.21M|    } else {
   70|   746k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 366k, False: 380k]
  ------------------
   71|   366k|        rotation_count = 0;
   72|   380k|      } else {
   73|   380k|        rotation_count = 3;
   74|   380k|      }
   75|   746k|    }
   76|  5.96M|    return rotation_count;
   77|  5.96M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|  9.35M|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|  9.35M|    switch (rotation_count) {
   81|  2.17M|      case 1:
  ------------------
  |  Branch (81:7): [True: 2.17M, False: 7.17M]
  ------------------
   82|  2.17M|        return Point2(p[1], -p[0]);
   83|  4.99M|      case 2:
  ------------------
  |  Branch (83:7): [True: 4.99M, False: 4.35M]
  ------------------
   84|  4.99M|        return Point2(-p[0], -p[1]);
   85|  2.17M|      case 3:
  ------------------
  |  Branch (85:7): [True: 2.17M, False: 7.17M]
  ------------------
   86|  2.17M|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 9.35M]
  ------------------
   88|      0|        return p;
   89|  9.35M|    }
   90|  9.35M|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    474|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

_ZN5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE19DecodeTransformDataEPNS_13DecoderBufferE:
   45|    360|  bool DecodeTransformData(DecoderBuffer *buffer) {
   46|    360|    DataTypeT max_quantized_value, center_value;
   47|    360|    if (!buffer->Decode(&max_quantized_value)) {
  ------------------
  |  Branch (47:9): [True: 9, False: 351]
  ------------------
   48|      9|      return false;
   49|      9|    }
   50|    351|    if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    351|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (50:9): [True: 53, False: 298]
  ------------------
   51|     53|      if (!buffer->Decode(&center_value)) {
  ------------------
  |  Branch (51:11): [True: 3, False: 50]
  ------------------
   52|      3|        return false;
   53|      3|      }
   54|     53|    }
   55|    348|    (void)center_value;
   56|    348|    return this->set_max_quantized_value(max_quantized_value);
   57|    351|  }
_ZNK5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE20ComputeOriginalValueEPKiS3_Pi:
   61|  34.1M|                                   DataType *out_orig_vals) const {
   62|  34.1M|    DRACO_DCHECK_LE(pred_vals[0], 2 * this->center_value());
   63|  34.1M|    DRACO_DCHECK_LE(pred_vals[1], 2 * this->center_value());
   64|  34.1M|    DRACO_DCHECK_LE(corr_vals[0], 2 * this->center_value());
   65|  34.1M|    DRACO_DCHECK_LE(corr_vals[1], 2 * this->center_value());
   66|       |
   67|  34.1M|    DRACO_DCHECK_LE(0, pred_vals[0]);
   68|  34.1M|    DRACO_DCHECK_LE(0, pred_vals[1]);
   69|  34.1M|    DRACO_DCHECK_LE(0, corr_vals[0]);
   70|  34.1M|    DRACO_DCHECK_LE(0, corr_vals[1]);
   71|       |
   72|  34.1M|    const Point2 pred = Point2(pred_vals[0], pred_vals[1]);
   73|  34.1M|    const Point2 corr = Point2(corr_vals[0], corr_vals[1]);
   74|  34.1M|    const Point2 orig = ComputeOriginalValue(pred, corr);
   75|       |
   76|  34.1M|    out_orig_vals[0] = orig[0];
   77|  34.1M|    out_orig_vals[1] = orig[1];
   78|  34.1M|  }
_ZNK5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE20ComputeOriginalValueENS_7VectorDIiLi2EEERKS3_:
   81|  34.1M|  Point2 ComputeOriginalValue(Point2 pred, const Point2 &corr) const {
   82|  34.1M|    const Point2 t(this->center_value(), this->center_value());
   83|  34.1M|    typedef typename std::make_unsigned<DataTypeT>::type UnsignedDataTypeT;
   84|  34.1M|    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|  34.1M|    pred = Point2(Point2u(pred) - Point2u(t));
   89|       |
   90|  34.1M|    const bool pred_is_in_diamond = this->IsInDiamond(pred[0], pred[1]);
   91|  34.1M|    if (!pred_is_in_diamond) {
  ------------------
  |  Branch (91:9): [True: 19.3M, False: 14.8M]
  ------------------
   92|  19.3M|      this->InvertDiamond(&pred[0], &pred[1]);
   93|  19.3M|    }
   94|       |
   95|       |    // Perform the addition in unsigned type to avoid signed integer overflow.
   96|       |    // Note that the result will be the same (for non-overflowing values).
   97|  34.1M|    Point2 orig(Point2u(pred) + Point2u(corr));
   98|       |
   99|  34.1M|    orig[0] = this->ModMax(orig[0]);
  100|  34.1M|    orig[1] = this->ModMax(orig[1]);
  101|  34.1M|    if (!pred_is_in_diamond) {
  ------------------
  |  Branch (101:9): [True: 19.3M, False: 14.8M]
  ------------------
  102|  19.3M|      this->InvertDiamond(&orig[0], &orig[1]);
  103|  19.3M|    }
  104|       |
  105|       |    // Perform the addition in unsigned type to avoid signed integer overflow.
  106|       |    // Note that the result will be the same (for non-overflowing values).
  107|  34.1M|    orig = Point2(Point2u(orig) + Point2u(t));
  108|  34.1M|    return orig;
  109|  34.1M|  }
_ZN5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE4InitEi:
   44|    105|  void Init(int num_components) {}
_ZN5draco49PredictionSchemeNormalOctahedronDecodingTransformIiEC2Ev:
   41|    384|  PredictionSchemeNormalOctahedronDecodingTransform() {}

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

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

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

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

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

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  25.9k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  5.10k|    DecoderBuffer *buffer) {
   30|  5.10k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 235, False: 4.87k]
  ------------------
   31|    235|    return false;
   32|    235|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  4.87k|  const int32_t num_attributes = GetNumAttributes();
   35|  4.87k|  sequential_decoders_.resize(num_attributes);
   36|  16.0k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 11.1k, False: 4.84k]
  ------------------
   37|  11.1k|    uint8_t decoder_type;
   38|  11.1k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 12, False: 11.1k]
  ------------------
   39|     12|      return false;
   40|     12|    }
   41|       |    // Create the decoder from the id.
   42|  11.1k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  11.1k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 7, False: 11.1k]
  ------------------
   44|      7|      return false;
   45|      7|    }
   46|  11.1k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 7, False: 11.1k]
  ------------------
   47|      7|      return false;
   48|      7|    }
   49|  11.1k|  }
   50|  4.84k|  return true;
   51|  4.87k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  3.31k|    DecoderBuffer *buffer) {
   55|  3.31k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 3.31k]
  |  Branch (55:22): [True: 7, False: 3.30k]
  ------------------
   56|      7|    return false;
   57|      7|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  3.30k|  const int32_t num_attributes = GetNumAttributes();
   60|  12.6k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 9.37k, False: 3.30k]
  ------------------
   61|  9.37k|    PointAttribute *const pa =
   62|  9.37k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  9.37k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 1, False: 9.37k]
  ------------------
   64|      1|      return false;
   65|      1|    }
   66|  9.37k|  }
   67|  3.30k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  3.30k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  3.30k|    DecoderBuffer *in_buffer) {
   72|  3.30k|  const int32_t num_attributes = GetNumAttributes();
   73|  8.78k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 7.13k, False: 1.64k]
  ------------------
   74|  7.13k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 1.65k, False: 5.47k]
  ------------------
   75|  7.13k|                                                          in_buffer)) {
   76|  1.65k|      return false;
   77|  1.65k|    }
   78|  7.13k|  }
   79|  1.64k|  return true;
   80|  3.30k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  1.64k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  1.64k|  const int32_t num_attributes = GetNumAttributes();
   85|  4.40k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 3.07k, False: 1.32k]
  ------------------
   86|  3.07k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 320, False: 2.75k]
  ------------------
   87|  3.07k|            point_ids_, in_buffer)) {
   88|    320|      return false;
   89|    320|    }
   90|  3.07k|  }
   91|  1.32k|  return true;
   92|  1.64k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  1.32k|    TransformAttributesToOriginalFormat() {
   96|  1.32k|  const int32_t num_attributes = GetNumAttributes();
   97|  3.38k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 2.41k, False: 968]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  2.41k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 2.41k, False: 0]
  ------------------
  100|  2.41k|      const PointAttribute *const attribute =
  101|  2.41k|          sequential_decoders_[i]->attribute();
  102|  2.41k|      const PointAttribute *const portable_attribute =
  103|  2.41k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  2.41k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 2.10k, False: 313]
  |  Branch (104:11): [True: 0, False: 2.41k]
  ------------------
  105|  2.10k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 0, False: 2.10k]
  ------------------
  106|  2.10k|              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|  2.41k|    }
  116|  2.41k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 361, False: 2.05k]
  ------------------
  117|  2.41k|            point_ids_)) {
  118|    361|      return false;
  119|    361|    }
  120|  2.41k|  }
  121|    968|  return true;
  122|  1.32k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  11.1k|    uint8_t decoder_type) {
  127|  11.1k|  switch (decoder_type) {
  128|  1.06k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.06k, False: 10.0k]
  ------------------
  129|  1.06k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.06k|          new SequentialAttributeDecoder());
  131|  8.54k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 8.54k, False: 2.60k]
  ------------------
  132|  8.54k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  8.54k|          new SequentialIntegerAttributeDecoder());
  134|    437|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 437, False: 10.7k]
  ------------------
  135|    437|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    437|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.09k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.09k, False: 10.0k]
  ------------------
  139|  1.09k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.09k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|      7|    default:
  ------------------
  |  Branch (142:5): [True: 7, False: 11.1k]
  ------------------
  143|      7|      break;
  144|  11.1k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|      7|  return nullptr;
  147|  11.1k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  10.0k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  10.0k|                                             int attribute_id) {
   27|  10.0k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 10.0k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  10.0k|  return true;
   31|  10.0k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  2.10k|    const std::vector<PointIndex> &point_ids) {
   35|  2.10k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  2.10k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 2.10k, False: 0]
  ------------------
   37|  2.10k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.10k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 0, False: 2.10k]
  ------------------
   38|      0|    return true;  // Don't revert the transform here for older files.
   39|      0|  }
   40|  2.10k|#endif
   41|  2.10k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  2.10k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  6.55k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  6.55k|  int8_t prediction_scheme_method;
   48|  6.55k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 121, False: 6.43k]
  ------------------
   49|    121|    return false;
   50|    121|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  6.43k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 42, False: 6.39k]
  ------------------
   53|  6.39k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 105, False: 6.28k]
  ------------------
   54|    147|    return false;
   55|    147|  }
   56|  6.28k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 6.20k, False: 83]
  ------------------
   57|  6.20k|    int8_t prediction_transform_type;
   58|  6.20k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 39, False: 6.16k]
  ------------------
   59|     39|      return false;
   60|     39|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  6.16k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 18, False: 6.14k]
  ------------------
   63|  6.14k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 34, False: 6.11k]
  ------------------
   64|     52|      return false;
   65|     52|    }
   66|  6.11k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  6.11k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  6.11k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  6.11k|  }
   70|       |
   71|  6.19k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 4.05k, False: 2.13k]
  ------------------
   72|  4.05k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 25, False: 4.03k]
  ------------------
   73|     25|      return false;
   74|     25|    }
   75|  4.05k|  }
   76|       |
   77|  6.17k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 1.10k, False: 5.06k]
  ------------------
   78|  1.10k|    return false;
   79|  1.10k|  }
   80|       |
   81|  5.06k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  5.06k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  5.06k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 5.06k, False: 0]
  ------------------
   84|  5.06k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  5.06k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 1, False: 5.06k]
  ------------------
   85|       |    // For older files, revert the transform right after we decode the data.
   86|      1|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (86:9): [True: 1, False: 0]
  ------------------
   87|      1|      return false;
   88|      1|    }
   89|      1|  }
   90|  5.06k|#endif
   91|  5.06k|  return true;
   92|  5.06k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  5.21k|    PredictionSchemeTransformType transform_type) {
   98|  5.21k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 2.01k, False: 3.19k]
  ------------------
   99|  2.01k|    return nullptr;  // For now we support only wrap transform.
  100|  2.01k|  }
  101|  3.19k|  return CreatePredictionSchemeForDecoder<
  102|  3.19k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  3.19k|      method, attribute_id(), decoder());
  104|  5.21k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  6.16k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  6.16k|  const int num_components = GetNumValueComponents();
  109|  6.16k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 6.16k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  6.16k|  const size_t num_entries = point_ids.size();
  113|  6.16k|  const size_t num_values = num_entries * num_components;
  114|  6.16k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  6.16k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  6.16k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 3, False: 6.16k]
  ------------------
  117|      3|    return false;
  118|      3|  }
  119|  6.16k|  uint8_t compressed;
  120|  6.16k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 22, False: 6.14k]
  ------------------
  121|     22|    return false;
  122|     22|  }
  123|  6.14k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 480, False: 5.66k]
  ------------------
  124|       |    // Decode compressed values.
  125|    480|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 202, False: 278]
  ------------------
  126|    480|                       in_buffer,
  127|    480|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    202|      return false;
  129|    202|    }
  130|  5.66k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  5.66k|    uint8_t num_bytes;
  134|  5.66k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 8, False: 5.65k]
  ------------------
  135|      8|      return false;
  136|      8|    }
  137|  5.65k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 184, False: 5.47k]
  ------------------
  138|    184|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 184]
  ------------------
  139|    184|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    184|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 5, False: 179]
  ------------------
  143|    184|                             sizeof(int32_t) * num_values)) {
  144|      5|        return false;
  145|      5|      }
  146|  5.47k|    } else {
  147|  5.47k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 29, False: 5.44k]
  ------------------
  148|  5.47k|          num_bytes * num_values) {
  149|     29|        return false;
  150|     29|      }
  151|  5.44k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 29, False: 5.41k]
  ------------------
  152|  5.44k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     29|        return false;
  154|     29|      }
  155|  2.29G|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 2.29G, False: 5.41k]
  ------------------
  156|  2.29G|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 2.29G]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|  2.29G|      }
  160|  5.41k|    }
  161|  5.65k|  }
  162|       |
  163|  5.87k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 5.87k, False: 0]
  |  Branch (163:26): [True: 2.03k, False: 3.84k]
  ------------------
  164|  5.06k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 3.03k, False: 803]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  5.06k|    ConvertSymbolsToSignedInts(
  167|  5.06k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  5.06k|        static_cast<int>(num_values), portable_attribute_data);
  169|  5.06k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  5.87k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 3.84k, False: 2.03k]
  ------------------
  173|  3.84k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 495, False: 3.34k]
  ------------------
  174|    495|      return false;
  175|    495|    }
  176|       |
  177|  3.34k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 3.34k, False: 0]
  ------------------
  178|  3.34k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 308, False: 3.03k]
  ------------------
  179|  3.34k|              portable_attribute_data, portable_attribute_data,
  180|  3.34k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    308|        return false;
  182|    308|      }
  183|  3.34k|    }
  184|  3.34k|  }
  185|  5.06k|  return true;
  186|  5.87k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  1.76k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  1.76k|  switch (attribute()->data_type()) {
  190|    220|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 220, False: 1.54k]
  ------------------
  191|    220|      StoreTypedValues<uint8_t>(num_values);
  192|    220|      break;
  193|    829|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 829, False: 931]
  ------------------
  194|    829|      StoreTypedValues<int8_t>(num_values);
  195|    829|      break;
  196|    117|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 117, False: 1.64k]
  ------------------
  197|    117|      StoreTypedValues<uint16_t>(num_values);
  198|    117|      break;
  199|    222|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 222, False: 1.53k]
  ------------------
  200|    222|      StoreTypedValues<int16_t>(num_values);
  201|    222|      break;
  202|    145|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 145, False: 1.61k]
  ------------------
  203|    145|      StoreTypedValues<uint32_t>(num_values);
  204|    145|      break;
  205|     74|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 74, False: 1.68k]
  ------------------
  206|     74|      StoreTypedValues<int32_t>(num_values);
  207|     74|      break;
  208|    153|    default:
  ------------------
  |  Branch (208:5): [True: 153, False: 1.60k]
  ------------------
  209|    153|      return false;
  210|  1.76k|  }
  211|  1.60k|  return true;
  212|  1.76k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  6.16k|    int num_entries, int num_components) {
  237|  6.16k|  GeometryAttribute ga;
  238|  6.16k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  6.16k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  6.16k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  6.16k|  port_att->SetIdentityMapping();
  242|  6.16k|  port_att->Reset(num_entries);
  243|  6.16k|  port_att->set_unique_id(attribute()->unique_id());
  244|  6.16k|  SetPortableAttribute(std::move(port_att));
  245|  6.16k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    220|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    220|  const int num_components = attribute()->num_components();
  217|    220|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    220|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    220|      new AttributeTypeT[num_components]);
  220|    220|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    220|  int val_id = 0;
  222|    220|  int out_byte_pos = 0;
  223|  52.2M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 52.2M, False: 220]
  ------------------
  224|   362M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 309M, False: 52.2M]
  ------------------
  225|   309M|      const AttributeTypeT value =
  226|   309M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   309M|      att_val[c] = value;
  228|   309M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  52.2M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  52.2M|    out_byte_pos += entry_size;
  232|  52.2M|  }
  233|    220|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|    829|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    829|  const int num_components = attribute()->num_components();
  217|    829|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    829|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    829|      new AttributeTypeT[num_components]);
  220|    829|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    829|  int val_id = 0;
  222|    829|  int out_byte_pos = 0;
  223|  91.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 91.3M, False: 829]
  ------------------
  224|   202M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 110M, False: 91.3M]
  ------------------
  225|   110M|      const AttributeTypeT value =
  226|   110M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   110M|      att_val[c] = value;
  228|   110M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  91.3M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  91.3M|    out_byte_pos += entry_size;
  232|  91.3M|  }
  233|    829|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|    117|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    117|  const int num_components = attribute()->num_components();
  217|    117|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    117|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    117|      new AttributeTypeT[num_components]);
  220|    117|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    117|  int val_id = 0;
  222|    117|  int out_byte_pos = 0;
  223|   101M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 101M, False: 117]
  ------------------
  224|   431M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 329M, False: 101M]
  ------------------
  225|   329M|      const AttributeTypeT value =
  226|   329M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   329M|      att_val[c] = value;
  228|   329M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   101M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   101M|    out_byte_pos += entry_size;
  232|   101M|  }
  233|    117|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    222|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    222|  const int num_components = attribute()->num_components();
  217|    222|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    222|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    222|      new AttributeTypeT[num_components]);
  220|    222|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    222|  int val_id = 0;
  222|    222|  int out_byte_pos = 0;
  223|  2.03M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 2.03M, False: 222]
  ------------------
  224|   192M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 190M, False: 2.03M]
  ------------------
  225|   190M|      const AttributeTypeT value =
  226|   190M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   190M|      att_val[c] = value;
  228|   190M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  2.03M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  2.03M|    out_byte_pos += entry_size;
  232|  2.03M|  }
  233|    222|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    145|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    145|  const int num_components = attribute()->num_components();
  217|    145|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    145|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    145|      new AttributeTypeT[num_components]);
  220|    145|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    145|  int val_id = 0;
  222|    145|  int out_byte_pos = 0;
  223|  50.2M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 50.2M, False: 145]
  ------------------
  224|   161M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 110M, False: 50.2M]
  ------------------
  225|   110M|      const AttributeTypeT value =
  226|   110M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   110M|      att_val[c] = value;
  228|   110M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  50.2M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  50.2M|    out_byte_pos += entry_size;
  232|  50.2M|  }
  233|    145|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|     74|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     74|  const int num_components = attribute()->num_components();
  217|     74|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     74|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     74|      new AttributeTypeT[num_components]);
  220|     74|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     74|  int val_id = 0;
  222|     74|  int out_byte_pos = 0;
  223|  54.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 54.3M, False: 74]
  ------------------
  224|   469M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 415M, False: 54.3M]
  ------------------
  225|   415M|      const AttributeTypeT value =
  226|   415M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   415M|      att_val[c] = value;
  228|   415M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  54.3M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  54.3M|    out_byte_pos += entry_size;
  232|  54.3M|  }
  233|     74|}

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

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

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

_ZN5draco38SequentialQuantizationAttributeDecoderC2Ev:
   22|    437|    SequentialQuantizationAttributeDecoder() {}
_ZN5draco38SequentialQuantizationAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   25|    437|                                                  int attribute_id) {
   26|    437|  if (!SequentialIntegerAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (26:7): [True: 0, False: 437]
  ------------------
   27|      0|    return false;
   28|      0|  }
   29|    437|  const PointAttribute *const attribute =
   30|    437|      decoder->point_cloud()->attribute(attribute_id);
   31|       |  // Currently we can quantize only floating point arguments.
   32|    437|  if (attribute->data_type() != DT_FLOAT32) {
  ------------------
  |  Branch (32:7): [True: 3, False: 434]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|    434|  return true;
   36|    437|}
_ZN5draco38SequentialQuantizationAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   39|    284|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   40|    284|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   41|    284|  if (decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0) &&
  ------------------
  |  |  115|    568|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (41:7): [True: 2, False: 282]
  ------------------
   42|      2|      !DecodeQuantizedDataInfo()) {
  ------------------
  |  Branch (42:7): [True: 1, False: 1]
  ------------------
   43|      1|    return false;
   44|      1|  }
   45|    283|#endif
   46|    283|  return SequentialIntegerAttributeDecoder::DecodeIntegerValues(point_ids,
   47|    283|                                                                in_buffer);
   48|    284|}
_ZN5draco38SequentialQuantizationAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   52|     76|        const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   53|     76|  if (decoder()->bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     76|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (53:7): [True: 76, False: 0]
  ------------------
   54|       |    // Decode quantization data here only for files with bitstream version 2.0+
   55|     76|    if (!DecodeQuantizedDataInfo()) {
  ------------------
  |  Branch (55:9): [True: 47, False: 29]
  ------------------
   56|     47|      return false;
   57|     47|    }
   58|     76|  }
   59|       |
   60|       |  // Store the decoded transform data in portable attribute;
   61|     29|  return quantization_transform_.TransferToAttribute(portable_attribute());
   62|     76|}
_ZN5draco38SequentialQuantizationAttributeDecoder11StoreValuesEj:
   64|     27|bool SequentialQuantizationAttributeDecoder::StoreValues(uint32_t num_points) {
   65|     27|  return DequantizeValues(num_points);
   66|     27|}
_ZN5draco38SequentialQuantizationAttributeDecoder23DecodeQuantizedDataInfoEv:
   68|     78|bool SequentialQuantizationAttributeDecoder::DecodeQuantizedDataInfo() {
   69|       |  // Get attribute used as source for decoding.
   70|     78|  auto att = GetPortableAttribute();
   71|     78|  if (att == nullptr) {
  ------------------
  |  Branch (71:7): [True: 2, False: 76]
  ------------------
   72|       |    // This should happen only in the backward compatibility mode. It will still
   73|       |    // work fine for this case because the only thing the quantization transform
   74|       |    // cares about is the number of components that is the same for both source
   75|       |    // and target attributes.
   76|      2|    att = attribute();
   77|      2|  }
   78|     78|  return quantization_transform_.DecodeParameters(*att, decoder()->buffer());
   79|     78|}
_ZN5draco38SequentialQuantizationAttributeDecoder16DequantizeValuesEj:
   82|     27|    uint32_t num_values) {
   83|       |  // Convert all quantized values back to floats.
   84|     27|  return quantization_transform_.InverseTransformAttribute(
   85|     27|      *GetPortableAttribute(), attribute());
   86|     27|}

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  5.90M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  5.90M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  5.90M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  5.90M|    const int remaining = 32 - num_used_bits_;
   54|  5.90M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 5.68M, False: 223k]
  ------------------
   55|  5.68M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 5.37M, False: 314k]
  ------------------
   56|  5.37M|        return false;
   57|  5.37M|      }
   58|   314k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   314k|      num_used_bits_ += nbits;
   60|   314k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 10.5k, False: 303k]
  ------------------
   61|  10.5k|        ++pos_;
   62|  10.5k|        num_used_bits_ = 0;
   63|  10.5k|      }
   64|   314k|    } else {
   65|   223k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 214k, False: 8.99k]
  ------------------
   66|   214k|        return false;
   67|   214k|      }
   68|  8.99k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  8.99k|      num_used_bits_ = nbits - remaining;
   70|  8.99k|      ++pos_;
   71|  8.99k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  8.99k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  8.99k|    }
   74|   323k|    return true;
   75|  5.90M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  6.20M|  bool DecodeNextBit() {
   35|  6.20M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  6.20M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 5.92M, False: 277k]
  ------------------
   37|  5.92M|      return false;
   38|  5.92M|    }
   39|   277k|    const bool bit = *pos_ & selector;
   40|   277k|    ++num_used_bits_;
   41|   277k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 8.50k, False: 268k]
  ------------------
   42|  8.50k|      ++pos_;
   43|  8.50k|      num_used_bits_ = 0;
   44|  8.50k|    }
   45|   277k|    return bit;
   46|  6.20M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    440|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    513|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    322|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  7.55k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 7.34k, False: 206]
  ------------------
   35|  7.34k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 116, False: 7.23k]
  ------------------
   36|    116|        return false;
   37|    116|      }
   38|  7.34k|    }
   39|    206|    return bit_decoder_.StartDecoding(source_buffer);
   40|    322|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  1.97M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  1.97M|    uint32_t result = 0;
   49|  12.3M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 10.3M, False: 1.97M]
  ------------------
   50|  10.3M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  10.3M|      result = (result << 1) + bit;
   52|  10.3M|    }
   53|  1.97M|    *value = result;
   54|  1.97M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     52|  void EndDecoding() {
   57|  1.71k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 1.66k, False: 52]
  ------------------
   58|  1.66k|      folded_number_decoders_[i].EndDecoding();
   59|  1.66k|    }
   60|     52|    bit_decoder_.EndDecoding();
   61|     52|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    513|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  43.6k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  21.9k|                                const uint8_t *const buf, int offset) {
  301|  21.9k|  unsigned x;
  302|  21.9k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 42, False: 21.9k]
  ------------------
  303|     42|    return 1;
  304|     42|  }
  305|  21.9k|  ans->buf = buf;
  306|  21.9k|  x = buf[offset - 1] >> 6;
  307|  21.9k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 19.5k, False: 2.37k]
  ------------------
  308|  19.5k|    ans->buf_offset = offset - 1;
  309|  19.5k|    ans->state = buf[offset - 1] & 0x3F;
  310|  19.5k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.12k, False: 250]
  ------------------
  311|  2.12k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 4, False: 2.12k]
  ------------------
  312|      4|      return 1;
  313|      4|    }
  314|  2.12k|    ans->buf_offset = offset - 2;
  315|  2.12k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.12k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 243, False: 7]
  ------------------
  317|    243|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 3, False: 240]
  ------------------
  318|      3|      return 1;
  319|      3|    }
  320|    240|    ans->buf_offset = offset - 3;
  321|    240|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    240|  } else {
  323|      7|    return 1;
  324|      7|  }
  325|  21.8k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  21.8k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  21.8k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  21.8k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  21.8k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 6, False: 21.8k]
  ------------------
  327|      6|    return 1;
  328|      6|  }
  329|  21.8k|  return 0;
  330|  21.8k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.12k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.12k|  uint32_t val;
   69|  2.12k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.12k|  val = mem[1] << 8;
   72|  2.12k|  val |= mem[0];
   73|  2.12k|  return val;
   74|  2.12k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    240|static uint32_t mem_get_le24(const void *vmem) {
   77|    240|  uint32_t val;
   78|    240|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    240|  val = mem[2] << 16;
   81|    240|  val |= mem[1] << 8;
   82|    240|  val |= mem[0];
   83|    240|  return val;
   84|    240|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  10.5G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  10.5G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  10.5G|  unsigned quot, rem, x, xn;
  172|  10.5G|#endif
  173|  10.5G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  10.5G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  10.5G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  21.0G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 9.72G, False: 776M]
  |  Branch (174:40): [True: 63.2k, False: 9.72G]
  ------------------
  175|  63.2k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  63.2k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  63.2k|  }
  177|       |#if DRACO_ANS_IMPL1
  178|       |  val = ans->state % DRACO_ANS_P8_PRECISION < p;
  179|       |  l_s = val ? p : p0;
  180|       |  ans->state = (ans->state / DRACO_ANS_P8_PRECISION) * l_s +
  181|       |               ans->state % DRACO_ANS_P8_PRECISION - (!val * p);
  182|       |#else
  183|  10.5G|  x = ans->state;
  184|  10.5G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  10.5G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  10.5G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  10.5G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  10.5G|  xn = quot * p;
  187|  10.5G|  val = rem < p;
  188|  10.5G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  21.0G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 9.72G, False: 772M]
  |  |  ------------------
  ------------------
  189|  9.72G|    ans->state = xn + rem;
  190|  9.72G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   772M|    ans->state = x - xn - p;
  193|   772M|  }
  194|  10.5G|#endif
  195|  10.5G|  return val;
  196|  10.5G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  58.9k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  58.9k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  58.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  58.9k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  3.67k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  2.03k|                                       uint32_t num_symbols) {
  482|  2.03k|    lut_table_.resize(rans_precision);
  483|  2.03k|    probability_table_.resize(num_symbols);
  484|  2.03k|    uint32_t cum_prob = 0;
  485|  2.03k|    uint32_t act_prob = 0;
  486|  16.0k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 14.1k, False: 1.90k]
  ------------------
  487|  14.1k|      probability_table_[i].prob = token_probs[i];
  488|  14.1k|      probability_table_[i].cum_prob = cum_prob;
  489|  14.1k|      cum_prob += token_probs[i];
  490|  14.1k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 131, False: 14.0k]
  ------------------
  491|    131|        return false;
  492|    131|      }
  493|  7.19M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 7.18M, False: 14.0k]
  ------------------
  494|  7.18M|        lut_table_[j] = i;
  495|  7.18M|      }
  496|  14.0k|      act_prob = cum_prob;
  497|  14.0k|    }
  498|  1.90k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 190, False: 1.71k]
  ------------------
  499|    190|      return false;
  500|    190|    }
  501|  1.71k|    return true;
  502|  1.90k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.38k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.38k|    unsigned x;
  423|  1.38k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 98, False: 1.28k]
  ------------------
  424|     98|      return 1;
  425|     98|    }
  426|  1.28k|    ans_.buf = buf;
  427|  1.28k|    x = buf[offset - 1] >> 6;
  428|  1.28k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 728, False: 555]
  ------------------
  429|    728|      ans_.buf_offset = offset - 1;
  430|    728|      ans_.state = buf[offset - 1] & 0x3F;
  431|    728|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 211, False: 344]
  ------------------
  432|    211|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 56, False: 155]
  ------------------
  433|     56|        return 1;
  434|     56|      }
  435|    155|      ans_.buf_offset = offset - 2;
  436|    155|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    344|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 241, False: 103]
  ------------------
  438|    241|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 76, False: 165]
  ------------------
  439|     76|        return 1;
  440|     76|      }
  441|    165|      ans_.buf_offset = offset - 3;
  442|    165|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    165|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 103, False: 0]
  ------------------
  444|    103|      ans_.buf_offset = offset - 4;
  445|    103|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    103|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.15k|    ans_.state += l_rans_base;
  450|  1.15k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.15k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 105, False: 1.04k]
  ------------------
  451|    105|      return 1;
  452|    105|    }
  453|  1.04k|    return 0;
  454|  1.15k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    270|static uint32_t mem_get_le16(const void *vmem) {
   68|    270|  uint32_t val;
   69|    270|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    270|  val = mem[1] << 8;
   72|    270|  val |= mem[0];
   73|    270|  return val;
   74|    270|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    240|static uint32_t mem_get_le24(const void *vmem) {
   77|    240|  uint32_t val;
   78|    240|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    240|  val = mem[2] << 16;
   81|    240|  val |= mem[1] << 8;
   82|    240|  val |= mem[0];
   83|    240|  return val;
   84|    240|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    352|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    352|  uint32_t val;
   88|    352|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    352|  val = mem[3] << 24;
   91|    352|  val |= mem[2] << 16;
   92|    352|  val |= mem[1] << 8;
   93|    352|  val |= mem[0];
   94|    352|  return val;
   95|    352|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|   325M|  inline int rans_read() {
  463|   325M|    unsigned rem;
  464|   325M|    unsigned quo;
  465|   325M|    struct rans_dec_sym sym;
  466|   325M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 302M, False: 22.9M]
  |  Branch (466:40): [True: 13.5k, False: 302M]
  ------------------
  467|  13.5k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  13.5k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  13.5k|    }
  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|   325M|    quo = ans_.state / rans_precision;
  472|   325M|    rem = ans_.state % rans_precision;
  473|   325M|    fetch_sym(&sym, rem);
  474|   325M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   325M|    return sym.val;
  476|   325M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|   325M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   325M|    uint32_t symbol = lut_table_[rem];
  507|   325M|    out->val = symbol;
  508|   325M|    out->prob = probability_table_[symbol].prob;
  509|   325M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   325M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|  1.00k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    370|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    242|                                       uint32_t num_symbols) {
  482|    242|    lut_table_.resize(rans_precision);
  483|    242|    probability_table_.resize(num_symbols);
  484|    242|    uint32_t cum_prob = 0;
  485|    242|    uint32_t act_prob = 0;
  486|  12.0k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 11.7k, False: 216]
  ------------------
  487|  11.7k|      probability_table_[i].prob = token_probs[i];
  488|  11.7k|      probability_table_[i].cum_prob = cum_prob;
  489|  11.7k|      cum_prob += token_probs[i];
  490|  11.7k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 26, False: 11.7k]
  ------------------
  491|     26|        return false;
  492|     26|      }
  493|  1.55M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.54M, False: 11.7k]
  ------------------
  494|  1.54M|        lut_table_[j] = i;
  495|  1.54M|      }
  496|  11.7k|      act_prob = cum_prob;
  497|  11.7k|    }
  498|    216|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 38, False: 178]
  ------------------
  499|     38|      return false;
  500|     38|    }
  501|    178|    return true;
  502|    216|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|    102|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    102|    unsigned x;
  423|    102|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 4, False: 98]
  ------------------
  424|      4|      return 1;
  425|      4|    }
  426|     98|    ans_.buf = buf;
  427|     98|    x = buf[offset - 1] >> 6;
  428|     98|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 42, False: 56]
  ------------------
  429|     42|      ans_.buf_offset = offset - 1;
  430|     42|      ans_.state = buf[offset - 1] & 0x3F;
  431|     56|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 22, False: 34]
  ------------------
  432|     22|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 13, False: 9]
  ------------------
  433|     13|        return 1;
  434|     13|      }
  435|      9|      ans_.buf_offset = offset - 2;
  436|      9|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     34|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 18, False: 16]
  ------------------
  438|     18|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 8, False: 10]
  ------------------
  439|      8|        return 1;
  440|      8|      }
  441|     10|      ans_.buf_offset = offset - 3;
  442|     10|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     16|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 16, False: 0]
  ------------------
  444|     16|      ans_.buf_offset = offset - 4;
  445|     16|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     16|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     77|    ans_.state += l_rans_base;
  450|     77|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     77|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 14, False: 63]
  ------------------
  451|     14|      return 1;
  452|     14|    }
  453|     63|    return 0;
  454|     77|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|   215k|  inline int rans_read() {
  463|   215k|    unsigned rem;
  464|   215k|    unsigned quo;
  465|   215k|    struct rans_dec_sym sym;
  466|   216k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 191k, False: 24.9k]
  |  Branch (466:40): [True: 1.27k, False: 190k]
  ------------------
  467|  1.27k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.27k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.27k|    }
  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|   215k|    quo = ans_.state / rans_precision;
  472|   215k|    rem = ans_.state % rans_precision;
  473|   215k|    fetch_sym(&sym, rem);
  474|   215k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   215k|    return sym.val;
  476|   215k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|   215k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   215k|    uint32_t symbol = lut_table_[rem];
  507|   215k|    out->val = symbol;
  508|   215k|    out->prob = probability_table_[symbol].prob;
  509|   215k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   215k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     63|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    355|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    221|                                       uint32_t num_symbols) {
  482|    221|    lut_table_.resize(rans_precision);
  483|    221|    probability_table_.resize(num_symbols);
  484|    221|    uint32_t cum_prob = 0;
  485|    221|    uint32_t act_prob = 0;
  486|  7.73k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 7.52k, False: 206]
  ------------------
  487|  7.52k|      probability_table_[i].prob = token_probs[i];
  488|  7.52k|      probability_table_[i].cum_prob = cum_prob;
  489|  7.52k|      cum_prob += token_probs[i];
  490|  7.52k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 15, False: 7.51k]
  ------------------
  491|     15|        return false;
  492|     15|      }
  493|  5.68M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 5.67M, False: 7.51k]
  ------------------
  494|  5.67M|        lut_table_[j] = i;
  495|  5.67M|      }
  496|  7.51k|      act_prob = cum_prob;
  497|  7.51k|    }
  498|    206|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 44, False: 162]
  ------------------
  499|     44|      return false;
  500|     44|    }
  501|    162|    return true;
  502|    206|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|    108|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    108|    unsigned x;
  423|    108|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 16, False: 92]
  ------------------
  424|     16|      return 1;
  425|     16|    }
  426|     92|    ans_.buf = buf;
  427|     92|    x = buf[offset - 1] >> 6;
  428|     92|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 25, False: 67]
  ------------------
  429|     25|      ans_.buf_offset = offset - 1;
  430|     25|      ans_.state = buf[offset - 1] & 0x3F;
  431|     67|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 25, False: 42]
  ------------------
  432|     25|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 10, False: 15]
  ------------------
  433|     10|        return 1;
  434|     10|      }
  435|     15|      ans_.buf_offset = offset - 2;
  436|     15|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     42|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 17, False: 25]
  ------------------
  438|     17|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 4, False: 13]
  ------------------
  439|      4|        return 1;
  440|      4|      }
  441|     13|      ans_.buf_offset = offset - 3;
  442|     13|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     25|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 25, False: 0]
  ------------------
  444|     25|      ans_.buf_offset = offset - 4;
  445|     25|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     25|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     78|    ans_.state += l_rans_base;
  450|     78|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     78|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 24, False: 54]
  ------------------
  451|     24|      return 1;
  452|     24|    }
  453|     54|    return 0;
  454|     78|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   367k|  inline int rans_read() {
  463|   367k|    unsigned rem;
  464|   367k|    unsigned quo;
  465|   367k|    struct rans_dec_sym sym;
  466|   370k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 271k, False: 98.5k]
  |  Branch (466:40): [True: 2.65k, False: 268k]
  ------------------
  467|  2.65k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.65k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.65k|    }
  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|   367k|    quo = ans_.state / rans_precision;
  472|   367k|    rem = ans_.state % rans_precision;
  473|   367k|    fetch_sym(&sym, rem);
  474|   367k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   367k|    return sym.val;
  476|   367k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   367k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   367k|    uint32_t symbol = lut_table_[rem];
  507|   367k|    out->val = symbol;
  508|   367k|    out->prob = probability_table_[symbol].prob;
  509|   367k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   367k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     54|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    348|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    188|                                       uint32_t num_symbols) {
  482|    188|    lut_table_.resize(rans_precision);
  483|    188|    probability_table_.resize(num_symbols);
  484|    188|    uint32_t cum_prob = 0;
  485|    188|    uint32_t act_prob = 0;
  486|  5.27k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 5.10k, False: 171]
  ------------------
  487|  5.10k|      probability_table_[i].prob = token_probs[i];
  488|  5.10k|      probability_table_[i].cum_prob = cum_prob;
  489|  5.10k|      cum_prob += token_probs[i];
  490|  5.10k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 17, False: 5.08k]
  ------------------
  491|     17|        return false;
  492|     17|      }
  493|  9.34M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 9.33M, False: 5.08k]
  ------------------
  494|  9.33M|        lut_table_[j] = i;
  495|  9.33M|      }
  496|  5.08k|      act_prob = cum_prob;
  497|  5.08k|    }
  498|    171|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 50, False: 121]
  ------------------
  499|     50|      return false;
  500|     50|    }
  501|    121|    return true;
  502|    171|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     67|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     67|    unsigned x;
  423|     67|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 61]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     61|    ans_.buf = buf;
  427|     61|    x = buf[offset - 1] >> 6;
  428|     61|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 27, False: 34]
  ------------------
  429|     27|      ans_.buf_offset = offset - 1;
  430|     27|      ans_.state = buf[offset - 1] & 0x3F;
  431|     34|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 7, False: 27]
  ------------------
  432|      7|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 6]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      6|      ans_.buf_offset = offset - 2;
  436|      6|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     27|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 3, False: 24]
  ------------------
  438|      3|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 2]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|      2|      ans_.buf_offset = offset - 3;
  442|      2|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     24|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 24, False: 0]
  ------------------
  444|     24|      ans_.buf_offset = offset - 4;
  445|     24|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     24|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     59|    ans_.state += l_rans_base;
  450|     59|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     59|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 18, False: 41]
  ------------------
  451|     18|      return 1;
  452|     18|    }
  453|     41|    return 0;
  454|     59|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|   189k|  inline int rans_read() {
  463|   189k|    unsigned rem;
  464|   189k|    unsigned quo;
  465|   189k|    struct rans_dec_sym sym;
  466|   189k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 107k, False: 82.0k]
  |  Branch (466:40): [True: 542, False: 107k]
  ------------------
  467|    542|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    542|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    542|    }
  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|   189k|    quo = ans_.state / rans_precision;
  472|   189k|    rem = ans_.state % rans_precision;
  473|   189k|    fetch_sym(&sym, rem);
  474|   189k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   189k|    return sym.val;
  476|   189k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|   189k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   189k|    uint32_t symbol = lut_table_[rem];
  507|   189k|    out->val = symbol;
  508|   189k|    out->prob = probability_table_[symbol].prob;
  509|   189k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   189k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     41|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    354|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    242|                                       uint32_t num_symbols) {
  482|    242|    lut_table_.resize(rans_precision);
  483|    242|    probability_table_.resize(num_symbols);
  484|    242|    uint32_t cum_prob = 0;
  485|    242|    uint32_t act_prob = 0;
  486|  7.60k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 7.38k, False: 222]
  ------------------
  487|  7.38k|      probability_table_[i].prob = token_probs[i];
  488|  7.38k|      probability_table_[i].cum_prob = cum_prob;
  489|  7.38k|      cum_prob += token_probs[i];
  490|  7.38k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 20, False: 7.36k]
  ------------------
  491|     20|        return false;
  492|     20|      }
  493|  45.1M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 45.1M, False: 7.36k]
  ------------------
  494|  45.1M|        lut_table_[j] = i;
  495|  45.1M|      }
  496|  7.36k|      act_prob = cum_prob;
  497|  7.36k|    }
  498|    222|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 61, False: 161]
  ------------------
  499|     61|      return false;
  500|     61|    }
  501|    161|    return true;
  502|    222|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     89|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     89|    unsigned x;
  423|     89|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 13, False: 76]
  ------------------
  424|     13|      return 1;
  425|     13|    }
  426|     76|    ans_.buf = buf;
  427|     76|    x = buf[offset - 1] >> 6;
  428|     76|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 19, False: 57]
  ------------------
  429|     19|      ans_.buf_offset = offset - 1;
  430|     19|      ans_.state = buf[offset - 1] & 0x3F;
  431|     57|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 26, False: 31]
  ------------------
  432|     26|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 11, False: 15]
  ------------------
  433|     11|        return 1;
  434|     11|      }
  435|     15|      ans_.buf_offset = offset - 2;
  436|     15|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     31|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 10, False: 21]
  ------------------
  438|     10|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 2, False: 8]
  ------------------
  439|      2|        return 1;
  440|      2|      }
  441|      8|      ans_.buf_offset = offset - 3;
  442|      8|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     21|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 21, False: 0]
  ------------------
  444|     21|      ans_.buf_offset = offset - 4;
  445|     21|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     21|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     63|    ans_.state += l_rans_base;
  450|     63|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     63|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 9, False: 54]
  ------------------
  451|      9|      return 1;
  452|      9|    }
  453|     54|    return 0;
  454|     63|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|   130k|  inline int rans_read() {
  463|   130k|    unsigned rem;
  464|   130k|    unsigned quo;
  465|   130k|    struct rans_dec_sym sym;
  466|   130k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 125k, False: 5.52k]
  |  Branch (466:40): [True: 280, False: 124k]
  ------------------
  467|    280|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    280|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    280|    }
  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|   130k|    quo = ans_.state / rans_precision;
  472|   130k|    rem = ans_.state % rans_precision;
  473|   130k|    fetch_sym(&sym, rem);
  474|   130k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   130k|    return sym.val;
  476|   130k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|   130k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   130k|    uint32_t symbol = lut_table_[rem];
  507|   130k|    out->val = symbol;
  508|   130k|    out->prob = probability_table_[symbol].prob;
  509|   130k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   130k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     54|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    302|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    163|                                       uint32_t num_symbols) {
  482|    163|    lut_table_.resize(rans_precision);
  483|    163|    probability_table_.resize(num_symbols);
  484|    163|    uint32_t cum_prob = 0;
  485|    163|    uint32_t act_prob = 0;
  486|  2.76k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.62k, False: 140]
  ------------------
  487|  2.62k|      probability_table_[i].prob = token_probs[i];
  488|  2.62k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.62k|      cum_prob += token_probs[i];
  490|  2.62k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 23, False: 2.60k]
  ------------------
  491|     23|        return false;
  492|     23|      }
  493|  53.0M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 53.0M, False: 2.60k]
  ------------------
  494|  53.0M|        lut_table_[j] = i;
  495|  53.0M|      }
  496|  2.60k|      act_prob = cum_prob;
  497|  2.60k|    }
  498|    140|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 49, False: 91]
  ------------------
  499|     49|      return false;
  500|     49|    }
  501|     91|    return true;
  502|    140|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     59|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     59|    unsigned x;
  423|     59|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 58]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     58|    ans_.buf = buf;
  427|     58|    x = buf[offset - 1] >> 6;
  428|     58|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 21, False: 37]
  ------------------
  429|     21|      ans_.buf_offset = offset - 1;
  430|     21|      ans_.state = buf[offset - 1] & 0x3F;
  431|     37|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 6, False: 31]
  ------------------
  432|      6|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 5]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      5|      ans_.buf_offset = offset - 2;
  436|      5|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     31|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 13, False: 18]
  ------------------
  438|     13|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 4, False: 9]
  ------------------
  439|      4|        return 1;
  440|      4|      }
  441|      9|      ans_.buf_offset = offset - 3;
  442|      9|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     18|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 18, False: 0]
  ------------------
  444|     18|      ans_.buf_offset = offset - 4;
  445|     18|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     18|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     53|    ans_.state += l_rans_base;
  450|     53|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     53|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 9, False: 44]
  ------------------
  451|      9|      return 1;
  452|      9|    }
  453|     44|    return 0;
  454|     53|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   177k|  inline int rans_read() {
  463|   177k|    unsigned rem;
  464|   177k|    unsigned quo;
  465|   177k|    struct rans_dec_sym sym;
  466|   177k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 50.9k, False: 126k]
  |  Branch (466:40): [True: 261, False: 50.7k]
  ------------------
  467|    261|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    261|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    261|    }
  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|   177k|    quo = ans_.state / rans_precision;
  472|   177k|    rem = ans_.state % rans_precision;
  473|   177k|    fetch_sym(&sym, rem);
  474|   177k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   177k|    return sym.val;
  476|   177k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   177k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   177k|    uint32_t symbol = lut_table_[rem];
  507|   177k|    out->val = symbol;
  508|   177k|    out->prob = probability_table_[symbol].prob;
  509|   177k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   177k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     44|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.58k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    897|                                       uint32_t num_symbols) {
  482|    897|    lut_table_.resize(rans_precision);
  483|    897|    probability_table_.resize(num_symbols);
  484|    897|    uint32_t cum_prob = 0;
  485|    897|    uint32_t act_prob = 0;
  486|  7.30k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.44k, False: 862]
  ------------------
  487|  6.44k|      probability_table_[i].prob = token_probs[i];
  488|  6.44k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.44k|      cum_prob += token_probs[i];
  490|  6.44k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 35, False: 6.40k]
  ------------------
  491|     35|        return false;
  492|     35|      }
  493|   823M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 823M, False: 6.40k]
  ------------------
  494|   823M|        lut_table_[j] = i;
  495|   823M|      }
  496|  6.40k|      act_prob = cum_prob;
  497|  6.40k|    }
  498|    862|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 99, False: 763]
  ------------------
  499|     99|      return false;
  500|     99|    }
  501|    763|    return true;
  502|    862|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    425|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    425|    unsigned x;
  423|    425|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 36, False: 389]
  ------------------
  424|     36|      return 1;
  425|     36|    }
  426|    389|    ans_.buf = buf;
  427|    389|    x = buf[offset - 1] >> 6;
  428|    389|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 95, False: 294]
  ------------------
  429|     95|      ans_.buf_offset = offset - 1;
  430|     95|      ans_.state = buf[offset - 1] & 0x3F;
  431|    294|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 84, False: 210]
  ------------------
  432|     84|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 19, False: 65]
  ------------------
  433|     19|        return 1;
  434|     19|      }
  435|     65|      ans_.buf_offset = offset - 2;
  436|     65|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    210|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 65, False: 145]
  ------------------
  438|     65|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 32, False: 33]
  ------------------
  439|     32|        return 1;
  440|     32|      }
  441|     33|      ans_.buf_offset = offset - 3;
  442|     33|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    145|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 145, False: 0]
  ------------------
  444|    145|      ans_.buf_offset = offset - 4;
  445|    145|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    145|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    338|    ans_.state += l_rans_base;
  450|    338|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    338|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 54, False: 284]
  ------------------
  451|     54|      return 1;
  452|     54|    }
  453|    284|    return 0;
  454|    338|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  30.5M|  inline int rans_read() {
  463|  30.5M|    unsigned rem;
  464|  30.5M|    unsigned quo;
  465|  30.5M|    struct rans_dec_sym sym;
  466|  30.5M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 24.9M, False: 5.64M]
  |  Branch (466:40): [True: 4.45k, False: 24.9M]
  ------------------
  467|  4.45k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.45k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  4.45k|    }
  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|  30.5M|    quo = ans_.state / rans_precision;
  472|  30.5M|    rem = ans_.state % rans_precision;
  473|  30.5M|    fetch_sym(&sym, rem);
  474|  30.5M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  30.5M|    return sym.val;
  476|  30.5M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  30.5M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  30.5M|    uint32_t symbol = lut_table_[rem];
  507|  30.5M|    out->val = symbol;
  508|  30.5M|    out->prob = probability_table_[symbol].prob;
  509|  30.5M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  30.5M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    284|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    989|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    989|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    989|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 989]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    989|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    989|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    989|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 64, False: 925]
  ------------------
   67|     64|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 13, False: 51]
  ------------------
   68|     13|      return false;
   69|     13|    }
   70|       |
   71|     64|  } else
   72|    925|#endif
   73|    925|  {
   74|    925|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 45, False: 880]
  ------------------
   75|     45|      return false;
   76|     45|    }
   77|    925|  }
   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|    931|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 68, False: 863]
  ------------------
   83|     68|    return false;
   84|     68|  }
   85|    863|  probability_table_.resize(num_symbols_);
   86|    863|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 310, False: 553]
  ------------------
   87|    310|    return true;
   88|    310|  }
   89|       |  // Decode the table.
   90|  11.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 10.8k, False: 354]
  ------------------
   91|  10.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|  10.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 65, False: 10.8k]
  ------------------
   95|     65|      return false;
   96|     65|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  10.8k|    const int token = prob_data & 3;
  102|  10.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.50k, False: 7.30k]
  ------------------
  103|  3.50k|      const uint32_t offset = prob_data >> 2;
  104|  3.50k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 109, False: 3.39k]
  ------------------
  105|    109|        return false;
  106|    109|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   129k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 126k, False: 3.39k]
  ------------------
  109|   126k|        probability_table_[i + j] = 0;
  110|   126k|      }
  111|  3.39k|      i += offset;
  112|  7.30k|    } else {
  113|  7.30k|      const int extra_bytes = token;
  114|  7.30k|      uint32_t prob = prob_data >> 2;
  115|  12.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.08k, False: 7.27k]
  ------------------
  116|  5.08k|        uint8_t eb;
  117|  5.08k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 5.05k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.05k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.05k|      }
  124|  7.27k|      probability_table_[i] = prob;
  125|  7.27k|    }
  126|  10.8k|  }
  127|    354|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 116, False: 238]
  ------------------
  128|    116|    return false;
  129|    116|  }
  130|    238|  return true;
  131|    354|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    481|    DecoderBuffer *buffer) {
  136|    481|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    481|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    481|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    481|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 25, False: 456]
  ------------------
  140|     25|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 21]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     25|  } else
  145|    456|#endif
  146|    456|  {
  147|    456|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 21, False: 435]
  ------------------
  148|     21|      return false;
  149|     21|    }
  150|    456|  }
  151|    456|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 83, False: 373]
  ------------------
  152|     83|    return false;
  153|     83|  }
  154|    373|  const uint8_t *const data_head =
  155|    373|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    373|  buffer->Advance(bytes_encoded);
  158|    373|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 103, False: 270]
  ------------------
  159|    103|    return false;
  160|    103|  }
  161|    270|  return true;
  162|    373|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    347|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  5.69M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    224|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    224|  ans_.read_end();
  167|    224|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    475|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    475|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    475|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 475]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    475|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    475|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    475|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 41, False: 434]
  ------------------
   67|     41|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 5, False: 36]
  ------------------
   68|      5|      return false;
   69|      5|    }
   70|       |
   71|     41|  } else
   72|    434|#endif
   73|    434|  {
   74|    434|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 423]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    434|  }
   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|    459|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 34, False: 425]
  ------------------
   83|     34|    return false;
   84|     34|  }
   85|    425|  probability_table_.resize(num_symbols_);
   86|    425|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 22, False: 403]
  ------------------
   87|     22|    return true;
   88|     22|  }
   89|       |  // Decode the table.
   90|  74.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 74.1k, False: 290]
  ------------------
   91|  74.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|  74.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 49, False: 74.1k]
  ------------------
   95|     49|      return false;
   96|     49|    }
   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|  74.1k|    const int token = prob_data & 3;
  102|  74.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.30k, False: 67.8k]
  ------------------
  103|  6.30k|      const uint32_t offset = prob_data >> 2;
  104|  6.30k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 42, False: 6.25k]
  ------------------
  105|     42|        return false;
  106|     42|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   274k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 268k, False: 6.25k]
  ------------------
  109|   268k|        probability_table_[i + j] = 0;
  110|   268k|      }
  111|  6.25k|      i += offset;
  112|  67.8k|    } else {
  113|  67.8k|      const int extra_bytes = token;
  114|  67.8k|      uint32_t prob = prob_data >> 2;
  115|  87.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 20.0k, False: 67.8k]
  ------------------
  116|  20.0k|        uint8_t eb;
  117|  20.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 19.9k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  19.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  19.9k|      }
  124|  67.8k|      probability_table_[i] = prob;
  125|  67.8k|    }
  126|  74.1k|  }
  127|    290|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 91, False: 199]
  ------------------
  128|     91|    return false;
  129|     91|  }
  130|    199|  return true;
  131|    290|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    221|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    199|    DecoderBuffer *buffer) {
  136|    199|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    199|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    199|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    199|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 192]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 6]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      7|  } else
  145|    192|#endif
  146|    192|  {
  147|    192|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 21, False: 171]
  ------------------
  148|     21|      return false;
  149|     21|    }
  150|    192|  }
  151|    177|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 34, False: 143]
  ------------------
  152|     34|    return false;
  153|     34|  }
  154|    143|  const uint8_t *const data_head =
  155|    143|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    143|  buffer->Advance(bytes_encoded);
  158|    143|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 24, False: 119]
  ------------------
  159|     24|    return false;
  160|     24|  }
  161|    119|  return true;
  162|    143|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|   187M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    119|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    119|  ans_.read_end();
  167|    119|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    413|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    413|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    413|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 413]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    413|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    413|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    413|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 68, False: 345]
  ------------------
   67|     68|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 65]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     68|  } else
   72|    345|#endif
   73|    345|  {
   74|    345|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 341]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    345|  }
   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|    406|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 30, False: 376]
  ------------------
   83|     30|    return false;
   84|     30|  }
   85|    376|  probability_table_.resize(num_symbols_);
   86|    376|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 365]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|   225k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 225k, False: 251]
  ------------------
   91|   225k|    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|   225k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 55, False: 225k]
  ------------------
   95|     55|      return false;
   96|     55|    }
   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|   225k|    const int token = prob_data & 3;
  102|   225k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 31.6k, False: 193k]
  ------------------
  103|  31.6k|      const uint32_t offset = prob_data >> 2;
  104|  31.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 40, False: 31.6k]
  ------------------
  105|     40|        return false;
  106|     40|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   654k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 622k, False: 31.6k]
  ------------------
  109|   622k|        probability_table_[i + j] = 0;
  110|   622k|      }
  111|  31.6k|      i += offset;
  112|   193k|    } else {
  113|   193k|      const int extra_bytes = token;
  114|   193k|      uint32_t prob = prob_data >> 2;
  115|   359k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 165k, False: 193k]
  ------------------
  116|   165k|        uint8_t eb;
  117|   165k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 165k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   165k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   165k|      }
  124|   193k|      probability_table_[i] = prob;
  125|   193k|    }
  126|   225k|  }
  127|    251|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 30, False: 221]
  ------------------
  128|     30|    return false;
  129|     30|  }
  130|    221|  return true;
  131|    251|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    232|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    221|    DecoderBuffer *buffer) {
  136|    221|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    221|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    221|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    221|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 44, False: 177]
  ------------------
  140|     44|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 42]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     44|  } else
  145|    177|#endif
  146|    177|  {
  147|    177|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 176]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    177|  }
  151|    218|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 68, False: 150]
  ------------------
  152|     68|    return false;
  153|     68|  }
  154|    150|  const uint8_t *const data_head =
  155|    150|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    150|  buffer->Advance(bytes_encoded);
  158|    150|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 116]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|    116|  return true;
  162|    150|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  73.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    116|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    116|  ans_.read_end();
  167|    116|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    427|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    427|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    427|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 427]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    427|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    427|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    427|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 56, False: 371]
  ------------------
   67|     56|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 55]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     56|  } else
   72|    371|#endif
   73|    371|  {
   74|    371|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 362]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    371|  }
   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|    417|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 403]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    403|  probability_table_.resize(num_symbols_);
   86|    403|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 390]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|  5.03k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 4.74k, False: 291]
  ------------------
   91|  4.74k|    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|  4.74k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 59, False: 4.68k]
  ------------------
   95|     59|      return false;
   96|     59|    }
   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|  4.68k|    const int token = prob_data & 3;
  102|  4.68k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.55k, False: 2.12k]
  ------------------
  103|  2.55k|      const uint32_t offset = prob_data >> 2;
  104|  2.55k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 2.53k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  91.8k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 89.3k, False: 2.53k]
  ------------------
  109|  89.3k|        probability_table_[i + j] = 0;
  110|  89.3k|      }
  111|  2.53k|      i += offset;
  112|  2.53k|    } else {
  113|  2.12k|      const int extra_bytes = token;
  114|  2.12k|      uint32_t prob = prob_data >> 2;
  115|  3.47k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.36k, False: 2.11k]
  ------------------
  116|  1.36k|        uint8_t eb;
  117|  1.36k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 1.35k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.35k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.35k|      }
  124|  2.11k|      probability_table_[i] = prob;
  125|  2.11k|    }
  126|  4.68k|  }
  127|    291|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 17, False: 274]
  ------------------
  128|     17|    return false;
  129|     17|  }
  130|    274|  return true;
  131|    291|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    287|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    274|    DecoderBuffer *buffer) {
  136|    274|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    274|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    274|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    274|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 44, False: 230]
  ------------------
  140|     44|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 41]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     44|  } else
  145|    230|#endif
  146|    230|  {
  147|    230|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 226]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    230|  }
  151|    267|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 78, False: 189]
  ------------------
  152|     78|    return false;
  153|     78|  }
  154|    189|  const uint8_t *const data_head =
  155|    189|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    189|  buffer->Advance(bytes_encoded);
  158|    189|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 151]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|    151|  return true;
  162|    189|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  18.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    151|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    151|  ans_.read_end();
  167|    151|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    290|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    290|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    290|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 290]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    290|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    290|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    290|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 280]
  ------------------
   67|     10|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 9]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     10|  } else
   72|    280|#endif
   73|    280|  {
   74|    280|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 271]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    280|  }
   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|    280|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 266]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    266|  probability_table_.resize(num_symbols_);
   86|    266|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 254]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|  11.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 11.2k, False: 172]
  ------------------
   91|  11.2k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  11.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 49, False: 11.1k]
  ------------------
   95|     49|      return false;
   96|     49|    }
   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: 3.49k, False: 7.68k]
  ------------------
  103|  3.49k|      const uint32_t offset = prob_data >> 2;
  104|  3.49k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 16, False: 3.47k]
  ------------------
  105|     16|        return false;
  106|     16|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   136k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 133k, False: 3.47k]
  ------------------
  109|   133k|        probability_table_[i + j] = 0;
  110|   133k|      }
  111|  3.47k|      i += offset;
  112|  7.68k|    } else {
  113|  7.68k|      const int extra_bytes = token;
  114|  7.68k|      uint32_t prob = prob_data >> 2;
  115|  13.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.31k, False: 7.67k]
  ------------------
  116|  6.31k|        uint8_t eb;
  117|  6.31k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 6.29k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.29k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.29k|      }
  124|  7.67k|      probability_table_[i] = prob;
  125|  7.67k|    }
  126|  11.1k|  }
  127|    172|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 159]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|    159|  return true;
  131|    172|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    171|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    159|    DecoderBuffer *buffer) {
  136|    159|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    159|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    159|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    159|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 157]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 1]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      2|  } else
  145|    157|#endif
  146|    157|  {
  147|    157|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 154]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    157|  }
  151|    155|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 17, False: 138]
  ------------------
  152|     17|    return false;
  153|     17|  }
  154|    138|  const uint8_t *const data_head =
  155|    138|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    138|  buffer->Advance(bytes_encoded);
  158|    138|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 22, False: 116]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|    116|  return true;
  162|    138|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  1.59M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    116|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    116|  ans_.read_end();
  167|    116|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    348|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    348|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    348|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 348]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    348|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    348|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    348|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 53, False: 295]
  ------------------
   67|     53|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 53]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     53|  } else
   72|    295|#endif
   73|    295|  {
   74|    295|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 291]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    295|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    344|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 33, False: 311]
  ------------------
   83|     33|    return false;
   84|     33|  }
   85|    311|  probability_table_.resize(num_symbols_);
   86|    311|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 307]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  11.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 10.8k, False: 221]
  ------------------
   91|  10.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|  10.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 55, False: 10.7k]
  ------------------
   95|     55|      return false;
   96|     55|    }
   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|  10.7k|    const int token = prob_data & 3;
  102|  10.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.96k, False: 7.81k]
  ------------------
  103|  2.96k|      const uint32_t offset = prob_data >> 2;
  104|  2.96k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 17, False: 2.94k]
  ------------------
  105|     17|        return false;
  106|     17|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  84.1k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 81.2k, False: 2.94k]
  ------------------
  109|  81.2k|        probability_table_[i + j] = 0;
  110|  81.2k|      }
  111|  2.94k|      i += offset;
  112|  7.81k|    } else {
  113|  7.81k|      const int extra_bytes = token;
  114|  7.81k|      uint32_t prob = prob_data >> 2;
  115|  11.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.05k, False: 7.80k]
  ------------------
  116|  4.05k|        uint8_t eb;
  117|  4.05k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 4.03k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.03k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.03k|      }
  124|  7.80k|      probability_table_[i] = prob;
  125|  7.80k|    }
  126|  10.7k|  }
  127|    221|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 200]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    200|  return true;
  131|    221|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    204|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    200|    DecoderBuffer *buffer) {
  136|    200|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    200|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    200|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    200|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 36, False: 164]
  ------------------
  140|     36|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 33]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     36|  } else
  145|    164|#endif
  146|    164|  {
  147|    164|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 163]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    164|  }
  151|    196|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 72, False: 124]
  ------------------
  152|     72|    return false;
  153|     72|  }
  154|    124|  const uint8_t *const data_head =
  155|    124|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    124|  buffer->Advance(bytes_encoded);
  158|    124|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 49, False: 75]
  ------------------
  159|     49|    return false;
  160|     49|  }
  161|     75|  return true;
  162|    124|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  25.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|     75|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     75|  ans_.read_end();
  167|     75|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    375|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    375|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    375|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 375]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    375|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    375|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    375|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 38, False: 337]
  ------------------
   67|     38|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 37]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     38|  } else
   72|    337|#endif
   73|    337|  {
   74|    337|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 328]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    337|  }
   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|    365|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 349]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    349|  probability_table_.resize(num_symbols_);
   86|    349|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 343]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|   294k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 294k, False: 238]
  ------------------
   91|   294k|    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|   294k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 61, False: 294k]
  ------------------
   95|     61|      return false;
   96|     61|    }
   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|   294k|    const int token = prob_data & 3;
  102|   294k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 121k, False: 172k]
  ------------------
  103|   121k|      const uint32_t offset = prob_data >> 2;
  104|   121k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 121k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.14M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.02M, False: 121k]
  ------------------
  109|  5.02M|        probability_table_[i + j] = 0;
  110|  5.02M|      }
  111|   121k|      i += offset;
  112|   172k|    } else {
  113|   172k|      const int extra_bytes = token;
  114|   172k|      uint32_t prob = prob_data >> 2;
  115|   322k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 149k, False: 172k]
  ------------------
  116|   149k|        uint8_t eb;
  117|   149k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 149k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   149k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   149k|      }
  124|   172k|      probability_table_[i] = prob;
  125|   172k|    }
  126|   294k|  }
  127|    238|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 15, False: 223]
  ------------------
  128|     15|    return false;
  129|     15|  }
  130|    223|  return true;
  131|    238|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    229|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    223|    DecoderBuffer *buffer) {
  136|    223|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    223|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    223|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    223|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 24, False: 199]
  ------------------
  140|     24|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 5, False: 19]
  ------------------
  141|      5|      return false;
  142|      5|    }
  143|       |
  144|     24|  } else
  145|    199|#endif
  146|    199|  {
  147|    199|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 8, False: 191]
  ------------------
  148|      8|      return false;
  149|      8|    }
  150|    199|  }
  151|    210|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 50, False: 160]
  ------------------
  152|     50|    return false;
  153|     50|  }
  154|    160|  const uint8_t *const data_head =
  155|    160|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    160|  buffer->Advance(bytes_encoded);
  158|    160|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 126]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|    126|  return true;
  162|    160|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  5.20M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    126|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    126|  ans_.read_end();
  167|    126|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    355|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    355|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    355|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 355]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    355|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    355|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    355|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 313]
  ------------------
   67|     42|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 40]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     42|  } else
   72|    313|#endif
   73|    313|  {
   74|    313|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 305]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    313|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    345|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 27, False: 318]
  ------------------
   83|     27|    return false;
   84|     27|  }
   85|    318|  probability_table_.resize(num_symbols_);
   86|    318|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 305]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|   102k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 102k, False: 217]
  ------------------
   91|   102k|    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|   102k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 52, False: 102k]
  ------------------
   95|     52|      return false;
   96|     52|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   102k|    const int token = prob_data & 3;
  102|   102k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 14.2k, False: 87.9k]
  ------------------
  103|  14.2k|      const uint32_t offset = prob_data >> 2;
  104|  14.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 20, False: 14.2k]
  ------------------
  105|     20|        return false;
  106|     20|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   479k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 465k, False: 14.2k]
  ------------------
  109|   465k|        probability_table_[i + j] = 0;
  110|   465k|      }
  111|  14.2k|      i += offset;
  112|  87.9k|    } else {
  113|  87.9k|      const int extra_bytes = token;
  114|  87.9k|      uint32_t prob = prob_data >> 2;
  115|   162k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 74.6k, False: 87.9k]
  ------------------
  116|  74.6k|        uint8_t eb;
  117|  74.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 74.5k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  74.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  74.5k|      }
  124|  87.9k|      probability_table_[i] = prob;
  125|  87.9k|    }
  126|   102k|  }
  127|    217|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 18, False: 199]
  ------------------
  128|     18|    return false;
  129|     18|  }
  130|    199|  return true;
  131|    217|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    212|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    199|    DecoderBuffer *buffer) {
  136|    199|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    199|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    199|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    199|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 29, False: 170]
  ------------------
  140|     29|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 26]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     29|  } else
  145|    170|#endif
  146|    170|  {
  147|    170|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 12, False: 158]
  ------------------
  148|     12|      return false;
  149|     12|    }
  150|    170|  }
  151|    184|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 80, False: 104]
  ------------------
  152|     80|    return false;
  153|     80|  }
  154|    104|  const uint8_t *const data_head =
  155|    104|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    104|  buffer->Advance(bytes_encoded);
  158|    104|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 31, False: 73]
  ------------------
  159|     31|    return false;
  160|     31|  }
  161|     73|  return true;
  162|    104|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  6.63M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     73|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     73|  ans_.read_end();
  167|     73|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    370|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    370|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    370|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 370]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    370|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    370|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    370|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 35, False: 335]
  ------------------
   67|     35|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 33]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     35|  } else
   72|    335|#endif
   73|    335|  {
   74|    335|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 334]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    335|  }
   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|    367|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 18, False: 349]
  ------------------
   83|     18|    return false;
   84|     18|  }
   85|    349|  probability_table_.resize(num_symbols_);
   86|    349|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 339]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  39.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 39.4k, False: 242]
  ------------------
   91|  39.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|  39.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 56, False: 39.3k]
  ------------------
   95|     56|      return false;
   96|     56|    }
   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|  39.3k|    const int token = prob_data & 3;
  102|  39.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.17k, False: 33.1k]
  ------------------
  103|  6.17k|      const uint32_t offset = prob_data >> 2;
  104|  6.17k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 6.15k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   200k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 194k, False: 6.15k]
  ------------------
  109|   194k|        probability_table_[i + j] = 0;
  110|   194k|      }
  111|  6.15k|      i += offset;
  112|  33.1k|    } else {
  113|  33.1k|      const int extra_bytes = token;
  114|  33.1k|      uint32_t prob = prob_data >> 2;
  115|  59.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 26.6k, False: 33.1k]
  ------------------
  116|  26.6k|        uint8_t eb;
  117|  26.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 26.6k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  26.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  26.6k|      }
  124|  33.1k|      probability_table_[i] = prob;
  125|  33.1k|    }
  126|  39.3k|  }
  127|    242|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 64, False: 178]
  ------------------
  128|     64|    return false;
  129|     64|  }
  130|    178|  return true;
  131|    242|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    188|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    178|    DecoderBuffer *buffer) {
  136|    178|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    178|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    178|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    178|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 14, False: 164]
  ------------------
  140|     14|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 12]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     14|  } else
  145|    164|#endif
  146|    164|  {
  147|    164|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 163]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    164|  }
  151|    175|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 73, False: 102]
  ------------------
  152|     73|    return false;
  153|     73|  }
  154|    102|  const uint8_t *const data_head =
  155|    102|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    102|  buffer->Advance(bytes_encoded);
  158|    102|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 39, False: 63]
  ------------------
  159|     39|    return false;
  160|     39|  }
  161|     63|  return true;
  162|    102|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   215k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     63|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     63|  ans_.read_end();
  167|     63|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    355|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    355|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    355|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 355]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    355|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    355|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    355|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 28, False: 327]
  ------------------
   67|     28|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 24]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     28|  } else
   72|    327|#endif
   73|    327|  {
   74|    327|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 15, False: 312]
  ------------------
   75|     15|      return false;
   76|     15|    }
   77|    327|  }
   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|    336|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 317]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    317|  probability_table_.resize(num_symbols_);
   86|    317|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 308]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  81.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 80.8k, False: 221]
  ------------------
   91|  80.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|  80.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 52, False: 80.7k]
  ------------------
   95|     52|      return false;
   96|     52|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  80.7k|    const int token = prob_data & 3;
  102|  80.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 12.1k, False: 68.5k]
  ------------------
  103|  12.1k|      const uint32_t offset = prob_data >> 2;
  104|  12.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 12.1k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   290k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 278k, False: 12.1k]
  ------------------
  109|   278k|        probability_table_[i + j] = 0;
  110|   278k|      }
  111|  12.1k|      i += offset;
  112|  68.5k|    } else {
  113|  68.5k|      const int extra_bytes = token;
  114|  68.5k|      uint32_t prob = prob_data >> 2;
  115|   127k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 58.8k, False: 68.5k]
  ------------------
  116|  58.8k|        uint8_t eb;
  117|  58.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 58.8k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  58.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  58.8k|      }
  124|  68.5k|      probability_table_[i] = prob;
  125|  68.5k|    }
  126|  80.7k|  }
  127|    221|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 59, False: 162]
  ------------------
  128|     59|    return false;
  129|     59|  }
  130|    162|  return true;
  131|    221|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    171|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    162|    DecoderBuffer *buffer) {
  136|    162|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    162|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    162|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    162|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 13, False: 149]
  ------------------
  140|     13|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 12]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     13|  } else
  145|    149|#endif
  146|    149|  {
  147|    149|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 147]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    149|  }
  151|    159|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 51, False: 108]
  ------------------
  152|     51|    return false;
  153|     51|  }
  154|    108|  const uint8_t *const data_head =
  155|    108|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    108|  buffer->Advance(bytes_encoded);
  158|    108|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 54, False: 54]
  ------------------
  159|     54|    return false;
  160|     54|  }
  161|     54|  return true;
  162|    108|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   367k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     54|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     54|  ans_.read_end();
  167|     54|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    348|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    348|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    348|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 348]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    348|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    348|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    348|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 33, False: 315]
  ------------------
   67|     33|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 30]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     33|  } else
   72|    315|#endif
   73|    315|  {
   74|    315|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 14, False: 301]
  ------------------
   75|     14|      return false;
   76|     14|    }
   77|    315|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    331|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 28, False: 303]
  ------------------
   83|     28|    return false;
   84|     28|  }
   85|    303|  probability_table_.resize(num_symbols_);
   86|    303|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 294]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  15.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 15.1k, False: 188]
  ------------------
   91|  15.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|  15.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 57, False: 15.0k]
  ------------------
   95|     57|      return false;
   96|     57|    }
   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|  15.0k|    const int token = prob_data & 3;
  102|  15.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.77k, False: 11.3k]
  ------------------
  103|  3.77k|      const uint32_t offset = prob_data >> 2;
  104|  3.77k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 3.75k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   146k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 143k, False: 3.75k]
  ------------------
  109|   143k|        probability_table_[i + j] = 0;
  110|   143k|      }
  111|  3.75k|      i += offset;
  112|  11.3k|    } else {
  113|  11.3k|      const int extra_bytes = token;
  114|  11.3k|      uint32_t prob = prob_data >> 2;
  115|  21.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.2k, False: 11.2k]
  ------------------
  116|  10.2k|        uint8_t eb;
  117|  10.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 10.2k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.2k|      }
  124|  11.2k|      probability_table_[i] = prob;
  125|  11.2k|    }
  126|  15.0k|  }
  127|    188|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 67, False: 121]
  ------------------
  128|     67|    return false;
  129|     67|  }
  130|    121|  return true;
  131|    188|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    130|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    121|    DecoderBuffer *buffer) {
  136|    121|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    121|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    121|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    121|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 121]
  ------------------
  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|    121|#endif
  146|    121|  {
  147|    121|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 120]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    121|  }
  151|    120|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 53, False: 67]
  ------------------
  152|     53|    return false;
  153|     53|  }
  154|     67|  const uint8_t *const data_head =
  155|     67|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     67|  buffer->Advance(bytes_encoded);
  158|     67|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 41]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     41|  return true;
  162|     67|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   189k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     41|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     41|  ans_.read_end();
  167|     41|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    354|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    354|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    354|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 354]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    354|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    354|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    354|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 13, False: 341]
  ------------------
   67|     13|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 12]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     13|  } else
   72|    341|#endif
   73|    341|  {
   74|    341|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 335]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    341|  }
   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|    347|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 337]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    337|  probability_table_.resize(num_symbols_);
   86|    337|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 328]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|   141k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 141k, False: 242]
  ------------------
   91|   141k|    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|   141k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 47, False: 140k]
  ------------------
   95|     47|      return false;
   96|     47|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   140k|    const int token = prob_data & 3;
  102|   140k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 17.9k, False: 122k]
  ------------------
  103|  17.9k|      const uint32_t offset = prob_data >> 2;
  104|  17.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 17.9k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   532k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 514k, False: 17.9k]
  ------------------
  109|   514k|        probability_table_[i + j] = 0;
  110|   514k|      }
  111|  17.9k|      i += offset;
  112|   122k|    } else {
  113|   122k|      const int extra_bytes = token;
  114|   122k|      uint32_t prob = prob_data >> 2;
  115|   265k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 142k, False: 122k]
  ------------------
  116|   142k|        uint8_t eb;
  117|   142k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 142k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   142k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   142k|      }
  124|   122k|      probability_table_[i] = prob;
  125|   122k|    }
  126|   140k|  }
  127|    242|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 81, False: 161]
  ------------------
  128|     81|    return false;
  129|     81|  }
  130|    161|  return true;
  131|    242|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    170|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    161|    DecoderBuffer *buffer) {
  136|    161|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    161|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    161|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    161|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 11, False: 150]
  ------------------
  140|     11|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 10]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     11|  } else
  145|    150|#endif
  146|    150|  {
  147|    150|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 148]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    150|  }
  151|    158|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 69, False: 89]
  ------------------
  152|     69|    return false;
  153|     69|  }
  154|     89|  const uint8_t *const data_head =
  155|     89|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     89|  buffer->Advance(bytes_encoded);
  158|     89|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 35, False: 54]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|     54|  return true;
  162|     89|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   130k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     54|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     54|  ans_.read_end();
  167|     54|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    302|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    302|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    302|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 302]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    302|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    302|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    302|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 7, False: 295]
  ------------------
   67|      7|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 6]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|      7|  } else
   72|    295|#endif
   73|    295|  {
   74|    295|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 17, False: 278]
  ------------------
   75|     17|      return false;
   76|     17|    }
   77|    295|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    284|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 272]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    272|  probability_table_.resize(num_symbols_);
   86|    272|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 266]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|   319k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 319k, False: 163]
  ------------------
   91|   319k|    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|   319k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 58, False: 319k]
  ------------------
   95|     58|      return false;
   96|     58|    }
   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|   319k|    const int token = prob_data & 3;
  102|   319k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 186k, False: 132k]
  ------------------
  103|   186k|      const uint32_t offset = prob_data >> 2;
  104|   186k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 186k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  6.29M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 6.11M, False: 186k]
  ------------------
  109|  6.11M|        probability_table_[i + j] = 0;
  110|  6.11M|      }
  111|   186k|      i += offset;
  112|   186k|    } else {
  113|   132k|      const int extra_bytes = token;
  114|   132k|      uint32_t prob = prob_data >> 2;
  115|   223k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 90.4k, False: 132k]
  ------------------
  116|  90.4k|        uint8_t eb;
  117|  90.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 90.4k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  90.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  90.4k|      }
  124|   132k|      probability_table_[i] = prob;
  125|   132k|    }
  126|   319k|  }
  127|    163|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 72, False: 91]
  ------------------
  128|     72|    return false;
  129|     72|  }
  130|     91|  return true;
  131|    163|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|     97|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|     91|    DecoderBuffer *buffer) {
  136|     91|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     91|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     91|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     91|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 91]
  ------------------
  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|     91|#endif
  146|     91|  {
  147|     91|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 89]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|     91|  }
  151|     89|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 30, False: 59]
  ------------------
  152|     30|    return false;
  153|     30|  }
  154|     59|  const uint8_t *const data_head =
  155|     59|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     59|  buffer->Advance(bytes_encoded);
  158|     59|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 15, False: 44]
  ------------------
  159|     15|    return false;
  160|     15|  }
  161|     44|  return true;
  162|     59|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   177k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     44|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     44|  ans_.read_end();
  167|     44|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    322|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    322|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    322|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 322]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    322|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    322|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    322|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 43, False: 279]
  ------------------
   67|     43|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 5, False: 38]
  ------------------
   68|      5|      return false;
   69|      5|    }
   70|       |
   71|     43|  } else
   72|    279|#endif
   73|    279|  {
   74|    279|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 16, False: 263]
  ------------------
   75|     16|      return false;
   76|     16|    }
   77|    279|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    301|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 281]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    281|  probability_table_.resize(num_symbols_);
   86|    281|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 274]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|   117k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 116k, False: 173]
  ------------------
   91|   116k|    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|   116k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 56, False: 116k]
  ------------------
   95|     56|      return false;
   96|     56|    }
   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|   116k|    const int token = prob_data & 3;
  102|   116k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 43.6k, False: 73.2k]
  ------------------
  103|  43.6k|      const uint32_t offset = prob_data >> 2;
  104|  43.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 43.6k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.22M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.17M, False: 43.6k]
  ------------------
  109|  2.17M|        probability_table_[i + j] = 0;
  110|  2.17M|      }
  111|  43.6k|      i += offset;
  112|  73.2k|    } else {
  113|  73.2k|      const int extra_bytes = token;
  114|  73.2k|      uint32_t prob = prob_data >> 2;
  115|   170k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 97.5k, False: 73.2k]
  ------------------
  116|  97.5k|        uint8_t eb;
  117|  97.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 97.5k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  97.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  97.5k|      }
  124|  73.2k|      probability_table_[i] = prob;
  125|  73.2k|    }
  126|   116k|  }
  127|    173|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 147]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    147|  return true;
  131|    173|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    154|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    147|    DecoderBuffer *buffer) {
  136|    147|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    147|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    147|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    147|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 10, False: 137]
  ------------------
  140|     10|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 8]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     10|  } else
  145|    137|#endif
  146|    137|  {
  147|    137|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 134]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    137|  }
  151|    142|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 57, False: 85]
  ------------------
  152|     57|    return false;
  153|     57|  }
  154|     85|  const uint8_t *const data_head =
  155|     85|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     85|  buffer->Advance(bytes_encoded);
  158|     85|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 27, False: 58]
  ------------------
  159|     27|    return false;
  160|     27|  }
  161|     58|  return true;
  162|     85|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|   108k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    302|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    302|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    302|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 302]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    302|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    302|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    302|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 37, False: 265]
  ------------------
   67|     37|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 36]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     37|  } else
   72|    265|#endif
   73|    265|  {
   74|    265|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 254]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    265|  }
   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|    290|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 270]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    270|  probability_table_.resize(num_symbols_);
   86|    270|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 264]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|  28.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 28.1k, False: 173]
  ------------------
   91|  28.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|  28.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 59, False: 28.0k]
  ------------------
   95|     59|      return false;
   96|     59|    }
   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|  28.0k|    const int token = prob_data & 3;
  102|  28.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.86k, False: 18.2k]
  ------------------
  103|  9.86k|      const uint32_t offset = prob_data >> 2;
  104|  9.86k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 16, False: 9.85k]
  ------------------
  105|     16|        return false;
  106|     16|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   452k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 442k, False: 9.85k]
  ------------------
  109|   442k|        probability_table_[i + j] = 0;
  110|   442k|      }
  111|  9.85k|      i += offset;
  112|  18.2k|    } else {
  113|  18.2k|      const int extra_bytes = token;
  114|  18.2k|      uint32_t prob = prob_data >> 2;
  115|  44.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 26.6k, False: 18.1k]
  ------------------
  116|  26.6k|        uint8_t eb;
  117|  26.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 26.6k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  26.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  26.6k|      }
  124|  18.1k|      probability_table_[i] = prob;
  125|  18.1k|    }
  126|  28.0k|  }
  127|    173|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 32, False: 141]
  ------------------
  128|     32|    return false;
  129|     32|  }
  130|    141|  return true;
  131|    173|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    147|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    141|    DecoderBuffer *buffer) {
  136|    141|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    141|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    141|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    141|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 21, False: 120]
  ------------------
  140|     21|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 20]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     21|  } else
  145|    120|#endif
  146|    120|  {
  147|    120|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 119]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    120|  }
  151|    139|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 45, False: 94]
  ------------------
  152|     45|    return false;
  153|     45|  }
  154|     94|  const uint8_t *const data_head =
  155|     94|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     94|  buffer->Advance(bytes_encoded);
  158|     94|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 36, False: 58]
  ------------------
  159|     36|    return false;
  160|     36|  }
  161|     58|  return true;
  162|     94|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  6.42M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    299|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    299|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    299|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 299]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    299|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    299|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    299|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 21, False: 278]
  ------------------
   67|     21|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 20]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     21|  } else
   72|    278|#endif
   73|    278|  {
   74|    278|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 274]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    278|  }
   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|    294|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 281]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    281|  probability_table_.resize(num_symbols_);
   86|    281|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 268]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|  5.66k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 5.49k, False: 169]
  ------------------
   91|  5.49k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  5.49k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 50, False: 5.44k]
  ------------------
   95|     50|      return false;
   96|     50|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  5.44k|    const int token = prob_data & 3;
  102|  5.44k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.33k, False: 3.11k]
  ------------------
  103|  2.33k|      const uint32_t offset = prob_data >> 2;
  104|  2.33k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 2.30k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  79.2k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 76.8k, False: 2.30k]
  ------------------
  109|  76.8k|        probability_table_[i + j] = 0;
  110|  76.8k|      }
  111|  2.30k|      i += offset;
  112|  3.11k|    } else {
  113|  3.11k|      const int extra_bytes = token;
  114|  3.11k|      uint32_t prob = prob_data >> 2;
  115|  5.62k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.53k, False: 3.09k]
  ------------------
  116|  2.53k|        uint8_t eb;
  117|  2.53k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 24, False: 2.50k]
  ------------------
  118|     24|          return false;
  119|     24|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.50k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.50k|      }
  124|  3.09k|      probability_table_[i] = prob;
  125|  3.09k|    }
  126|  5.44k|  }
  127|    169|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 22, False: 147]
  ------------------
  128|     22|    return false;
  129|     22|  }
  130|    147|  return true;
  131|    169|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    160|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    147|    DecoderBuffer *buffer) {
  136|    147|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    147|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    147|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    147|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 5, False: 142]
  ------------------
  140|      5|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 3]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|      5|  } else
  145|    142|#endif
  146|    142|  {
  147|    142|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 13, False: 129]
  ------------------
  148|     13|      return false;
  149|     13|    }
  150|    142|  }
  151|    132|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 51, False: 81]
  ------------------
  152|     51|    return false;
  153|     51|  }
  154|     81|  const uint8_t *const data_head =
  155|     81|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     81|  buffer->Advance(bytes_encoded);
  158|     81|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 30, False: 51]
  ------------------
  159|     30|    return false;
  160|     30|  }
  161|     51|  return true;
  162|     81|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  17.4M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     51|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     51|  ans_.read_end();
  167|     51|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    330|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    330|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    330|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 330]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    330|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    330|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    330|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 20, False: 310]
  ------------------
   67|     20|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 19]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     20|  } else
   72|    310|#endif
   73|    310|  {
   74|    310|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 21, False: 289]
  ------------------
   75|     21|      return false;
   76|     21|    }
   77|    310|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    308|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 24, False: 284]
  ------------------
   83|     24|    return false;
   84|     24|  }
   85|    284|  probability_table_.resize(num_symbols_);
   86|    284|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 272]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|   117k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 117k, False: 175]
  ------------------
   91|   117k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   117k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 54, False: 117k]
  ------------------
   95|     54|      return false;
   96|     54|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   117k|    const int token = prob_data & 3;
  102|   117k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 93.3k, False: 24.3k]
  ------------------
  103|  93.3k|      const uint32_t offset = prob_data >> 2;
  104|  93.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 93.2k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.58M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.48M, False: 93.2k]
  ------------------
  109|  4.48M|        probability_table_[i + j] = 0;
  110|  4.48M|      }
  111|  93.2k|      i += offset;
  112|  93.2k|    } else {
  113|  24.3k|      const int extra_bytes = token;
  114|  24.3k|      uint32_t prob = prob_data >> 2;
  115|  33.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.90k, False: 24.3k]
  ------------------
  116|  8.90k|        uint8_t eb;
  117|  8.90k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 8.88k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.88k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.88k|      }
  124|  24.3k|      probability_table_[i] = prob;
  125|  24.3k|    }
  126|   117k|  }
  127|    175|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 27, False: 148]
  ------------------
  128|     27|    return false;
  129|     27|  }
  130|    148|  return true;
  131|    175|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    160|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    148|    DecoderBuffer *buffer) {
  136|    148|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    148|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    148|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    148|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 10, False: 138]
  ------------------
  140|     10|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 8]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     10|  } else
  145|    138|#endif
  146|    138|  {
  147|    138|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 134]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    138|  }
  151|    142|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 63, False: 79]
  ------------------
  152|     63|    return false;
  153|     63|  }
  154|     79|  const uint8_t *const data_head =
  155|     79|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     79|  buffer->Advance(bytes_encoded);
  158|     79|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 22, False: 57]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|     57|  return true;
  162|     79|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  6.47M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     57|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     57|  ans_.read_end();
  167|     57|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    327|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    327|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    327|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 327]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    327|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    327|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    327|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 39, False: 288]
  ------------------
   67|     39|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 37]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     39|  } else
   72|    288|#endif
   73|    288|  {
   74|    288|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 278]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    288|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    315|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 303]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    303|  probability_table_.resize(num_symbols_);
   86|    303|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 296]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  6.40k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 6.20k, False: 207]
  ------------------
   91|  6.20k|    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|  6.20k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 47, False: 6.15k]
  ------------------
   95|     47|      return false;
   96|     47|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  6.15k|    const int token = prob_data & 3;
  102|  6.15k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.71k, False: 3.44k]
  ------------------
  103|  2.71k|      const uint32_t offset = prob_data >> 2;
  104|  2.71k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 2.69k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  95.9k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 93.2k, False: 2.69k]
  ------------------
  109|  93.2k|        probability_table_[i + j] = 0;
  110|  93.2k|      }
  111|  2.69k|      i += offset;
  112|  3.44k|    } else {
  113|  3.44k|      const int extra_bytes = token;
  114|  3.44k|      uint32_t prob = prob_data >> 2;
  115|  5.55k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.13k, False: 3.42k]
  ------------------
  116|  2.13k|        uint8_t eb;
  117|  2.13k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 2.11k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.11k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.11k|      }
  124|  3.42k|      probability_table_[i] = prob;
  125|  3.42k|    }
  126|  6.15k|  }
  127|    207|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 27, False: 180]
  ------------------
  128|     27|    return false;
  129|     27|  }
  130|    180|  return true;
  131|    207|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    187|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    180|    DecoderBuffer *buffer) {
  136|    180|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    180|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    180|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    180|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 160]
  ------------------
  140|     20|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 18]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     20|  } else
  145|    160|#endif
  146|    160|  {
  147|    160|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 13, False: 147]
  ------------------
  148|     13|      return false;
  149|     13|    }
  150|    160|  }
  151|    165|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 79, False: 86]
  ------------------
  152|     79|    return false;
  153|     79|  }
  154|     86|  const uint8_t *const data_head =
  155|     86|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     86|  buffer->Advance(bytes_encoded);
  158|     86|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 60]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     60|  return true;
  162|     86|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  85.6k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     60|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     60|  ans_.read_end();
  167|     60|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  9.66k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  9.66k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 15, False: 9.65k]
  ------------------
   35|     15|    return true;
   36|     15|  }
   37|       |  // Decode which scheme to use.
   38|  9.65k|  uint8_t scheme;
   39|  9.65k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 151, False: 9.49k]
  ------------------
   40|    151|    return false;
   41|    151|  }
   42|  9.49k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 827, False: 8.67k]
  ------------------
   43|    827|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    827|                                                  src_buffer, out_values);
   45|  8.67k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 6.43k, False: 2.24k]
  ------------------
   46|  6.43k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  6.43k|                                               out_values);
   48|  6.43k|  }
   49|  2.24k|  return false;
   50|  9.49k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    827|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    827|  SymbolDecoderT<5> tag_decoder;
   57|    827|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 403, False: 424]
  ------------------
   58|    403|    return false;
   59|    403|  }
   60|       |
   61|    424|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 201, False: 223]
  ------------------
   62|    201|    return false;
   63|    201|  }
   64|       |
   65|    223|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 223, False: 0]
  |  Branch (65:25): [True: 45, False: 178]
  ------------------
   66|     45|    return false;  // Wrong number of symbols.
   67|     45|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    178|  src_buffer->StartBitDecoding(false, nullptr);
   72|    178|  int value_id = 0;
   73|   597k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 596k, False: 177]
  ------------------
   74|       |    // Decode the tag.
   75|   596k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  1.20M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 603k, False: 596k]
  ------------------
   78|   603k|      uint32_t val;
   79|   603k|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 1, False: 603k]
  ------------------
   80|      1|        return false;
   81|      1|      }
   82|   603k|      out_values[value_id++] = val;
   83|   603k|    }
   84|   596k|  }
   85|    177|  tag_decoder.EndDecoding();
   86|    177|  src_buffer->EndBitDecoding();
   87|    177|  return true;
   88|    178|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  6.43k|                      uint32_t *out_values) {
  117|  6.43k|  uint8_t max_bit_length;
  118|  6.43k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 35, False: 6.39k]
  ------------------
  119|     35|    return false;
  120|     35|  }
  121|  6.39k|  switch (max_bit_length) {
  122|    475|    case 1:
  ------------------
  |  Branch (122:5): [True: 475, False: 5.92k]
  ------------------
  123|    475|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    475|                                                         out_values);
  125|    413|    case 2:
  ------------------
  |  Branch (125:5): [True: 413, False: 5.98k]
  ------------------
  126|    413|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    413|                                                         out_values);
  128|    427|    case 3:
  ------------------
  |  Branch (128:5): [True: 427, False: 5.96k]
  ------------------
  129|    427|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    427|                                                         out_values);
  131|    290|    case 4:
  ------------------
  |  Branch (131:5): [True: 290, False: 6.10k]
  ------------------
  132|    290|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    290|                                                         out_values);
  134|    162|    case 5:
  ------------------
  |  Branch (134:5): [True: 162, False: 6.23k]
  ------------------
  135|    162|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    162|                                                         out_values);
  137|    348|    case 6:
  ------------------
  |  Branch (137:5): [True: 348, False: 6.04k]
  ------------------
  138|    348|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    348|                                                         out_values);
  140|    375|    case 7:
  ------------------
  |  Branch (140:5): [True: 375, False: 6.02k]
  ------------------
  141|    375|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    375|                                                         out_values);
  143|    355|    case 8:
  ------------------
  |  Branch (143:5): [True: 355, False: 6.04k]
  ------------------
  144|    355|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    355|                                                         out_values);
  146|    370|    case 9:
  ------------------
  |  Branch (146:5): [True: 370, False: 6.02k]
  ------------------
  147|    370|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    370|                                                         out_values);
  149|    355|    case 10:
  ------------------
  |  Branch (149:5): [True: 355, False: 6.04k]
  ------------------
  150|    355|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    355|          num_values, src_buffer, out_values);
  152|    348|    case 11:
  ------------------
  |  Branch (152:5): [True: 348, False: 6.04k]
  ------------------
  153|    348|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    348|          num_values, src_buffer, out_values);
  155|    354|    case 12:
  ------------------
  |  Branch (155:5): [True: 354, False: 6.04k]
  ------------------
  156|    354|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    354|          num_values, src_buffer, out_values);
  158|    302|    case 13:
  ------------------
  |  Branch (158:5): [True: 302, False: 6.09k]
  ------------------
  159|    302|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    302|          num_values, src_buffer, out_values);
  161|    322|    case 14:
  ------------------
  |  Branch (161:5): [True: 322, False: 6.07k]
  ------------------
  162|    322|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    322|          num_values, src_buffer, out_values);
  164|    302|    case 15:
  ------------------
  |  Branch (164:5): [True: 302, False: 6.09k]
  ------------------
  165|    302|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    302|          num_values, src_buffer, out_values);
  167|    299|    case 16:
  ------------------
  |  Branch (167:5): [True: 299, False: 6.09k]
  ------------------
  168|    299|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    299|          num_values, src_buffer, out_values);
  170|    330|    case 17:
  ------------------
  |  Branch (170:5): [True: 330, False: 6.06k]
  ------------------
  171|    330|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    330|          num_values, src_buffer, out_values);
  173|    327|    case 18:
  ------------------
  |  Branch (173:5): [True: 327, False: 6.06k]
  ------------------
  174|    327|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    327|          num_values, src_buffer, out_values);
  176|    241|    default:
  ------------------
  |  Branch (176:5): [True: 241, False: 6.15k]
  ------------------
  177|    241|      return false;
  178|  6.39k|  }
  179|  6.39k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    475|                              uint32_t *out_values) {
   93|    475|  SymbolDecoderT decoder;
   94|    475|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 254, False: 221]
  ------------------
   95|    254|    return false;
   96|    254|  }
   97|       |
   98|    221|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 221, False: 0]
  |  Branch (98:25): [True: 22, False: 199]
  ------------------
   99|     22|    return false;  // Wrong number of symbols.
  100|     22|  }
  101|       |
  102|    199|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 80, False: 119]
  ------------------
  103|     80|    return false;
  104|     80|  }
  105|   187M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 187M, False: 119]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   187M|    const uint32_t value = decoder.DecodeSymbol();
  108|   187M|    out_values[i] = value;
  109|   187M|  }
  110|    119|  decoder.EndDecoding();
  111|    119|  return true;
  112|    199|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    413|                              uint32_t *out_values) {
   93|    413|  SymbolDecoderT decoder;
   94|    413|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 181, False: 232]
  ------------------
   95|    181|    return false;
   96|    181|  }
   97|       |
   98|    232|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 232, False: 0]
  |  Branch (98:25): [True: 11, False: 221]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    221|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 105, False: 116]
  ------------------
  103|    105|    return false;
  104|    105|  }
  105|  73.8M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 73.8M, False: 116]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  73.8M|    const uint32_t value = decoder.DecodeSymbol();
  108|  73.8M|    out_values[i] = value;
  109|  73.8M|  }
  110|    116|  decoder.EndDecoding();
  111|    116|  return true;
  112|    221|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    427|                              uint32_t *out_values) {
   93|    427|  SymbolDecoderT decoder;
   94|    427|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 140, False: 287]
  ------------------
   95|    140|    return false;
   96|    140|  }
   97|       |
   98|    287|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 287, False: 0]
  |  Branch (98:25): [True: 13, False: 274]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    274|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 123, False: 151]
  ------------------
  103|    123|    return false;
  104|    123|  }
  105|  18.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 18.7M, False: 151]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  18.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  18.7M|    out_values[i] = value;
  109|  18.7M|  }
  110|    151|  decoder.EndDecoding();
  111|    151|  return true;
  112|    274|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    290|                              uint32_t *out_values) {
   93|    290|  SymbolDecoderT decoder;
   94|    290|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 119, False: 171]
  ------------------
   95|    119|    return false;
   96|    119|  }
   97|       |
   98|    171|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 171, False: 0]
  |  Branch (98:25): [True: 12, False: 159]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    159|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 43, False: 116]
  ------------------
  103|     43|    return false;
  104|     43|  }
  105|  1.59M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.59M, False: 116]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.59M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.59M|    out_values[i] = value;
  109|  1.59M|  }
  110|    116|  decoder.EndDecoding();
  111|    116|  return true;
  112|    159|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    162|                              uint32_t *out_values) {
   93|    162|  SymbolDecoderT decoder;
   94|    162|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 38, False: 124]
  ------------------
   95|     38|    return false;
   96|     38|  }
   97|       |
   98|    124|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 124, False: 0]
  |  Branch (98:25): [True: 67, False: 57]
  ------------------
   99|     67|    return false;  // Wrong number of symbols.
  100|     67|  }
  101|       |
  102|     57|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 10, False: 47]
  ------------------
  103|     10|    return false;
  104|     10|  }
  105|  5.09M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.09M, False: 47]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.09M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.09M|    out_values[i] = value;
  109|  5.09M|  }
  110|     47|  decoder.EndDecoding();
  111|     47|  return true;
  112|     57|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    348|                              uint32_t *out_values) {
   93|    348|  SymbolDecoderT decoder;
   94|    348|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 144, False: 204]
  ------------------
   95|    144|    return false;
   96|    144|  }
   97|       |
   98|    204|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 204, False: 0]
  |  Branch (98:25): [True: 4, False: 200]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    200|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 125, False: 75]
  ------------------
  103|    125|    return false;
  104|    125|  }
  105|  25.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 25.6M, False: 75]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  25.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  25.6M|    out_values[i] = value;
  109|  25.6M|  }
  110|     75|  decoder.EndDecoding();
  111|     75|  return true;
  112|    200|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    375|                              uint32_t *out_values) {
   93|    375|  SymbolDecoderT decoder;
   94|    375|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 146, False: 229]
  ------------------
   95|    146|    return false;
   96|    146|  }
   97|       |
   98|    229|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 229, False: 0]
  |  Branch (98:25): [True: 6, False: 223]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    223|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 97, False: 126]
  ------------------
  103|     97|    return false;
  104|     97|  }
  105|  5.20M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.20M, False: 126]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.20M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.20M|    out_values[i] = value;
  109|  5.20M|  }
  110|    126|  decoder.EndDecoding();
  111|    126|  return true;
  112|    223|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    355|                              uint32_t *out_values) {
   93|    355|  SymbolDecoderT decoder;
   94|    355|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 143, False: 212]
  ------------------
   95|    143|    return false;
   96|    143|  }
   97|       |
   98|    212|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 212, False: 0]
  |  Branch (98:25): [True: 13, False: 199]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    199|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 126, False: 73]
  ------------------
  103|    126|    return false;
  104|    126|  }
  105|  6.63M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.63M, False: 73]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.63M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.63M|    out_values[i] = value;
  109|  6.63M|  }
  110|     73|  decoder.EndDecoding();
  111|     73|  return true;
  112|    199|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    370|                              uint32_t *out_values) {
   93|    370|  SymbolDecoderT decoder;
   94|    370|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 182, False: 188]
  ------------------
   95|    182|    return false;
   96|    182|  }
   97|       |
   98|    188|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 188, False: 0]
  |  Branch (98:25): [True: 10, False: 178]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    178|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 115, False: 63]
  ------------------
  103|    115|    return false;
  104|    115|  }
  105|   215k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 215k, False: 63]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   215k|    const uint32_t value = decoder.DecodeSymbol();
  108|   215k|    out_values[i] = value;
  109|   215k|  }
  110|     63|  decoder.EndDecoding();
  111|     63|  return true;
  112|    178|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    355|                              uint32_t *out_values) {
   93|    355|  SymbolDecoderT decoder;
   94|    355|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 184, False: 171]
  ------------------
   95|    184|    return false;
   96|    184|  }
   97|       |
   98|    171|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 171, False: 0]
  |  Branch (98:25): [True: 9, False: 162]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    162|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 108, False: 54]
  ------------------
  103|    108|    return false;
  104|    108|  }
  105|   367k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 367k, False: 54]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   367k|    const uint32_t value = decoder.DecodeSymbol();
  108|   367k|    out_values[i] = value;
  109|   367k|  }
  110|     54|  decoder.EndDecoding();
  111|     54|  return true;
  112|    162|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    348|                              uint32_t *out_values) {
   93|    348|  SymbolDecoderT decoder;
   94|    348|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 218, False: 130]
  ------------------
   95|    218|    return false;
   96|    218|  }
   97|       |
   98|    130|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 130, False: 0]
  |  Branch (98:25): [True: 9, False: 121]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    121|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 80, False: 41]
  ------------------
  103|     80|    return false;
  104|     80|  }
  105|   189k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 189k, False: 41]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   189k|    const uint32_t value = decoder.DecodeSymbol();
  108|   189k|    out_values[i] = value;
  109|   189k|  }
  110|     41|  decoder.EndDecoding();
  111|     41|  return true;
  112|    121|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    354|                              uint32_t *out_values) {
   93|    354|  SymbolDecoderT decoder;
   94|    354|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 184, False: 170]
  ------------------
   95|    184|    return false;
   96|    184|  }
   97|       |
   98|    170|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 170, False: 0]
  |  Branch (98:25): [True: 9, False: 161]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    161|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 107, False: 54]
  ------------------
  103|    107|    return false;
  104|    107|  }
  105|   130k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 130k, False: 54]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   130k|    const uint32_t value = decoder.DecodeSymbol();
  108|   130k|    out_values[i] = value;
  109|   130k|  }
  110|     54|  decoder.EndDecoding();
  111|     54|  return true;
  112|    161|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    302|                              uint32_t *out_values) {
   93|    302|  SymbolDecoderT decoder;
   94|    302|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 205, False: 97]
  ------------------
   95|    205|    return false;
   96|    205|  }
   97|       |
   98|     97|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 97, False: 0]
  |  Branch (98:25): [True: 6, False: 91]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|     91|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 47, False: 44]
  ------------------
  103|     47|    return false;
  104|     47|  }
  105|   177k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 177k, False: 44]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   177k|    const uint32_t value = decoder.DecodeSymbol();
  108|   177k|    out_values[i] = value;
  109|   177k|  }
  110|     44|  decoder.EndDecoding();
  111|     44|  return true;
  112|     91|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    322|                              uint32_t *out_values) {
   93|    322|  SymbolDecoderT decoder;
   94|    322|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 168, False: 154]
  ------------------
   95|    168|    return false;
   96|    168|  }
   97|       |
   98|    154|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 154, False: 0]
  |  Branch (98:25): [True: 7, False: 147]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    147|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 89, False: 58]
  ------------------
  103|     89|    return false;
  104|     89|  }
  105|   108k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 108k, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   108k|    const uint32_t value = decoder.DecodeSymbol();
  108|   108k|    out_values[i] = value;
  109|   108k|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|    147|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    302|                              uint32_t *out_values) {
   93|    302|  SymbolDecoderT decoder;
   94|    302|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 155, False: 147]
  ------------------
   95|    155|    return false;
   96|    155|  }
   97|       |
   98|    147|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 147, False: 0]
  |  Branch (98:25): [True: 6, False: 141]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    141|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 83, False: 58]
  ------------------
  103|     83|    return false;
  104|     83|  }
  105|  6.42M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.42M, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.42M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.42M|    out_values[i] = value;
  109|  6.42M|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|    141|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    299|                              uint32_t *out_values) {
   93|    299|  SymbolDecoderT decoder;
   94|    299|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 139, False: 160]
  ------------------
   95|    139|    return false;
   96|    139|  }
   97|       |
   98|    160|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 160, False: 0]
  |  Branch (98:25): [True: 13, False: 147]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    147|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 96, False: 51]
  ------------------
  103|     96|    return false;
  104|     96|  }
  105|  17.4M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 17.4M, False: 51]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  17.4M|    const uint32_t value = decoder.DecodeSymbol();
  108|  17.4M|    out_values[i] = value;
  109|  17.4M|  }
  110|     51|  decoder.EndDecoding();
  111|     51|  return true;
  112|    147|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    330|                              uint32_t *out_values) {
   93|    330|  SymbolDecoderT decoder;
   94|    330|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 170, False: 160]
  ------------------
   95|    170|    return false;
   96|    170|  }
   97|       |
   98|    160|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 160, False: 0]
  |  Branch (98:25): [True: 12, False: 148]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    148|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 91, False: 57]
  ------------------
  103|     91|    return false;
  104|     91|  }
  105|  6.47M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.47M, False: 57]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.47M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.47M|    out_values[i] = value;
  109|  6.47M|  }
  110|     57|  decoder.EndDecoding();
  111|     57|  return true;
  112|    148|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    327|                              uint32_t *out_values) {
   93|    327|  SymbolDecoderT decoder;
   94|    327|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 140, False: 187]
  ------------------
   95|    140|    return false;
   96|    140|  }
   97|       |
   98|    187|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 187, False: 0]
  |  Branch (98:25): [True: 7, False: 180]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    180|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 120, False: 60]
  ------------------
  103|    120|    return false;
  104|    120|  }
  105|  85.6k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 85.6k, False: 60]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  85.6k|    const uint32_t value = decoder.DecodeSymbol();
  108|  85.6k|    out_values[i] = value;
  109|  85.6k|  }
  110|     60|  decoder.EndDecoding();
  111|     60|  return true;
  112|    180|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  6.48k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  2.10k|  const CornerTable *GetCornerTable() const override {
   67|  2.10k|    return corner_table_.get();
   68|  2.10k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  1.76M|                       int *out_encoder_split_symbol_id) {
   87|  1.76M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 1.57M, False: 191k]
  ------------------
   88|  1.57M|      return false;
   89|  1.57M|    }
   90|   191k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 15, False: 191k]
  ------------------
   91|   191k|        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|   191k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 190k, False: 1.18k]
  ------------------
  101|   190k|      return false;
  102|   190k|    }
  103|  1.18k|    *out_face_edge =
  104|  1.18k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.18k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.18k|    topology_split_data_.pop_back();
  108|  1.18k|    return true;
  109|   191k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  6.90M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  6.90M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  6.90M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  6.90M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  11.8k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  3.74k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  2.41k|  const CornerTable *GetCornerTable() const override {
   67|  2.41k|    return corner_table_.get();
   68|  2.41k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  19.7M|                       int *out_encoder_split_symbol_id) {
   87|  19.7M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 17.2M, False: 2.42M]
  ------------------
   88|  17.2M|      return false;
   89|  17.2M|    }
   90|  2.42M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 31, False: 2.42M]
  ------------------
   91|  2.42M|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     31|      *out_encoder_split_symbol_id = -1;
   98|     31|      return true;
   99|     31|    }
  100|  2.42M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 2.42M, False: 944]
  ------------------
  101|  2.42M|      return false;
  102|  2.42M|    }
  103|    944|    *out_face_edge =
  104|    944|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    944|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    944|    topology_split_data_.pop_back();
  108|    944|    return true;
  109|  2.42M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  58.7M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  58.7M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  58.7M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  58.7M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  7.54k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  10.4k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.11k|  const CornerTable *GetCornerTable() const override {
   67|  2.11k|    return corner_table_.get();
   68|  2.11k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  33.3M|                       int *out_encoder_split_symbol_id) {
   87|  33.3M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 33.0M, False: 348k]
  ------------------
   88|  33.0M|      return false;
   89|  33.0M|    }
   90|   348k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 26, False: 348k]
  ------------------
   91|   348k|        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|     26|      *out_encoder_split_symbol_id = -1;
   98|     26|      return true;
   99|     26|    }
  100|   348k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 347k, False: 689]
  ------------------
  101|   347k|      return false;
  102|   347k|    }
  103|    689|    *out_face_edge =
  104|    689|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    689|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    689|    topology_split_data_.pop_back();
  108|    689|    return true;
  109|   348k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  40.6M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  40.6M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  40.6M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  40.6M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  10.5k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  6.37k|      : attribute_connectivity_decoders_(nullptr),
   34|  6.37k|        num_attribute_data_(0),
   35|  6.37k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  5.33k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  5.33k|    decoder_impl_ = decoder;
   38|  5.33k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  5.33k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  5.33k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  5.33k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  4.64k|  uint16_t BitstreamVersion() const {
   45|  4.64k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  4.64k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  2.16k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  5.33k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  3.40k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  3.40k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 114, False: 3.29k]
  ------------------
   63|    114|      return false;
   64|    114|    }
   65|       |
   66|  3.29k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 76, False: 3.21k]
  ------------------
   67|     76|      return false;
   68|     76|    }
   69|       |
   70|  3.21k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 26, False: 3.19k]
  ------------------
   71|     26|      return false;
   72|     26|    }
   73|  3.19k|    *out_buffer = buffer_;
   74|  3.19k|    return true;
   75|  3.21k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  1.89M|  inline bool DecodeStartFaceConfiguration() {
   79|  1.89M|    uint32_t face_configuration;
   80|  1.89M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  1.89M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.89M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 609, False: 1.89M]
  ------------------
   82|    609|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    609|    } else
   85|  1.89M|#endif
   86|  1.89M|    {
   87|  1.89M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  1.89M|    }
   89|  1.89M|    return face_configuration;
   90|  1.89M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  4.75M|  inline uint32_t DecodeSymbol() {
   94|  4.75M|    uint32_t symbol;
   95|  4.75M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  4.75M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 2.31M, False: 2.43M]
  ------------------
   97|  2.31M|      return symbol;
   98|  2.31M|    }
   99|       |    // Else decode two additional bits.
  100|  2.43M|    uint32_t symbol_suffix;
  101|  2.43M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  2.43M|    symbol |= (symbol_suffix << 1);
  103|  2.43M|    return symbol;
  104|  4.75M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  4.69M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|   641k|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  11.9M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  11.9M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  11.9M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  3.01k|  void Done() {
  123|  3.01k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 2.81k, False: 199]
  ------------------
  124|  2.81k|      symbol_buffer_.EndBitDecoding();
  125|  2.81k|    }
  126|  3.01k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  3.01k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.01k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 266, False: 2.74k]
  ------------------
  128|    266|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    266|    } else
  131|  2.74k|#endif
  132|  2.74k|    {
  133|  2.74k|      start_face_decoder_.EndDecoding();
  134|  2.74k|    }
  135|  3.01k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  1.78k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  3.61k|  bool DecodeTraversalSymbols() {
  141|  3.61k|    uint64_t traversal_size;
  142|  3.61k|    symbol_buffer_ = buffer_;
  143|  3.61k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 37, False: 3.57k]
  ------------------
  144|     37|      return false;
  145|     37|    }
  146|  3.57k|    buffer_ = symbol_buffer_;
  147|  3.57k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 124, False: 3.45k]
  ------------------
  148|    124|      return false;
  149|    124|    }
  150|  3.45k|    buffer_.Advance(traversal_size);
  151|  3.45k|    return true;
  152|  3.57k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  5.17k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  5.17k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  5.17k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.17k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 508, False: 4.67k]
  ------------------
  158|    508|      start_face_buffer_ = buffer_;
  159|    508|      uint64_t traversal_size;
  160|    508|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 4, False: 504]
  ------------------
  161|      4|        return false;
  162|      4|      }
  163|    504|      buffer_ = start_face_buffer_;
  164|    504|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 112, False: 392]
  ------------------
  165|    112|        return false;
  166|    112|      }
  167|    392|      buffer_.Advance(traversal_size);
  168|    392|      return true;
  169|    504|    }
  170|  4.67k|#endif
  171|  4.67k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  5.17k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  5.01k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  5.01k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 3.08k, False: 1.93k]
  ------------------
  177|  3.08k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  3.08k|          new BinaryDecoder[num_attribute_data_]);
  179|  9.40k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 6.36k, False: 3.04k]
  ------------------
  180|  6.36k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 38, False: 6.32k]
  ------------------
  181|     38|          return false;
  182|     38|        }
  183|  6.36k|      }
  184|  3.08k|    }
  185|  4.97k|    return true;
  186|  5.01k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  3.57k|MeshSequentialDecoder::MeshSequentialDecoder() {}
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  3.40k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  3.40k|  uint32_t num_faces;
   31|  3.40k|  uint32_t num_points;
   32|  3.40k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  3.40k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.40k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 468, False: 2.93k]
  ------------------
   34|    468|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 9, False: 459]
  ------------------
   35|      9|      return false;
   36|      9|    }
   37|    459|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 3, False: 456]
  ------------------
   38|      3|      return false;
   39|      3|    }
   40|       |
   41|    459|  } else
   42|  2.93k|#endif
   43|  2.93k|  {
   44|  2.93k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 10, False: 2.92k]
  ------------------
   45|     10|      return false;
   46|     10|    }
   47|  2.92k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 2, False: 2.92k]
  ------------------
   48|      2|      return false;
   49|      2|    }
   50|  2.92k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  3.37k|  const uint64_t faces_64 = static_cast<uint64_t>(num_faces);
   54|       |  // Compressed sequential encoding can only handle (2^32 - 1) / 3 indices.
   55|  3.37k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 3, False: 3.37k]
  ------------------
   56|      3|    return false;
   57|      3|  }
   58|  3.37k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 27, False: 3.34k]
  ------------------
   59|       |    // The number of faces is unreasonably high, because face indices do not
   60|       |    // fit in the remaining size of the buffer.
   61|     27|    return false;
   62|     27|  }
   63|  3.34k|  uint8_t connectivity_method;
   64|  3.34k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 2, False: 3.34k]
  ------------------
   65|      2|    return false;
   66|      2|  }
   67|  3.34k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 2.66k, False: 678]
  ------------------
   68|  2.66k|    if (!DecodeAndDecompressIndices(num_faces)) {
  ------------------
  |  Branch (68:9): [True: 2.52k, False: 142]
  ------------------
   69|  2.52k|      return false;
   70|  2.52k|    }
   71|  2.66k|  } else {
   72|    678|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 447, False: 231]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|  3.34k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 2.89k, False: 441]
  ------------------
   75|  2.89k|        Mesh::Face face;
   76|  11.5k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 8.69k, False: 2.89k]
  ------------------
   77|  8.69k|          uint8_t val;
   78|  8.69k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 6, False: 8.69k]
  ------------------
   79|      6|            return false;
   80|      6|          }
   81|  8.69k|          face[j] = val;
   82|  8.69k|        }
   83|  2.89k|        mesh()->AddFace(face);
   84|  2.89k|      }
   85|    447|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (85:16): [True: 87, False: 144]
  ------------------
   86|       |      // Decode indices as uint16_t.
   87|    602|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (87:28): [True: 536, False: 66]
  ------------------
   88|    536|        Mesh::Face face;
   89|  2.10k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (89:25): [True: 1.58k, False: 515]
  ------------------
   90|  1.58k|          uint16_t val;
   91|  1.58k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (91:15): [True: 21, False: 1.56k]
  ------------------
   92|     21|            return false;
   93|     21|          }
   94|  1.56k|          face[j] = val;
   95|  1.56k|        }
   96|    515|        mesh()->AddFace(face);
   97|    515|      }
   98|    144|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (98:16): [True: 99, False: 45]
  ------------------
   99|     99|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     99|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (99:16): [True: 92, False: 7]
  ------------------
  100|       |      // Decode indices as uint32_t.
  101|    444|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (101:28): [True: 370, False: 74]
  ------------------
  102|    370|        Mesh::Face face;
  103|  1.44k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (103:25): [True: 1.09k, False: 352]
  ------------------
  104|  1.09k|          uint32_t val;
  105|  1.09k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (105:15): [True: 18, False: 1.07k]
  ------------------
  106|     18|            return false;
  107|     18|          }
  108|  1.07k|          face[j] = val;
  109|  1.07k|        }
  110|    352|        mesh()->AddFace(face);
  111|    352|      }
  112|     92|    } else {
  113|       |      // Decode faces as uint32_t (default).
  114|    233|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (114:28): [True: 203, False: 30]
  ------------------
  115|    203|        Mesh::Face face;
  116|    760|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (116:25): [True: 579, False: 181]
  ------------------
  117|    579|          uint32_t val;
  118|    579|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (118:15): [True: 22, False: 557]
  ------------------
  119|     22|            return false;
  120|     22|          }
  121|    557|          face[j] = val;
  122|    557|        }
  123|    181|        mesh()->AddFace(face);
  124|    181|      }
  125|     52|    }
  126|    678|  }
  127|    753|  point_cloud()->set_num_points(num_points);
  128|    753|  return true;
  129|  3.34k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  131|  17.5k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  132|       |  // Always create the basic attribute decoder.
  133|  17.5k|  return SetAttributesDecoder(
  134|  17.5k|      att_decoder_id,
  135|  17.5k|      std::unique_ptr<AttributesDecoder>(
  136|  17.5k|          new SequentialAttributeDecodersController(
  137|  17.5k|              std::unique_ptr<PointsSequencer>(
  138|  17.5k|                  new LinearSequencer(point_cloud()->num_points())))));
  139|  17.5k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEj:
  141|  2.66k|bool MeshSequentialDecoder::DecodeAndDecompressIndices(uint32_t num_faces) {
  142|       |  // Get decoded indices differences that were encoded with an entropy code.
  143|  2.66k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  144|  2.66k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (144:7): [True: 2.45k, False: 207]
  ------------------
  145|  2.45k|    return false;
  146|  2.45k|  }
  147|       |  // Reconstruct the indices from the differences.
  148|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  149|    207|  int32_t last_index_value = 0;  // This will always be >= 0.
  150|    207|  int vertex_index = 0;
  151|  1.03k|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (151:24): [True: 888, False: 142]
  ------------------
  152|    888|    Mesh::Face face;
  153|  3.39k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (153:21): [True: 2.57k, False: 823]
  ------------------
  154|  2.57k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  155|  2.57k|      int32_t index_diff = (encoded_val >> 1);
  156|  2.57k|      if (encoded_val & 1) {
  ------------------
  |  Branch (156:11): [True: 914, False: 1.66k]
  ------------------
  157|    914|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (157:13): [True: 50, False: 864]
  ------------------
  158|       |          // Subtracting index_diff would result in a negative index.
  159|     50|          return false;
  160|     50|        }
  161|    864|        index_diff = -index_diff;
  162|  1.66k|      } else {
  163|  1.66k|        if (index_diff >
  ------------------
  |  Branch (163:13): [True: 15, False: 1.64k]
  ------------------
  164|  1.66k|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  165|       |          // Adding index_diff to last_index_value would overflow.
  166|     15|          return false;
  167|     15|        }
  168|  1.66k|      }
  169|  2.51k|      const int32_t index_value = index_diff + last_index_value;
  170|  2.51k|      face[j] = index_value;
  171|  2.51k|      last_index_value = index_value;
  172|  2.51k|    }
  173|    823|    mesh()->AddFace(face);
  174|    823|  }
  175|    142|  return true;
  176|    207|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    888|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.33M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.33M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.32M, False: 8.55k]
  ------------------
   61|  1.32M|      return true;  // Already traversed.
   62|  1.32M|    }
   63|       |
   64|  8.55k|    corner_traversal_stack_.clear();
   65|  8.55k|    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|  8.55k|    const VertexIndex next_vert =
   69|  8.55k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  8.55k|    const VertexIndex prev_vert =
   71|  8.55k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  8.55k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 8.55k]
  |  Branch (72:45): [True: 0, False: 8.55k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  8.55k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 7.93k, False: 625]
  ------------------
   76|  7.93k|      this->MarkVertexVisited(next_vert);
   77|  7.93k|      this->traversal_observer().OnNewVertexVisited(
   78|  7.93k|          next_vert, this->corner_table()->Next(corner_id));
   79|  7.93k|    }
   80|  8.55k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.96k, False: 5.59k]
  ------------------
   81|  2.96k|      this->MarkVertexVisited(prev_vert);
   82|  2.96k|      this->traversal_observer().OnNewVertexVisited(
   83|  2.96k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.96k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  27.1k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 18.6k, False: 8.55k]
  ------------------
   88|       |      // Currently processed corner.
   89|  18.6k|      corner_id = corner_traversal_stack_.back();
   90|  18.6k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  18.6k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 18.6k]
  |  Branch (92:47): [True: 558, False: 18.0k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    558|        corner_traversal_stack_.pop_back();
   95|    558|        continue;
   96|    558|      }
   97|  1.33M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.33M, Folded]
  ------------------
   98|  1.33M|        this->MarkFaceVisited(face_id);
   99|  1.33M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.33M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.33M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.33M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.33M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 674k, False: 659k]
  ------------------
  105|   674k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   674k|          this->MarkVertexVisited(vert_id);
  107|   674k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   674k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 652k, False: 22.0k]
  ------------------
  109|   652k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   652k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   652k|            continue;
  112|   652k|          }
  113|   674k|        }
  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|   682k|        const CornerIndex right_corner_id =
  118|   682k|            this->corner_table()->GetRightCorner(corner_id);
  119|   682k|        const CornerIndex left_corner_id =
  120|   682k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   682k|        const FaceIndex right_face_id(
  122|   682k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 15.6k, False: 666k]
  ------------------
  123|   682k|                 ? kInvalidFaceIndex
  124|   682k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   682k|        const FaceIndex left_face_id(
  126|   682k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 14.0k, False: 667k]
  ------------------
  127|   682k|                 ? kInvalidFaceIndex
  128|   682k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   682k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 656k, False: 25.3k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   656k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 13.0k, False: 643k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  13.0k|            corner_traversal_stack_.pop_back();
  134|  13.0k|            break;  // Break from the while (true) loop.
  135|   643k|          } else {
  136|       |            // Go to the left face.
  137|   643k|            corner_id = left_corner_id;
  138|   643k|            face_id = left_face_id;
  139|   643k|          }
  140|   656k|        } else {
  141|       |          // Right face was not visited.
  142|  25.3k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 20.2k, False: 5.03k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  20.2k|            corner_id = right_corner_id;
  145|  20.2k|            face_id = right_face_id;
  146|  20.2k|          } 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.03k|            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.03k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  5.03k|            break;
  159|  5.03k|          }
  160|  25.3k|        }
  161|   682k|      }
  162|  18.0k|    }
  163|  8.55k|    return true;
  164|  8.55k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    888|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  1.89k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.26k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.90M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.90M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 695k, False: 1.20M]
  ------------------
   61|   695k|      return true;  // Already traversed.
   62|   695k|    }
   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: 703]
  ------------------
   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.19M, False: 18.4k]
  ------------------
   81|  1.19M|      this->MarkVertexVisited(prev_vert);
   82|  1.19M|      this->traversal_observer().OnNewVertexVisited(
   83|  1.19M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  1.19M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  2.45M|    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.12k, False: 1.23M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  2.12k|        corner_traversal_stack_.pop_back();
   95|  2.12k|        continue;
   96|  2.12k|      }
   97|  1.90M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.90M, Folded]
  ------------------
   98|  1.90M|        this->MarkFaceVisited(face_id);
   99|  1.90M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.90M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.90M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.90M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.90M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.55M, False: 352k]
  ------------------
  105|  1.55M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.55M|          this->MarkVertexVisited(vert_id);
  107|  1.55M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.55M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 328k, False: 1.22M]
  ------------------
  109|   328k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   328k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   328k|            continue;
  112|   328k|          }
  113|  1.55M|        }
  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.57M|        const CornerIndex right_corner_id =
  118|  1.57M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.57M|        const CornerIndex left_corner_id =
  120|  1.57M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.57M|        const FaceIndex right_face_id(
  122|  1.57M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 1.20M, False: 366k]
  ------------------
  123|  1.57M|                 ? kInvalidFaceIndex
  124|  1.57M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.57M|        const FaceIndex left_face_id(
  126|  1.57M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 1.22M, False: 353k]
  ------------------
  127|  1.57M|                 ? kInvalidFaceIndex
  128|  1.57M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.57M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.53M, False: 41.2k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.53M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 1.22M, False: 311k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  1.22M|            corner_traversal_stack_.pop_back();
  134|  1.22M|            break;  // Break from the while (true) loop.
  135|  1.22M|          } else {
  136|       |            // Go to the left face.
  137|   311k|            corner_id = left_corner_id;
  138|   311k|            face_id = left_face_id;
  139|   311k|          }
  140|  1.53M|        } else {
  141|       |          // Right face was not visited.
  142|  41.2k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 25.2k, False: 16.0k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  25.2k|            corner_id = right_corner_id;
  145|  25.2k|            face_id = right_face_id;
  146|  25.2k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  16.0k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  16.0k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  16.0k|            break;
  159|  16.0k|          }
  160|  41.2k|        }
  161|  1.57M|      }
  162|  1.23M|    }
  163|  1.20M|    return true;
  164|  1.20M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.26k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.62k|  DepthFirstTraverser() {}

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

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

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

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  2.62k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  20.0M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  10.5M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  10.5M|    return is_vertex_visited_[vert_id.value()];
   65|  10.5M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  1.55M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  1.55M|    is_vertex_visited_[vert_id.value()] = true;
   68|  1.55M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  4.57M|  inline TraversalObserverT &traversal_observer() {
   75|  4.57M|    return traversal_observer_;
   76|  4.57M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  8.05M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  8.05M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 78.6k, False: 7.97M]
  ------------------
   47|  78.6k|      return true;  // Invalid faces are always considered as visited.
   48|  78.6k|    }
   49|  7.97M|    return is_face_visited_[face_id.value()];
   50|  8.05M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.01M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.01M|    is_face_visited_[face_id.value()] = true;
   62|  3.01M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  2.62k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  2.62k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.31k|                    TraversalObserver traversal_observer) {
   37|  1.31k|    corner_table_ = corner_table;
   38|  1.31k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.31k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.31k|    traversal_observer_ = traversal_observer;
   41|  1.31k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.33M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.33M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.33M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.33M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.33M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  14.1M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.90M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.90M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.90M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.90M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.90M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  4.32M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  4.32M|    return is_vertex_visited_[vert_id.value()];
   65|  4.32M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  3.95M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  3.95M|    is_vertex_visited_[vert_id.value()] = true;
   68|  3.95M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  5.85M|  inline TraversalObserverT &traversal_observer() {
   75|  5.85M|    return traversal_observer_;
   76|  5.85M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  4.39M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  4.39M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 2.43M, False: 1.96M]
  ------------------
   47|  2.43M|      return true;  // Invalid faces are always considered as visited.
   48|  2.43M|    }
   49|  1.96M|    return is_face_visited_[face_id.value()];
   50|  4.39M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  1.90M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  1.90M|    is_face_visited_[face_id.value()] = true;
   62|  1.90M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  2.62k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.31k|                    TraversalObserver traversal_observer) {
   37|  1.31k|    corner_table_ = corner_table;
   38|  1.31k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.31k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.31k|    traversal_observer_ = traversal_observer;
   41|  1.31k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    210|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    210|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 16, False: 194]
  ------------------
  187|     16|    return false;
  188|     16|  }
  189|    194|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 186]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|    186|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 184]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    184|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 50, False: 134]
  ------------------
  196|     50|    return true;
  197|     50|  }
  198|    134|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 30, False: 104]
  ------------------
  199|     30|    return false;
  200|     30|  }
  201|    104|  num_decoded_points_ = 0;
  202|       |
  203|    104|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 23, False: 81]
  ------------------
  204|     23|    return false;
  205|     23|  }
  206|     81|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 78]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     78|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 78]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     78|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 77]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     77|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 57, False: 20]
  ------------------
  217|     57|    return false;
  218|     57|  }
  219|       |
  220|     20|  numbers_decoder_.EndDecoding();
  221|     20|  remaining_bits_decoder_.EndDecoding();
  222|     20|  axis_decoder_.EndDecoding();
  223|     20|  half_decoder_.EndDecoding();
  224|       |
  225|     20|  return true;
  226|     77|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     77|    uint32_t num_points, OutputIteratorT &oit) {
  254|     77|  typedef DecodingStatus Status;
  255|     77|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     77|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     77|  DecodingStatus init_status(num_points, 0, 0);
  258|     77|  std::stack<Status> status_stack;
  259|     77|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   623k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 623k, False: 20]
  ------------------
  263|   623k|    const DecodingStatus status = status_stack.top();
  264|   623k|    status_stack.pop();
  265|       |
  266|   623k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   623k|    const uint32_t last_axis = status.last_axis;
  268|   623k|    const uint32_t stack_pos = status.stack_pos;
  269|   623k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   623k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   623k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 623k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   623k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   623k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 623k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   623k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   623k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 307k, False: 315k]
  ------------------
  285|   127M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 127M, False: 307k]
  ------------------
  286|   127M|        *oit = old_base;
  287|   127M|        ++oit;
  288|   127M|        ++num_decoded_points_;
  289|   127M|      }
  290|   307k|      continue;
  291|   307k|    }
  292|       |
  293|   315k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   315k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 3.77k, False: 312k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  3.77k|      axes_[0] = axis;
  300|  11.5k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 7.82k, False: 3.77k]
  ------------------
  301|  7.82k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  7.82k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.12k, False: 5.70k]
  |  |  ------------------
  ------------------
  302|  7.82k|      }
  303|  10.0k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 6.28k, False: 3.74k]
  ------------------
  304|  25.1k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 18.8k, False: 6.25k]
  ------------------
  305|  18.8k|          p_[axes_[j]] = 0;
  306|  18.8k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  18.8k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 16.0k, False: 2.85k]
  ------------------
  308|  16.0k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 27, False: 16.0k]
  ------------------
  309|  16.0k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     27|              return false;
  311|     27|            }
  312|  16.0k|          }
  313|  18.8k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  18.8k|        }
  315|  6.25k|        *oit = p_;
  316|  6.25k|        ++oit;
  317|  6.25k|        ++num_decoded_points_;
  318|  6.25k|      }
  319|  3.74k|      continue;
  320|  3.77k|    }
  321|       |
  322|   312k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 312k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   312k|    const int num_remaining_bits = bit_length_ - level;
  327|   312k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   312k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   312k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   312k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   312k|    uint32_t number = 0;
  334|   312k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   312k|    uint32_t first_half = num_remaining_points / 2;
  337|   312k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 30, False: 312k]
  ------------------
  338|       |      // Invalid |number|.
  339|     30|      return false;
  340|     30|    }
  341|   312k|    first_half -= number;
  342|   312k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   312k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 188k, False: 123k]
  ------------------
  345|   188k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 185k, False: 2.58k]
  ------------------
  346|   185k|        std::swap(first_half, second_half);
  347|   185k|      }
  348|   188k|    }
  349|       |
  350|   312k|    levels_stack_[stack_pos][axis] += 1;
  351|   312k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   312k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 311k, False: 102]
  ------------------
  353|   311k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   311k|    }
  355|   312k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 311k, False: 329]
  ------------------
  356|   311k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   311k|    }
  358|   312k|  }
  359|     20|  return true;
  360|     77|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  2.01M|        : num_remaining_points(num_remaining_points_),
  135|  2.01M|          last_axis(last_axis_),
  136|  2.01M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  1.00M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.00M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.00M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     46|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    301|      : bit_length_(0),
   87|    301|        num_points_(0),
   88|    301|        num_decoded_points_(0),
   89|    301|        dimension_(dimension),
   90|    301|        p_(dimension, 0),
   91|    301|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    301|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    301|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    151|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    151|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 6, False: 145]
  ------------------
  187|      6|    return false;
  188|      6|  }
  189|    145|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 20, False: 125]
  ------------------
  190|     20|    return false;
  191|     20|  }
  192|    125|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 4, False: 121]
  ------------------
  193|      4|    return false;
  194|      4|  }
  195|    121|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 21, False: 100]
  ------------------
  196|     21|    return true;
  197|     21|  }
  198|    100|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 15, False: 85]
  ------------------
  199|     15|    return false;
  200|     15|  }
  201|     85|  num_decoded_points_ = 0;
  202|       |
  203|     85|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 18, False: 67]
  ------------------
  204|     18|    return false;
  205|     18|  }
  206|     67|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 64]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     64|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 64]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     64|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 62]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     62|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 47, False: 15]
  ------------------
  217|     47|    return false;
  218|     47|  }
  219|       |
  220|     15|  numbers_decoder_.EndDecoding();
  221|     15|  remaining_bits_decoder_.EndDecoding();
  222|     15|  axis_decoder_.EndDecoding();
  223|     15|  half_decoder_.EndDecoding();
  224|       |
  225|     15|  return true;
  226|     62|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     62|    uint32_t num_points, OutputIteratorT &oit) {
  254|     62|  typedef DecodingStatus Status;
  255|     62|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     62|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     62|  DecodingStatus init_status(num_points, 0, 0);
  258|     62|  std::stack<Status> status_stack;
  259|     62|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.73M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.73M, False: 15]
  ------------------
  263|  2.73M|    const DecodingStatus status = status_stack.top();
  264|  2.73M|    status_stack.pop();
  265|       |
  266|  2.73M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.73M|    const uint32_t last_axis = status.last_axis;
  268|  2.73M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.73M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.73M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.73M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.73M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.73M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.73M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.73M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.73M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.73M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.36M, False: 1.37M]
  ------------------
  285|  25.5M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 24.1M, False: 1.36M]
  ------------------
  286|  24.1M|        *oit = old_base;
  287|  24.1M|        ++oit;
  288|  24.1M|        ++num_decoded_points_;
  289|  24.1M|      }
  290|  1.36M|      continue;
  291|  1.36M|    }
  292|       |
  293|  1.37M|    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.37M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.11k, False: 1.37M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.11k|      axes_[0] = axis;
  300|  6.29k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 5.18k, False: 1.11k]
  ------------------
  301|  5.18k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  5.18k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 303, False: 4.88k]
  |  |  ------------------
  ------------------
  302|  5.18k|      }
  303|  3.04k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.95k, False: 1.08k]
  ------------------
  304|  11.8k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 9.91k, False: 1.93k]
  ------------------
  305|  9.91k|          p_[axes_[j]] = 0;
  306|  9.91k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  9.91k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.06k, False: 5.84k]
  ------------------
  308|  4.06k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 25, False: 4.03k]
  ------------------
  309|  4.06k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     25|              return false;
  311|     25|            }
  312|  4.06k|          }
  313|  9.88k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  9.88k|        }
  315|  1.93k|        *oit = p_;
  316|  1.93k|        ++oit;
  317|  1.93k|        ++num_decoded_points_;
  318|  1.93k|      }
  319|  1.08k|      continue;
  320|  1.11k|    }
  321|       |
  322|  1.37M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.37M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.37M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.37M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.37M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.37M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.37M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.37M|    uint32_t number = 0;
  334|  1.37M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.37M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.37M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 22, False: 1.37M]
  ------------------
  338|       |      // Invalid |number|.
  339|     22|      return false;
  340|     22|    }
  341|  1.37M|    first_half -= number;
  342|  1.37M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.37M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 709k, False: 660k]
  ------------------
  345|   709k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 705k, False: 4.12k]
  ------------------
  346|   705k|        std::swap(first_half, second_half);
  347|   705k|      }
  348|   709k|    }
  349|       |
  350|  1.37M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.37M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.37M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.36M, False: 92]
  ------------------
  353|  1.36M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.36M|    }
  355|  1.37M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.36M, False: 88]
  ------------------
  356|  1.36M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.36M|    }
  358|  1.37M|  }
  359|     15|  return true;
  360|     62|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  9.17M|        : num_remaining_points(num_remaining_points_),
  135|  9.17M|          last_axis(last_axis_),
  136|  9.17M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  9.17M|    uint32_t last_axis) {
  232|  9.17M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 9.17M, Folded]
  ------------------
  233|  9.17M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  9.17M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.36M, False: 5.80M]
  |  |  ------------------
  ------------------
  234|  9.17M|  }
  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|  9.17M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  4.58M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  4.58M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  4.58M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|     16|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    152|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    152|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 149]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    149|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 14, False: 135]
  ------------------
  190|     14|    return false;
  191|     14|  }
  192|    135|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 3, False: 132]
  ------------------
  193|      3|    return false;
  194|      3|  }
  195|    132|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 19, False: 113]
  ------------------
  196|     19|    return true;
  197|     19|  }
  198|    113|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 19, False: 94]
  ------------------
  199|     19|    return false;
  200|     19|  }
  201|     94|  num_decoded_points_ = 0;
  202|       |
  203|     94|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 9, False: 85]
  ------------------
  204|      9|    return false;
  205|      9|  }
  206|     85|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 7, False: 78]
  ------------------
  207|      7|    return false;
  208|      7|  }
  209|     78|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 6, False: 72]
  ------------------
  210|      6|    return false;
  211|      6|  }
  212|     72|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 71]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     71|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 67, False: 4]
  ------------------
  217|     67|    return false;
  218|     67|  }
  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|     71|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     71|    uint32_t num_points, OutputIteratorT &oit) {
  254|     71|  typedef DecodingStatus Status;
  255|     71|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     71|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     71|  DecodingStatus init_status(num_points, 0, 0);
  258|     71|  std::stack<Status> status_stack;
  259|     71|  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: 4]
  ------------------
  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: 5.54k, False: 11.5k]
  ------------------
  285|  9.13M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 9.13M, False: 5.54k]
  ------------------
  286|  9.13M|        *oit = old_base;
  287|  9.13M|        ++oit;
  288|  9.13M|        ++num_decoded_points_;
  289|  9.13M|      }
  290|  5.54k|      continue;
  291|  5.54k|    }
  292|       |
  293|  11.5k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  11.5k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 578, False: 10.9k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    578|      axes_[0] = axis;
  300|  1.67k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.09k, False: 578]
  ------------------
  301|  1.09k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.09k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 140, False: 957]
  |  |  ------------------
  ------------------
  302|  1.09k|      }
  303|  1.57k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.01k, False: 559]
  ------------------
  304|  3.51k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 2.52k, False: 994]
  ------------------
  305|  2.52k|          p_[axes_[j]] = 0;
  306|  2.52k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  2.52k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.68k, False: 835]
  ------------------
  308|  1.68k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 19, False: 1.66k]
  ------------------
  309|  1.68k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     19|              return false;
  311|     19|            }
  312|  1.68k|          }
  313|  2.50k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  2.50k|        }
  315|    994|        *oit = p_;
  316|    994|        ++oit;
  317|    994|        ++num_decoded_points_;
  318|    994|      }
  319|    559|      continue;
  320|    578|    }
  321|       |
  322|  10.9k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 10.9k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  10.9k|    const int num_remaining_bits = bit_length_ - level;
  327|  10.9k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  10.9k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  10.9k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  10.9k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  10.9k|    uint32_t number = 0;
  334|  10.9k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  10.9k|    uint32_t first_half = num_remaining_points / 2;
  337|  10.9k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 48, False: 10.9k]
  ------------------
  338|       |      // Invalid |number|.
  339|     48|      return false;
  340|     48|    }
  341|  10.9k|    first_half -= number;
  342|  10.9k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  10.9k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 7.95k, False: 2.96k]
  ------------------
  345|  7.95k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 6.33k, False: 1.61k]
  ------------------
  346|  6.33k|        std::swap(first_half, second_half);
  347|  6.33k|      }
  348|  7.95k|    }
  349|       |
  350|  10.9k|    levels_stack_[stack_pos][axis] += 1;
  351|  10.9k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  10.9k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 10.0k, False: 835]
  ------------------
  353|  10.0k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  10.0k|    }
  355|  10.9k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 7.35k, False: 3.55k]
  ------------------
  356|  7.35k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  7.35k|    }
  358|  10.9k|  }
  359|      4|  return true;
  360|     71|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  4.30M|        : num_remaining_points(num_remaining_points_),
  135|  4.30M|          last_axis(last_axis_),
  136|  4.30M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  2.15M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.15M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.15M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|     21|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    232|      : bit_length_(0),
   87|    232|        num_points_(0),
   88|    232|        num_decoded_points_(0),
   89|    232|        dimension_(dimension),
   90|    232|        p_(dimension, 0),
   91|    232|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    232|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    232|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    141|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    141|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 7, False: 134]
  ------------------
  187|      7|    return false;
  188|      7|  }
  189|    134|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 9, False: 125]
  ------------------
  190|      9|    return false;
  191|      9|  }
  192|    125|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 3, False: 122]
  ------------------
  193|      3|    return false;
  194|      3|  }
  195|    122|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 10, False: 112]
  ------------------
  196|     10|    return true;
  197|     10|  }
  198|    112|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 14, False: 98]
  ------------------
  199|     14|    return false;
  200|     14|  }
  201|     98|  num_decoded_points_ = 0;
  202|       |
  203|     98|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 93]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     93|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 90]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     90|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 4, False: 86]
  ------------------
  210|      4|    return false;
  211|      4|  }
  212|     86|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 85]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     85|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 77, False: 8]
  ------------------
  217|     77|    return false;
  218|     77|  }
  219|       |
  220|      8|  numbers_decoder_.EndDecoding();
  221|      8|  remaining_bits_decoder_.EndDecoding();
  222|      8|  axis_decoder_.EndDecoding();
  223|      8|  half_decoder_.EndDecoding();
  224|       |
  225|      8|  return true;
  226|     85|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     85|    uint32_t num_points, OutputIteratorT &oit) {
  254|     85|  typedef DecodingStatus Status;
  255|     85|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     85|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     85|  DecodingStatus init_status(num_points, 0, 0);
  258|     85|  std::stack<Status> status_stack;
  259|     85|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  26.3k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 26.3k, False: 8]
  ------------------
  263|  26.3k|    const DecodingStatus status = status_stack.top();
  264|  26.3k|    status_stack.pop();
  265|       |
  266|  26.3k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  26.3k|    const uint32_t last_axis = status.last_axis;
  268|  26.3k|    const uint32_t stack_pos = status.stack_pos;
  269|  26.3k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  26.3k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  26.3k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 26.3k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  26.3k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  26.3k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 26.3k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  26.3k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  26.3k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 3.34k, False: 22.9k]
  ------------------
  285|  49.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 49.7M, False: 3.34k]
  ------------------
  286|  49.7M|        *oit = old_base;
  287|  49.7M|        ++oit;
  288|  49.7M|        ++num_decoded_points_;
  289|  49.7M|      }
  290|  3.34k|      continue;
  291|  3.34k|    }
  292|       |
  293|  22.9k|    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.9k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.53k, False: 21.4k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.53k|      axes_[0] = axis;
  300|  3.77k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.23k, False: 1.53k]
  ------------------
  301|  2.23k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.23k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 590, False: 1.64k]
  |  |  ------------------
  ------------------
  302|  2.23k|      }
  303|  4.03k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.50k, False: 1.52k]
  ------------------
  304|  8.57k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.08k, False: 2.49k]
  ------------------
  305|  6.08k|          p_[axes_[j]] = 0;
  306|  6.08k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.08k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.44k, False: 1.63k]
  ------------------
  308|  4.44k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 12, False: 4.43k]
  ------------------
  309|  4.44k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     12|              return false;
  311|     12|            }
  312|  4.44k|          }
  313|  6.07k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.07k|        }
  315|  2.49k|        *oit = p_;
  316|  2.49k|        ++oit;
  317|  2.49k|        ++num_decoded_points_;
  318|  2.49k|      }
  319|  1.52k|      continue;
  320|  1.53k|    }
  321|       |
  322|  21.4k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 21.4k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  21.4k|    const int num_remaining_bits = bit_length_ - level;
  327|  21.4k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  21.4k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  21.4k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  21.4k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  21.4k|    uint32_t number = 0;
  334|  21.4k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  21.4k|    uint32_t first_half = num_remaining_points / 2;
  337|  21.4k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 65, False: 21.3k]
  ------------------
  338|       |      // Invalid |number|.
  339|     65|      return false;
  340|     65|    }
  341|  21.3k|    first_half -= number;
  342|  21.3k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  21.3k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 18.6k, False: 2.72k]
  ------------------
  345|  18.6k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 15.9k, False: 2.72k]
  ------------------
  346|  15.9k|        std::swap(first_half, second_half);
  347|  15.9k|      }
  348|  18.6k|    }
  349|       |
  350|  21.3k|    levels_stack_[stack_pos][axis] += 1;
  351|  21.3k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  21.3k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 19.2k, False: 2.15k]
  ------------------
  353|  19.2k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  19.2k|    }
  355|  21.3k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 7.55k, False: 13.8k]
  ------------------
  356|  7.55k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  7.55k|    }
  358|  21.3k|  }
  359|      8|  return true;
  360|     85|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  69.0k|        : num_remaining_points(num_remaining_points_),
  135|  69.0k|          last_axis(last_axis_),
  136|  69.0k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  67.6k|    uint32_t last_axis) {
  232|  67.6k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 67.6k, Folded]
  ------------------
  233|  67.6k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  67.6k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 18.1k, False: 49.4k]
  |  |  ------------------
  ------------------
  234|  67.6k|  }
  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|  67.6k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  42.6k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  42.6k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  42.6k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|     15|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    142|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    142|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 138]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|    138|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 128]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|    128|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 126]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    126|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 25, False: 101]
  ------------------
  196|     25|    return true;
  197|     25|  }
  198|    101|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 25, False: 76]
  ------------------
  199|     25|    return false;
  200|     25|  }
  201|     76|  num_decoded_points_ = 0;
  202|       |
  203|     76|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 13, False: 63]
  ------------------
  204|     13|    return false;
  205|     13|  }
  206|     63|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 62]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     62|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 59]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     59|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 59]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     59|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 46, False: 13]
  ------------------
  217|     46|    return false;
  218|     46|  }
  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|     59|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     59|    uint32_t num_points, OutputIteratorT &oit) {
  254|     59|  typedef DecodingStatus Status;
  255|     59|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     59|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     59|  DecodingStatus init_status(num_points, 0, 0);
  258|     59|  std::stack<Status> status_stack;
  259|     59|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.32M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.32M, False: 13]
  ------------------
  263|  2.32M|    const DecodingStatus status = status_stack.top();
  264|  2.32M|    status_stack.pop();
  265|       |
  266|  2.32M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.32M|    const uint32_t last_axis = status.last_axis;
  268|  2.32M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.32M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.32M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.32M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.32M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.32M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.32M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.32M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.32M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.32M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.09M, False: 1.22M]
  ------------------
  285|  50.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 49.1M, False: 1.09M]
  ------------------
  286|  49.1M|        *oit = old_base;
  287|  49.1M|        ++oit;
  288|  49.1M|        ++num_decoded_points_;
  289|  49.1M|      }
  290|  1.09M|      continue;
  291|  1.09M|    }
  292|       |
  293|  1.22M|    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.22M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 59.7k, False: 1.16M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  59.7k|      axes_[0] = axis;
  300|  92.1k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 32.3k, False: 59.7k]
  ------------------
  301|  32.3k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  32.3k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 11.3k, False: 21.0k]
  |  |  ------------------
  ------------------
  302|  32.3k|      }
  303|   153k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 93.4k, False: 59.6k]
  ------------------
  304|   230k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 137k, False: 93.3k]
  ------------------
  305|   137k|          p_[axes_[j]] = 0;
  306|   137k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   137k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 123k, False: 14.2k]
  ------------------
  308|   123k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 41, False: 122k]
  ------------------
  309|   123k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     41|              return false;
  311|     41|            }
  312|   123k|          }
  313|   137k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   137k|        }
  315|  93.3k|        *oit = p_;
  316|  93.3k|        ++oit;
  317|  93.3k|        ++num_decoded_points_;
  318|  93.3k|      }
  319|  59.6k|      continue;
  320|  59.7k|    }
  321|       |
  322|  1.16M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.16M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.16M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.16M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.16M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.16M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.16M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.16M|    uint32_t number = 0;
  334|  1.16M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.16M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.16M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 5, False: 1.16M]
  ------------------
  338|       |      // Invalid |number|.
  339|      5|      return false;
  340|      5|    }
  341|  1.16M|    first_half -= number;
  342|  1.16M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.16M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.12M, False: 42.1k]
  ------------------
  345|  1.12M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.10M, False: 21.3k]
  ------------------
  346|  1.10M|        std::swap(first_half, second_half);
  347|  1.10M|      }
  348|  1.12M|    }
  349|       |
  350|  1.16M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.16M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.16M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.16M, False: 7.35k]
  ------------------
  353|  1.16M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.16M|    }
  355|  1.16M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.15M, False: 10.8k]
  ------------------
  356|  1.15M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.15M|    }
  358|  1.16M|  }
  359|     13|  return true;
  360|     59|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  2.32M|        : num_remaining_points(num_remaining_points_),
  135|  2.32M|          last_axis(last_axis_),
  136|  2.32M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  1.16M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.16M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.16M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     37|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    195|      : bit_length_(0),
   87|    195|        num_points_(0),
   88|    195|        num_decoded_points_(0),
   89|    195|        dimension_(dimension),
   90|    195|        p_(dimension, 0),
   91|    195|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    195|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    195|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    155|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    155|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 152]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    152|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 144]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|    144|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 3, False: 141]
  ------------------
  193|      3|    return false;
  194|      3|  }
  195|    141|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 9, False: 132]
  ------------------
  196|      9|    return true;
  197|      9|  }
  198|    132|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 20, False: 112]
  ------------------
  199|     20|    return false;
  200|     20|  }
  201|    112|  num_decoded_points_ = 0;
  202|       |
  203|    112|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 39, False: 73]
  ------------------
  204|     39|    return false;
  205|     39|  }
  206|     73|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 71]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     71|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 6, False: 65]
  ------------------
  210|      6|    return false;
  211|      6|  }
  212|     65|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 4, False: 61]
  ------------------
  213|      4|    return false;
  214|      4|  }
  215|       |
  216|     61|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 34, False: 27]
  ------------------
  217|     34|    return false;
  218|     34|  }
  219|       |
  220|     27|  numbers_decoder_.EndDecoding();
  221|     27|  remaining_bits_decoder_.EndDecoding();
  222|     27|  axis_decoder_.EndDecoding();
  223|     27|  half_decoder_.EndDecoding();
  224|       |
  225|     27|  return true;
  226|     61|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     61|    uint32_t num_points, OutputIteratorT &oit) {
  254|     61|  typedef DecodingStatus Status;
  255|     61|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     61|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     61|  DecodingStatus init_status(num_points, 0, 0);
  258|     61|  std::stack<Status> status_stack;
  259|     61|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.30M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.30M, False: 27]
  ------------------
  263|  1.30M|    const DecodingStatus status = status_stack.top();
  264|  1.30M|    status_stack.pop();
  265|       |
  266|  1.30M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.30M|    const uint32_t last_axis = status.last_axis;
  268|  1.30M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.30M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.30M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.30M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.30M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.30M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.30M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.30M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.30M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.30M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 592k, False: 713k]
  ------------------
  285|  65.9M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 65.3M, False: 592k]
  ------------------
  286|  65.3M|        *oit = old_base;
  287|  65.3M|        ++oit;
  288|  65.3M|        ++num_decoded_points_;
  289|  65.3M|      }
  290|   592k|      continue;
  291|   592k|    }
  292|       |
  293|   713k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   713k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 48.6k, False: 664k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  48.6k|      axes_[0] = axis;
  300|   147k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 99.1k, False: 48.6k]
  ------------------
  301|  99.1k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  99.1k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 16.2k, False: 82.9k]
  |  |  ------------------
  ------------------
  302|  99.1k|      }
  303|   118k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 70.3k, False: 48.5k]
  ------------------
  304|   299k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 228k, False: 70.3k]
  ------------------
  305|   228k|          p_[axes_[j]] = 0;
  306|   228k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   228k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 111k, False: 117k]
  ------------------
  308|   111k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 33, False: 111k]
  ------------------
  309|   111k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     33|              return false;
  311|     33|            }
  312|   111k|          }
  313|   228k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   228k|        }
  315|  70.3k|        *oit = p_;
  316|  70.3k|        ++oit;
  317|  70.3k|        ++num_decoded_points_;
  318|  70.3k|      }
  319|  48.5k|      continue;
  320|  48.6k|    }
  321|       |
  322|   664k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 664k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   664k|    const int num_remaining_bits = bit_length_ - level;
  327|   664k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   664k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   664k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   664k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   664k|    uint32_t number = 0;
  334|   664k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   664k|    uint32_t first_half = num_remaining_points / 2;
  337|   664k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 664k]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|   664k|    first_half -= number;
  342|   664k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   664k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 648k, False: 16.3k]
  ------------------
  345|   648k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 617k, False: 30.5k]
  ------------------
  346|   617k|        std::swap(first_half, second_half);
  347|   617k|      }
  348|   648k|    }
  349|       |
  350|   664k|    levels_stack_[stack_pos][axis] += 1;
  351|   664k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   664k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 655k, False: 9.38k]
  ------------------
  353|   655k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   655k|    }
  355|   664k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 650k, False: 13.8k]
  ------------------
  356|   650k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   650k|    }
  358|   664k|  }
  359|     27|  return true;
  360|     61|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  1.30M|        : num_remaining_points(num_remaining_points_),
  135|  1.30M|          last_axis(last_axis_),
  136|  1.30M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.30M|    uint32_t last_axis) {
  232|  1.30M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.30M, Folded]
  ------------------
  233|  1.30M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.30M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 498k, False: 807k]
  |  |  ------------------
  ------------------
  234|  1.30M|  }
  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.30M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|   664k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   664k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   664k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     36|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    117|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    117|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 115]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|    115|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 108]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|    108|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 4, False: 104]
  ------------------
  193|      4|    return false;
  194|      4|  }
  195|    104|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 16, False: 88]
  ------------------
  196|     16|    return true;
  197|     16|  }
  198|     88|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 9, False: 79]
  ------------------
  199|      9|    return false;
  200|      9|  }
  201|     79|  num_decoded_points_ = 0;
  202|       |
  203|     79|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 10, False: 69]
  ------------------
  204|     10|    return false;
  205|     10|  }
  206|     69|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 68]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     68|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 67]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     67|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 67]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     67|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 55, False: 12]
  ------------------
  217|     55|    return false;
  218|     55|  }
  219|       |
  220|     12|  numbers_decoder_.EndDecoding();
  221|     12|  remaining_bits_decoder_.EndDecoding();
  222|     12|  axis_decoder_.EndDecoding();
  223|     12|  half_decoder_.EndDecoding();
  224|       |
  225|     12|  return true;
  226|     67|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     67|    uint32_t num_points, OutputIteratorT &oit) {
  254|     67|  typedef DecodingStatus Status;
  255|     67|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     67|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     67|  DecodingStatus init_status(num_points, 0, 0);
  258|     67|  std::stack<Status> status_stack;
  259|     67|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   138k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 138k, False: 12]
  ------------------
  263|   138k|    const DecodingStatus status = status_stack.top();
  264|   138k|    status_stack.pop();
  265|       |
  266|   138k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   138k|    const uint32_t last_axis = status.last_axis;
  268|   138k|    const uint32_t stack_pos = status.stack_pos;
  269|   138k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   138k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   138k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 138k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   138k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   138k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 6, False: 138k]
  ------------------
  278|      6|      return false;
  279|      6|    }
  280|       |
  281|   138k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   138k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 394, False: 137k]
  ------------------
  285|  49.0k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 48.6k, False: 394]
  ------------------
  286|  48.6k|        *oit = old_base;
  287|  48.6k|        ++oit;
  288|  48.6k|        ++num_decoded_points_;
  289|  48.6k|      }
  290|    394|      continue;
  291|    394|    }
  292|       |
  293|   137k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   137k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 511, False: 137k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    511|      axes_[0] = axis;
  300|  31.1k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 30.6k, False: 511]
  ------------------
  301|  30.6k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  30.6k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 498, False: 30.1k]
  |  |  ------------------
  ------------------
  302|  30.6k|      }
  303|  1.16k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 679, False: 487]
  ------------------
  304|  39.8k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 39.2k, False: 655]
  ------------------
  305|  39.2k|          p_[axes_[j]] = 0;
  306|  39.2k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  39.2k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 39.0k, False: 155]
  ------------------
  308|  39.0k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 24, False: 39.0k]
  ------------------
  309|  39.0k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     24|              return false;
  311|     24|            }
  312|  39.0k|          }
  313|  39.2k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  39.2k|        }
  315|    655|        *oit = p_;
  316|    655|        ++oit;
  317|    655|        ++num_decoded_points_;
  318|    655|      }
  319|    487|      continue;
  320|    511|    }
  321|       |
  322|   137k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 137k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   137k|    const int num_remaining_bits = bit_length_ - level;
  327|   137k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   137k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   137k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   137k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   137k|    uint32_t number = 0;
  334|   137k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   137k|    uint32_t first_half = num_remaining_points / 2;
  337|   137k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 25, False: 137k]
  ------------------
  338|       |      // Invalid |number|.
  339|     25|      return false;
  340|     25|    }
  341|   137k|    first_half -= number;
  342|   137k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   137k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 137k, False: 57]
  ------------------
  345|   137k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 104k, False: 32.2k]
  ------------------
  346|   104k|        std::swap(first_half, second_half);
  347|   104k|      }
  348|   137k|    }
  349|       |
  350|   137k|    levels_stack_[stack_pos][axis] += 1;
  351|   137k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   137k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 105k, False: 31.8k]
  ------------------
  353|   105k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   105k|    }
  355|   137k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 32.9k, False: 104k]
  ------------------
  356|  32.9k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  32.9k|    }
  358|   137k|  }
  359|     12|  return true;
  360|     67|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   138k|        : num_remaining_points(num_remaining_points_),
  135|   138k|          last_axis(last_axis_),
  136|   138k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   137k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   137k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   137k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     25|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    137|      : bit_length_(0),
   87|    137|        num_points_(0),
   88|    137|        num_decoded_points_(0),
   89|    137|        dimension_(dimension),
   90|    137|        p_(dimension, 0),
   91|    137|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    137|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    137|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    106|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    106|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    106|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    235|      : bit_length_(0),
   87|    235|        num_points_(0),
   88|    235|        num_decoded_points_(0),
   89|    235|        dimension_(dimension),
   90|    235|        p_(dimension, 0),
   91|    235|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    235|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    235|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     95|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     95|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     95|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     37|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     37|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     37|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    243|      : bit_length_(0),
   87|    243|        num_points_(0),
   88|    243|        num_decoded_points_(0),
   89|    243|        dimension_(dimension),
   90|    243|        p_(dimension, 0),
   91|    243|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    243|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    243|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     40|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     40|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     40|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     10|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     10|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     10|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    181|      : bit_length_(0),
   87|    181|        num_points_(0),
   88|    181|        num_decoded_points_(0),
   89|    181|        dimension_(dimension),
   90|    181|        p_(dimension, 0),
   91|    181|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    181|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    181|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      1|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      1|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__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: 580k, False: 1.43M]
  |  |  ------------------
  ------------------
  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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.30M|    uint32_t last_axis) {
  232|  4.30M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.30M, Folded]
  ------------------
  233|  4.30M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.30M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.23M, False: 3.07M]
  |  |  ------------------
  ------------------
  234|  4.30M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  4.30M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.32M|    uint32_t last_axis) {
  232|  2.32M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.32M, Folded]
  ------------------
  233|  2.32M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.32M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.23M, False: 82.1k]
  |  |  ------------------
  ------------------
  234|  2.32M|  }
  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.32M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   138k|    uint32_t last_axis) {
  232|   138k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 138k]
  ------------------
  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|   138k|  uint32_t best_axis = 0;
  237|   138k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 137k, False: 590]
  ------------------
  238|  14.6M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 14.5M, False: 137k]
  ------------------
  239|  14.5M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 162k, False: 14.3M]
  ------------------
  240|   162k|        best_axis = axis;
  241|   162k|      }
  242|  14.5M|    }
  243|   137k|  } else {
  244|    590|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|    590|  }
  246|       |
  247|   138k|  return best_axis;
  248|   138k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     91|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     91|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     91|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_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: 13, False: 78]
  ------------------
  190|     13|    return false;
  191|     13|  }
  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: 2, False: 75]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|     75|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 75]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     75|  num_decoded_points_ = 0;
  202|       |
  203|     75|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 24, False: 51]
  ------------------
  204|     24|    return false;
  205|     24|  }
  206|     51|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 47]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     47|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 47]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     47|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 46]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     46|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 37, False: 9]
  ------------------
  217|     37|    return false;
  218|     37|  }
  219|       |
  220|      9|  numbers_decoder_.EndDecoding();
  221|      9|  remaining_bits_decoder_.EndDecoding();
  222|      9|  axis_decoder_.EndDecoding();
  223|      9|  half_decoder_.EndDecoding();
  224|       |
  225|      9|  return true;
  226|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     46|    uint32_t num_points, OutputIteratorT &oit) {
  254|     46|  typedef DecodingStatus Status;
  255|     46|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     46|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     46|  DecodingStatus init_status(num_points, 0, 0);
  258|     46|  std::stack<Status> status_stack;
  259|     46|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.38M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.38M, False: 9]
  ------------------
  263|  1.38M|    const DecodingStatus status = status_stack.top();
  264|  1.38M|    status_stack.pop();
  265|       |
  266|  1.38M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.38M|    const uint32_t last_axis = status.last_axis;
  268|  1.38M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.38M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.38M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.38M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.38M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.38M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.38M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.38M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.38M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.38M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 692k, False: 695k]
  ------------------
  285|  92.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 91.4M, False: 692k]
  ------------------
  286|  91.4M|        *oit = old_base;
  287|  91.4M|        ++oit;
  288|  91.4M|        ++num_decoded_points_;
  289|  91.4M|      }
  290|   692k|      continue;
  291|   692k|    }
  292|       |
  293|   695k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   695k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.08k, False: 694k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.08k|      axes_[0] = axis;
  300|  3.26k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.17k, False: 1.08k]
  ------------------
  301|  2.17k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.17k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 290, False: 1.88k]
  |  |  ------------------
  ------------------
  302|  2.17k|      }
  303|  2.97k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.90k, False: 1.06k]
  ------------------
  304|  7.56k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 5.68k, False: 1.88k]
  ------------------
  305|  5.68k|          p_[axes_[j]] = 0;
  306|  5.68k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  5.68k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.77k, False: 2.91k]
  ------------------
  308|  2.77k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 20, False: 2.75k]
  ------------------
  309|  2.77k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     20|              return false;
  311|     20|            }
  312|  2.77k|          }
  313|  5.66k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  5.66k|        }
  315|  1.88k|        *oit = p_;
  316|  1.88k|        ++oit;
  317|  1.88k|        ++num_decoded_points_;
  318|  1.88k|      }
  319|  1.06k|      continue;
  320|  1.08k|    }
  321|       |
  322|   694k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 694k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   694k|    const int num_remaining_bits = bit_length_ - level;
  327|   694k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   694k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   694k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   694k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   694k|    uint32_t number = 0;
  334|   694k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   694k|    uint32_t first_half = num_remaining_points / 2;
  337|   694k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 17, False: 694k]
  ------------------
  338|       |      // Invalid |number|.
  339|     17|      return false;
  340|     17|    }
  341|   694k|    first_half -= number;
  342|   694k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   694k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 325k, False: 368k]
  ------------------
  345|   325k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 315k, False: 10.3k]
  ------------------
  346|   315k|        std::swap(first_half, second_half);
  347|   315k|      }
  348|   325k|    }
  349|       |
  350|   694k|    levels_stack_[stack_pos][axis] += 1;
  351|   694k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   694k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 694k, False: 63]
  ------------------
  353|   694k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   694k|    }
  355|   694k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 694k, False: 129]
  ------------------
  356|   694k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   694k|    }
  358|   694k|  }
  359|      9|  return true;
  360|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     84|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     84|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     84|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     84|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     84|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 83]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     83|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 73]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|     73|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 72]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     72|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 71]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     71|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 71]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     71|  num_decoded_points_ = 0;
  202|       |
  203|     71|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 17, False: 54]
  ------------------
  204|     17|    return false;
  205|     17|  }
  206|     54|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 52]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     52|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 51]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     51|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 50]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     50|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 38, False: 12]
  ------------------
  217|     38|    return false;
  218|     38|  }
  219|       |
  220|     12|  numbers_decoder_.EndDecoding();
  221|     12|  remaining_bits_decoder_.EndDecoding();
  222|     12|  axis_decoder_.EndDecoding();
  223|     12|  half_decoder_.EndDecoding();
  224|       |
  225|     12|  return true;
  226|     50|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     50|    uint32_t num_points, OutputIteratorT &oit) {
  254|     50|  typedef DecodingStatus Status;
  255|     50|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     50|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     50|  DecodingStatus init_status(num_points, 0, 0);
  258|     50|  std::stack<Status> status_stack;
  259|     50|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  6.43M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 6.43M, False: 12]
  ------------------
  263|  6.43M|    const DecodingStatus status = status_stack.top();
  264|  6.43M|    status_stack.pop();
  265|       |
  266|  6.43M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  6.43M|    const uint32_t last_axis = status.last_axis;
  268|  6.43M|    const uint32_t stack_pos = status.stack_pos;
  269|  6.43M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  6.43M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  6.43M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 6.43M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  6.43M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  6.43M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 6.43M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  6.43M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  6.43M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 3.21M, False: 3.21M]
  ------------------
  285|  66.9M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 63.7M, False: 3.21M]
  ------------------
  286|  63.7M|        *oit = old_base;
  287|  63.7M|        ++oit;
  288|  63.7M|        ++num_decoded_points_;
  289|  63.7M|      }
  290|  3.21M|      continue;
  291|  3.21M|    }
  292|       |
  293|  3.21M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  3.21M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.20k, False: 3.21M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.20k|      axes_[0] = axis;
  300|  3.62k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.41k, False: 1.20k]
  ------------------
  301|  2.41k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.41k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 432, False: 1.98k]
  |  |  ------------------
  ------------------
  302|  2.41k|      }
  303|  3.22k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.04k, False: 1.18k]
  ------------------
  304|  8.11k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.09k, False: 2.01k]
  ------------------
  305|  6.09k|          p_[axes_[j]] = 0;
  306|  6.09k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.09k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.32k, False: 2.76k]
  ------------------
  308|  3.32k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 25, False: 3.30k]
  ------------------
  309|  3.32k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     25|              return false;
  311|     25|            }
  312|  3.32k|          }
  313|  6.06k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.06k|        }
  315|  2.01k|        *oit = p_;
  316|  2.01k|        ++oit;
  317|  2.01k|        ++num_decoded_points_;
  318|  2.01k|      }
  319|  1.18k|      continue;
  320|  1.20k|    }
  321|       |
  322|  3.21M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 3.21M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  3.21M|    const int num_remaining_bits = bit_length_ - level;
  327|  3.21M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  3.21M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  3.21M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  3.21M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  3.21M|    uint32_t number = 0;
  334|  3.21M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  3.21M|    uint32_t first_half = num_remaining_points / 2;
  337|  3.21M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 13, False: 3.21M]
  ------------------
  338|       |      // Invalid |number|.
  339|     13|      return false;
  340|     13|    }
  341|  3.21M|    first_half -= number;
  342|  3.21M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  3.21M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 2.03M, False: 1.18M]
  ------------------
  345|  2.03M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 2.03M, False: 2.29k]
  ------------------
  346|  2.03M|        std::swap(first_half, second_half);
  347|  2.03M|      }
  348|  2.03M|    }
  349|       |
  350|  3.21M|    levels_stack_[stack_pos][axis] += 1;
  351|  3.21M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  3.21M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 3.21M, False: 128]
  ------------------
  353|  3.21M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  3.21M|    }
  355|  3.21M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 3.21M, False: 81]
  ------------------
  356|  3.21M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  3.21M|    }
  358|  3.21M|  }
  359|     12|  return true;
  360|     50|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     80|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     80|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     80|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     80|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     80|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 78]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|     78|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 75]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     75|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 75]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     75|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 74]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     74|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 74]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     74|  num_decoded_points_ = 0;
  202|       |
  203|     74|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 21, False: 53]
  ------------------
  204|     21|    return false;
  205|     21|  }
  206|     53|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 51]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     51|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 50]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     50|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 49]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     49|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 43, False: 6]
  ------------------
  217|     43|    return false;
  218|     43|  }
  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|     49|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     49|    uint32_t num_points, OutputIteratorT &oit) {
  254|     49|  typedef DecodingStatus Status;
  255|     49|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     49|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     49|  DecodingStatus init_status(num_points, 0, 0);
  258|     49|  std::stack<Status> status_stack;
  259|     49|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  4.28M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.28M, False: 6]
  ------------------
  263|  4.28M|    const DecodingStatus status = status_stack.top();
  264|  4.28M|    status_stack.pop();
  265|       |
  266|  4.28M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.28M|    const uint32_t last_axis = status.last_axis;
  268|  4.28M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.28M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.28M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.28M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.28M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.28M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.28M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.28M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.28M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.28M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.14M, False: 2.14M]
  ------------------
  285|  20.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 18.0M, False: 2.14M]
  ------------------
  286|  18.0M|        *oit = old_base;
  287|  18.0M|        ++oit;
  288|  18.0M|        ++num_decoded_points_;
  289|  18.0M|      }
  290|  2.14M|      continue;
  291|  2.14M|    }
  292|       |
  293|  2.14M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  2.14M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 601, False: 2.14M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    601|      axes_[0] = axis;
  300|  1.80k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.20k, False: 601]
  ------------------
  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: 154, False: 1.04k]
  |  |  ------------------
  ------------------
  302|  1.20k|      }
  303|  1.59k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.00k, False: 593]
  ------------------
  304|  3.99k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 2.99k, False: 996]
  ------------------
  305|  2.99k|          p_[axes_[j]] = 0;
  306|  2.99k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  2.99k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.59k, False: 1.40k]
  ------------------
  308|  1.59k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 8, False: 1.59k]
  ------------------
  309|  1.59k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      8|              return false;
  311|      8|            }
  312|  1.59k|          }
  313|  2.99k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  2.99k|        }
  315|    996|        *oit = p_;
  316|    996|        ++oit;
  317|    996|        ++num_decoded_points_;
  318|    996|      }
  319|    593|      continue;
  320|    601|    }
  321|       |
  322|  2.14M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.14M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.14M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.14M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.14M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.14M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.14M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.14M|    uint32_t number = 0;
  334|  2.14M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.14M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.14M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 35, False: 2.14M]
  ------------------
  338|       |      // Invalid |number|.
  339|     35|      return false;
  340|     35|    }
  341|  2.14M|    first_half -= number;
  342|  2.14M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.14M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 991k, False: 1.15M]
  ------------------
  345|   991k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 988k, False: 3.41k]
  ------------------
  346|   988k|        std::swap(first_half, second_half);
  347|   988k|      }
  348|   991k|    }
  349|       |
  350|  2.14M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.14M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.14M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.14M, False: 95]
  ------------------
  353|  2.14M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.14M|    }
  355|  2.14M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.14M, False: 142]
  ------------------
  356|  2.14M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.14M|    }
  358|  2.14M|  }
  359|      6|  return true;
  360|     49|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    102|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    102|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    102|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    102|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    102|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 100]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|    100|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 93]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|     93|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 93]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     93|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 92]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     92|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 92]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     92|  num_decoded_points_ = 0;
  202|       |
  203|     92|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 28, False: 64]
  ------------------
  204|     28|    return false;
  205|     28|  }
  206|     64|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 62]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     62|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 60]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     60|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 59]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     59|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 57, False: 2]
  ------------------
  217|     57|    return false;
  218|     57|  }
  219|       |
  220|      2|  numbers_decoder_.EndDecoding();
  221|      2|  remaining_bits_decoder_.EndDecoding();
  222|      2|  axis_decoder_.EndDecoding();
  223|      2|  half_decoder_.EndDecoding();
  224|       |
  225|      2|  return true;
  226|     59|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     59|    uint32_t num_points, OutputIteratorT &oit) {
  254|     59|  typedef DecodingStatus Status;
  255|     59|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     59|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     59|  DecodingStatus init_status(num_points, 0, 0);
  258|     59|  std::stack<Status> status_stack;
  259|     59|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  41.3k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 41.3k, False: 2]
  ------------------
  263|  41.3k|    const DecodingStatus status = status_stack.top();
  264|  41.3k|    status_stack.pop();
  265|       |
  266|  41.3k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  41.3k|    const uint32_t last_axis = status.last_axis;
  268|  41.3k|    const uint32_t stack_pos = status.stack_pos;
  269|  41.3k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  41.3k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  41.3k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 41.3k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  41.3k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  41.3k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 41.3k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  41.3k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  41.3k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 18.2k, False: 23.1k]
  ------------------
  285|  9.05M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 9.03M, False: 18.2k]
  ------------------
  286|  9.03M|        *oit = old_base;
  287|  9.03M|        ++oit;
  288|  9.03M|        ++num_decoded_points_;
  289|  9.03M|      }
  290|  18.2k|      continue;
  291|  18.2k|    }
  292|       |
  293|  23.1k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  23.1k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.89k, False: 21.2k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.89k|      axes_[0] = axis;
  300|  5.67k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 3.78k, False: 1.89k]
  ------------------
  301|  3.78k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  3.78k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 634, False: 3.14k]
  |  |  ------------------
  ------------------
  302|  3.78k|      }
  303|  5.24k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.36k, False: 1.87k]
  ------------------
  304|  13.4k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 10.0k, False: 3.35k]
  ------------------
  305|  10.0k|          p_[axes_[j]] = 0;
  306|  10.0k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  10.0k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 6.27k, False: 3.81k]
  ------------------
  308|  6.27k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 13, False: 6.26k]
  ------------------
  309|  6.27k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     13|              return false;
  311|     13|            }
  312|  6.27k|          }
  313|  10.0k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  10.0k|        }
  315|  3.35k|        *oit = p_;
  316|  3.35k|        ++oit;
  317|  3.35k|        ++num_decoded_points_;
  318|  3.35k|      }
  319|  1.87k|      continue;
  320|  1.89k|    }
  321|       |
  322|  21.2k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 21.2k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  21.2k|    const int num_remaining_bits = bit_length_ - level;
  327|  21.2k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  21.2k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  21.2k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  21.2k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  21.2k|    uint32_t number = 0;
  334|  21.2k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  21.2k|    uint32_t first_half = num_remaining_points / 2;
  337|  21.2k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 44, False: 21.1k]
  ------------------
  338|       |      // Invalid |number|.
  339|     44|      return false;
  340|     44|    }
  341|  21.1k|    first_half -= number;
  342|  21.1k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  21.1k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 13.1k, False: 8.06k]
  ------------------
  345|  13.1k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 8.53k, False: 4.56k]
  ------------------
  346|  8.53k|        std::swap(first_half, second_half);
  347|  8.53k|      }
  348|  13.1k|    }
  349|       |
  350|  21.1k|    levels_stack_[stack_pos][axis] += 1;
  351|  21.1k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  21.1k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 21.1k, False: 61]
  ------------------
  353|  21.1k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  21.1k|    }
  355|  21.1k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 21.0k, False: 128]
  ------------------
  356|  21.0k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  21.0k|    }
  358|  21.1k|  }
  359|      2|  return true;
  360|     59|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_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: 2, False: 51]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|     51|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 21, False: 30]
  ------------------
  190|     21|    return false;
  191|     21|  }
  192|     30|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 28]
  ------------------
  193|      2|    return false;
  194|      2|  }
  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: 0, False: 27]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     27|  num_decoded_points_ = 0;
  202|       |
  203|     27|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 27, False: 0]
  ------------------
  204|     27|    return false;
  205|     27|  }
  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|     26|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     26|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     26|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     26|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     26|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 25]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     25|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 18]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|     18|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 17]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     17|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 16]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     16|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 16]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     16|  num_decoded_points_ = 0;
  202|       |
  203|     16|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 16, False: 0]
  ------------------
  204|     16|    return false;
  205|     16|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     20|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     20|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     20|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     20|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     20|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 19]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     19|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 5, False: 14]
  ------------------
  190|      5|    return false;
  191|      5|  }
  192|     14|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 13]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     13|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 12]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     12|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 12]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     12|  num_decoded_points_ = 0;
  202|       |
  203|     12|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 12, False: 0]
  ------------------
  204|     12|    return false;
  205|     12|  }
  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|    521|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    521|  qinfo_.quantization_bits = 0;
   67|    521|  qinfo_.range = 0;
   68|    521|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    483|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    483|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 1, False: 482]
  ------------------
   73|      1|    return false;
   74|      1|  }
   75|    482|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 1, False: 481]
  ------------------
   76|      1|    return false;
   77|      1|  }
   78|    481|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 481]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|    481|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 1, False: 480]
  ------------------
   82|      1|    return false;
   83|      1|  }
   84|    480|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 25, False: 455]
  |  Branch (84:38): [True: 14, False: 11]
  ------------------
   85|     14|    return false;
   86|     14|  }
   87|    466|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 1, False: 465]
  ------------------
   88|      1|    return false;
   89|      1|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    465|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 6, False: 459]
  ------------------
   93|      6|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      6|#define DRACO_LOGE printf
  ------------------
   94|      6|               compression_level_);
   95|      6|    return false;
   96|      6|  }
   97|       |
   98|    459|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    459|      std::back_inserter(*qpoints);
  100|    459|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    459|                           Converter>
  102|    459|      oit(oit_qpoints);
  103|    459|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 456, False: 3]
  ------------------
  104|    456|    qpoints->reserve(num_points_);
  105|    456|    switch (compression_level_) {
  106|     91|      case 0: {
  ------------------
  |  Branch (106:7): [True: 91, False: 365]
  ------------------
  107|     91|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|     91|        qpoints_decoder.DecodePoints(buffer, oit);
  109|     91|        break;
  110|      0|      }
  111|     84|      case 1: {
  ------------------
  |  Branch (111:7): [True: 84, False: 372]
  ------------------
  112|     84|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     84|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     84|        break;
  115|      0|      }
  116|     80|      case 2: {
  ------------------
  |  Branch (116:7): [True: 80, False: 376]
  ------------------
  117|     80|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     80|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     80|        break;
  120|      0|      }
  121|    102|      case 3: {
  ------------------
  |  Branch (121:7): [True: 102, False: 354]
  ------------------
  122|    102|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|    102|        qpoints_decoder.DecodePoints(buffer, oit);
  124|    102|        break;
  125|      0|      }
  126|     53|      case 4: {
  ------------------
  |  Branch (126:7): [True: 53, False: 403]
  ------------------
  127|     53|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     53|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     53|        break;
  130|      0|      }
  131|     26|      case 5: {
  ------------------
  |  Branch (131:7): [True: 26, False: 430]
  ------------------
  132|     26|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|     26|        qpoints_decoder.DecodePoints(buffer, oit);
  134|     26|        break;
  135|      0|      }
  136|     20|      case 6: {
  ------------------
  |  Branch (136:7): [True: 20, False: 436]
  ------------------
  137|     20|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|     20|        qpoints_decoder.DecodePoints(buffer, oit);
  139|     20|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 456]
  ------------------
  142|      0|        return false;
  143|    456|    }
  144|    456|  }
  145|       |
  146|    459|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 452, False: 7]
  ------------------
  147|    452|    return false;
  148|    452|  }
  149|      7|  return true;
  150|    459|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    459|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   182M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   182M|  const Self &operator=(const SourceType &source) {
   56|   182M|    *oit_ = Converter()(source);
   57|   182M|    return *this;
   58|   182M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   182M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   182M|    return Point3ui(v[0], v[1], v[2]);
   31|   182M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   182M|  const Self &operator++() {
   46|   182M|    ++oit_;
   47|   182M|    return *this;
   48|   182M|  }

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  7.80M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  7.80M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 7.80M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  7.80M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  7.80M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  2.29G|  bool Decode(void *out_data, size_t size_to_decode) {
   77|  2.29G|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 375, False: 2.29G]
  ------------------
   78|    375|      return false;  // Buffer overflow.
   79|    375|    }
   80|  2.29G|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  2.29G|    pos_ += size_to_decode;
   82|  2.29G|    return true;
   83|  2.29G|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  28.2k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  12.2k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  39.1k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   200k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  5.33k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  7.80M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  1.96M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  5.78k|    inline void reset(const void *b, size_t s) {
  131|  5.78k|      bit_offset_ = 0;
  132|  5.78k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  5.78k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  5.78k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  4.78k|    inline uint64_t BitsDecoded() const {
  138|  4.78k|      return static_cast<uint64_t>(bit_offset_);
  139|  4.78k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  7.80M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  7.80M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 1, False: 7.80M]
  ------------------
  162|      1|        return false;
  163|      1|      }
  164|  7.80M|      uint32_t value = 0;
  165|  18.3M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 10.5M, False: 7.80M]
  ------------------
  166|  10.5M|        value |= GetBit() << bit;
  167|  10.5M|      }
  168|  7.80M|      *x = value;
  169|  7.80M|      return true;
  170|  7.80M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  10.5M|    inline int GetBit() {
  176|  10.5M|      const size_t off = bit_offset_;
  177|  10.5M|      const size_t byte_offset = off >> 3;
  178|  10.5M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  10.5M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 9.59M, False: 1.00M]
  ------------------
  180|  9.59M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  9.59M|        bit_offset_ = off + 1;
  182|  9.59M|        return bit;
  183|  9.59M|      }
  184|  1.00M|      return 0;
  185|  10.5M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  3.38M|  bool Decode(T *out_val) {
   69|  3.38M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 3.88k, False: 3.38M]
  ------------------
   70|  3.88k|      return false;
   71|  3.88k|    }
   72|  3.38M|    pos_ += sizeof(T);
   73|  3.38M|    return true;
   74|  3.38M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  3.38M|  bool Peek(T *out_val) {
   88|  3.38M|    const size_t size_to_decode = sizeof(T);
   89|  3.38M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 3.88k, False: 3.38M]
  ------------------
   90|  3.88k|      return false;  // Buffer overflow.
   91|  3.88k|    }
   92|  3.38M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  3.38M|    return true;
   94|  3.38M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  10.3k|  bool Decode(T *out_val) {
   69|  10.3k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 130, False: 10.1k]
  ------------------
   70|    130|      return false;
   71|    130|    }
   72|  10.1k|    pos_ += sizeof(T);
   73|  10.1k|    return true;
   74|  10.3k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  10.3k|  bool Peek(T *out_val) {
   88|  10.3k|    const size_t size_to_decode = sizeof(T);
   89|  10.3k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 130, False: 10.1k]
  ------------------
   90|    130|      return false;  // Buffer overflow.
   91|    130|    }
   92|  10.1k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  10.1k|    return true;
   94|  10.3k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|  95.3k|  bool Decode(T *out_val) {
   69|  95.3k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 382, False: 94.9k]
  ------------------
   70|    382|      return false;
   71|    382|    }
   72|  94.9k|    pos_ += sizeof(T);
   73|  94.9k|    return true;
   74|  95.3k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|  95.3k|  bool Peek(T *out_val) {
   88|  95.3k|    const size_t size_to_decode = sizeof(T);
   89|  95.3k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 382, False: 94.9k]
  ------------------
   90|    382|      return false;  // Buffer overflow.
   91|    382|    }
   92|  94.9k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  94.9k|    return true;
   94|  95.3k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  15.8k|  bool Decode(T *out_val) {
   69|  15.8k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 211, False: 15.6k]
  ------------------
   70|    211|      return false;
   71|    211|    }
   72|  15.6k|    pos_ += sizeof(T);
   73|  15.6k|    return true;
   74|  15.8k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  15.8k|  bool Peek(T *out_val) {
   88|  15.8k|    const size_t size_to_decode = sizeof(T);
   89|  15.8k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 211, False: 15.6k]
  ------------------
   90|    211|      return false;  // Buffer overflow.
   91|    211|    }
   92|  15.6k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  15.6k|    return true;
   94|  15.8k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   673k|  bool Decode(T *out_val) {
   69|   673k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 68, False: 673k]
  ------------------
   70|     68|      return false;
   71|     68|    }
   72|   673k|    pos_ += sizeof(T);
   73|   673k|    return true;
   74|   673k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   673k|  bool Peek(T *out_val) {
   88|   673k|    const size_t size_to_decode = sizeof(T);
   89|   673k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 68, False: 673k]
  ------------------
   90|     68|      return false;  // Buffer overflow.
   91|     68|    }
   92|   673k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   673k|    return true;
   94|   673k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  38.3k|  bool Decode(T *out_val) {
   69|  38.3k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 24, False: 38.3k]
  ------------------
   70|     24|      return false;
   71|     24|    }
   72|  38.3k|    pos_ += sizeof(T);
   73|  38.3k|    return true;
   74|  38.3k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  38.3k|  bool Peek(T *out_val) {
   88|  38.3k|    const size_t size_to_decode = sizeof(T);
   89|  38.3k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 24, False: 38.3k]
  ------------------
   90|     24|      return false;  // Buffer overflow.
   91|     24|    }
   92|  38.3k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  38.3k|    return true;
   94|  38.3k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.40k|  bool Decode(T *out_val) {
   69|  1.40k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 43, False: 1.36k]
  ------------------
   70|     43|      return false;
   71|     43|    }
   72|  1.36k|    pos_ += sizeof(T);
   73|  1.36k|    return true;
   74|  1.40k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.40k|  bool Peek(T *out_val) {
   88|  1.40k|    const size_t size_to_decode = sizeof(T);
   89|  1.40k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 43, False: 1.36k]
  ------------------
   90|     43|      return false;  // Buffer overflow.
   91|     43|    }
   92|  1.36k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.36k|    return true;
   94|  1.40k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    621|  bool Decode(T *out_val) {
   69|    621|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 11, False: 610]
  ------------------
   70|     11|      return false;
   71|     11|    }
   72|    610|    pos_ += sizeof(T);
   73|    610|    return true;
   74|    621|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    621|  bool Peek(T *out_val) {
   88|    621|    const size_t size_to_decode = sizeof(T);
   89|    621|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 11, False: 610]
  ------------------
   90|     11|      return false;  // Buffer overflow.
   91|     11|    }
   92|    610|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    610|    return true;
   94|    621|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   243M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   425M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  6.75M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  6.75M|    return value_ >= val;
  100|  6.75M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   160M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  2.06G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  15.2M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  54.4M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  54.4M|    value_ = i.value_;
  153|  54.4M|    return *this;
  154|  54.4M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|  2.23G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  2.23G|    value_ = i.value_;
  153|  2.23G|    return *this;
  154|  2.23G|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  15.2M|  inline ThisIndexType &operator++() {
  103|  15.2M|    ++value_;
  104|  15.2M|    return *this;
  105|  15.2M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  1.52G|  constexpr bool operator==(const IndexType &i) const {
   76|  1.52G|    return value_ == i.value_;
   77|  1.52G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   612M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  6.30k|  constexpr bool operator<(const IndexType &i) const {
   88|  6.30k|    return value_ < i.value_;
   89|  6.30k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|  80.1M|  constexpr bool operator==(const IndexType &i) const {
   76|  80.1M|    return value_ == i.value_;
   77|  80.1M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   110M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   110M|    return ThisIndexType(value_ - val);
  133|   110M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   466M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   466M|    return ThisIndexType(value_ + val);
  127|   466M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  12.4M|  constexpr bool operator==(const IndexType &i) const {
   76|  12.4M|    return value_ == i.value_;
   77|  12.4M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   157M|  constexpr bool operator!=(const IndexType &i) const {
   82|   157M|    return value_ != i.value_;
   83|   157M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   218M|  constexpr bool operator!=(const IndexType &i) const {
   82|   218M|    return value_ != i.value_;
   83|   218M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   330M|  inline ThisIndexType &operator++() {
  103|   330M|    ++value_;
  104|   330M|    return *this;
  105|   330M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   271M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   271M|    value_ = i.value_;
  153|   271M|    return *this;
  154|   271M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   676M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   676M|    value_ = i.value_;
  153|   676M|    return *this;
  154|   676M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  25.4M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  25.4M|    return value_ >= val;
  100|  25.4M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  5.79M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   700M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  14.4G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   121M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  11.2G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   159M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  7.84M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  7.84M|    return ThisIndexType(value_ + val);
  127|  7.84M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|  97.3M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  15.8M|  constexpr bool operator<(const IndexType &i) const {
   88|  15.8M|    return value_ < i.value_;
   89|  15.8M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   496M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|  2.23G|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  40.0M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   409M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   353M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  3.66M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  3.66M|    value_ = i.value_;
  153|  3.66M|    return *this;
  154|  3.66M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  5.79M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  5.79M|    value_ += val;
  141|  5.79M|    return *this;
  142|  5.79M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  20.2M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  20.2M|    value_ = val;
  157|  20.2M|    return *this;
  158|  20.2M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|  2.21G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  4.32M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  4.32M|  inline ThisIndexType &operator++() {
  103|  4.32M|    ++value_;
  104|  4.32M|    return *this;
  105|  4.32M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  13.5M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|    200|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   338M|  inline ThisIndexType &operator++() {
  103|   338M|    ++value_;
  104|   338M|    return *this;
  105|   338M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|     97|  inline ThisIndexType &operator++() {
  103|     97|    ++value_;
  104|     97|    return *this;
  105|     97|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   364M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   364M|    return value_ >= val;
  100|   364M|  }

_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.5M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  10.2k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  10.6k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  38.9M|  inline reference operator[](const IndexTypeT &index) {
   71|  38.9M|    return vector_[index.value()];
   72|  38.9M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  4.76k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  13.5M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  3.01k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   70|  6.75M|  inline reference operator[](const IndexTypeT &index) {
   71|  6.75M|    return vector_[index.value()];
   72|  6.75M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  13.9M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  13.9M|    return vector_[index.value()];
   75|  13.9M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   124M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  7.49M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   199M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   199M|    return vector_[index.value()];
   75|   199M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   556M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   556M|    return vector_[index.value()];
   75|   556M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   247M|  inline reference operator[](const IndexTypeT &index) {
   71|   247M|    return vector_[index.value()];
   72|   247M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  36.5M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  36.5M|    return vector_[index.value()];
   75|  36.5M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   212M|  inline reference operator[](const IndexTypeT &index) {
   71|   212M|    return vector_[index.value()];
   72|   212M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  62.6M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   140M|  inline reference operator[](const IndexTypeT &index) {
   71|   140M|    return vector_[index.value()];
   72|   140M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.09k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   143M|  inline reference operator[](const IndexTypeT &index) {
   71|   143M|    return vector_[index.value()];
   72|   143M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  50.4k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  1.68M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  47.4k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  5.87k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  5.87k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  5.87k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  5.87k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  11.6k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  11.6k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  11.6k|    vector_.swap(arg.vector_);
   57|  11.6k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  11.6k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  11.6k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  11.6k|    vector_.swap(arg.vector_);
   57|  11.6k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  5.86k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  5.86k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  5.86k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  10.2k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  27.8k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  51.7k|int32_t DataTypeLength(DataType dt) {
   20|  51.7k|  switch (dt) {
   21|  12.6k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 12.6k, False: 39.0k]
  ------------------
   22|  15.8k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.19k, False: 48.5k]
  ------------------
   23|  15.8k|      return 1;
   24|  2.69k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 2.69k, False: 49.0k]
  ------------------
   25|  9.54k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 6.84k, False: 44.8k]
  ------------------
   26|  9.54k|      return 2;
   27|  19.6k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 19.6k, False: 32.0k]
  ------------------
   28|  21.1k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.44k, False: 50.2k]
  ------------------
   29|  21.1k|      return 4;
   30|    508|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 508, False: 51.2k]
  ------------------
   31|    867|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 359, False: 51.3k]
  ------------------
   32|    867|      return 8;
   33|  3.91k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.91k, False: 47.8k]
  ------------------
   34|  3.91k|      return 4;
   35|     66|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 66, False: 51.6k]
  ------------------
   36|     66|      return 8;
   37|    339|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 339, False: 51.3k]
  ------------------
   38|    339|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 51.7k]
  ------------------
   40|      0|      return -1;
   41|  51.7k|  }
   42|  51.7k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  2.01k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|      7|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  10.1k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|      8|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|     38|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  12.2k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  12.2k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|     38|  const Status &status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  11.4k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  12.2k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    852|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  2.02k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|      7|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  2.01k|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  10.2k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|      8|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  10.1k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   349k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   349k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 349k, Folded]
  ------------------
   65|   349k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.56k, False: 348k]
  ------------------
   66|  1.56k|      return false;
   67|  1.56k|    }
   68|   349k|  } 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|   348k|  return true;
   77|   349k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   115k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   115k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   115k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 71, False: 114k]
  ------------------
   33|     71|    return false;
   34|     71|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   114k|  uint8_t in;
   39|   114k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 946, False: 114k]
  ------------------
   40|    946|    return false;
   41|    946|  }
   42|   114k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 17.7k, False: 96.2k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  17.7k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 532, False: 17.2k]
  ------------------
   45|    532|      return false;
   46|    532|    }
   47|       |    // Append decoded info from this byte.
   48|  17.2k|    *out_val <<= 7;
   49|  17.2k|    *out_val |= in & ((1 << 7) - 1);
   50|  96.2k|  } else {
   51|       |    // Last byte reached
   52|  96.2k|    *out_val = in;
   53|  96.2k|  }
   54|   113k|  return true;
   55|   114k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  7.71k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  7.71k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.71k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 7.71k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.71k|  uint8_t in;
   39|  7.71k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 28, False: 7.68k]
  ------------------
   40|     28|    return false;
   41|     28|  }
   42|  7.68k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 771, False: 6.91k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    771|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 30, False: 741]
  ------------------
   45|     30|      return false;
   46|     30|    }
   47|       |    // Append decoded info from this byte.
   48|    741|    *out_val <<= 7;
   49|    741|    *out_val |= in & ((1 << 7) - 1);
   50|  6.91k|  } else {
   51|       |    // Last byte reached
   52|  6.91k|    *out_val = in;
   53|  6.91k|  }
   54|  7.65k|  return true;
   55|  7.68k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  6.15k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  6.15k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 6.15k, Folded]
  ------------------
   65|  6.15k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 146, False: 6.00k]
  ------------------
   66|    146|      return false;
   67|    146|    }
   68|  6.15k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  6.00k|  return true;
   77|  6.15k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  3.29k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.29k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.29k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 3.28k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.28k|  uint8_t in;
   39|  3.28k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 32, False: 3.25k]
  ------------------
   40|     32|    return false;
   41|     32|  }
   42|  3.25k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 255, False: 3.00k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    255|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 37, False: 218]
  ------------------
   45|     37|      return false;
   46|     37|    }
   47|       |    // Append decoded info from this byte.
   48|    218|    *out_val <<= 7;
   49|    218|    *out_val |= in & ((1 << 7) - 1);
   50|  3.00k|  } else {
   51|       |    // Last byte reached
   52|  3.00k|    *out_val = in;
   53|  3.00k|  }
   54|  3.22k|  return true;
   55|  3.25k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   186k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   186k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   186k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 186k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   186k|  uint8_t in;
   39|   186k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 149, False: 186k]
  ------------------
   40|    149|    return false;
   41|    149|  }
   42|   186k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.00k, False: 185k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.00k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 44, False: 958]
  ------------------
   45|     44|      return false;
   46|     44|    }
   47|       |    // Append decoded info from this byte.
   48|    958|    *out_val <<= 7;
   49|    958|    *out_val |= in & ((1 << 7) - 1);
   50|   185k|  } else {
   51|       |    // Last byte reached
   52|   185k|    *out_val = in;
   53|   185k|  }
   54|   186k|  return true;
   55|   186k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  2.17k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.17k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 2.17k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  2.17k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  2.17k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  2.17k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 23, False: 2.15k]
  ------------------
   72|     23|      return false;
   73|     23|    }
   74|  2.15k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  2.15k|  }
   76|  2.15k|  return true;
   77|  2.17k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.46k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.46k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.46k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 2.46k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.46k|  uint8_t in;
   39|  2.46k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 22, False: 2.44k]
  ------------------
   40|     22|    return false;
   41|     22|  }
   42|  2.44k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 293, False: 2.15k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    293|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 23, False: 270]
  ------------------
   45|     23|      return false;
   46|     23|    }
   47|       |    // Append decoded info from this byte.
   48|    270|    *out_val <<= 7;
   49|    270|    *out_val |= in & ((1 << 7) - 1);
   50|  2.15k|  } else {
   51|       |    // Last byte reached
   52|  2.15k|    *out_val = in;
   53|  2.15k|  }
   54|  2.42k|  return true;
   55|  2.44k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.60k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.60k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.60k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 2.60k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.60k|  uint8_t in;
   39|  2.60k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 28, False: 2.58k]
  ------------------
   40|     28|    return false;
   41|     28|  }
   42|  2.58k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 374, False: 2.20k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    374|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 10, False: 364]
  ------------------
   45|     10|      return false;
   46|     10|    }
   47|       |    // Append decoded info from this byte.
   48|    364|    *out_val <<= 7;
   49|    364|    *out_val |= in & ((1 << 7) - 1);
   50|  2.20k|  } else {
   51|       |    // Last byte reached
   52|  2.20k|    *out_val = in;
   53|  2.20k|  }
   54|  2.57k|  return true;
   55|  2.58k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  21.7k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  21.7k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  21.7k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 21.7k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  21.7k|  uint8_t in;
   39|  21.7k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 41, False: 21.6k]
  ------------------
   40|     41|    return false;
   41|     41|  }
   42|  21.6k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 482, False: 21.1k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    482|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 40, False: 442]
  ------------------
   45|     40|      return false;
   46|     40|    }
   47|       |    // Append decoded info from this byte.
   48|    442|    *out_val <<= 7;
   49|    442|    *out_val |= in & ((1 << 7) - 1);
   50|  21.1k|  } else {
   51|       |    // Last byte reached
   52|  21.1k|    *out_val = in;
   53|  21.1k|  }
   54|  21.6k|  return true;
   55|  21.6k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  8.28k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.28k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.28k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 107, False: 8.17k]
  ------------------
   33|    107|    return false;
   34|    107|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.17k|  uint8_t in;
   39|  8.17k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 107, False: 8.07k]
  ------------------
   40|    107|    return false;
   41|    107|  }
   42|  8.07k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.95k, False: 6.11k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.95k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 579, False: 1.37k]
  ------------------
   45|    579|      return false;
   46|    579|    }
   47|       |    // Append decoded info from this byte.
   48|  1.37k|    *out_val <<= 7;
   49|  1.37k|    *out_val |= in & ((1 << 7) - 1);
   50|  6.11k|  } else {
   51|       |    // Last byte reached
   52|  6.11k|    *out_val = in;
   53|  6.11k|  }
   54|  7.49k|  return true;
   55|  8.07k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  7.16k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  7.16k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.16k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 58, False: 7.10k]
  ------------------
   33|     58|    return false;
   34|     58|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.10k|  uint8_t in;
   39|  7.10k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 55, False: 7.05k]
  ------------------
   40|     55|    return false;
   41|     55|  }
   42|  7.05k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 4.04k, False: 3.00k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  4.04k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 724, False: 3.32k]
  ------------------
   45|    724|      return false;
   46|    724|    }
   47|       |    // Append decoded info from this byte.
   48|  3.32k|    *out_val <<= 7;
   49|  3.32k|    *out_val |= in & ((1 << 7) - 1);
   50|  3.32k|  } else {
   51|       |    // Last byte reached
   52|  3.00k|    *out_val = in;
   53|  3.00k|  }
   54|  6.32k|  return true;
   55|  7.05k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  32.8k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  32.8k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  32.8k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 32.8k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  32.8k|  uint8_t in;
   39|  32.8k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 70, False: 32.7k]
  ------------------
   40|     70|    return false;
   41|     70|  }
   42|  32.7k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.74k, False: 30.0k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.74k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 30, False: 2.71k]
  ------------------
   45|     30|      return false;
   46|     30|    }
   47|       |    // Append decoded info from this byte.
   48|  2.71k|    *out_val <<= 7;
   49|  2.71k|    *out_val |= in & ((1 << 7) - 1);
   50|  30.0k|  } else {
   51|       |    // Last byte reached
   52|  30.0k|    *out_val = in;
   53|  30.0k|  }
   54|  32.7k|  return true;
   55|  32.7k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|  50.9k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|  63.1k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  5.26k|  Self operator-(const Self &o) const {
  138|  5.26k|    Self ret;
  139|  21.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 15.7k, False: 5.26k]
  ------------------
  140|  15.7k|      ret[i] = (*this)[i] - o[i];
  141|  15.7k|    }
  142|  5.26k|    return ret;
  143|  5.26k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  13.0k|  VectorD() {
   41|  52.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 39.0k, False: 13.0k]
  ------------------
   42|  39.0k|      (*this)[i] = Scalar(0);
   43|  39.0k|    }
   44|  13.0k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  1.24G|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|     10|      : v_({{c0, c1, c2}}) {
   60|     10|    DRACO_DCHECK_EQ(dimension, 3);
   61|     10|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|  89.5M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  7.42M|  Self operator-(const Self &o) const {
  138|  7.42M|    Self ret;
  139|  29.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 22.2M, False: 7.42M]
  ------------------
  140|  22.2M|      ret[i] = (*this)[i] - o[i];
  141|  22.2M|    }
  142|  7.42M|    return ret;
  143|  7.42M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  3.70M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  3.70M|  static_assert(std::is_signed<ScalarT>::value,
  321|  3.70M|                "ScalarT must be a signed type. ");
  322|  3.70M|  VectorD<ScalarT, 3> r;
  323|  3.70M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  3.70M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  3.70M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  3.70M|  return r;
  327|  3.70M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  3.70M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  3.70M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  1.18M|  Scalar AbsSum() const {
  238|  1.18M|    Scalar result(0);
  239|  4.71M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 3.53M, False: 1.17M]
  ------------------
  240|  3.53M|      Scalar next_value = std::abs(v_[i]);
  241|  3.53M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 7.62k, False: 3.53M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  7.62k|        return std::numeric_limits<Scalar>::max();
  244|  7.62k|      }
  245|  3.53M|      result += next_value;
  246|  3.53M|    }
  247|  1.17M|    return result;
  248|  1.18M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   139k|  Self operator/(const Scalar &o) const {
  183|   139k|    Self ret;
  184|   556k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 417k, False: 139k]
  ------------------
  185|   417k|      ret[i] = (*this)[i] / o;
  186|   417k|    }
  187|   139k|    return ret;
  188|   139k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   109M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  6.51M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  3.54M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.08M|  Self operator-() const {
  121|  1.08M|    Self ret;
  122|  4.34M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 3.25M, False: 1.08M]
  ------------------
  123|  3.25M|      ret[i] = -(*this)[i];
  124|  3.25M|    }
  125|  1.08M|    return ret;
  126|  1.08M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  3.25M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  34.1M|  Self operator-(const Self &o) const {
  138|  34.1M|    Self ret;
  139|   102M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 68.3M, False: 34.1M]
  ------------------
  140|  68.3M|      ret[i] = (*this)[i] - o[i];
  141|  68.3M|    }
  142|  34.1M|    return ret;
  143|  34.1M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|   410M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|   615M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|   537M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  68.3M|  Self operator+(const Self &o) const {
  130|  68.3M|    Self ret;
  131|   205M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 136M, False: 68.3M]
  ------------------
  132|   136M|      ret[i] = (*this)[i] + o[i];
  133|   136M|    }
  134|  68.3M|    return ret;
  135|  68.3M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|   674M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  5.96M|  Self operator-(const Self &o) const {
  138|  5.96M|    Self ret;
  139|  17.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 11.9M, False: 5.96M]
  ------------------
  140|  11.9M|      ret[i] = (*this)[i] - o[i];
  141|  11.9M|    }
  142|  5.96M|    return ret;
  143|  5.96M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  5.96M|  Self operator+(const Self &o) const {
  130|  5.96M|    Self ret;
  131|  17.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 11.9M, False: 5.96M]
  ------------------
  132|  11.9M|      ret[i] = (*this)[i] + o[i];
  133|  11.9M|    }
  134|  5.96M|    return ret;
  135|  5.96M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   197k|  bool operator==(const Self &o) const {
  207|   587k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 392k, False: 195k]
  ------------------
  208|   392k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 2.48k, False: 390k]
  ------------------
  209|  2.48k|        return false;
  210|  2.48k|      }
  211|   392k|    }
  212|   195k|    return true;
  213|   197k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  2.37M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  2.78k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  3.08k|  Scalar Dot(const Self &o) const {
  251|  3.08k|    Scalar ret(0);
  252|  12.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 9.24k, False: 3.08k]
  ------------------
  253|  9.24k|      ret += (*this)[i] * o[i];
  254|  9.24k|    }
  255|  3.08k|    return ret;
  256|  3.08k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    301|  Self operator*(const Scalar &o) const {
  175|    301|    Self ret;
  176|  1.20k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 903, False: 301]
  ------------------
  177|    903|      ret[i] = (*this)[i] * o;
  178|    903|    }
  179|    301|    return ret;
  180|    301|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  2.48k|  Self operator-(const Self &o) const {
  138|  2.48k|    Self ret;
  139|  7.44k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.96k, False: 2.48k]
  ------------------
  140|  4.96k|      ret[i] = (*this)[i] - o[i];
  141|  4.96k|    }
  142|  2.48k|    return ret;
  143|  2.48k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  4.96k|  VectorD() {
   41|  14.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 9.92k, False: 4.96k]
  ------------------
   42|  9.92k|      (*this)[i] = Scalar(0);
   43|  9.92k|    }
   44|  4.96k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   397k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   397k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   397k|    v_[0] = c0;
   55|   397k|    v_[1] = c1;
   56|   397k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  19.7k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   238k|  bool operator==(const Self &o) const {
  207|   690k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 465k, False: 225k]
  ------------------
  208|   465k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 12.9k, False: 452k]
  ------------------
  209|  12.9k|        return false;
  210|  12.9k|      }
  211|   465k|    }
  212|   225k|    return true;
  213|   238k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.43M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  21.0M|  VectorD() {
   41|  84.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 63.2M, False: 21.0M]
  ------------------
   42|  63.2M|      (*this)[i] = Scalar(0);
   43|  63.2M|    }
   44|  21.0M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  15.0k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  17.1k|  Scalar Dot(const Self &o) const {
  251|  17.1k|    Scalar ret(0);
  252|  68.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 51.5k, False: 17.1k]
  ------------------
  253|  51.5k|      ret += (*this)[i] * o[i];
  254|  51.5k|    }
  255|  17.1k|    return ret;
  256|  17.1k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  2.15k|  Self operator-(const Self &o) const {
  138|  2.15k|    Self ret;
  139|  6.45k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.30k, False: 2.15k]
  ------------------
  140|  4.30k|      ret[i] = (*this)[i] - o[i];
  141|  4.30k|    }
  142|  2.15k|    return ret;
  143|  2.15k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  6.29k|  Self operator*(const Scalar &o) const {
  175|  6.29k|    Self ret;
  176|  18.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 12.5k, False: 6.29k]
  ------------------
  177|  12.5k|      ret[i] = (*this)[i] * o;
  178|  12.5k|    }
  179|  6.29k|    return ret;
  180|  6.29k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  2.10k|  Self operator+(const Self &o) const {
  130|  2.10k|    Self ret;
  131|  6.30k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 4.20k, False: 2.10k]
  ------------------
  132|  4.20k|      ret[i] = (*this)[i] + o[i];
  133|  4.20k|    }
  134|  2.10k|    return ret;
  135|  2.10k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.10k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.10k|  return v * o;
  294|  2.10k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  2.08k|  Self operator+(const Self &o) const {
  130|  2.08k|    Self ret;
  131|  8.34k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 6.25k, False: 2.08k]
  ------------------
  132|  6.25k|      ret[i] = (*this)[i] + o[i];
  133|  6.25k|    }
  134|  2.08k|    return ret;
  135|  2.08k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.08k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.08k|  return v * o;
  294|  2.08k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  2.08k|  Self operator*(const Scalar &o) const {
  175|  2.08k|    Self ret;
  176|  8.34k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 6.25k, False: 2.08k]
  ------------------
  177|  6.25k|      ret[i] = (*this)[i] * o;
  178|  6.25k|    }
  179|  2.08k|    return ret;
  180|  2.08k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   479k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   479k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   479k|    v_[0] = c0;
   55|   479k|    v_[1] = c1;
   56|   479k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  14.6k|  VectorD() {
   41|  44.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 29.3k, False: 14.6k]
  ------------------
   42|  29.3k|      (*this)[i] = Scalar(0);
   43|  29.3k|    }
   44|  14.6k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  4.12k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  12.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 8.24k, False: 4.12k]
  ------------------
  104|  8.24k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 8.24k, False: 0]
  ------------------
  105|  8.24k|        v_[i] = Scalar(src_vector[i]);
  106|  8.24k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  8.24k|    }
  110|  4.12k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|  1.17k|  Self operator+(const Self &o) const {
  130|  1.17k|    Self ret;
  131|  3.52k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.35k, False: 1.17k]
  ------------------
  132|  2.35k|      ret[i] = (*this)[i] + o[i];
  133|  2.35k|    }
  134|  1.17k|    return ret;
  135|  1.17k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  2.06k|  VectorD() {
   41|  6.18k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.12k, False: 2.06k]
  ------------------
   42|  4.12k|      (*this)[i] = Scalar(0);
   43|  4.12k|    }
   44|  2.06k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  12.3k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  8.24k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  2.06k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  6.18k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 4.12k, False: 2.06k]
  ------------------
  104|  4.12k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 4.12k, False: 0]
  ------------------
  105|  4.12k|        v_[i] = Scalar(src_vector[i]);
  106|  4.12k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  4.12k|    }
  110|  2.06k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  2.06k|  Self operator/(const Scalar &o) const {
  183|  2.06k|    Self ret;
  184|  6.18k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 4.12k, False: 2.06k]
  ------------------
  185|  4.12k|      ret[i] = (*this)[i] / o;
  186|  4.12k|    }
  187|  2.06k|    return ret;
  188|  2.06k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|    886|  Self operator-(const Self &o) const {
  138|    886|    Self ret;
  139|  2.65k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.77k, False: 886]
  ------------------
  140|  1.77k|      ret[i] = (*this)[i] - o[i];
  141|  1.77k|    }
  142|    886|    return ret;
  143|    886|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  58.7k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.08M|  VectorD() {
   41|  4.34M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.26M, False: 1.08M]
  ------------------
   42|  3.26M|      (*this)[i] = Scalar(0);
   43|  3.26M|    }
   44|  1.08M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|   135M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   135M|    DRACO_DCHECK_EQ(dimension, 2);
   54|   135M|    v_[0] = c0;
   55|   135M|    v_[1] = c1;
   56|   135M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|   205M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|   615M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 410M, False: 205M]
  ------------------
  104|   410M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 410M, False: 0]
  ------------------
  105|   410M|        v_[i] = Scalar(src_vector[i]);
  106|   410M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   410M|    }
  110|   205M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|   102M|  VectorD() {
   41|   307M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 205M, False: 102M]
  ------------------
   42|   205M|      (*this)[i] = Scalar(0);
   43|   205M|    }
   44|   102M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|   102M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|   307M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 205M, False: 102M]
  ------------------
  104|   205M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 205M, False: 0]
  ------------------
  105|   205M|        v_[i] = Scalar(src_vector[i]);
  106|   205M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   205M|    }
  110|   102M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  61.4M|  VectorD(const Self &o) {
   89|   184M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 122M, False: 61.4M]
  ------------------
   90|   122M|      (*this)[i] = o[i];
   91|   122M|    }
   92|  61.4M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  11.9M|  VectorD() {
   41|  35.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 23.8M, False: 11.9M]
  ------------------
   42|  23.8M|      (*this)[i] = Scalar(0);
   43|  23.8M|    }
   44|  11.9M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   414M|  VectorD(const Self &o) {
   89|  1.65G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 1.24G, False: 414M]
  ------------------
   90|  1.24G|      (*this)[i] = o[i];
   91|  1.24G|    }
   92|   414M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  1.24G|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   182M|      : v_({{c0, c1, c2}}) {
   60|   182M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   182M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  62.2M|  inline int num_vertices() const {
   74|  62.2M|    return static_cast<int>(vertex_corners_.size());
   75|  62.2M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  5.81M|  inline int num_corners() const {
   77|  5.81M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  5.81M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  1.68M|  inline int num_faces() const {
   80|  1.68M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  1.68M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   199M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   199M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 199M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   199M|    return opposite_corners_[corner];
   88|   199M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   337M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   337M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 6.47M, False: 330M]
  ------------------
   91|  6.47M|      return corner;
   92|  6.47M|    }
   93|   330M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 300M, False: 30.0M]
  ------------------
   94|   337M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   291M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   291M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 2.49M, False: 289M]
  ------------------
   97|  2.49M|      return corner;
   98|  2.49M|    }
   99|   289M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 80.8M, False: 208M]
  ------------------
  100|   291M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   556M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   556M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 556M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   556M|    return ConfidentVertex(corner);
  106|   556M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   556M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   556M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   556M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   556M|    return corner_to_vertex_map_[corner];
  111|   556M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  21.2M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  21.2M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 21.2M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  21.2M|    return FaceIndex(corner.value() / 3);
  117|  21.2M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   620M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  36.5M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  36.5M|    return vertex_corners_[v];
  152|  36.5M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|   674k|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|   674k|    const CornerIndex corner = LeftMostCorner(vert);
  187|   674k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 22.0k, False: 652k]
  ------------------
  188|  22.0k|      return true;
  189|  22.0k|    }
  190|   652k|    return false;
  191|   674k|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  46.7M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  46.7M|    return Previous(Opposite(Previous(corner)));
  202|  46.7M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  6.38M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  6.38M|    return Next(Opposite(Next(corner)));
  207|  6.38M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  2.36M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  2.36M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 2.36M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  2.36M|    return Opposite(Previous(corner_id));
  222|  2.36M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  3.01M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  3.01M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 3.01M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  3.01M|    return Opposite(Next(corner_id));
  228|  3.01M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   212M|                                CornerIndex opp_corner_id) {
  249|   212M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   212M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   212M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   247M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   247M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   247M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   247M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  62.6M|  VertexIndex AddNewVertex() {
  271|  62.6M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  62.6M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  62.6M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  62.6M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   139M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   139M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   139M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 139M, False: 0]
  ------------------
  295|   139M|      vertex_corners_[vert] = corner;
  296|   139M|    }
  297|   139M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|   665k|  void MakeVertexIsolated(VertexIndex vert) {
  329|   665k|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|   665k|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|   665k|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  5.93k|      : corner_table_(table),
  229|  5.93k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  5.93k|        corner_(start_corner_),
  231|  5.93k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  3.20M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  19.1k|  VertexCornersIterator &operator++() {
  268|  19.1k|    Next();
  269|  19.1k|    return *this;
  270|  19.1k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  2.73M|  void Next() {
  248|  2.73M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.71M, False: 25.1k]
  ------------------
  249|  2.71M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.71M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 20.7k, False: 2.69M]
  ------------------
  251|       |        // Open boundary reached.
  252|  20.7k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  20.7k|        left_traversal_ = false;
  254|  2.69M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 448k, False: 2.24M]
  ------------------
  255|       |        // End reached.
  256|   448k|        corner_ = kInvalidCornerIndex;
  257|   448k|      }
  258|  2.71M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  25.1k|      corner_ = corner_table_->SwingRight(corner_);
  262|  25.1k|    }
  263|  2.73M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  4.82M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  1.70M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  1.74M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|   986k|  void Next() {
  248|   986k|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 976k, False: 9.96k]
  ------------------
  249|   976k|      corner_ = corner_table_->SwingLeft(corner_);
  250|   976k|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 665k, False: 310k]
  ------------------
  251|       |        // Open boundary reached.
  252|   665k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|   665k|        left_traversal_ = false;
  254|   665k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 51.0k, False: 259k]
  ------------------
  255|       |        // End reached.
  256|  51.0k|        corner_ = kInvalidCornerIndex;
  257|  51.0k|      }
  258|   976k|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  9.96k|      corner_ = corner_table_->SwingRight(corner_);
  262|  9.96k|    }
  263|   986k|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   716k|      : corner_table_(table),
  236|   716k|        start_corner_(corner_id),
  237|   716k|        corner_(start_corner_),
  238|   716k|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   463k|      : corner_table_(table),
  236|   463k|        start_corner_(corner_id),
  237|   463k|        corner_(start_corner_),
  238|   463k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  33.5M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  33.5M|    return is_edge_on_seam_[corner.value()];
   47|  33.5M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  14.1M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  14.1M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 14.1M]
  |  Branch (50:42): [True: 11.1M, False: 3.05M]
  ------------------
   51|  11.1M|      return kInvalidCornerIndex;
   52|  11.1M|    }
   53|  3.05M|    return corner_table_->Opposite(corner);
   54|  14.1M|  }
_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|  10.2M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  10.2M|    return corner_table_->Previous(corner);
   62|  10.2M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  2.88M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  2.88M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  2.88M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.57M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  1.57M|    return Opposite(Previous(corner));
   73|  1.57M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  1.90M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  1.90M|    return Opposite(Next(corner));
   76|  1.90M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  2.00M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  2.00M|    return Previous(Opposite(Previous(corner)));
   81|  2.00M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  6.64M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  6.64M|    return Next(Opposite(Next(corner)));
   86|  6.64M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  8.34k|  int num_vertices() const {
   89|  8.34k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  8.34k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  2.57k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.12k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  54.4M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  54.4M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  54.4M|    return ConfidentVertex(corner);
   97|  54.4M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  54.4M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  54.4M|    return corner_to_vertex_map_[corner.value()];
  100|  54.4M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  1.55M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  1.55M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  1.55M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  1.55M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  1.55M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  1.55M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 1.55M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  1.55M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 1.22M, False: 328k]
  ------------------
  128|  1.22M|      return true;
  129|  1.22M|    }
  130|   328k|    return false;
  131|  1.55M|  }

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

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

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

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

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

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

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

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

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

