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

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

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

_ZN5draco30AttributeQuantizationTransformC2Ev:
   29|    633|  AttributeQuantizationTransform() : quantization_bits_(-1), range_(0.f) {}
_ZNK5draco30AttributeQuantizationTransform17quantization_bitsEv:
   59|     45|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco30AttributeQuantizationTransform5rangeEv:
   62|     45|  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.85k|  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|  5.23k|  void AppendParameterValue(const DataTypeT &in_data) {
   61|  5.23k|    SetParameterValue(static_cast<int>(buffer_.data_size()), in_data);
   62|  5.23k|  }
_ZN5draco22AttributeTransformData17SetParameterValueIfEEviRKT_:
   51|  5.23k|  void SetParameterValue(int byte_offset, const DataTypeT &in_data) {
   52|  5.23k|    if (byte_offset + sizeof(DataTypeT) > buffer_.data_size()) {
  ------------------
  |  Branch (52:9): [True: 5.23k, False: 0]
  ------------------
   53|  5.23k|      buffer_.Resize(byte_offset + sizeof(DataTypeT));
   54|  5.23k|    }
   55|  5.23k|    buffer_.Write(byte_offset, &in_data, sizeof(DataTypeT));
   56|  5.23k|  }

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

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

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

_ZNK5draco14PointAttribute4sizeEv:
   55|   525M|  size_t size() const { return num_unique_entries_; }
_ZNK5draco14PointAttribute12mapped_indexENS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   56|   556M|  AttributeValueIndex mapped_index(PointIndex point_index) const {
   57|   556M|    if (identity_mapping_) {
  ------------------
  |  Branch (57:9): [True: 525M, False: 31.3M]
  ------------------
   58|   525M|      return AttributeValueIndex(point_index.value());
   59|   525M|    }
   60|  31.3M|    return indices_map_[point_index];
   61|   556M|  }
_ZNK5draco14PointAttribute6bufferEv:
   62|   211M|  DataBuffer *buffer() const { return attribute_buffer_.get(); }
_ZNK5draco14PointAttribute19is_mapping_identityEv:
   63|  20.0M|  bool is_mapping_identity() const { return identity_mapping_; }
_ZNK5draco14PointAttribute16indices_map_sizeEv:
   64|  20.0M|  size_t indices_map_size() const {
   65|  20.0M|    if (is_mapping_identity()) {
  ------------------
  |  Branch (65:9): [True: 0, False: 20.0M]
  ------------------
   66|      0|      return 0;
   67|      0|    }
   68|  20.0M|    return indices_map_.size();
   69|  20.0M|  }
_ZN5draco14PointAttribute18SetIdentityMappingEv:
   88|  10.5k|  void SetIdentityMapping() {
   89|  10.5k|    identity_mapping_ = true;
   90|  10.5k|    indices_map_.clear();
   91|  10.5k|  }
_ZN5draco14PointAttribute18SetExplicitMappingEm:
   94|  13.6k|  void SetExplicitMapping(size_t num_points) {
   95|  13.6k|    identity_mapping_ = false;
   96|  13.6k|    indices_map_.resize(num_points, kInvalidAttributeValueIndex);
   97|  13.6k|  }
_ZN5draco14PointAttribute16SetPointMapEntryENS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEE:
  101|  57.3M|                        AttributeValueIndex entry_index) {
  102|  57.3M|    DRACO_DCHECK(!identity_mapping_);
  103|  57.3M|    indices_map_[point_index] = entry_index;
  104|  57.3M|  }
_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|  19.0k|    : point_cloud_decoder_(nullptr), point_cloud_(nullptr) {}
_ZN5draco17AttributesDecoder4InitEPNS_17PointCloudDecoderEPNS_10PointCloudE:
   24|  18.9k|bool AttributesDecoder::Init(PointCloudDecoder *decoder, PointCloud *pc) {
   25|  18.9k|  point_cloud_decoder_ = decoder;
   26|  18.9k|  point_cloud_ = pc;
   27|  18.9k|  return true;
   28|  18.9k|}
_ZN5draco17AttributesDecoder27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   30|  7.92k|bool AttributesDecoder::DecodeAttributesDecoderData(DecoderBuffer *in_buffer) {
   31|       |  // Decode and create attributes.
   32|  7.92k|  uint32_t num_attributes;
   33|  7.92k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   34|  7.92k|  if (point_cloud_decoder_->bitstream_version() <
  ------------------
  |  Branch (34:7): [True: 24, False: 7.89k]
  ------------------
   35|  7.92k|      DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  7.92k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
   36|     24|    if (!in_buffer->Decode(&num_attributes)) {
  ------------------
  |  Branch (36:9): [True: 1, False: 23]
  ------------------
   37|      1|      return false;
   38|      1|    }
   39|     24|  } else
   40|  7.89k|#endif
   41|  7.89k|  {
   42|  7.89k|    if (!DecodeVarint(&num_attributes, in_buffer)) {
  ------------------
  |  Branch (42:9): [True: 6, False: 7.89k]
  ------------------
   43|      6|      return false;
   44|      6|    }
   45|  7.89k|  }
   46|       |
   47|       |  // Check that decoded number of attributes is valid.
   48|  7.91k|  if (num_attributes == 0) {
  ------------------
  |  Branch (48:7): [True: 7, False: 7.90k]
  ------------------
   49|      7|    return false;
   50|      7|  }
   51|  7.90k|  if (num_attributes > 5 * in_buffer->remaining_size()) {
  ------------------
  |  Branch (51:7): [True: 28, False: 7.87k]
  ------------------
   52|       |    // The decoded number of attributes is unreasonably high, because at least
   53|       |    // five bytes of attribute descriptor data per attribute are expected.
   54|     28|    return false;
   55|     28|  }
   56|       |
   57|       |  // Decode attribute descriptor data.
   58|  7.87k|  point_attribute_ids_.resize(num_attributes);
   59|  7.87k|  PointCloud *pc = point_cloud_;
   60|  29.7k|  for (uint32_t i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:24): [True: 21.9k, False: 7.79k]
  ------------------
   61|       |    // Decode attribute descriptor data.
   62|  21.9k|    uint8_t att_type, data_type, num_components, normalized;
   63|  21.9k|    if (!in_buffer->Decode(&att_type)) {
  ------------------
  |  Branch (63:9): [True: 3, False: 21.9k]
  ------------------
   64|      3|      return false;
   65|      3|    }
   66|  21.9k|    if (!in_buffer->Decode(&data_type)) {
  ------------------
  |  Branch (66:9): [True: 13, False: 21.9k]
  ------------------
   67|     13|      return false;
   68|     13|    }
   69|  21.9k|    if (!in_buffer->Decode(&num_components)) {
  ------------------
  |  Branch (69:9): [True: 12, False: 21.9k]
  ------------------
   70|     12|      return false;
   71|     12|    }
   72|  21.9k|    if (!in_buffer->Decode(&normalized)) {
  ------------------
  |  Branch (72:9): [True: 9, False: 21.9k]
  ------------------
   73|      9|      return false;
   74|      9|    }
   75|  21.9k|    if (att_type >= GeometryAttribute::NAMED_ATTRIBUTES_COUNT) {
  ------------------
  |  Branch (75:9): [True: 26, False: 21.9k]
  ------------------
   76|     26|      return false;
   77|     26|    }
   78|  21.9k|    if (data_type == DT_INVALID || data_type >= DT_TYPES_COUNT) {
  ------------------
  |  Branch (78:9): [True: 3, False: 21.9k]
  |  Branch (78:36): [True: 7, False: 21.8k]
  ------------------
   79|     10|      return false;
   80|     10|    }
   81|       |
   82|       |    // Check decoded attribute descriptor data.
   83|  21.8k|    if (num_components == 0) {
  ------------------
  |  Branch (83:9): [True: 2, False: 21.8k]
  ------------------
   84|      2|      return false;
   85|      2|    }
   86|       |
   87|       |    // Add the attribute to the point cloud.
   88|  21.8k|    const DataType draco_dt = static_cast<DataType>(data_type);
   89|  21.8k|    GeometryAttribute ga;
   90|  21.8k|    ga.Init(static_cast<GeometryAttribute::Type>(att_type), nullptr,
   91|  21.8k|            num_components, draco_dt, normalized > 0,
   92|  21.8k|            DataTypeLength(draco_dt) * num_components, 0);
   93|  21.8k|    uint32_t unique_id;
   94|  21.8k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   95|  21.8k|    if (point_cloud_decoder_->bitstream_version() <
  ------------------
  |  Branch (95:9): [True: 90, False: 21.8k]
  ------------------
   96|  21.8k|        DRACO_BITSTREAM_VERSION(1, 3)) {
  ------------------
  |  |  115|  21.8k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
   97|     90|      uint16_t custom_id;
   98|     90|      if (!in_buffer->Decode(&custom_id)) {
  ------------------
  |  Branch (98:11): [True: 0, False: 90]
  ------------------
   99|      0|        return false;
  100|      0|      }
  101|       |      // TODO(draco-eng): Add "custom_id" to attribute metadata.
  102|     90|      unique_id = static_cast<uint32_t>(custom_id);
  103|     90|      ga.set_unique_id(unique_id);
  104|     90|    } else
  105|  21.8k|#endif
  106|  21.8k|    {
  107|  21.8k|      if (!DecodeVarint(&unique_id, in_buffer)) {
  ------------------
  |  Branch (107:11): [True: 10, False: 21.7k]
  ------------------
  108|     10|        return false;
  109|     10|      }
  110|  21.7k|      ga.set_unique_id(unique_id);
  111|  21.7k|    }
  112|  21.8k|    const int att_id = pc->AddAttribute(
  113|  21.8k|        std::unique_ptr<PointAttribute>(new PointAttribute(ga)));
  114|  21.8k|    pc->attribute(att_id)->set_unique_id(unique_id);
  115|  21.8k|    point_attribute_ids_[i] = att_id;
  116|       |
  117|       |    // Update the inverse map.
  118|  21.8k|    if (att_id >=
  ------------------
  |  Branch (118:9): [True: 21.8k, False: 0]
  ------------------
  119|  21.8k|        static_cast<int32_t>(point_attribute_to_local_id_map_.size())) {
  120|  21.8k|      point_attribute_to_local_id_map_.resize(att_id + 1, -1);
  121|  21.8k|    }
  122|  21.8k|    point_attribute_to_local_id_map_[att_id] = i;
  123|  21.8k|  }
  124|  7.79k|  return true;
  125|  7.87k|}

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

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

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

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

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

_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.96k|  bool SetQuantizationBits(int32_t q) {
   60|  1.96k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 557, False: 1.40k]
  |  Branch (60:18): [True: 97, False: 1.30k]
  ------------------
   61|    654|      return false;
   62|    654|    }
   63|  1.30k|    quantization_bits_ = q;
   64|  1.30k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.30k|    max_value_ = max_quantized_value_ - 1;
   66|  1.30k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.30k|    center_value_ = max_value_ / 2;
   68|  1.30k|    return true;
   69|  1.96k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  1.63M|                                           int32_t *out_t) const {
   77|  1.63M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 2.92k, False: 1.62M]
  |  Branch (77:20): [True: 0, False: 2.92k]
  |  Branch (77:32): [True: 2.92k, False: 1.62M]
  |  Branch (77:42): [True: 0, False: 2.92k]
  ------------------
   78|  1.63M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.32M, False: 309k]
  |  Branch (78:29): [True: 5.99k, False: 1.31M]
  ------------------
   79|  5.99k|      s = max_value_;
   80|  5.99k|      t = max_value_;
   81|  1.62M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 2.92k, False: 1.62M]
  |  Branch (81:26): [True: 773, False: 2.15k]
  ------------------
   82|    773|      t = center_value_ - (t - center_value_);
   83|  1.62M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.31M, False: 308k]
  |  Branch (83:35): [True: 6.00k, False: 1.31M]
  ------------------
   84|  6.00k|      t = center_value_ + (center_value_ - t);
   85|  1.61M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.31M, False: 306k]
  |  Branch (85:35): [True: 237, False: 1.31M]
  ------------------
   86|    237|      s = center_value_ + (center_value_ - s);
   87|  1.61M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 3.38k, False: 1.61M]
  |  Branch (87:26): [True: 1.32k, False: 2.06k]
  ------------------
   88|  1.32k|      s = center_value_ - (s - center_value_);
   89|  1.32k|    }
   90|       |
   91|  1.63M|    *out_s = s;
   92|  1.63M|    *out_t = t;
   93|  1.63M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  1.63M|                                                       int32_t *out_t) const {
  100|  1.63M|    DRACO_DCHECK_EQ(
  101|  1.63M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  1.63M|        center_value_);
  103|  1.63M|    int32_t s, t;
  104|  1.63M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 665k, False: 965k]
  ------------------
  105|       |      // Right hemisphere.
  106|   665k|      s = (int_vec[1] + center_value_);
  107|   665k|      t = (int_vec[2] + center_value_);
  108|   965k|    } else {
  109|       |      // Left hemisphere.
  110|   965k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 43.5k, False: 922k]
  ------------------
  111|  43.5k|        s = std::abs(int_vec[2]);
  112|   922k|      } else {
  113|   922k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   922k|      }
  115|   965k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 45.8k, False: 919k]
  ------------------
  116|  45.8k|        t = std::abs(int_vec[1]);
  117|   919k|      } else {
  118|   919k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   919k|      }
  120|   965k|    }
  121|  1.63M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  1.63M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  8.23M|                                                    float *out_vector) const {
  199|  8.23M|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  8.23M|                                 in_t * dequantization_scale_ - 1.f,
  201|  8.23M|                                 out_vector);
  202|  8.23M|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  36.0M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  36.0M|    DRACO_DCHECK_LE(s, center_value_);
  208|  36.0M|    DRACO_DCHECK_LE(t, center_value_);
  209|  36.0M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  36.0M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  36.0M|    const uint32_t st =
  212|  36.0M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  36.0M|    return st <= center_value_;
  214|  36.0M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  45.3M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  45.3M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  45.3M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  45.3M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  45.3M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  45.3M|    int32_t sign_s = 0;
  223|  45.3M|    int32_t sign_t = 0;
  224|  45.3M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 36.7M, False: 8.61M]
  |  Branch (224:20): [True: 35.9M, False: 805k]
  ------------------
  225|  35.9M|      sign_s = 1;
  226|  35.9M|      sign_t = 1;
  227|  35.9M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 9.00M, False: 415k]
  |  Branch (227:27): [True: 4.06M, False: 4.94M]
  ------------------
  228|  4.06M|      sign_s = -1;
  229|  4.06M|      sign_t = -1;
  230|  5.36M|    } else {
  231|  5.36M|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 415k, False: 4.94M]
  ------------------
  232|  5.36M|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 4.94M, False: 415k]
  ------------------
  233|  5.36M|    }
  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|  45.3M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  45.3M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  45.3M|    uint32_t us = *s;
  241|  45.3M|    uint32_t ut = *t;
  242|  45.3M|    us = us + us - corner_point_s;
  243|  45.3M|    ut = ut + ut - corner_point_t;
  244|  45.3M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 40.0M, False: 5.36M]
  ------------------
  245|  40.0M|      uint32_t temp = us;
  246|  40.0M|      us = -ut;
  247|  40.0M|      ut = -temp;
  248|  40.0M|    } else {
  249|  5.36M|      std::swap(us, ut);
  250|  5.36M|    }
  251|  45.3M|    us = us + corner_point_s;
  252|  45.3M|    ut = ut + corner_point_t;
  253|       |
  254|  45.3M|    *s = us;
  255|  45.3M|    *t = ut;
  256|  45.3M|    *s /= 2;
  257|  45.3M|    *t /= 2;
  258|  45.3M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  72.0M|  int32_t ModMax(int32_t x) const {
  273|  72.0M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 18.0k, False: 72.0M]
  ------------------
  274|  18.0k|      return x - this->max_quantized_value();
  275|  18.0k|    }
  276|  72.0M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 983, False: 72.0M]
  ------------------
  277|    983|      return x + this->max_quantized_value();
  278|    983|    }
  279|  72.0M|    return x;
  280|  72.0M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.28k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  19.0k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|   216M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  8.23M|                                           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|  8.23M|    float y = in_s_scaled;
  329|  8.23M|    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|  8.23M|    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|  8.23M|    float x_offset = -x;
  342|  8.23M|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 58.4k, False: 8.17M]
  ------------------
  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|  8.23M|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 493k, False: 7.74M]
  ------------------
  348|  8.23M|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 156k, False: 8.08M]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  8.23M|    const float norm_squared = x * x + y * y + z * z;
  352|  8.23M|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 8.23M]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  8.23M|    } else {
  357|  8.23M|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  8.23M|      out_vector[0] = x * d;
  359|  8.23M|      out_vector[1] = y * d;
  360|  8.23M|      out_vector[2] = z * d;
  361|  8.23M|    }
  362|  8.23M|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  1.63M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  1.63M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  1.63M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  1.63M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  1.63M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  1.63M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  1.63M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 1.40M, False: 223k]
  ------------------
  181|  1.40M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.40M|    } else {
  183|   223k|      vec[0] =
  184|   223k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   223k|          abs_sum;
  186|   223k|      vec[1] =
  187|   223k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   223k|          abs_sum;
  189|   223k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 119k, False: 104k]
  ------------------
  190|   119k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   119k|      } else {
  192|   104k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   104k|      }
  194|   223k|    }
  195|  1.63M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    344|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    344|            attribute, transform, mesh_data),
   52|    344|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    332|                                                                *buffer) {
  194|    332|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    332|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    332|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 5, False: 327]
  ------------------
  196|       |    // Decode prediction mode.
  197|      5|    uint8_t mode;
  198|      5|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 5]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      5|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 4, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      4|      return false;
  205|      4|    }
  206|      5|  }
  207|    328|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.49k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.23k, False: 259]
  ------------------
  211|  1.23k|    uint32_t num_flags;
  212|  1.23k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 11, False: 1.22k]
  ------------------
  213|     11|      return false;
  214|     11|    }
  215|  1.22k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 36, False: 1.18k]
  ------------------
  216|     36|      return false;
  217|     36|    }
  218|  1.18k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 582, False: 602]
  ------------------
  219|    582|      is_crease_edge_[i].resize(num_flags);
  220|    582|      RAnsBitDecoder decoder;
  221|    582|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 22, False: 560]
  ------------------
  222|     22|        return false;
  223|     22|      }
  224|  1.43M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.43M, False: 560]
  ------------------
  225|  1.43M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.43M|      }
  227|    560|      decoder.EndDecoding();
  228|    560|    }
  229|  1.18k|  }
  230|    259|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    259|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    328|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    235|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    235|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    235|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.17k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 940, False: 235]
  ------------------
   93|    940|    pred_vals[i].resize(num_components, 0);
   94|    940|  }
   95|    235|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    235|                                         out_data);
   97|       |
   98|    235|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    235|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    235|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    235|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    235|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    235|  const int corner_map_size =
  109|    235|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   698k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 698k, False: 157]
  ------------------
  111|   698k|    const CornerIndex start_corner_id =
  112|   698k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   698k|    CornerIndex corner_id(start_corner_id);
  115|   698k|    int num_parallelograms = 0;
  116|   698k|    bool first_pass = true;
  117|  1.61M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 964k, False: 652k]
  ------------------
  118|   964k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 99.2k, False: 865k]
  ------------------
  119|   964k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   964k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  99.2k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  99.2k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 1.08k, False: 98.1k]
  ------------------
  127|  1.08k|          break;
  128|  1.08k|        }
  129|  99.2k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|   963k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 950k, False: 12.9k]
  ------------------
  134|   950k|        corner_id = table->SwingLeft(corner_id);
  135|   950k|      } else {
  136|  12.9k|        corner_id = table->SwingRight(corner_id);
  137|  12.9k|      }
  138|   963k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 44.7k, False: 918k]
  ------------------
  139|  44.7k|        break;
  140|  44.7k|      }
  141|   918k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 658k, False: 260k]
  |  Branch (141:47): [True: 652k, False: 5.97k]
  ------------------
  142|   652k|        first_pass = false;
  143|   652k|        corner_id = table->SwingRight(start_corner_id);
  144|   652k|      }
  145|   918k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   698k|    int num_used_parallelograms = 0;
  150|   698k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 54.3k, False: 644k]
  ------------------
  151|  4.37M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 4.32M, False: 54.3k]
  ------------------
  152|  4.32M|        multi_pred_vals[i] = 0;
  153|  4.32M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   153k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 99.1k, False: 54.2k]
  ------------------
  156|  99.1k|        const int context = num_parallelograms - 1;
  157|  99.1k|        const int pos = is_crease_edge_pos[context]++;
  158|  99.1k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 78, False: 99.1k]
  ------------------
  159|     78|          return false;
  160|     78|        }
  161|  99.1k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  99.1k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 13.8k, False: 85.2k]
  ------------------
  163|  13.8k|          ++num_used_parallelograms;
  164|  1.30M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.28M, False: 13.8k]
  ------------------
  165|  1.28M|            multi_pred_vals[j] =
  166|  1.28M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.28M|          }
  168|  13.8k|        }
  169|  99.1k|      }
  170|  54.3k|    }
  171|   698k|    const int dst_offset = p * num_components;
  172|   698k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 692k, False: 5.43k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   692k|      const int src_offset = (p - 1) * num_components;
  176|   692k|      this->transform().ComputeOriginalValue(
  177|   692k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   692k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   489k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 484k, False: 5.43k]
  ------------------
  181|   484k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   484k|      }
  183|  5.43k|      this->transform().ComputeOriginalValue(
  184|  5.43k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  5.43k|    }
  186|   698k|  }
  187|    157|  return true;
  188|    235|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    354|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    354|            attribute, transform, mesh_data),
   52|    354|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    346|                                                                *buffer) {
  194|    346|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    346|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    346|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 2, False: 344]
  ------------------
  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|    345|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.57k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.29k, False: 284]
  ------------------
  211|  1.29k|    uint32_t num_flags;
  212|  1.29k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 6, False: 1.28k]
  ------------------
  213|      6|      return false;
  214|      6|    }
  215|  1.28k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 34, False: 1.25k]
  ------------------
  216|     34|      return false;
  217|     34|    }
  218|  1.25k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 582, False: 673]
  ------------------
  219|    582|      is_crease_edge_[i].resize(num_flags);
  220|    582|      RAnsBitDecoder decoder;
  221|    582|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 21, False: 561]
  ------------------
  222|     21|        return false;
  223|     21|      }
  224|  1.00M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 999k, False: 561]
  ------------------
  225|   999k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   999k|      }
  227|    561|      decoder.EndDecoding();
  228|    561|    }
  229|  1.25k|  }
  230|    284|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    284|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    345|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    257|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    257|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    257|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.28k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.02k, False: 257]
  ------------------
   93|  1.02k|    pred_vals[i].resize(num_components, 0);
   94|  1.02k|  }
   95|    257|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    257|                                         out_data);
   97|       |
   98|    257|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    257|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    257|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    257|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    257|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    257|  const int corner_map_size =
  109|    257|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   100k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 100k, False: 139]
  ------------------
  111|   100k|    const CornerIndex start_corner_id =
  112|   100k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   100k|    CornerIndex corner_id(start_corner_id);
  115|   100k|    int num_parallelograms = 0;
  116|   100k|    bool first_pass = true;
  117|   666k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 652k, False: 14.3k]
  ------------------
  118|   652k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 182k, False: 469k]
  ------------------
  119|   652k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   652k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   182k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   182k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 526, False: 182k]
  ------------------
  127|    526|          break;
  128|    526|        }
  129|   182k|      }
  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|   651k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 633k, False: 18.1k]
  ------------------
  134|   633k|        corner_id = table->SwingLeft(corner_id);
  135|   633k|      } else {
  136|  18.1k|        corner_id = table->SwingRight(corner_id);
  137|  18.1k|      }
  138|   651k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 85.4k, False: 566k]
  ------------------
  139|  85.4k|        break;
  140|  85.4k|      }
  141|   566k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 26.4k, False: 539k]
  |  Branch (141:47): [True: 14.3k, False: 12.1k]
  ------------------
  142|  14.3k|        first_pass = false;
  143|  14.3k|        corner_id = table->SwingRight(start_corner_id);
  144|  14.3k|      }
  145|   566k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   100k|    int num_used_parallelograms = 0;
  150|   100k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 98.0k, False: 2.27k]
  ------------------
  151|  13.7M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 13.6M, False: 98.0k]
  ------------------
  152|  13.6M|        multi_pred_vals[i] = 0;
  153|  13.6M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   280k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 182k, False: 97.9k]
  ------------------
  156|   182k|        const int context = num_parallelograms - 1;
  157|   182k|        const int pos = is_crease_edge_pos[context]++;
  158|   182k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 118, False: 182k]
  ------------------
  159|    118|          return false;
  160|    118|        }
  161|   182k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   182k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 9.65k, False: 172k]
  ------------------
  163|  9.65k|          ++num_used_parallelograms;
  164|  1.46M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.45M, False: 9.65k]
  ------------------
  165|  1.45M|            multi_pred_vals[j] =
  166|  1.45M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.45M|          }
  168|  9.65k|        }
  169|   182k|      }
  170|  98.0k|    }
  171|   100k|    const int dst_offset = p * num_components;
  172|   100k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 95.5k, False: 4.64k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  95.5k|      const int src_offset = (p - 1) * num_components;
  176|  95.5k|      this->transform().ComputeOriginalValue(
  177|  95.5k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  95.5k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   630k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 625k, False: 4.64k]
  ------------------
  181|   625k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   625k|      }
  183|  4.64k|      this->transform().ComputeOriginalValue(
  184|  4.64k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  4.64k|    }
  186|   100k|  }
  187|    139|  return true;
  188|    257|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.88k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.88k|    mesh_ = mesh;
   39|  1.88k|    corner_table_ = table;
   40|  1.88k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.88k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.88k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  10.1M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  6.67M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  6.67M|    return vertex_to_data_map_;
   48|  6.67M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  4.61M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  4.61M|    return data_to_corner_map_;
   51|  4.61M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.15k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.15k|    mesh_ = mesh;
   39|  2.15k|    corner_table_ = table;
   40|  2.15k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.15k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.15k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  8.44M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  7.44M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  7.44M|    return vertex_to_data_map_;
   48|  7.44M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  2.01M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  2.01M|    return data_to_corner_map_;
   51|  2.01M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  1.88k|      : mesh_(nullptr),
   31|  1.88k|        corner_table_(nullptr),
   32|  1.88k|        vertex_to_data_map_(nullptr),
   33|  1.88k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  2.15k|      : mesh_(nullptr),
   31|  2.15k|        corner_table_(nullptr),
   32|  2.15k|        vertex_to_data_map_(nullptr),
   33|  2.15k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   506k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   181k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   256k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   195k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.55k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.55k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  9.16M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.87k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.87k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  2.14M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    149|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    149|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    127|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    127|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    171|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    171|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    136|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    136|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    297|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    149|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    149|    DRACO_DCHECK_EQ(i, 0);
   70|    149|    (void)i;
   71|    149|    return GeometryAttribute::POSITION;
   72|    149|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    149|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    149|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 149]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    149|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 148]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    148|    predictor_.SetPositionAttribute(*att);
   82|    148|    return true;
   83|    149|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    148|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    148|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 6, False: 142]
  ------------------
  145|      6|    return false;
  146|      6|  }
  147|       |
  148|    142|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    142|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    142|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 40, False: 102]
  ------------------
  150|     40|    uint8_t prediction_mode;
  151|     40|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 39]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     39|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 38]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     38|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 38]
  ------------------
  160|     38|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     38|  }
  164|    140|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    140|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 4, False: 136]
  ------------------
  168|      4|    return false;
  169|      4|  }
  170|       |
  171|    136|  return true;
  172|    140|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    136|                                      const PointIndex *entry_to_point_id_map) {
  103|    136|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    136|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    136|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    136|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    136|  const int corner_map_size =
  111|    136|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    136|  VectorD<int32_t, 3> pred_normal_3d;
  114|    136|  int32_t pred_normal_oct[2];
  115|       |
  116|   506k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 506k, False: 136]
  ------------------
  117|   506k|    const CornerIndex corner_id =
  118|   506k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   506k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   506k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   506k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   506k|                    octahedron_tool_box_.center_value());
  125|   506k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 473k, False: 32.2k]
  ------------------
  126|   473k|      pred_normal_3d = -pred_normal_3d;
  127|   473k|    }
  128|   506k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   506k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   506k|    const int data_offset = data_id * 2;
  132|   506k|    this->transform().ComputeOriginalValue(
  133|   506k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   506k|  }
  135|    136|  flip_normal_bit_decoder_.EndDecoding();
  136|    136|  return true;
  137|    136|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    136|  void SetQuantizationBits(int q) {
   85|    136|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    136|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    252|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    127|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    127|    DRACO_DCHECK_EQ(i, 0);
   70|    127|    (void)i;
   71|    127|    return GeometryAttribute::POSITION;
   72|    127|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    126|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    126|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 126]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    126|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 125]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    125|    predictor_.SetPositionAttribute(*att);
   82|    125|    return true;
   83|    126|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    125|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    125|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 120]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    120|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    120|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    120|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 23, False: 97]
  ------------------
  150|     23|    uint8_t prediction_mode;
  151|     23|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 23]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     23|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 22]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     22|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 22]
  ------------------
  160|     22|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     22|  }
  164|    119|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    119|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 116]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|    116|  return true;
  172|    119|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    116|                                      const PointIndex *entry_to_point_id_map) {
  103|    116|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    116|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    116|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    116|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    116|  const int corner_map_size =
  111|    116|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    116|  VectorD<int32_t, 3> pred_normal_3d;
  114|    116|  int32_t pred_normal_oct[2];
  115|       |
  116|   181k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 181k, False: 116]
  ------------------
  117|   181k|    const CornerIndex corner_id =
  118|   181k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   181k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   181k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   181k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   181k|                    octahedron_tool_box_.center_value());
  125|   181k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 118k, False: 62.6k]
  ------------------
  126|   118k|      pred_normal_3d = -pred_normal_3d;
  127|   118k|    }
  128|   181k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   181k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   181k|    const int data_offset = data_id * 2;
  132|   181k|    this->transform().ComputeOriginalValue(
  133|   181k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   181k|  }
  135|    116|  flip_normal_bit_decoder_.EndDecoding();
  136|    116|  return true;
  137|    116|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    116|  void SetQuantizationBits(int q) {
   85|    116|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    116|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    340|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    171|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    171|    DRACO_DCHECK_EQ(i, 0);
   70|    171|    (void)i;
   71|    171|    return GeometryAttribute::POSITION;
   72|    171|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    171|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    171|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 171]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    171|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 169]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    169|    predictor_.SetPositionAttribute(*att);
   82|    169|    return true;
   83|    171|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    169|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    169|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 8, False: 161]
  ------------------
  145|      8|    return false;
  146|      8|  }
  147|       |
  148|    161|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    161|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    161|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 41, False: 120]
  ------------------
  150|     41|    uint8_t prediction_mode;
  151|     41|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 41]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     41|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 9, False: 32]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      9|      return false;
  157|      9|    }
  158|       |
  159|     32|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 32]
  ------------------
  160|     32|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     32|  }
  164|    152|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    152|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 147]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    147|  return true;
  172|    152|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    147|                                      const PointIndex *entry_to_point_id_map) {
  103|    147|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    147|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    147|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    147|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    147|  const int corner_map_size =
  111|    147|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    147|  VectorD<int32_t, 3> pred_normal_3d;
  114|    147|  int32_t pred_normal_oct[2];
  115|       |
  116|   256k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 255k, False: 147]
  ------------------
  117|   255k|    const CornerIndex corner_id =
  118|   255k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   255k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   255k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   255k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   255k|                    octahedron_tool_box_.center_value());
  125|   255k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 253k, False: 2.00k]
  ------------------
  126|   253k|      pred_normal_3d = -pred_normal_3d;
  127|   253k|    }
  128|   255k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   255k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   255k|    const int data_offset = data_id * 2;
  132|   255k|    this->transform().ComputeOriginalValue(
  133|   255k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   255k|  }
  135|    147|  flip_normal_bit_decoder_.EndDecoding();
  136|    147|  return true;
  137|    147|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    147|  void SetQuantizationBits(int q) {
   85|    147|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    147|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    270|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    136|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    136|    DRACO_DCHECK_EQ(i, 0);
   70|    136|    (void)i;
   71|    136|    return GeometryAttribute::POSITION;
   72|    136|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    136|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    136|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 136]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    136|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 134]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    134|    predictor_.SetPositionAttribute(*att);
   82|    134|    return true;
   83|    136|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    133|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    133|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 8, False: 125]
  ------------------
  145|      8|    return false;
  146|      8|  }
  147|       |
  148|    125|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    125|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    125|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 15, False: 110]
  ------------------
  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|    124|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    124|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 121]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|    121|  return true;
  172|    124|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    121|                                      const PointIndex *entry_to_point_id_map) {
  103|    121|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    121|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    121|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    121|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    121|  const int corner_map_size =
  111|    121|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    121|  VectorD<int32_t, 3> pred_normal_3d;
  114|    121|  int32_t pred_normal_oct[2];
  115|       |
  116|   195k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 195k, False: 121]
  ------------------
  117|   195k|    const CornerIndex corner_id =
  118|   195k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   195k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   195k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   195k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   195k|                    octahedron_tool_box_.center_value());
  125|   195k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 187k, False: 8.30k]
  ------------------
  126|   187k|      pred_normal_3d = -pred_normal_3d;
  127|   187k|    }
  128|   195k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   195k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   195k|    const int data_offset = data_id * 2;
  132|   195k|    this->transform().ComputeOriginalValue(
  133|   195k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   195k|  }
  135|    121|  flip_normal_bit_decoder_.EndDecoding();
  136|    121|  return true;
  137|    121|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    121|  void SetQuantizationBits(int q) {
   85|    121|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    121|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    159|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    159|            attribute, transform, mesh_data),
   37|    159|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    315|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_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_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    158|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    158|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 158]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    158|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 156]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    156|    predictor_.SetPositionAttribute(*att);
   82|    156|    return true;
   83|    158|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    155|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    155|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 20, False: 135]
  ------------------
  145|     20|    return false;
  146|     20|  }
  147|       |
  148|    135|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    135|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    135|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 38, False: 97]
  ------------------
  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|    133|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    133|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 7, False: 126]
  ------------------
  168|      7|    return false;
  169|      7|  }
  170|       |
  171|    126|  return true;
  172|    133|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    126|                                      const PointIndex *entry_to_point_id_map) {
  103|    126|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    126|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    126|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    126|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    126|  const int corner_map_size =
  111|    126|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    126|  VectorD<int32_t, 3> pred_normal_3d;
  114|    126|  int32_t pred_normal_oct[2];
  115|       |
  116|   321k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 321k, False: 126]
  ------------------
  117|   321k|    const CornerIndex corner_id =
  118|   321k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   321k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   321k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   321k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   321k|                    octahedron_tool_box_.center_value());
  125|   321k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 287k, False: 34.2k]
  ------------------
  126|   287k|      pred_normal_3d = -pred_normal_3d;
  127|   287k|    }
  128|   321k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   321k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   321k|    const int data_offset = data_id * 2;
  132|   321k|    this->transform().ComputeOriginalValue(
  133|   321k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   321k|  }
  135|    126|  flip_normal_bit_decoder_.EndDecoding();
  136|    126|  return true;
  137|    126|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    126|  void SetQuantizationBits(int q) {
   85|    126|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    126|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    359|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    359|            attribute, transform, mesh_data),
   37|    359|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    717|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    359|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    359|    DRACO_DCHECK_EQ(i, 0);
   70|    359|    (void)i;
   71|    359|    return GeometryAttribute::POSITION;
   72|    359|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    359|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    359|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 359]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    359|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 358]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    358|    predictor_.SetPositionAttribute(*att);
   82|    358|    return true;
   83|    359|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    356|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    356|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 25, False: 331]
  ------------------
  145|     25|    return false;
  146|     25|  }
  147|       |
  148|    331|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    331|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    331|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 104, False: 227]
  ------------------
  150|    104|    uint8_t prediction_mode;
  151|    104|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 103]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    103|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 102]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|    102|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 102]
  ------------------
  160|    102|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    102|  }
  164|    329|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    329|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 13, False: 316]
  ------------------
  168|     13|    return false;
  169|     13|  }
  170|       |
  171|    316|  return true;
  172|    329|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    316|                                      const PointIndex *entry_to_point_id_map) {
  103|    316|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    316|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    316|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    316|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    316|  const int corner_map_size =
  111|    316|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    316|  VectorD<int32_t, 3> pred_normal_3d;
  114|    316|  int32_t pred_normal_oct[2];
  115|       |
  116|   171k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 170k, False: 316]
  ------------------
  117|   170k|    const CornerIndex corner_id =
  118|   170k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   170k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   170k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   170k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   170k|                    octahedron_tool_box_.center_value());
  125|   170k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 162k, False: 8.45k]
  ------------------
  126|   162k|      pred_normal_3d = -pred_normal_3d;
  127|   162k|    }
  128|   170k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   170k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   170k|    const int data_offset = data_id * 2;
  132|   170k|    this->transform().ComputeOriginalValue(
  133|   170k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   170k|  }
  135|    316|  flip_normal_bit_decoder_.EndDecoding();
  136|    316|  return true;
  137|    316|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    316|  void SetQuantizationBits(int q) {
   85|    316|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    316|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    149|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    149|            attribute, transform, mesh_data),
   37|    149|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    127|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    127|            attribute, transform, mesh_data),
   37|    127|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    171|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    171|            attribute, transform, mesh_data),
   37|    171|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    136|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    136|            attribute, transform, mesh_data),
   37|    136|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    187|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    187|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 36, False: 151]
  ------------------
  105|     36|      this->normal_prediction_mode_ = mode;
  106|     36|      return true;
  107|    151|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 151, False: 0]
  ------------------
  108|    151|      this->normal_prediction_mode_ = mode;
  109|    151|      return true;
  110|    151|    }
  111|      0|    return false;
  112|    187|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   506k|                             DataTypeT *prediction) override {
   42|   506k|    DRACO_DCHECK(this->IsInitialized());
   43|   506k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   506k|    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|   506k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   506k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   506k|    VectorD<int64_t, 3> normal;
   53|   506k|    CornerIndex c_next, c_prev;
   54|  1.17M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 669k, False: 506k]
  ------------------
   55|       |      // Getting corners.
   56|   669k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 216, False: 669k]
  ------------------
   57|    216|        c_next = corner_table->Next(corner_id);
   58|    216|        c_prev = corner_table->Previous(corner_id);
   59|   669k|      } else {
   60|   669k|        c_next = corner_table->Next(cit.Corner());
   61|   669k|        c_prev = corner_table->Previous(cit.Corner());
   62|   669k|      }
   63|   669k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   669k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   669k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   669k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   669k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   669k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   669k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   669k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   669k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   669k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   669k|      cit.Next();
   81|   669k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   506k|    constexpr int64_t upper_bound = 1 << 29;
   85|   506k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 170, False: 505k]
  ------------------
   86|    170|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    170|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 46, False: 124]
  ------------------
   88|     46|        const int64_t quotient = abs_sum / upper_bound;
   89|     46|        normal = normal / quotient;
   90|     46|      }
   91|   505k|    } else {
   92|   505k|      const int64_t abs_sum = normal.AbsSum();
   93|   505k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.51k, False: 504k]
  ------------------
   94|  1.51k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.51k|        normal = normal / quotient;
   96|  1.51k|      }
   97|   505k|    }
   98|   506k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   506k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   506k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   506k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   506k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    149|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    149|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 21, False: 128]
  ------------------
  105|     21|      this->normal_prediction_mode_ = mode;
  106|     21|      return true;
  107|    128|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 128, False: 0]
  ------------------
  108|    128|      this->normal_prediction_mode_ = mode;
  109|    128|      return true;
  110|    128|    }
  111|      0|    return false;
  112|    149|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   181k|                             DataTypeT *prediction) override {
   42|   181k|    DRACO_DCHECK(this->IsInitialized());
   43|   181k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   181k|    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|   181k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   181k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   181k|    VectorD<int64_t, 3> normal;
   53|   181k|    CornerIndex c_next, c_prev;
   54|  1.26M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.08M, False: 181k]
  ------------------
   55|       |      // Getting corners.
   56|  1.08M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 120, False: 1.08M]
  ------------------
   57|    120|        c_next = corner_table->Next(corner_id);
   58|    120|        c_prev = corner_table->Previous(corner_id);
   59|  1.08M|      } else {
   60|  1.08M|        c_next = corner_table->Next(cit.Corner());
   61|  1.08M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.08M|      }
   63|  1.08M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.08M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.08M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.08M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.08M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.08M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.08M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.08M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.08M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.08M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.08M|      cit.Next();
   81|  1.08M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   181k|    constexpr int64_t upper_bound = 1 << 29;
   85|   181k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 80, False: 181k]
  ------------------
   86|     80|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     80|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 27, False: 53]
  ------------------
   88|     27|        const int64_t quotient = abs_sum / upper_bound;
   89|     27|        normal = normal / quotient;
   90|     27|      }
   91|   181k|    } else {
   92|   181k|      const int64_t abs_sum = normal.AbsSum();
   93|   181k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 79.7k, False: 101k]
  ------------------
   94|  79.7k|        const int64_t quotient = abs_sum / upper_bound;
   95|  79.7k|        normal = normal / quotient;
   96|  79.7k|      }
   97|   181k|    }
   98|   181k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   181k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   181k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   181k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   181k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    203|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    203|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 29, False: 174]
  ------------------
  105|     29|      this->normal_prediction_mode_ = mode;
  106|     29|      return true;
  107|    174|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 174, False: 0]
  ------------------
  108|    174|      this->normal_prediction_mode_ = mode;
  109|    174|      return true;
  110|    174|    }
  111|      0|    return false;
  112|    203|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   255k|                             DataTypeT *prediction) override {
   42|   255k|    DRACO_DCHECK(this->IsInitialized());
   43|   255k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   255k|    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|   255k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   255k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   255k|    VectorD<int64_t, 3> normal;
   53|   255k|    CornerIndex c_next, c_prev;
   54|   596k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 340k, False: 255k]
  ------------------
   55|       |      // Getting corners.
   56|   340k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 174, False: 340k]
  ------------------
   57|    174|        c_next = corner_table->Next(corner_id);
   58|    174|        c_prev = corner_table->Previous(corner_id);
   59|   340k|      } else {
   60|   340k|        c_next = corner_table->Next(cit.Corner());
   61|   340k|        c_prev = corner_table->Previous(cit.Corner());
   62|   340k|      }
   63|   340k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   340k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   340k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   340k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   340k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   340k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   340k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   340k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   340k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   340k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   340k|      cit.Next();
   81|   340k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   255k|    constexpr int64_t upper_bound = 1 << 29;
   85|   255k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 116, False: 255k]
  ------------------
   86|    116|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    116|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 42, False: 74]
  ------------------
   88|     42|        const int64_t quotient = abs_sum / upper_bound;
   89|     42|        normal = normal / quotient;
   90|     42|      }
   91|   255k|    } else {
   92|   255k|      const int64_t abs_sum = normal.AbsSum();
   93|   255k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.62k, False: 254k]
  ------------------
   94|  1.62k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.62k|        normal = normal / quotient;
   96|  1.62k|      }
   97|   255k|    }
   98|   255k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   255k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   255k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   255k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   255k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    150|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    150|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 13, False: 137]
  ------------------
  105|     13|      this->normal_prediction_mode_ = mode;
  106|     13|      return true;
  107|    137|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 137, False: 0]
  ------------------
  108|    137|      this->normal_prediction_mode_ = mode;
  109|    137|      return true;
  110|    137|    }
  111|      0|    return false;
  112|    150|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   195k|                             DataTypeT *prediction) override {
   42|   195k|    DRACO_DCHECK(this->IsInitialized());
   43|   195k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   195k|    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|   195k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   195k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   195k|    VectorD<int64_t, 3> normal;
   53|   195k|    CornerIndex c_next, c_prev;
   54|  1.36M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.16M, False: 195k]
  ------------------
   55|       |      // Getting corners.
   56|  1.16M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 78, False: 1.16M]
  ------------------
   57|     78|        c_next = corner_table->Next(corner_id);
   58|     78|        c_prev = corner_table->Previous(corner_id);
   59|  1.16M|      } else {
   60|  1.16M|        c_next = corner_table->Next(cit.Corner());
   61|  1.16M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.16M|      }
   63|  1.16M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.16M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.16M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.16M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.16M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.16M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.16M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.16M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.16M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.16M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.16M|      cit.Next();
   81|  1.16M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   195k|    constexpr int64_t upper_bound = 1 << 29;
   85|   195k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 52, False: 195k]
  ------------------
   86|     52|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     52|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 29, False: 23]
  ------------------
   88|     29|        const int64_t quotient = abs_sum / upper_bound;
   89|     29|        normal = normal / quotient;
   90|     29|      }
   91|   195k|    } else {
   92|   195k|      const int64_t abs_sum = normal.AbsSum();
   93|   195k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 118k, False: 76.6k]
  ------------------
   94|   118k|        const int64_t quotient = abs_sum / upper_bound;
   95|   118k|        normal = normal / quotient;
   96|   118k|      }
   97|   195k|    }
   98|   195k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   195k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   195k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   195k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   195k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    159|      : Base(md) {
   35|    159|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    159|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    195|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    195|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 33, False: 162]
  ------------------
  105|     33|      this->normal_prediction_mode_ = mode;
  106|     33|      return true;
  107|    162|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 162, False: 0]
  ------------------
  108|    162|      this->normal_prediction_mode_ = mode;
  109|    162|      return true;
  110|    162|    }
  111|      0|    return false;
  112|    195|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   321k|                             DataTypeT *prediction) override {
   42|   321k|    DRACO_DCHECK(this->IsInitialized());
   43|   321k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   321k|    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|   321k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   321k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   321k|    VectorD<int64_t, 3> normal;
   53|   321k|    CornerIndex c_next, c_prev;
   54|   901k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 579k, False: 321k]
  ------------------
   55|       |      // Getting corners.
   56|   579k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 185k, False: 394k]
  ------------------
   57|   185k|        c_next = corner_table->Next(corner_id);
   58|   185k|        c_prev = corner_table->Previous(corner_id);
   59|   394k|      } else {
   60|   394k|        c_next = corner_table->Next(cit.Corner());
   61|   394k|        c_prev = corner_table->Previous(cit.Corner());
   62|   394k|      }
   63|   579k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   579k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   579k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   579k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   579k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   579k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   579k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   579k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   579k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   579k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   579k|      cit.Next();
   81|   579k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   321k|    constexpr int64_t upper_bound = 1 << 29;
   85|   321k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 31.3k, False: 290k]
  ------------------
   86|  31.3k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  31.3k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 76, False: 31.2k]
  ------------------
   88|     76|        const int64_t quotient = abs_sum / upper_bound;
   89|     76|        normal = normal / quotient;
   90|     76|      }
   91|   290k|    } else {
   92|   290k|      const int64_t abs_sum = normal.AbsSum();
   93|   290k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.10k, False: 289k]
  ------------------
   94|  1.10k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.10k|        normal = normal / quotient;
   96|  1.10k|      }
   97|   290k|    }
   98|   321k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   321k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   321k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   321k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   321k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    359|      : Base(md) {
   35|    359|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    359|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    461|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    461|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 100, False: 361]
  ------------------
  105|    100|      this->normal_prediction_mode_ = mode;
  106|    100|      return true;
  107|    361|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 361, False: 0]
  ------------------
  108|    361|      this->normal_prediction_mode_ = mode;
  109|    361|      return true;
  110|    361|    }
  111|      0|    return false;
  112|    461|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   170k|                             DataTypeT *prediction) override {
   42|   170k|    DRACO_DCHECK(this->IsInitialized());
   43|   170k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   170k|    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|   170k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   170k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   170k|    VectorD<int64_t, 3> normal;
   53|   170k|    CornerIndex c_next, c_prev;
   54|  1.14M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 972k, False: 170k]
  ------------------
   55|       |      // Getting corners.
   56|   972k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 408k, False: 564k]
  ------------------
   57|   408k|        c_next = corner_table->Next(corner_id);
   58|   408k|        c_prev = corner_table->Previous(corner_id);
   59|   564k|      } else {
   60|   564k|        c_next = corner_table->Next(cit.Corner());
   61|   564k|        c_prev = corner_table->Previous(cit.Corner());
   62|   564k|      }
   63|   972k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   972k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   972k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   972k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   972k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   972k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   972k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   972k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   972k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   972k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   972k|      cit.Next();
   81|   972k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   170k|    constexpr int64_t upper_bound = 1 << 29;
   85|   170k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 70.2k, False: 100k]
  ------------------
   86|  70.2k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  70.2k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 338, False: 69.9k]
  ------------------
   88|    338|        const int64_t quotient = abs_sum / upper_bound;
   89|    338|        normal = normal / quotient;
   90|    338|      }
   91|   100k|    } else {
   92|   100k|      const int64_t abs_sum = normal.AbsSum();
   93|   100k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 7.49k, False: 93.0k]
  ------------------
   94|  7.49k|        const int64_t quotient = abs_sum / upper_bound;
   95|  7.49k|        normal = normal / quotient;
   96|  7.49k|      }
   97|   100k|    }
   98|   170k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   170k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   170k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   170k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   170k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    149|      : Base(md) {
   35|    149|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    149|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    127|      : Base(md) {
   35|    127|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    127|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    171|      : Base(md) {
   35|    171|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    171|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    136|      : Base(md) {
   35|    136|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    136|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_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_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   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_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    148|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    148|    pos_attribute_ = &position_attribute;
   43|    148|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    136|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    136|    entry_to_point_id_map_ = map;
   46|    136|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.34M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.34M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.34M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.34M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.34M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.34M|    return GetPositionForDataId(data_id);
   77|  2.34M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.34M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.34M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.34M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.34M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.34M|    VectorD<int64_t, 3> pos;
   68|  2.34M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.34M|    return pos;
   70|  2.34M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    125|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    125|    pos_attribute_ = &position_attribute;
   43|    125|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    116|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    116|    entry_to_point_id_map_ = map;
   46|    116|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   937k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   937k|    DRACO_DCHECK(this->IsInitialized());
   73|   937k|    const auto corner_table = mesh_data_.corner_table();
   74|   937k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   937k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   937k|    return GetPositionForDataId(data_id);
   77|   937k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|   937k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   937k|    DRACO_DCHECK(this->IsInitialized());
   65|   937k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   937k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   937k|    VectorD<int64_t, 3> pos;
   68|   937k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   937k|    return pos;
   70|   937k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    169|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    169|    pos_attribute_ = &position_attribute;
   43|    169|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    147|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    147|    entry_to_point_id_map_ = map;
   46|    147|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.52M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.52M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.52M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.52M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.52M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.52M|    return GetPositionForDataId(data_id);
   77|  2.52M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.52M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.52M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.52M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.52M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.52M|    VectorD<int64_t, 3> pos;
   68|  2.52M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.52M|    return pos;
   70|  2.52M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    134|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    134|    pos_attribute_ = &position_attribute;
   43|    134|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    121|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    121|    entry_to_point_id_map_ = map;
   46|    121|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    159|      : pos_attribute_(nullptr),
   36|    159|        entry_to_point_id_map_(nullptr),
   37|    159|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    159|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.48M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.48M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.48M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.48M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.48M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.48M|    return GetPositionForDataId(data_id);
   77|  1.48M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.48M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.48M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.48M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.48M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.48M|    VectorD<int64_t, 3> pos;
   68|  1.48M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.48M|    return pos;
   70|  1.48M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    156|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    156|    pos_attribute_ = &position_attribute;
   43|    156|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    126|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    126|    entry_to_point_id_map_ = map;
   46|    126|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    359|      : pos_attribute_(nullptr),
   36|    359|        entry_to_point_id_map_(nullptr),
   37|    359|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    359|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.11M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.11M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.11M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.11M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.11M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.11M|    return GetPositionForDataId(data_id);
   77|  2.11M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.11M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.11M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.11M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.11M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.11M|    VectorD<int64_t, 3> pos;
   68|  2.11M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.11M|    return pos;
   70|  2.11M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    358|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    358|    pos_attribute_ = &position_attribute;
   43|    358|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    316|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    316|    entry_to_point_id_map_ = map;
   46|    316|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    149|      : pos_attribute_(nullptr),
   36|    149|        entry_to_point_id_map_(nullptr),
   37|    149|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    149|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    127|      : pos_attribute_(nullptr),
   36|    127|        entry_to_point_id_map_(nullptr),
   37|    127|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    127|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    171|      : pos_attribute_(nullptr),
   36|    171|        entry_to_point_id_map_(nullptr),
   37|    171|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    171|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    136|      : pos_attribute_(nullptr),
   36|    136|        entry_to_point_id_map_(nullptr),
   37|    136|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    136|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    300|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    300|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    288|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    288|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    288|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    288|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    288|      new DataTypeT[num_components]());
   70|       |
   71|    288|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    288|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    288|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    288|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    288|  const int corner_map_size =
   78|    288|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   869k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 869k, False: 288]
  ------------------
   80|   869k|    const CornerIndex start_corner_id =
   81|   869k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   869k|    CornerIndex corner_id(start_corner_id);
   84|   869k|    int num_parallelograms = 0;
   85|  44.1M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 43.3M, False: 869k]
  ------------------
   86|  43.3M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  43.3M|    }
   88|  2.24M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.37M, False: 869k]
  ------------------
   89|  1.37M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 214k, False: 1.16M]
  ------------------
   90|  1.37M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.37M|              num_components, parallelogram_pred_vals.get())) {
   92|  11.5M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 11.3M, False: 214k]
  ------------------
   93|  11.3M|          pred_vals[c] =
   94|  11.3M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  11.3M|        }
   96|   214k|        ++num_parallelograms;
   97|   214k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.37M|      corner_id = table->SwingRight(corner_id);
  101|  1.37M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 98.9k, False: 1.27M]
  ------------------
  102|  98.9k|        corner_id = kInvalidCornerIndex;
  103|  98.9k|      }
  104|  1.37M|    }
  105|       |
  106|   869k|    const int dst_offset = p * num_components;
  107|   869k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 751k, False: 117k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|   751k|      const int src_offset = (p - 1) * num_components;
  111|   751k|      this->transform().ComputeOriginalValue(
  112|   751k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   751k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  6.83M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 6.71M, False: 117k]
  ------------------
  116|  6.71M|        pred_vals[c] /= num_parallelograms;
  117|  6.71M|      }
  118|   117k|      this->transform().ComputeOriginalValue(
  119|   117k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   117k|    }
  121|   869k|  }
  122|    288|  return true;
  123|    288|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    393|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    393|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    369|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    369|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    369|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    369|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    369|      new DataTypeT[num_components]());
   70|       |
   71|    369|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    369|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    369|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    369|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    369|  const int corner_map_size =
   78|    369|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   682k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 681k, False: 369]
  ------------------
   80|   681k|    const CornerIndex start_corner_id =
   81|   681k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   681k|    CornerIndex corner_id(start_corner_id);
   84|   681k|    int num_parallelograms = 0;
   85|  22.9M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 22.2M, False: 681k]
  ------------------
   86|  22.2M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  22.2M|    }
   88|  4.71M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 4.03M, False: 681k]
  ------------------
   89|  4.03M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.32M, False: 2.71M]
  ------------------
   90|  4.03M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  4.03M|              num_components, parallelogram_pred_vals.get())) {
   92|  44.4M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 43.1M, False: 1.32M]
  ------------------
   93|  43.1M|          pred_vals[c] =
   94|  43.1M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  43.1M|        }
   96|  1.32M|        ++num_parallelograms;
   97|  1.32M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  4.03M|      corner_id = table->SwingRight(corner_id);
  101|  4.03M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 669k, False: 3.36M]
  ------------------
  102|   669k|        corner_id = kInvalidCornerIndex;
  103|   669k|      }
  104|  4.03M|    }
  105|       |
  106|   681k|    const int dst_offset = p * num_components;
  107|   681k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.75k, False: 680k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.75k|      const int src_offset = (p - 1) * num_components;
  111|  1.75k|      this->transform().ComputeOriginalValue(
  112|  1.75k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   680k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  22.8M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 22.1M, False: 680k]
  ------------------
  116|  22.1M|        pred_vals[c] /= num_parallelograms;
  117|  22.1M|      }
  118|   680k|      this->transform().ComputeOriginalValue(
  119|   680k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   680k|    }
  121|   681k|  }
  122|    369|  return true;
  123|    369|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  3.09M|    int num_components, DataTypeT *out_prediction) {
   49|  3.09M|  const CornerIndex oci = table->Opposite(ci);
   50|  3.09M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 2.10M, False: 992k]
  ------------------
   51|  2.10M|    return false;
   52|  2.10M|  }
   53|   992k|  int vert_opp, vert_next, vert_prev;
   54|   992k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   992k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   992k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 527k, False: 464k]
  |  Branch (56:35): [True: 399k, False: 127k]
  ------------------
   57|   399k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 384k, False: 15.2k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   384k|    const int v_opp_off = vert_opp * num_components;
   60|   384k|    const int v_next_off = vert_next * num_components;
   61|   384k|    const int v_prev_off = vert_prev * num_components;
   62|  20.5M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 20.2M, False: 384k]
  ------------------
   63|  20.2M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  20.2M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  20.2M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  20.2M|      const int64_t result =
   67|  20.2M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  20.2M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  20.2M|    }
   71|   384k|    return true;
   72|   384k|  }
   73|   608k|  return false;  // Not all data is available for prediction
   74|   992k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   992k|    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|   992k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   992k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   992k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   992k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  5.14M|    int num_components, DataTypeT *out_prediction) {
   49|  5.14M|  const CornerIndex oci = table->Opposite(ci);
   50|  5.14M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 82.8k, False: 5.06M]
  ------------------
   51|  82.8k|    return false;
   52|  82.8k|  }
   53|  5.06M|  int vert_opp, vert_next, vert_prev;
   54|  5.06M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  5.06M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  5.06M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 2.73M, False: 2.33M]
  |  Branch (56:35): [True: 2.13M, False: 597k]
  ------------------
   57|  2.13M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 1.95M, False: 177k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  1.95M|    const int v_opp_off = vert_opp * num_components;
   60|  1.95M|    const int v_next_off = vert_next * num_components;
   61|  1.95M|    const int v_prev_off = vert_prev * num_components;
   62|  89.0M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 87.0M, False: 1.95M]
  ------------------
   63|  87.0M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  87.0M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  87.0M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  87.0M|      const int64_t result =
   67|  87.0M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  87.0M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  87.0M|    }
   71|  1.95M|    return true;
   72|  1.95M|  }
   73|  3.10M|  return false;  // Not all data is available for prediction
   74|  5.06M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  5.06M|    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|  5.06M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  5.06M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  5.06M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  5.06M|}

_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    141|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    141|            attribute, transform, mesh_data),
   46|    141|        pos_attribute_(nullptr),
   47|    141|        entry_to_point_id_map_(nullptr),
   48|    141|        num_components_(0),
   49|    141|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   71|    281|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   73|    141|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    141|    DRACO_DCHECK_EQ(i, 0);
   75|    141|    (void)i;
   76|    141|    return GeometryAttribute::POSITION;
   77|    141|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    141|  bool SetParentAttribute(const PointAttribute *att) override {
   80|    141|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 141]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    141|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 141]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    141|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 1, False: 140]
  ------------------
   87|      1|      return false;  // Currently works only for 3 component positions.
   88|      1|    }
   89|    140|    pos_attribute_ = att;
   90|    140|    return true;
   91|    141|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|    136|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|    136|  uint32_t num_orientations = 0;
  156|    136|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    136|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 4, False: 132]
  ------------------
  157|      4|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 1, False: 3]
  ------------------
  158|      1|      return false;
  159|      1|    }
  160|    132|  } else {
  161|    132|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 1, False: 131]
  ------------------
  162|      1|      return false;
  163|      1|    }
  164|    132|  }
  165|    134|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 3, False: 131]
  ------------------
  166|      3|    return false;
  167|      3|  }
  168|    131|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 9, False: 122]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      9|    return false;
  172|      9|  }
  173|    122|  orientations_.resize(num_orientations);
  174|    122|  bool last_orientation = true;
  175|    122|  RAnsBitDecoder decoder;
  176|    122|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 2, False: 120]
  ------------------
  177|      2|    return false;
  178|      2|  }
  179|  45.3k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 45.2k, False: 120]
  ------------------
  180|  45.2k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 15.3k, False: 29.9k]
  ------------------
  181|  15.3k|      last_orientation = !last_orientation;
  182|  15.3k|    }
  183|  45.2k|    orientations_[i] = last_orientation;
  184|  45.2k|  }
  185|    120|  decoder.EndDecoding();
  186|    120|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|    120|                                     MeshDataT>::DecodePredictionData(buffer);
  188|    122|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|     88|                          const PointIndex *entry_to_point_id_map) {
  126|     88|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 3, False: 85]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      3|    return false;
  129|      3|  }
  130|     85|  num_components_ = num_components;
  131|     85|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|     85|  predicted_value_ =
  133|     85|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|     85|  this->transform().Init(num_components);
  135|       |
  136|     85|  const int corner_map_size =
  137|     85|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|   884k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 884k, False: 72]
  ------------------
  139|   884k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|   884k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 13, False: 884k]
  ------------------
  141|     13|      return false;
  142|     13|    }
  143|       |
  144|   884k|    const int dst_offset = p * num_components;
  145|   884k|    this->transform().ComputeOriginalValue(
  146|   884k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|   884k|  }
  148|     72|  return true;
  149|     85|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|   884k|                          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|   884k|  const CornerIndex next_corner_id =
  198|   884k|      this->mesh_data().corner_table()->Next(corner_id);
  199|   884k|  const CornerIndex prev_corner_id =
  200|   884k|      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|   884k|  int next_data_id, prev_data_id;
  204|       |
  205|   884k|  int next_vert_id, prev_vert_id;
  206|   884k|  next_vert_id =
  207|   884k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|   884k|  prev_vert_id =
  209|   884k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|   884k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|   884k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|   884k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 603k, False: 281k]
  |  Branch (214:33): [True: 322k, False: 281k]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|   322k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|   322k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|   322k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 317k, False: 4.84k]
  ------------------
  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|   635k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 635k, False: 317k]
  ------------------
  223|   635k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 635k]
  |  Branch (223:36): [True: 124, False: 634k]
  ------------------
  224|   634k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 634k]
  ------------------
  225|    124|          predicted_value_[i] = INT_MIN;
  226|   634k|        } else {
  227|   634k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   634k|        }
  229|   635k|      }
  230|   317k|      return true;
  231|   317k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  4.84k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  4.84k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  4.84k|    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|  4.84k|    const Vector3f pn = prev_pos - next_pos;
  261|  4.84k|    const Vector3f cn = tip_pos - next_pos;
  262|  4.84k|    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|  4.84k|    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|  4.84k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  9.68k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 4.84k]
  |  Branch (273:53): [True: 40, False: 4.80k]
  ------------------
  274|     40|      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|     40|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  4.80k|    } else {
  280|  4.80k|      s = 0;
  281|  4.80k|      t = 0;
  282|  4.80k|    }
  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|  4.84k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  4.84k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  4.84k|    const float pnut = pn_uv[0] * t;
  301|  4.84k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  4.84k|    const float pnvt = pn_uv[1] * t;
  303|  4.84k|    Vector2f predicted_uv;
  304|  4.84k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 13, False: 4.83k]
  ------------------
  305|     13|      return false;
  306|     13|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  4.83k|    const bool orientation = orientations_.back();
  310|  4.83k|    orientations_.pop_back();
  311|  4.83k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 1.53k, False: 3.29k]
  ------------------
  312|  1.53k|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|  3.29k|    } else {
  314|  3.29k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|  3.29k|    }
  316|  4.83k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 4.83k, 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|  4.83k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  4.83k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 4.83k]
  |  Branch (321:28): [True: 94, False: 4.73k]
  |  Branch (321:43): [True: 10, False: 4.72k]
  ------------------
  322|    104|        predicted_value_[0] = INT_MIN;
  323|  4.72k|      } else {
  324|  4.72k|        predicted_value_[0] = static_cast<int>(u);
  325|  4.72k|      }
  326|  4.83k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  4.83k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 4.83k]
  |  Branch (327:28): [True: 67, False: 4.76k]
  |  Branch (327:43): [True: 10, False: 4.75k]
  ------------------
  328|     77|        predicted_value_[1] = INT_MIN;
  329|  4.75k|      } else {
  330|  4.75k|        predicted_value_[1] = static_cast<int>(v);
  331|  4.75k|      }
  332|  4.83k|    } 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|  4.83k|    return true;
  338|  4.84k|  }
  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|   562k|  int data_offset = 0;
  343|   562k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 281k, False: 281k]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|   281k|    data_offset = prev_data_id * num_components_;
  346|   281k|  }
  347|   562k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 16, False: 562k]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|     16|    data_offset = next_data_id * num_components_;
  350|   562k|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|   562k|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 562k, False: 85]
  ------------------
  354|   562k|      data_offset = (data_id - 1) * num_components_;
  355|   562k|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    255|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 170, False: 85]
  ------------------
  358|    170|        predicted_value_[i] = 0;
  359|    170|      }
  360|     85|      return true;
  361|     85|    }
  362|   562k|  }
  363|  1.68M|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 1.12M, False: 562k]
  ------------------
  364|  1.12M|    predicted_value_[i] = data[data_offset + i];
  365|  1.12M|  }
  366|   562k|  return true;
  367|   562k|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   644k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   644k|    const int data_offset = entry_id * num_components_;
  104|   644k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   644k|                    static_cast<float>(data[data_offset + 1]));
  106|   644k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   94|  14.5k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  14.5k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  14.5k|    Vector3f pos;
   97|  14.5k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  14.5k|                                 &pos[0]);
   99|  14.5k|    return pos;
  100|  14.5k|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    133|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    133|            attribute, transform, mesh_data),
   46|    133|        pos_attribute_(nullptr),
   47|    133|        entry_to_point_id_map_(nullptr),
   48|    133|        num_components_(0),
   49|    133|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   71|    263|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   73|    133|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    133|    DRACO_DCHECK_EQ(i, 0);
   75|    133|    (void)i;
   76|    133|    return GeometryAttribute::POSITION;
   77|    133|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    133|  bool SetParentAttribute(const PointAttribute *att) override {
   80|    133|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 133]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    133|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 133]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    133|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 3, False: 130]
  ------------------
   87|      3|      return false;  // Currently works only for 3 component positions.
   88|      3|    }
   89|    130|    pos_attribute_ = att;
   90|    130|    return true;
   91|    133|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|    124|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|    124|  uint32_t num_orientations = 0;
  156|    124|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    124|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 2, False: 122]
  ------------------
  157|      2|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 1, False: 1]
  ------------------
  158|      1|      return false;
  159|      1|    }
  160|    122|  } else {
  161|    122|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 1, False: 121]
  ------------------
  162|      1|      return false;
  163|      1|    }
  164|    122|  }
  165|    122|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 5, False: 117]
  ------------------
  166|      5|    return false;
  167|      5|  }
  168|    117|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 8, False: 109]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      8|    return false;
  172|      8|  }
  173|    109|  orientations_.resize(num_orientations);
  174|    109|  bool last_orientation = true;
  175|    109|  RAnsBitDecoder decoder;
  176|    109|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 2, False: 107]
  ------------------
  177|      2|    return false;
  178|      2|  }
  179|  73.5k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 73.4k, False: 107]
  ------------------
  180|  73.4k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 39.4k, False: 33.9k]
  ------------------
  181|  39.4k|      last_orientation = !last_orientation;
  182|  39.4k|    }
  183|  73.4k|    orientations_[i] = last_orientation;
  184|  73.4k|  }
  185|    107|  decoder.EndDecoding();
  186|    107|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|    107|                                     MeshDataT>::DecodePredictionData(buffer);
  188|    109|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|     86|                          const PointIndex *entry_to_point_id_map) {
  126|     86|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 4, False: 82]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      4|    return false;
  129|      4|  }
  130|     82|  num_components_ = num_components;
  131|     82|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|     82|  predicted_value_ =
  133|     82|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|     82|  this->transform().Init(num_components);
  135|       |
  136|     82|  const int corner_map_size =
  137|     82|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|  82.6k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 82.6k, False: 51]
  ------------------
  139|  82.6k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|  82.6k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 31, False: 82.6k]
  ------------------
  141|     31|      return false;
  142|     31|    }
  143|       |
  144|  82.6k|    const int dst_offset = p * num_components;
  145|  82.6k|    this->transform().ComputeOriginalValue(
  146|  82.6k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|  82.6k|  }
  148|     51|  return true;
  149|     82|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|  82.6k|                          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|  82.6k|  const CornerIndex next_corner_id =
  198|  82.6k|      this->mesh_data().corner_table()->Next(corner_id);
  199|  82.6k|  const CornerIndex prev_corner_id =
  200|  82.6k|      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|  82.6k|  int next_data_id, prev_data_id;
  204|       |
  205|  82.6k|  int next_vert_id, prev_vert_id;
  206|  82.6k|  next_vert_id =
  207|  82.6k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|  82.6k|  prev_vert_id =
  209|  82.6k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|  82.6k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|  82.6k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|  82.6k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 82.3k, False: 266]
  |  Branch (214:33): [True: 82.1k, False: 255]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|  82.1k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|  82.1k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|  82.1k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 80.0k, False: 2.10k]
  ------------------
  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|   160k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 160k, False: 80.0k]
  ------------------
  223|   160k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 160k]
  |  Branch (223:36): [True: 107, False: 159k]
  ------------------
  224|   159k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 159k]
  ------------------
  225|    107|          predicted_value_[i] = INT_MIN;
  226|   159k|        } else {
  227|   159k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   159k|        }
  229|   160k|      }
  230|  80.0k|      return true;
  231|  80.0k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  2.10k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  2.10k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  2.10k|    const Vector3f prev_pos = GetPositionForEntryId(prev_data_id);
  237|       |    // Use the positions of the above triangle to predict the texture coordinate
  238|       |    // on the tip corner C.
  239|       |    // Convert the triangle into a new coordinate system defined by orthogonal
  240|       |    // bases vectors S, T, where S is vector prev_pos - next_pos and T is an
  241|       |    // perpendicular vector to S in the same plane as vector the
  242|       |    // tip_pos - next_pos.
  243|       |    // The transformed triangle in the new coordinate system is then going to
  244|       |    // be represented as:
  245|       |    //
  246|       |    //        1 ^
  247|       |    //          |
  248|       |    //          |
  249|       |    //          |   C
  250|       |    //          |  /  \
  251|       |    //          | /      \
  252|       |    //          |/          \
  253|       |    //          N--------------P
  254|       |    //          0              1
  255|       |    //
  256|       |    // Where next_pos point (N) is at position (0, 0), prev_pos point (P) is
  257|       |    // at (1, 0). Our goal is to compute the position of the tip_pos point (C)
  258|       |    // in this new coordinate space (s, t).
  259|       |    //
  260|  2.10k|    const Vector3f pn = prev_pos - next_pos;
  261|  2.10k|    const Vector3f cn = tip_pos - next_pos;
  262|  2.10k|    const float pn_norm2_squared = pn.SquaredNorm();
  263|       |    // Coordinate s of the tip corner C is simply the dot product of the
  264|       |    // normalized vectors |pn| and |cn| (normalized by the length of |pn|).
  265|       |    // Since both of these vectors are normalized, we don't need to perform the
  266|       |    // normalization explicitly and instead we can just use the squared norm
  267|       |    // of |pn| as a denominator of the resulting dot product of non normalized
  268|       |    // vectors.
  269|  2.10k|    float s, t;
  270|       |    // |pn_norm2_squared| can be exactly 0 when the next_pos and prev_pos are
  271|       |    // the same positions (e.g. because they were quantized to the same
  272|       |    // location).
  273|  2.10k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  4.20k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 2.10k]
  |  Branch (273:53): [True: 470, False: 1.63k]
  ------------------
  274|    470|      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|    470|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  1.63k|    } else {
  280|  1.63k|      s = 0;
  281|  1.63k|      t = 0;
  282|  1.63k|    }
  283|       |
  284|       |    // Now we need to transform the point (s, t) to the texture coordinate space
  285|       |    // UV. We know the UV coordinates on points N and P (N_UV and P_UV). Lets
  286|       |    // denote P_UV - N_UV = PN_UV. PN_UV is then 2 dimensional vector that can
  287|       |    // be used to define transformation from the normalized coordinate system
  288|       |    // to the texture coordinate system using a 3x3 affine matrix M:
  289|       |    //
  290|       |    //  M = | PN_UV[0]  -PN_UV[1]  N_UV[0] |
  291|       |    //      | PN_UV[1]   PN_UV[0]  N_UV[1] |
  292|       |    //      | 0          0         1       |
  293|       |    //
  294|       |    // The predicted point C_UV in the texture space is then equal to
  295|       |    // C_UV = M * (s, t, 1). Because the triangle in UV space may be flipped
  296|       |    // around the PN_UV axis, we also need to consider point C_UV' = M * (s, -t)
  297|       |    // as the prediction.
  298|  2.10k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  2.10k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  2.10k|    const float pnut = pn_uv[0] * t;
  301|  2.10k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  2.10k|    const float pnvt = pn_uv[1] * t;
  303|  2.10k|    Vector2f predicted_uv;
  304|  2.10k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 31, False: 2.07k]
  ------------------
  305|     31|      return false;
  306|     31|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  2.07k|    const bool orientation = orientations_.back();
  310|  2.07k|    orientations_.pop_back();
  311|  2.07k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 918, False: 1.15k]
  ------------------
  312|    918|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|  1.15k|    } else {
  314|  1.15k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|  1.15k|    }
  316|  2.07k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 2.07k, Folded]
  ------------------
  317|       |      // Round the predicted value for integer types.
  318|       |      // Technically floats > INT_MAX are undefined, but compilers will
  319|       |      // convert those values to INT_MIN. We are being explicit here for asan.
  320|  2.07k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  2.07k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 2.07k]
  |  Branch (321:28): [True: 82, False: 1.98k]
  |  Branch (321:43): [True: 40, False: 1.94k]
  ------------------
  322|    122|        predicted_value_[0] = INT_MIN;
  323|  1.94k|      } else {
  324|  1.94k|        predicted_value_[0] = static_cast<int>(u);
  325|  1.94k|      }
  326|  2.07k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  2.07k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 2.07k]
  |  Branch (327:28): [True: 86, False: 1.98k]
  |  Branch (327:43): [True: 45, False: 1.94k]
  ------------------
  328|    131|        predicted_value_[1] = INT_MIN;
  329|  1.94k|      } else {
  330|  1.94k|        predicted_value_[1] = static_cast<int>(v);
  331|  1.94k|      }
  332|  2.07k|    } else {
  333|      0|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  334|      0|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  335|      0|    }
  336|       |
  337|  2.07k|    return true;
  338|  2.10k|  }
  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|    521|  int data_offset = 0;
  343|    521|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 255, False: 266]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|    255|    data_offset = prev_data_id * num_components_;
  346|    255|  }
  347|    521|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 16, False: 505]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|     16|    data_offset = next_data_id * num_components_;
  350|    505|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|    505|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 423, False: 82]
  ------------------
  354|    423|      data_offset = (data_id - 1) * num_components_;
  355|    423|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    246|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 164, False: 82]
  ------------------
  358|    164|        predicted_value_[i] = 0;
  359|    164|      }
  360|     82|      return true;
  361|     82|    }
  362|    505|  }
  363|  1.31k|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 878, False: 439]
  ------------------
  364|    878|    predicted_value_[i] = data[data_offset + i];
  365|    878|  }
  366|    439|  return true;
  367|    521|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   164k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   164k|    const int data_offset = entry_id * num_components_;
  104|   164k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   164k|                    static_cast<float>(data[data_offset + 1]));
  106|   164k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   94|  6.30k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  6.30k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  6.30k|    Vector3f pos;
   97|  6.30k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  6.30k|                                 &pos[0]);
   99|  6.30k|    return pos;
  100|  6.30k|  }

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    172|      : pos_attribute_(nullptr),
   39|    172|        entry_to_point_id_map_(nullptr),
   40|    172|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    171|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    171|    pos_attribute_ = &position_attribute;
   43|    171|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    165|  void ResizeOrientations(int num_orientations) {
   74|    165|    orientations_.resize(num_orientations);
   75|    165|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  5.18G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    137|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    137|    entry_to_point_id_map_ = map;
   46|    137|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   320k|                                                 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|   320k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   320k|  const CornerIndex prev_corner_id =
   99|   320k|      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|   320k|  int next_data_id, prev_data_id;
  103|       |
  104|   320k|  int next_vert_id, prev_vert_id;
  105|   320k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   320k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   320k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   320k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   320k|  typedef VectorD<int64_t, 2> Vec2;
  112|   320k|  typedef VectorD<int64_t, 3> Vec3;
  113|   320k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   320k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 230k, False: 90.0k]
  |  Branch (115:33): [True: 140k, False: 90.0k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   140k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   140k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   140k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 137k, False: 2.84k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   137k|      predicted_value_[0] = p_uv[0];
  122|   137k|      predicted_value_[1] = p_uv[1];
  123|   137k|      return true;
  124|   137k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  2.84k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  2.84k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  2.84k|    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.84k|    const Vec3 pn = prev_pos - next_pos;
  146|  2.84k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  2.84k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.82k, False: 1.01k]
  ------------------
  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.82k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.82k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.82k|      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.82k|      const int64_t n_uv_absmax_element =
  164|  1.82k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.82k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 28, False: 1.80k]
  ------------------
  166|  1.82k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     28|        return false;
  169|     28|      }
  170|  1.80k|      const int64_t pn_uv_absmax_element =
  171|  1.80k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.80k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 12, False: 1.78k]
  ------------------
  173|  1.80k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     12|        return false;
  176|     12|      }
  177|  1.78k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.78k|      const int64_t pn_absmax_element =
  179|  1.78k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.78k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 8, False: 1.78k]
  ------------------
  181|  1.78k|          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|  1.78k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.78k|      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.78k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.78k|      const uint64_t norm_squared =
  207|  1.78k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.78k|      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.78k|      Vec2 predicted_uv;
  214|  1.78k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.78k]
  ------------------
  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.78k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.78k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 7, False: 1.77k]
  ------------------
  233|      7|          return false;
  234|      7|        }
  235|  1.77k|        const bool orientation = orientations_.back();
  236|  1.77k|        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.77k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 638, False: 1.13k]
  ------------------
  240|    638|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|  1.13k|        } else {
  242|  1.13k|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|  1.13k|        }
  244|  1.77k|      }
  245|  1.77k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.77k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.77k|      return true;
  248|  1.78k|    }
  249|  2.84k|  }
  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|   181k|  int data_offset = 0;
  254|   181k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 91.0k, False: 90.0k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  91.0k|    data_offset = prev_data_id * kNumComponents;
  257|  91.0k|  }
  258|   181k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 1.02k, False: 180k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  1.02k|    data_offset = next_data_id * kNumComponents;
  261|   180k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   180k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 179k, False: 137]
  ------------------
  265|   179k|      data_offset = (data_id - 1) * kNumComponents;
  266|   179k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    411|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 274, False: 137]
  ------------------
  269|    274|        predicted_value_[i] = 0;
  270|    274|      }
  271|    137|      return true;
  272|    137|    }
  273|   180k|  }
  274|   542k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 361k, False: 180k]
  ------------------
  275|   361k|    predicted_value_[i] = data[data_offset + i];
  276|   361k|  }
  277|   180k|  return true;
  278|   181k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   281k|                                            const DataTypeT *data) const {
   59|   281k|    const int data_offset = entry_id * kNumComponents;
   60|   281k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   281k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  8.54k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  8.54k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  8.54k|    VectorD<int64_t, 3> pos;
   52|  8.54k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  8.54k|                                 &pos[0]);
   54|  8.54k|    return pos;
   55|  8.54k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   320k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    179|      : pos_attribute_(nullptr),
   39|    179|        entry_to_point_id_map_(nullptr),
   40|    179|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    173|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    173|    pos_attribute_ = &position_attribute;
   43|    173|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    168|  void ResizeOrientations(int num_orientations) {
   74|    168|    orientations_.resize(num_orientations);
   75|    168|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  6.18G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    127|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    127|    entry_to_point_id_map_ = map;
   46|    127|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   144k|                                                 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|   144k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   144k|  const CornerIndex prev_corner_id =
   99|   144k|      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|   144k|  int next_data_id, prev_data_id;
  103|       |
  104|   144k|  int next_vert_id, prev_vert_id;
  105|   144k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   144k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   144k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   144k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   144k|  typedef VectorD<int64_t, 2> Vec2;
  112|   144k|  typedef VectorD<int64_t, 3> Vec3;
  113|   144k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   144k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 144k, False: 182]
  |  Branch (115:33): [True: 144k, False: 179]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   144k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   144k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   144k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 133k, False: 10.7k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   133k|      predicted_value_[0] = p_uv[0];
  122|   133k|      predicted_value_[1] = p_uv[1];
  123|   133k|      return true;
  124|   133k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  10.7k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  10.7k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  10.7k|    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.7k|    const Vec3 pn = prev_pos - next_pos;
  146|  10.7k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  10.7k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.61k, False: 9.17k]
  ------------------
  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.61k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.61k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.61k|      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.61k|      const int64_t n_uv_absmax_element =
  164|  1.61k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.61k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 16, False: 1.59k]
  ------------------
  166|  1.61k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     16|        return false;
  169|     16|      }
  170|  1.59k|      const int64_t pn_uv_absmax_element =
  171|  1.59k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.59k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 7, False: 1.59k]
  ------------------
  173|  1.59k|          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.59k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.59k|      const int64_t pn_absmax_element =
  179|  1.59k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.59k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 4, False: 1.58k]
  ------------------
  181|  1.59k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      4|        return false;
  184|      4|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.58k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.58k|      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.58k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.58k|      const uint64_t norm_squared =
  207|  1.58k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.58k|      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.58k|      Vec2 predicted_uv;
  214|  1.58k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.58k]
  ------------------
  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.58k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.58k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 10, False: 1.57k]
  ------------------
  233|     10|          return false;
  234|     10|        }
  235|  1.57k|        const bool orientation = orientations_.back();
  236|  1.57k|        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.57k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 651, False: 926]
  ------------------
  240|    651|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    926|        } else {
  242|    926|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    926|        }
  244|  1.57k|      }
  245|  1.57k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.57k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.57k|      return true;
  248|  1.58k|    }
  249|  10.7k|  }
  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|  9.53k|  int data_offset = 0;
  254|  9.53k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 9.34k, False: 182]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  9.34k|    data_offset = prev_data_id * kNumComponents;
  257|  9.34k|  }
  258|  9.53k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 9.18k, False: 350]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  9.18k|    data_offset = next_data_id * kNumComponents;
  261|  9.18k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    350|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 223, False: 127]
  ------------------
  265|    223|      data_offset = (data_id - 1) * kNumComponents;
  266|    223|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    381|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 254, False: 127]
  ------------------
  269|    254|        predicted_value_[i] = 0;
  270|    254|      }
  271|    127|      return true;
  272|    127|    }
  273|    350|  }
  274|  28.2k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 18.8k, False: 9.40k]
  ------------------
  275|  18.8k|    predicted_value_[i] = data[data_offset + i];
  276|  18.8k|  }
  277|  9.40k|  return true;
  278|  9.53k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   288k|                                            const DataTypeT *data) const {
   59|   288k|    const int data_offset = entry_id * kNumComponents;
   60|   288k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   288k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  32.3k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  32.3k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  32.3k|    VectorD<int64_t, 3> pos;
   52|  32.3k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  32.3k|                                 &pos[0]);
   54|  32.3k|    return pos;
   55|  32.3k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   144k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     92|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    354|  bool AreCorrectionsPositive() override {
   71|    354|    return transform_.AreCorrectionsPositive();
   72|    354|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     81|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     81|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 10, False: 71]
  ------------------
   50|     10|      return false;
   51|     10|    }
   52|     71|    return true;
   53|     81|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  31.8M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    120|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    411|  bool AreCorrectionsPositive() override {
   71|    411|    return transform_.AreCorrectionsPositive();
   72|    411|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    109|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    109|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 14, False: 95]
  ------------------
   50|     14|      return false;
   51|     14|    }
   52|     95|    return true;
   53|    109|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  4.16M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  3.70k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  2.55k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  3.54k|  bool AreCorrectionsPositive() override {
   71|  3.54k|    return transform_.AreCorrectionsPositive();
   72|  3.54k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  2.84k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  2.84k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 199, False: 2.64k]
  ------------------
   50|    199|      return false;
   51|    199|    }
   52|  2.64k|    return true;
   53|  2.84k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  6.53M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    368|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    427|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    368|                                 const PointCloudDecoder *decoder) {
  188|    368|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    368|      method, att_id, decoder, TransformT());
  190|    368|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    368|                                 const TransformT &transform) {
  156|    368|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 368]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    368|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    368|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 367, 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|    367|    const MeshDecoder *const mesh_decoder =
  167|    367|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    367|    auto ret = CreateMeshPredictionScheme<
  170|    367|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    367|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    367|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    367|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 276, False: 91]
  ------------------
  174|    276|      return ret;
  175|    276|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    367|  }
  178|       |  // Create delta decoder.
  179|     92|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     92|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    368|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    154|      uint16_t bitstream_version) {
  143|    154|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    154|        method, attribute, transform, mesh_data, bitstream_version);
  145|    154|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    154|        uint16_t bitstream_version) {
  127|    154|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 149, False: 5]
  ------------------
  128|    149|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    149|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    149|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    149|                                                  mesh_data));
  132|    149|      }
  133|      5|      return nullptr;
  134|    154|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    131|      uint16_t bitstream_version) {
  143|    131|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    131|        method, attribute, transform, mesh_data, bitstream_version);
  145|    131|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    131|        uint16_t bitstream_version) {
  127|    131|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 127, False: 4]
  ------------------
  128|    127|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    127|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    127|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    127|                                                  mesh_data));
  132|    127|      }
  133|      4|      return nullptr;
  134|    131|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    427|                                 const PointCloudDecoder *decoder) {
  188|    427|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    427|      method, att_id, decoder, TransformT());
  190|    427|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    427|                                 const TransformT &transform) {
  156|    427|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 427]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    427|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    427|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 427, False: 0]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|    427|    const MeshDecoder *const mesh_decoder =
  167|    427|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    427|    auto ret = CreateMeshPredictionScheme<
  170|    427|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    427|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    427|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    427|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 307, False: 120]
  ------------------
  174|    307|      return ret;
  175|    307|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    427|  }
  178|       |  // Create delta decoder.
  179|    120|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    120|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    427|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    176|      uint16_t bitstream_version) {
  143|    176|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    176|        method, attribute, transform, mesh_data, bitstream_version);
  145|    176|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    176|        uint16_t bitstream_version) {
  111|    176|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 171, False: 5]
  ------------------
  112|    171|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    171|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    171|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    171|                                                  mesh_data));
  116|    171|      }
  117|      5|      return nullptr;
  118|    176|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    144|      uint16_t bitstream_version) {
  143|    144|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    144|        method, attribute, transform, mesh_data, bitstream_version);
  145|    144|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    144|        uint16_t bitstream_version) {
  111|    144|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 136, False: 8]
  ------------------
  112|    136|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    136|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    136|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    136|                                                  mesh_data));
  116|    136|      }
  117|      8|      return nullptr;
  118|    144|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  3.70k|                                 const PointCloudDecoder *decoder) {
  188|  3.70k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  3.70k|      method, att_id, decoder, TransformT());
  190|  3.70k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  3.70k|                                 const TransformT &transform) {
  156|  3.70k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 3.70k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  3.70k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  3.70k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 3.68k, False: 16]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|  3.68k|    const MeshDecoder *const mesh_decoder =
  167|  3.68k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  3.68k|    auto ret = CreateMeshPredictionScheme<
  170|  3.68k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  3.68k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  3.68k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  3.68k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 3.43k, False: 252]
  ------------------
  174|  3.43k|      return ret;
  175|  3.43k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  3.68k|  }
  178|       |  // Create delta decoder.
  179|    268|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    268|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  3.70k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.55k|      uint16_t bitstream_version) {
  143|  1.55k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.55k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.55k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.55k|        uint16_t bitstream_version) {
   53|  1.55k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 441, False: 1.11k]
  ------------------
   54|    441|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    441|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    441|                                                         MeshDataT>(
   57|    441|                attribute, transform, mesh_data));
   58|    441|      }
   59|  1.11k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.11k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 300, False: 816]
  ------------------
   61|    300|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    300|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    300|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    300|                                                  mesh_data));
   65|    300|      }
   66|    816|#endif
   67|    816|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 344, False: 472]
  ------------------
   68|    344|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    344|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    344|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    344|                                                  mesh_data));
   72|    344|      }
   73|    472|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    472|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 141, False: 331]
  ------------------
   75|    141|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    141|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    141|                                                     MeshDataT>(
   78|    141|                attribute, transform, mesh_data, bitstream_version));
   79|    141|      }
   80|    331|#endif
   81|    331|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 172, False: 159]
  ------------------
   82|    172|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    172|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    172|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    172|                                                  mesh_data));
   86|    172|      }
   87|    159|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    159|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 159, False: 0]
  ------------------
   89|    159|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    159|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    159|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    159|                                                  mesh_data));
   93|    159|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.55k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.87k|      uint16_t bitstream_version) {
  143|  1.87k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.87k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.87k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.87k|        uint16_t bitstream_version) {
   53|  1.87k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 458, False: 1.41k]
  ------------------
   54|    458|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    458|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    458|                                                         MeshDataT>(
   57|    458|                attribute, transform, mesh_data));
   58|    458|      }
   59|  1.41k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.41k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 393, False: 1.02k]
  ------------------
   61|    393|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    393|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    393|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    393|                                                  mesh_data));
   65|    393|      }
   66|  1.02k|#endif
   67|  1.02k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 354, False: 671]
  ------------------
   68|    354|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    354|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    354|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    354|                                                  mesh_data));
   72|    354|      }
   73|    671|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    671|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 133, False: 538]
  ------------------
   75|    133|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    133|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    133|                                                     MeshDataT>(
   78|    133|                attribute, transform, mesh_data, bitstream_version));
   79|    133|      }
   80|    538|#endif
   81|    538|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 179, False: 359]
  ------------------
   82|    179|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    179|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    179|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    179|                                                  mesh_data));
   86|    179|      }
   87|    359|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    359|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 359, False: 0]
  ------------------
   89|    359|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    359|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    359|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    359|                                                  mesh_data));
   93|    359|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.87k|    }

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     71|    const PointIndex *) {
   50|     71|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     71|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     71|  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|  31.1M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 31.1M, False: 71]
  ------------------
   57|  31.1M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  31.1M|                                           in_corr + i, out_data + i);
   59|  31.1M|  }
   60|     71|  return true;
   61|     71|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     95|    const PointIndex *) {
   50|     95|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     95|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     95|  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|  3.71M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 3.71M, False: 95]
  ------------------
   57|  3.71M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  3.71M|                                           in_corr + i, out_data + i);
   59|  3.71M|  }
   60|     95|  return true;
   61|     95|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    268|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    229|    const PointIndex *) {
   50|    229|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    229|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    229|  this->transform().ComputeOriginalValue(zero_vals.get(), in_corr, out_data);
   54|       |
   55|       |  // Decode data from the front using D(i) = D(i) + D(i - 1).
   56|  1.03M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 1.03M, False: 229]
  ------------------
   57|  1.03M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  1.03M|                                           in_corr + i, out_data + i);
   59|  1.03M|  }
   60|    229|  return true;
   61|    229|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     92|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    120|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    367|    uint16_t bitstream_version) {
   38|    367|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    367|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 367, False: 0]
  ------------------
   40|    367|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 7, False: 360]
  ------------------
   41|    360|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 10, False: 350]
  ------------------
   42|    350|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 350]
  ------------------
   43|    350|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 19, False: 331]
  ------------------
   44|    331|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 276, False: 55]
  ------------------
   45|    313|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 1, False: 54]
  ------------------
   46|    313|    const CornerTable *const ct = source->GetCornerTable();
   47|    313|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    313|        source->GetAttributeEncodingData(att_id);
   49|    313|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 28, False: 285]
  |  Branch (49:26): [True: 0, False: 285]
  ------------------
   50|       |      // No connectivity data found.
   51|     28|      return nullptr;
   52|     28|    }
   53|       |    // Connectivity data exists.
   54|    285|    const MeshAttributeCornerTable *const att_ct =
   55|    285|        source->GetAttributeCornerTable(att_id);
   56|    285|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 154, False: 131]
  ------------------
   57|    154|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    154|      MeshData md;
   59|    154|      md.Set(source->mesh(), att_ct,
   60|    154|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    154|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    154|      MeshPredictionSchemeFactoryT factory;
   63|    154|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    154|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 149, False: 5]
  ------------------
   65|    149|        return ret;
   66|    149|      }
   67|    154|    } else {
   68|    131|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    131|      MeshData md;
   70|    131|      md.Set(source->mesh(), ct,
   71|    131|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    131|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    131|      MeshPredictionSchemeFactoryT factory;
   74|    131|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    131|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 127, False: 4]
  ------------------
   76|    127|        return ret;
   77|    127|      }
   78|    131|    }
   79|    285|  }
   80|     63|  return nullptr;
   81|    367|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    427|    uint16_t bitstream_version) {
   38|    427|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    427|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 427, False: 0]
  ------------------
   40|    427|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 15, False: 412]
  ------------------
   41|    412|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 24, False: 388]
  ------------------
   42|    388|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 5, False: 383]
  ------------------
   43|    383|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 2, False: 381]
  ------------------
   44|    381|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 307, False: 74]
  ------------------
   45|    355|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 2, False: 72]
  ------------------
   46|    355|    const CornerTable *const ct = source->GetCornerTable();
   47|    355|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    355|        source->GetAttributeEncodingData(att_id);
   49|    355|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 35, False: 320]
  |  Branch (49:26): [True: 0, False: 320]
  ------------------
   50|       |      // No connectivity data found.
   51|     35|      return nullptr;
   52|     35|    }
   53|       |    // Connectivity data exists.
   54|    320|    const MeshAttributeCornerTable *const att_ct =
   55|    320|        source->GetAttributeCornerTable(att_id);
   56|    320|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 176, False: 144]
  ------------------
   57|    176|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    176|      MeshData md;
   59|    176|      md.Set(source->mesh(), att_ct,
   60|    176|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    176|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    176|      MeshPredictionSchemeFactoryT factory;
   63|    176|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    176|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 171, False: 5]
  ------------------
   65|    171|        return ret;
   66|    171|      }
   67|    176|    } else {
   68|    144|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    144|      MeshData md;
   70|    144|      md.Set(source->mesh(), ct,
   71|    144|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    144|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    144|      MeshPredictionSchemeFactoryT factory;
   74|    144|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    144|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 136, False: 8]
  ------------------
   76|    136|        return ret;
   77|    136|      }
   78|    144|    }
   79|    320|  }
   80|     85|  return nullptr;
   81|    427|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  3.68k|    uint16_t bitstream_version) {
   38|  3.68k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  3.68k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 3.68k, False: 0]
  ------------------
   40|  3.68k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 916, False: 2.76k]
  ------------------
   41|  2.76k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 700, False: 2.06k]
  ------------------
   42|  2.06k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 710, False: 1.35k]
  ------------------
   43|  1.35k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 354, False: 1.00k]
  ------------------
   44|  1.00k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 519, False: 486]
  ------------------
   45|  3.47k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 275, False: 211]
  ------------------
   46|  3.47k|    const CornerTable *const ct = source->GetCornerTable();
   47|  3.47k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  3.47k|        source->GetAttributeEncodingData(att_id);
   49|  3.47k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 41, False: 3.43k]
  |  Branch (49:26): [True: 0, False: 3.43k]
  ------------------
   50|       |      // No connectivity data found.
   51|     41|      return nullptr;
   52|     41|    }
   53|       |    // Connectivity data exists.
   54|  3.43k|    const MeshAttributeCornerTable *const att_ct =
   55|  3.43k|        source->GetAttributeCornerTable(att_id);
   56|  3.43k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.55k, False: 1.87k]
  ------------------
   57|  1.55k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.55k|      MeshData md;
   59|  1.55k|      md.Set(source->mesh(), att_ct,
   60|  1.55k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.55k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.55k|      MeshPredictionSchemeFactoryT factory;
   63|  1.55k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.55k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.55k, False: 0]
  ------------------
   65|  1.55k|        return ret;
   66|  1.55k|      }
   67|  1.87k|    } else {
   68|  1.87k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  1.87k|      MeshData md;
   70|  1.87k|      md.Set(source->mesh(), ct,
   71|  1.87k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  1.87k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  1.87k|      MeshPredictionSchemeFactoryT factory;
   74|  1.87k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  1.87k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 1.87k, False: 0]
  ------------------
   76|  1.87k|        return ret;
   77|  1.87k|      }
   78|  1.87k|    }
   79|  3.43k|  }
   80|    211|  return nullptr;
   81|  3.68k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  4.16M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  4.16M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 1.12M, False: 3.03M]
  |  Branch (93:22): [True: 363k, False: 762k]
  ------------------
   94|   363k|      return true;
   95|   363k|    }
   96|  3.80M|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 1.89M, False: 1.90M]
  |  Branch (96:25): [True: 1.48M, False: 411k]
  ------------------
   97|  4.16M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  4.16M|  int32_t GetRotationCount(Point2 pred) const {
   51|  4.16M|    const DataType sign_x = pred[0];
   52|  4.16M|    const DataType sign_y = pred[1];
   53|       |
   54|  4.16M|    int32_t rotation_count = 0;
   55|  4.16M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 1.12M, False: 3.03M]
  ------------------
   56|  1.12M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 363k, False: 762k]
  ------------------
   57|   363k|        rotation_count = 0;
   58|   762k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 382k, False: 379k]
  ------------------
   59|   382k|        rotation_count = 3;
   60|   382k|      } else {
   61|   379k|        rotation_count = 1;
   62|   379k|      }
   63|  3.03M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 1.14M, False: 1.89M]
  ------------------
   64|  1.14M|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 1.11M, False: 33.5k]
  ------------------
   65|  1.11M|        rotation_count = 2;
   66|  1.11M|      } else {
   67|  33.5k|        rotation_count = 1;
   68|  33.5k|      }
   69|  1.89M|    } else {
   70|  1.89M|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 1.48M, False: 411k]
  ------------------
   71|  1.48M|        rotation_count = 0;
   72|  1.48M|      } else {
   73|   411k|        rotation_count = 3;
   74|   411k|      }
   75|  1.89M|    }
   76|  4.16M|    return rotation_count;
   77|  4.16M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|  4.64M|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|  4.64M|    switch (rotation_count) {
   81|  1.20M|      case 1:
  ------------------
  |  Branch (81:7): [True: 1.20M, False: 3.43M]
  ------------------
   82|  1.20M|        return Point2(p[1], -p[0]);
   83|  2.22M|      case 2:
  ------------------
  |  Branch (83:7): [True: 2.22M, False: 2.41M]
  ------------------
   84|  2.22M|        return Point2(-p[0], -p[1]);
   85|  1.20M|      case 3:
  ------------------
  |  Branch (85:7): [True: 1.20M, False: 3.43M]
  ------------------
   86|  1.20M|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 4.64M]
  ------------------
   88|      0|        return p;
   89|  4.64M|    }
   90|  4.64M|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    427|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

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

_ZN5draco26SequentialAttributeDecoderC2Ev:
   20|  13.0k|    : decoder_(nullptr), attribute_(nullptr), attribute_id_(-1) {}
_ZN5draco26SequentialAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   23|  13.0k|                                      int attribute_id) {
   24|  13.0k|  decoder_ = decoder;
   25|  13.0k|  attribute_ = decoder->point_cloud()->attribute(attribute_id);
   26|  13.0k|  attribute_id_ = attribute_id;
   27|  13.0k|  return true;
   28|  13.0k|}
_ZN5draco26SequentialAttributeDecoder23DecodePortableAttributeERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   38|  7.95k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   39|  7.95k|  if (attribute_->num_components() <= 0 ||
  ------------------
  |  Branch (39:7): [True: 0, False: 7.95k]
  ------------------
   40|  7.95k|      !attribute_->Reset(point_ids.size())) {
  ------------------
  |  Branch (40:7): [True: 0, False: 7.95k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  7.95k|  if (!DecodeValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (43:7): [True: 1.77k, False: 6.17k]
  ------------------
   44|  1.77k|    return false;
   45|  1.77k|  }
   46|  6.17k|  return true;
   47|  7.95k|}
_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|    147|    const std::vector<PointIndex> &point_ids) {
   57|       |  // Default implementation does not apply any transform.
   58|    147|  return true;
   59|    147|}
_ZN5draco26SequentialAttributeDecoder20GetPortableAttributeEv:
   61|  4.99k|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.99k|  if (!attribute_->is_mapping_identity() && portable_attribute_ &&
  ------------------
  |  Branch (64:7): [True: 4.11k, False: 884]
  |  Branch (64:45): [True: 3.98k, False: 134]
  ------------------
   65|  3.98k|      portable_attribute_->is_mapping_identity()) {
  ------------------
  |  Branch (65:7): [True: 3.11k, False: 863]
  ------------------
   66|  3.11k|    portable_attribute_->SetExplicitMapping(attribute_->indices_map_size());
   67|  3.11k|    for (PointIndex i(0);
   68|  19.9M|         i < static_cast<uint32_t>(attribute_->indices_map_size()); ++i) {
  ------------------
  |  Branch (68:10): [True: 19.9M, False: 3.11k]
  ------------------
   69|  19.9M|      portable_attribute_->SetPointMapEntry(i, attribute_->mapped_index(i));
   70|  19.9M|    }
   71|  3.11k|  }
   72|  4.99k|  return portable_attribute_.get();
   73|  4.99k|}
_ZN5draco26SequentialAttributeDecoder20InitPredictionSchemeEPNS_25PredictionSchemeInterfaceE:
   76|  4.49k|    PredictionSchemeInterface *ps) {
   77|  6.20k|  for (int i = 0; i < ps->GetNumParentAttributes(); ++i) {
  ------------------
  |  Branch (77:19): [True: 1.72k, False: 4.47k]
  ------------------
   78|  1.72k|    const int att_id = decoder_->point_cloud()->GetNamedAttributeId(
   79|  1.72k|        ps->GetParentAttributeType(i));
   80|  1.72k|    if (att_id == -1) {
  ------------------
  |  Branch (80:9): [True: 1, False: 1.72k]
  ------------------
   81|      1|      return false;  // Requested attribute does not exist.
   82|      1|    }
   83|  1.72k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   84|  1.72k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.72k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:9): [True: 0, False: 1.72k]
  ------------------
   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.72k|#endif
   90|  1.72k|    {
   91|  1.72k|      const PointAttribute *const pa = decoder_->GetPortableAttribute(att_id);
   92|  1.72k|      if (pa == nullptr || !ps->SetParentAttribute(pa)) {
  ------------------
  |  Branch (92:11): [True: 4, False: 1.72k]
  |  Branch (92:28): [True: 17, False: 1.70k]
  ------------------
   93|     21|        return false;
   94|     21|      }
   95|  1.72k|    }
   96|  1.72k|  }
   97|  4.47k|  return true;
   98|  4.49k|}
_ZN5draco26SequentialAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  101|    686|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  102|    686|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
  103|    686|  const int entry_size = static_cast<int>(attribute_->byte_stride());
  104|    686|  std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
  105|    686|  uint8_t *const value_data = value_data_ptr.get();
  106|    686|  int out_byte_pos = 0;
  107|       |  // Decode raw attribute values in their original format.
  108|  17.1k|  for (int i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (108:19): [True: 16.6k, False: 505]
  ------------------
  109|  16.6k|    if (!in_buffer->Decode(value_data, entry_size)) {
  ------------------
  |  Branch (109:9): [True: 181, False: 16.4k]
  ------------------
  110|    181|      return false;
  111|    181|    }
  112|  16.4k|    attribute_->buffer()->Write(out_byte_pos, value_data, entry_size);
  113|  16.4k|    out_byte_pos += entry_size;
  114|  16.4k|  }
  115|    505|  return true;
  116|    686|}

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  6.00k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  79.0M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  4.49k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  22.0k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  6.83k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  6.83k|    portable_attribute_ = std::move(att);
   71|  6.83k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  23.6k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  13.0k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  11.1k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  4.99k|    DecoderBuffer *buffer) {
   30|  4.99k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 97, False: 4.89k]
  ------------------
   31|     97|    return false;
   32|     97|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  4.89k|  const int32_t num_attributes = GetNumAttributes();
   35|  4.89k|  sequential_decoders_.resize(num_attributes);
   36|  17.9k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 13.0k, False: 4.86k]
  ------------------
   37|  13.0k|    uint8_t decoder_type;
   38|  13.0k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 8, False: 13.0k]
  ------------------
   39|      8|      return false;
   40|      8|    }
   41|       |    // Create the decoder from the id.
   42|  13.0k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  13.0k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 15, False: 13.0k]
  ------------------
   44|     15|      return false;
   45|     15|    }
   46|  13.0k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 4, False: 13.0k]
  ------------------
   47|      4|      return false;
   48|      4|    }
   49|  13.0k|  }
   50|  4.86k|  return true;
   51|  4.89k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  3.40k|    DecoderBuffer *buffer) {
   55|  3.40k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 3.40k]
  |  Branch (55:22): [True: 0, False: 3.40k]
  ------------------
   56|      0|    return false;
   57|      0|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  3.40k|  const int32_t num_attributes = GetNumAttributes();
   60|  14.7k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 11.3k, False: 3.40k]
  ------------------
   61|  11.3k|    PointAttribute *const pa =
   62|  11.3k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  11.3k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 1, False: 11.3k]
  ------------------
   64|      1|      return false;
   65|      1|    }
   66|  11.3k|  }
   67|  3.40k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  3.40k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  3.40k|    DecoderBuffer *in_buffer) {
   72|  3.40k|  const int32_t num_attributes = GetNumAttributes();
   73|  9.57k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 7.95k, False: 1.62k]
  ------------------
   74|  7.95k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 1.77k, False: 6.17k]
  ------------------
   75|  7.95k|                                                          in_buffer)) {
   76|  1.77k|      return false;
   77|  1.77k|    }
   78|  7.95k|  }
   79|  1.62k|  return true;
   80|  3.40k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  1.62k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  1.62k|  const int32_t num_attributes = GetNumAttributes();
   85|  4.33k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 3.01k, False: 1.31k]
  ------------------
   86|  3.01k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 308, False: 2.70k]
  ------------------
   87|  3.01k|            point_ids_, in_buffer)) {
   88|    308|      return false;
   89|    308|    }
   90|  3.01k|  }
   91|  1.31k|  return true;
   92|  1.62k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  1.31k|    TransformAttributesToOriginalFormat() {
   96|  1.31k|  const int32_t num_attributes = GetNumAttributes();
   97|  3.30k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 2.36k, False: 940]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  2.36k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 2.36k, False: 0]
  ------------------
  100|  2.36k|      const PointAttribute *const attribute =
  101|  2.36k|          sequential_decoders_[i]->attribute();
  102|  2.36k|      const PointAttribute *const portable_attribute =
  103|  2.36k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  2.36k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 2.21k, False: 147]
  |  Branch (104:11): [True: 0, False: 2.36k]
  ------------------
  105|  2.21k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 0, False: 2.21k]
  ------------------
  106|  2.21k|              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.36k|    }
  116|  2.36k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 378, False: 1.98k]
  ------------------
  117|  2.36k|            point_ids_)) {
  118|    378|      return false;
  119|    378|    }
  120|  2.36k|  }
  121|    940|  return true;
  122|  1.31k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  13.0k|    uint8_t decoder_type) {
  127|  13.0k|  switch (decoder_type) {
  128|  1.62k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.62k, False: 11.4k]
  ------------------
  129|  1.62k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.62k|          new SequentialAttributeDecoder());
  131|  9.92k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 9.92k, False: 3.15k]
  ------------------
  132|  9.92k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  9.92k|          new SequentialIntegerAttributeDecoder());
  134|    503|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 503, False: 12.5k]
  ------------------
  135|    503|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    503|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.01k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.01k, False: 12.0k]
  ------------------
  139|  1.01k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.01k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     15|    default:
  ------------------
  |  Branch (142:5): [True: 15, False: 13.0k]
  ------------------
  143|     15|      break;
  144|  13.0k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     15|  return nullptr;
  147|  13.0k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  11.4k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  11.4k|                                             int attribute_id) {
   27|  11.4k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 11.4k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  11.4k|  return true;
   31|  11.4k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  2.21k|    const std::vector<PointIndex> &point_ids) {
   35|  2.21k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  2.21k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 2.21k, False: 0]
  ------------------
   37|  2.21k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.21k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 1, False: 2.21k]
  ------------------
   38|      1|    return true;  // Don't revert the transform here for older files.
   39|      1|  }
   40|  2.21k|#endif
   41|  2.21k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  2.21k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  7.26k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  7.26k|  int8_t prediction_scheme_method;
   48|  7.26k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 107, False: 7.15k]
  ------------------
   49|    107|    return false;
   50|    107|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  7.15k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 55, False: 7.10k]
  ------------------
   53|  7.10k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 142, False: 6.96k]
  ------------------
   54|    197|    return false;
   55|    197|  }
   56|  6.96k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 6.88k, False: 80]
  ------------------
   57|  6.88k|    int8_t prediction_transform_type;
   58|  6.88k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 30, False: 6.85k]
  ------------------
   59|     30|      return false;
   60|     30|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  6.85k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 16, False: 6.83k]
  ------------------
   63|  6.83k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 58, False: 6.77k]
  ------------------
   64|     74|      return false;
   65|     74|    }
   66|  6.77k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  6.77k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  6.77k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  6.77k|  }
   70|       |
   71|  6.85k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 4.49k, False: 2.36k]
  ------------------
   72|  4.49k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 22, False: 4.47k]
  ------------------
   73|     22|      return false;
   74|     22|    }
   75|  4.49k|  }
   76|       |
   77|  6.83k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 1.16k, False: 5.66k]
  ------------------
   78|  1.16k|    return false;
   79|  1.16k|  }
   80|       |
   81|  5.66k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  5.66k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  5.66k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 5.66k, False: 0]
  ------------------
   84|  5.66k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  5.66k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 1, False: 5.66k]
  ------------------
   85|       |    // For older files, revert the transform right after we decode the data.
   86|      1|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 1]
  ------------------
   87|      0|      return false;
   88|      0|    }
   89|      1|  }
   90|  5.66k|#endif
   91|  5.66k|  return true;
   92|  5.66k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  5.93k|    PredictionSchemeTransformType transform_type) {
   98|  5.93k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 2.23k, False: 3.70k]
  ------------------
   99|  2.23k|    return nullptr;  // For now we support only wrap transform.
  100|  2.23k|  }
  101|  3.70k|  return CreatePredictionSchemeForDecoder<
  102|  3.70k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  3.70k|      method, attribute_id(), decoder());
  104|  5.93k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  6.83k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  6.83k|  const int num_components = GetNumValueComponents();
  109|  6.83k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 6.83k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  6.83k|  const size_t num_entries = point_ids.size();
  113|  6.83k|  const size_t num_values = num_entries * num_components;
  114|  6.83k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  6.83k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  6.83k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 1, False: 6.83k]
  ------------------
  117|      1|    return false;
  118|      1|  }
  119|  6.83k|  uint8_t compressed;
  120|  6.83k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 21, False: 6.81k]
  ------------------
  121|     21|    return false;
  122|     21|  }
  123|  6.81k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 572, False: 6.24k]
  ------------------
  124|       |    // Decode compressed values.
  125|    572|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 210, False: 362]
  ------------------
  126|    572|                       in_buffer,
  127|    572|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    210|      return false;
  129|    210|    }
  130|  6.24k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  6.24k|    uint8_t num_bytes;
  134|  6.24k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 4, False: 6.23k]
  ------------------
  135|      4|      return false;
  136|      4|    }
  137|  6.23k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 214, False: 6.02k]
  ------------------
  138|    214|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 214]
  ------------------
  139|    214|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    214|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 1, False: 213]
  ------------------
  143|    214|                             sizeof(int32_t) * num_values)) {
  144|      1|        return false;
  145|      1|      }
  146|  6.02k|    } else {
  147|  6.02k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 18, False: 6.00k]
  ------------------
  148|  6.02k|          num_bytes * num_values) {
  149|     18|        return false;
  150|     18|      }
  151|  6.00k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 26, False: 5.97k]
  ------------------
  152|  6.00k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     26|        return false;
  154|     26|      }
  155|   644M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 644M, False: 5.97k]
  ------------------
  156|   644M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 644M]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|   644M|      }
  160|  5.97k|    }
  161|  6.23k|  }
  162|       |
  163|  6.55k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 6.55k, False: 0]
  |  Branch (163:26): [True: 2.24k, False: 4.31k]
  ------------------
  164|  5.78k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 3.54k, False: 765]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  5.78k|    ConvertSymbolsToSignedInts(
  167|  5.78k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  5.78k|        static_cast<int>(num_values), portable_attribute_data);
  169|  5.78k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  6.55k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 4.31k, False: 2.24k]
  ------------------
  173|  4.31k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 537, False: 3.77k]
  ------------------
  174|    537|      return false;
  175|    537|    }
  176|       |
  177|  3.77k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 3.77k, False: 0]
  ------------------
  178|  3.77k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 350, False: 3.42k]
  ------------------
  179|  3.77k|              portable_attribute_data, portable_attribute_data,
  180|  3.77k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    350|        return false;
  182|    350|      }
  183|  3.77k|    }
  184|  3.77k|  }
  185|  5.66k|  return true;
  186|  6.55k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  1.91k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  1.91k|  switch (attribute()->data_type()) {
  190|    217|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 217, False: 1.70k]
  ------------------
  191|    217|      StoreTypedValues<uint8_t>(num_values);
  192|    217|      break;
  193|    856|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 856, False: 1.06k]
  ------------------
  194|    856|      StoreTypedValues<int8_t>(num_values);
  195|    856|      break;
  196|     70|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 70, False: 1.84k]
  ------------------
  197|     70|      StoreTypedValues<uint16_t>(num_values);
  198|     70|      break;
  199|    298|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 298, False: 1.62k]
  ------------------
  200|    298|      StoreTypedValues<int16_t>(num_values);
  201|    298|      break;
  202|    213|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 213, False: 1.70k]
  ------------------
  203|    213|      StoreTypedValues<uint32_t>(num_values);
  204|    213|      break;
  205|     78|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 78, False: 1.84k]
  ------------------
  206|     78|      StoreTypedValues<int32_t>(num_values);
  207|     78|      break;
  208|    186|    default:
  ------------------
  |  Branch (208:5): [True: 186, False: 1.73k]
  ------------------
  209|    186|      return false;
  210|  1.91k|  }
  211|  1.73k|  return true;
  212|  1.91k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  6.83k|    int num_entries, int num_components) {
  237|  6.83k|  GeometryAttribute ga;
  238|  6.83k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  6.83k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  6.83k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  6.83k|  port_att->SetIdentityMapping();
  242|  6.83k|  port_att->Reset(num_entries);
  243|  6.83k|  port_att->set_unique_id(attribute()->unique_id());
  244|  6.83k|  SetPortableAttribute(std::move(port_att));
  245|  6.83k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    217|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    217|  const int num_components = attribute()->num_components();
  217|    217|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    217|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    217|      new AttributeTypeT[num_components]);
  220|    217|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    217|  int val_id = 0;
  222|    217|  int out_byte_pos = 0;
  223|  69.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 69.7M, False: 217]
  ------------------
  224|   178M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 108M, False: 69.7M]
  ------------------
  225|   108M|      const AttributeTypeT value =
  226|   108M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   108M|      att_val[c] = value;
  228|   108M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  69.7M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  69.7M|    out_byte_pos += entry_size;
  232|  69.7M|  }
  233|    217|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|    856|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    856|  const int num_components = attribute()->num_components();
  217|    856|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    856|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    856|      new AttributeTypeT[num_components]);
  220|    856|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    856|  int val_id = 0;
  222|    856|  int out_byte_pos = 0;
  223|  4.78M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 4.78M, False: 856]
  ------------------
  224|  55.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 51.0M, False: 4.78M]
  ------------------
  225|  51.0M|      const AttributeTypeT value =
  226|  51.0M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  51.0M|      att_val[c] = value;
  228|  51.0M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  4.78M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  4.78M|    out_byte_pos += entry_size;
  232|  4.78M|  }
  233|    856|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|     70|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     70|  const int num_components = attribute()->num_components();
  217|     70|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     70|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     70|      new AttributeTypeT[num_components]);
  220|     70|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     70|  int val_id = 0;
  222|     70|  int out_byte_pos = 0;
  223|   156k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 156k, False: 70]
  ------------------
  224|  12.9M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 12.7M, False: 156k]
  ------------------
  225|  12.7M|      const AttributeTypeT value =
  226|  12.7M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  12.7M|      att_val[c] = value;
  228|  12.7M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   156k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   156k|    out_byte_pos += entry_size;
  232|   156k|  }
  233|     70|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    298|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    298|  const int num_components = attribute()->num_components();
  217|    298|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    298|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    298|      new AttributeTypeT[num_components]);
  220|    298|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    298|  int val_id = 0;
  222|    298|  int out_byte_pos = 0;
  223|  2.35M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 2.35M, False: 298]
  ------------------
  224|   123M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 121M, False: 2.35M]
  ------------------
  225|   121M|      const AttributeTypeT value =
  226|   121M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   121M|      att_val[c] = value;
  228|   121M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  2.35M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  2.35M|    out_byte_pos += entry_size;
  232|  2.35M|  }
  233|    298|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    213|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    213|  const int num_components = attribute()->num_components();
  217|    213|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    213|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    213|      new AttributeTypeT[num_components]);
  220|    213|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    213|  int val_id = 0;
  222|    213|  int out_byte_pos = 0;
  223|  1.79M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.79M, False: 213]
  ------------------
  224|   105M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 103M, False: 1.79M]
  ------------------
  225|   103M|      const AttributeTypeT value =
  226|   103M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   103M|      att_val[c] = value;
  228|   103M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.79M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.79M|    out_byte_pos += entry_size;
  232|  1.79M|  }
  233|    213|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|     78|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     78|  const int num_components = attribute()->num_components();
  217|     78|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     78|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     78|      new AttributeTypeT[num_components]);
  220|     78|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     78|  int val_id = 0;
  222|     78|  int out_byte_pos = 0;
  223|   182k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 182k, False: 78]
  ------------------
  224|  12.1M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 11.9M, False: 182k]
  ------------------
  225|  11.9M|      const AttributeTypeT value =
  226|  11.9M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  11.9M|      att_val[c] = value;
  228|  11.9M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   182k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   182k|    out_byte_pos += entry_size;
  232|   182k|  }
  233|     78|}

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  3.99M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  3.99M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  3.99M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  3.99M|    const int remaining = 32 - num_used_bits_;
   54|  3.99M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 3.75M, False: 238k]
  ------------------
   55|  3.75M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 3.36M, False: 391k]
  ------------------
   56|  3.36M|        return false;
   57|  3.36M|      }
   58|   391k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   391k|      num_used_bits_ += nbits;
   60|   391k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 13.2k, False: 378k]
  ------------------
   61|  13.2k|        ++pos_;
   62|  13.2k|        num_used_bits_ = 0;
   63|  13.2k|      }
   64|   391k|    } else {
   65|   238k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 227k, False: 10.9k]
  ------------------
   66|   227k|        return false;
   67|   227k|      }
   68|  10.9k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  10.9k|      num_used_bits_ = nbits - remaining;
   70|  10.9k|      ++pos_;
   71|  10.9k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  10.9k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  10.9k|    }
   74|   402k|    return true;
   75|  3.99M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  5.83M|  bool DecodeNextBit() {
   35|  5.83M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  5.83M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 5.45M, False: 375k]
  ------------------
   37|  5.45M|      return false;
   38|  5.45M|    }
   39|   375k|    const bool bit = *pos_ & selector;
   40|   375k|    ++num_used_bits_;
   41|   375k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 11.5k, False: 363k]
  ------------------
   42|  11.5k|      ++pos_;
   43|  11.5k|      num_used_bits_ = 0;
   44|  11.5k|    }
   45|   375k|    return bit;
   46|  5.83M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    566|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    456|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    355|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  9.55k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 9.28k, False: 265]
  ------------------
   35|  9.28k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 90, False: 9.19k]
  ------------------
   36|     90|        return false;
   37|     90|      }
   38|  9.28k|    }
   39|    265|    return bit_decoder_.StartDecoding(source_buffer);
   40|    355|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  2.84M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  2.84M|    uint32_t result = 0;
   49|  18.1M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 15.2M, False: 2.84M]
  ------------------
   50|  15.2M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  15.2M|      result = (result << 1) + bit;
   52|  15.2M|    }
   53|  2.84M|    *value = result;
   54|  2.84M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     82|  void EndDecoding() {
   57|  2.70k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 2.62k, False: 82]
  ------------------
   58|  2.62k|      folded_number_decoders_[i].EndDecoding();
   59|  2.62k|    }
   60|     82|    bit_decoder_.EndDecoding();
   61|     82|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    456|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  39.6k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  25.8k|                                const uint8_t *const buf, int offset) {
  301|  25.8k|  unsigned x;
  302|  25.8k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 38, False: 25.7k]
  ------------------
  303|     38|    return 1;
  304|     38|  }
  305|  25.7k|  ans->buf = buf;
  306|  25.7k|  x = buf[offset - 1] >> 6;
  307|  25.7k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 23.0k, False: 2.76k]
  ------------------
  308|  23.0k|    ans->buf_offset = offset - 1;
  309|  23.0k|    ans->state = buf[offset - 1] & 0x3F;
  310|  23.0k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.49k, False: 275]
  ------------------
  311|  2.49k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 3, False: 2.49k]
  ------------------
  312|      3|      return 1;
  313|      3|    }
  314|  2.49k|    ans->buf_offset = offset - 2;
  315|  2.49k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.49k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 266, False: 9]
  ------------------
  317|    266|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 2, False: 264]
  ------------------
  318|      2|      return 1;
  319|      2|    }
  320|    264|    ans->buf_offset = offset - 3;
  321|    264|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    264|  } else {
  323|      9|    return 1;
  324|      9|  }
  325|  25.7k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  25.7k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  25.7k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  25.7k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  25.7k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 5, False: 25.7k]
  ------------------
  327|      5|    return 1;
  328|      5|  }
  329|  25.7k|  return 0;
  330|  25.7k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.49k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.49k|  uint32_t val;
   69|  2.49k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.49k|  val = mem[1] << 8;
   72|  2.49k|  val |= mem[0];
   73|  2.49k|  return val;
   74|  2.49k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    264|static uint32_t mem_get_le24(const void *vmem) {
   77|    264|  uint32_t val;
   78|    264|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    264|  val = mem[2] << 16;
   81|    264|  val |= mem[1] << 8;
   82|    264|  val |= mem[0];
   83|    264|  return val;
   84|    264|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  11.4G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  11.4G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  11.4G|  unsigned quot, rem, x, xn;
  172|  11.4G|#endif
  173|  11.4G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  11.4G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  11.4G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  22.8G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 10.5G, False: 924M]
  |  Branch (174:40): [True: 84.3k, False: 10.5G]
  ------------------
  175|  84.3k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  84.3k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  84.3k|  }
  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|  11.4G|  x = ans->state;
  184|  11.4G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  11.4G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  11.4G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  11.4G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  11.4G|  xn = quot * p;
  187|  11.4G|  val = rem < p;
  188|  11.4G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  22.8G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 10.5G, False: 920M]
  |  |  ------------------
  ------------------
  189|  10.5G|    ans->state = xn + rem;
  190|  10.5G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   920M|    ans->state = x - xn - p;
  193|   920M|  }
  194|  11.4G|#endif
  195|  11.4G|  return val;
  196|  11.4G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  60.3k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  60.3k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  60.3k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  60.3k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  3.16k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  1.85k|                                       uint32_t num_symbols) {
  482|  1.85k|    lut_table_.resize(rans_precision);
  483|  1.85k|    probability_table_.resize(num_symbols);
  484|  1.85k|    uint32_t cum_prob = 0;
  485|  1.85k|    uint32_t act_prob = 0;
  486|  14.9k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 13.2k, False: 1.69k]
  ------------------
  487|  13.2k|      probability_table_[i].prob = token_probs[i];
  488|  13.2k|      probability_table_[i].cum_prob = cum_prob;
  489|  13.2k|      cum_prob += token_probs[i];
  490|  13.2k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 160, False: 13.0k]
  ------------------
  491|    160|        return false;
  492|    160|      }
  493|  6.40M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 6.39M, False: 13.0k]
  ------------------
  494|  6.39M|        lut_table_[j] = i;
  495|  6.39M|      }
  496|  13.0k|      act_prob = cum_prob;
  497|  13.0k|    }
  498|  1.69k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 172, False: 1.52k]
  ------------------
  499|    172|      return false;
  500|    172|    }
  501|  1.52k|    return true;
  502|  1.69k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.35k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.35k|    unsigned x;
  423|  1.35k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 93, False: 1.26k]
  ------------------
  424|     93|      return 1;
  425|     93|    }
  426|  1.26k|    ans_.buf = buf;
  427|  1.26k|    x = buf[offset - 1] >> 6;
  428|  1.26k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 800, False: 462]
  ------------------
  429|    800|      ans_.buf_offset = offset - 1;
  430|    800|      ans_.state = buf[offset - 1] & 0x3F;
  431|    800|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 165, False: 297]
  ------------------
  432|    165|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 27, False: 138]
  ------------------
  433|     27|        return 1;
  434|     27|      }
  435|    138|      ans_.buf_offset = offset - 2;
  436|    138|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    297|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 202, False: 95]
  ------------------
  438|    202|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 42, False: 160]
  ------------------
  439|     42|        return 1;
  440|     42|      }
  441|    160|      ans_.buf_offset = offset - 3;
  442|    160|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    160|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 95, False: 0]
  ------------------
  444|     95|      ans_.buf_offset = offset - 4;
  445|     95|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     95|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.19k|    ans_.state += l_rans_base;
  450|  1.19k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.19k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 94, False: 1.09k]
  ------------------
  451|     94|      return 1;
  452|     94|    }
  453|  1.09k|    return 0;
  454|  1.19k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    240|static uint32_t mem_get_le16(const void *vmem) {
   68|    240|  uint32_t val;
   69|    240|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    240|  val = mem[1] << 8;
   72|    240|  val |= mem[0];
   73|    240|  return val;
   74|    240|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    246|static uint32_t mem_get_le24(const void *vmem) {
   77|    246|  uint32_t val;
   78|    246|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    246|  val = mem[2] << 16;
   81|    246|  val |= mem[1] << 8;
   82|    246|  val |= mem[0];
   83|    246|  return val;
   84|    246|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    291|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    291|  uint32_t val;
   88|    291|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    291|  val = mem[3] << 24;
   91|    291|  val |= mem[2] << 16;
   92|    291|  val |= mem[1] << 8;
   93|    291|  val |= mem[0];
   94|    291|  return val;
   95|    291|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|   301M|  inline int rans_read() {
  463|   301M|    unsigned rem;
  464|   301M|    unsigned quo;
  465|   301M|    struct rans_dec_sym sym;
  466|   301M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 271M, False: 29.2M]
  |  Branch (466:40): [True: 21.9k, False: 271M]
  ------------------
  467|  21.9k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  21.9k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  21.9k|    }
  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|   301M|    quo = ans_.state / rans_precision;
  472|   301M|    rem = ans_.state % rans_precision;
  473|   301M|    fetch_sym(&sym, rem);
  474|   301M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   301M|    return sym.val;
  476|   301M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|   301M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   301M|    uint32_t symbol = lut_table_[rem];
  507|   301M|    out->val = symbol;
  508|   301M|    out->prob = probability_table_[symbol].prob;
  509|   301M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   301M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|  1.05k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    242|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    155|                                       uint32_t num_symbols) {
  482|    155|    lut_table_.resize(rans_precision);
  483|    155|    probability_table_.resize(num_symbols);
  484|    155|    uint32_t cum_prob = 0;
  485|    155|    uint32_t act_prob = 0;
  486|  4.00k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.86k, False: 144]
  ------------------
  487|  3.86k|      probability_table_[i].prob = token_probs[i];
  488|  3.86k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.86k|      cum_prob += token_probs[i];
  490|  3.86k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 11, False: 3.85k]
  ------------------
  491|     11|        return false;
  492|     11|      }
  493|  1.13M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.12M, False: 3.85k]
  ------------------
  494|  1.12M|        lut_table_[j] = i;
  495|  1.12M|      }
  496|  3.85k|      act_prob = cum_prob;
  497|  3.85k|    }
  498|    144|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 18, False: 126]
  ------------------
  499|     18|      return false;
  500|     18|    }
  501|    126|    return true;
  502|    144|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     93|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     93|    unsigned x;
  423|     93|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 87]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     87|    ans_.buf = buf;
  427|     87|    x = buf[offset - 1] >> 6;
  428|     87|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 61, False: 26]
  ------------------
  429|     61|      ans_.buf_offset = offset - 1;
  430|     61|      ans_.state = buf[offset - 1] & 0x3F;
  431|     61|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 8, False: 18]
  ------------------
  432|      8|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 8]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      8|      ans_.buf_offset = offset - 2;
  436|      8|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     18|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 5, False: 13]
  ------------------
  438|      5|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 5]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      5|      ans_.buf_offset = offset - 3;
  442|      5|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     13|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 13, False: 0]
  ------------------
  444|     13|      ans_.buf_offset = offset - 4;
  445|     13|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     13|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     87|    ans_.state += l_rans_base;
  450|     87|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     87|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 11, False: 76]
  ------------------
  451|     11|      return 1;
  452|     11|    }
  453|     76|    return 0;
  454|     87|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  9.84M|  inline int rans_read() {
  463|  9.84M|    unsigned rem;
  464|  9.84M|    unsigned quo;
  465|  9.84M|    struct rans_dec_sym sym;
  466|  9.84M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 9.81M, False: 28.6k]
  |  Branch (466:40): [True: 3.11k, False: 9.81M]
  ------------------
  467|  3.11k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  3.11k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  3.11k|    }
  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|  9.84M|    quo = ans_.state / rans_precision;
  472|  9.84M|    rem = ans_.state % rans_precision;
  473|  9.84M|    fetch_sym(&sym, rem);
  474|  9.84M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  9.84M|    return sym.val;
  476|  9.84M|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  9.84M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  9.84M|    uint32_t symbol = lut_table_[rem];
  507|  9.84M|    out->val = symbol;
  508|  9.84M|    out->prob = probability_table_[symbol].prob;
  509|  9.84M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  9.84M|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     76|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    233|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    158|                                       uint32_t num_symbols) {
  482|    158|    lut_table_.resize(rans_precision);
  483|    158|    probability_table_.resize(num_symbols);
  484|    158|    uint32_t cum_prob = 0;
  485|    158|    uint32_t act_prob = 0;
  486|  2.36k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.22k, False: 148]
  ------------------
  487|  2.22k|      probability_table_[i].prob = token_probs[i];
  488|  2.22k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.22k|      cum_prob += token_probs[i];
  490|  2.22k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 10, False: 2.21k]
  ------------------
  491|     10|        return false;
  492|     10|      }
  493|  4.51M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 4.51M, False: 2.21k]
  ------------------
  494|  4.51M|        lut_table_[j] = i;
  495|  4.51M|      }
  496|  2.21k|      act_prob = cum_prob;
  497|  2.21k|    }
  498|    148|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 15, False: 133]
  ------------------
  499|     15|      return false;
  500|     15|    }
  501|    133|    return true;
  502|    148|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|    100|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    100|    unsigned x;
  423|    100|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 10, False: 90]
  ------------------
  424|     10|      return 1;
  425|     10|    }
  426|     90|    ans_.buf = buf;
  427|     90|    x = buf[offset - 1] >> 6;
  428|     90|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 20, False: 70]
  ------------------
  429|     20|      ans_.buf_offset = offset - 1;
  430|     20|      ans_.state = buf[offset - 1] & 0x3F;
  431|     70|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 26, False: 44]
  ------------------
  432|     26|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 17]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     17|      ans_.buf_offset = offset - 2;
  436|     17|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     44|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 20, False: 24]
  ------------------
  438|     20|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 5, False: 15]
  ------------------
  439|      5|        return 1;
  440|      5|      }
  441|     15|      ans_.buf_offset = offset - 3;
  442|     15|      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|     76|    ans_.state += l_rans_base;
  450|     76|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     76|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 23, False: 53]
  ------------------
  451|     23|      return 1;
  452|     23|    }
  453|     53|    return 0;
  454|     76|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   372k|  inline int rans_read() {
  463|   372k|    unsigned rem;
  464|   372k|    unsigned quo;
  465|   372k|    struct rans_dec_sym sym;
  466|   376k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 332k, False: 44.5k]
  |  Branch (466:40): [True: 3.85k, False: 328k]
  ------------------
  467|  3.85k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  3.85k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  3.85k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   372k|    quo = ans_.state / rans_precision;
  472|   372k|    rem = ans_.state % rans_precision;
  473|   372k|    fetch_sym(&sym, rem);
  474|   372k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   372k|    return sym.val;
  476|   372k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   372k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   372k|    uint32_t symbol = lut_table_[rem];
  507|   372k|    out->val = symbol;
  508|   372k|    out->prob = probability_table_[symbol].prob;
  509|   372k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   372k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     53|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    224|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    122|                                       uint32_t num_symbols) {
  482|    122|    lut_table_.resize(rans_precision);
  483|    122|    probability_table_.resize(num_symbols);
  484|    122|    uint32_t cum_prob = 0;
  485|    122|    uint32_t act_prob = 0;
  486|  6.73k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.63k, False: 102]
  ------------------
  487|  6.63k|      probability_table_[i].prob = token_probs[i];
  488|  6.63k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.63k|      cum_prob += token_probs[i];
  490|  6.63k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 20, False: 6.61k]
  ------------------
  491|     20|        return false;
  492|     20|      }
  493|  6.43M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 6.42M, False: 6.61k]
  ------------------
  494|  6.42M|        lut_table_[j] = i;
  495|  6.42M|      }
  496|  6.61k|      act_prob = cum_prob;
  497|  6.61k|    }
  498|    102|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 23, False: 79]
  ------------------
  499|     23|      return false;
  500|     23|    }
  501|     79|    return true;
  502|    102|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     52|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     52|    unsigned x;
  423|     52|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 5, False: 47]
  ------------------
  424|      5|      return 1;
  425|      5|    }
  426|     47|    ans_.buf = buf;
  427|     47|    x = buf[offset - 1] >> 6;
  428|     47|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 24, False: 23]
  ------------------
  429|     24|      ans_.buf_offset = offset - 1;
  430|     24|      ans_.state = buf[offset - 1] & 0x3F;
  431|     24|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 6, False: 17]
  ------------------
  432|      6|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 6]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      6|      ans_.buf_offset = offset - 2;
  436|      6|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     17|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 2, False: 15]
  ------------------
  438|      2|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 1]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|      1|      ans_.buf_offset = offset - 3;
  442|      1|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     15|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 15, False: 0]
  ------------------
  444|     15|      ans_.buf_offset = offset - 4;
  445|     15|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     15|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     46|    ans_.state += l_rans_base;
  450|     46|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     46|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 13, False: 33]
  ------------------
  451|     13|      return 1;
  452|     13|    }
  453|     33|    return 0;
  454|     46|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|   235k|  inline int rans_read() {
  463|   235k|    unsigned rem;
  464|   235k|    unsigned quo;
  465|   235k|    struct rans_dec_sym sym;
  466|   236k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 143k, False: 93.1k]
  |  Branch (466:40): [True: 435, False: 142k]
  ------------------
  467|    435|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    435|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    435|    }
  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|   235k|    quo = ans_.state / rans_precision;
  472|   235k|    rem = ans_.state % rans_precision;
  473|   235k|    fetch_sym(&sym, rem);
  474|   235k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   235k|    return sym.val;
  476|   235k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|   235k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   235k|    uint32_t symbol = lut_table_[rem];
  507|   235k|    out->val = symbol;
  508|   235k|    out->prob = probability_table_[symbol].prob;
  509|   235k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   235k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     33|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    196|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    132|                                       uint32_t num_symbols) {
  482|    132|    lut_table_.resize(rans_precision);
  483|    132|    probability_table_.resize(num_symbols);
  484|    132|    uint32_t cum_prob = 0;
  485|    132|    uint32_t act_prob = 0;
  486|  14.1k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 14.0k, False: 123]
  ------------------
  487|  14.0k|      probability_table_[i].prob = token_probs[i];
  488|  14.0k|      probability_table_[i].cum_prob = cum_prob;
  489|  14.0k|      cum_prob += token_probs[i];
  490|  14.0k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 9, False: 14.0k]
  ------------------
  491|      9|        return false;
  492|      9|      }
  493|  26.3M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 26.3M, False: 14.0k]
  ------------------
  494|  26.3M|        lut_table_[j] = i;
  495|  26.3M|      }
  496|  14.0k|      act_prob = cum_prob;
  497|  14.0k|    }
  498|    123|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 38, False: 85]
  ------------------
  499|     38|      return false;
  500|     38|    }
  501|     85|    return true;
  502|    123|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     56|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     56|    unsigned x;
  423|     56|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 5, False: 51]
  ------------------
  424|      5|      return 1;
  425|      5|    }
  426|     51|    ans_.buf = buf;
  427|     51|    x = buf[offset - 1] >> 6;
  428|     51|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 19, False: 32]
  ------------------
  429|     19|      ans_.buf_offset = offset - 1;
  430|     19|      ans_.state = buf[offset - 1] & 0x3F;
  431|     32|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 9, False: 23]
  ------------------
  432|      9|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 6, False: 3]
  ------------------
  433|      6|        return 1;
  434|      6|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     23|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 7, False: 16]
  ------------------
  438|      7|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 7]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      7|      ans_.buf_offset = offset - 3;
  442|      7|      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|     45|    ans_.state += l_rans_base;
  450|     45|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     45|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 8, False: 37]
  ------------------
  451|      8|      return 1;
  452|      8|    }
  453|     37|    return 0;
  454|     45|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  36.1k|  inline int rans_read() {
  463|  36.1k|    unsigned rem;
  464|  36.1k|    unsigned quo;
  465|  36.1k|    struct rans_dec_sym sym;
  466|  36.3k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 34.2k, False: 2.12k]
  |  Branch (466:40): [True: 188, False: 34.0k]
  ------------------
  467|    188|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    188|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    188|    }
  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|  36.1k|    quo = ans_.state / rans_precision;
  472|  36.1k|    rem = ans_.state % rans_precision;
  473|  36.1k|    fetch_sym(&sym, rem);
  474|  36.1k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  36.1k|    return sym.val;
  476|  36.1k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  36.1k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  36.1k|    uint32_t symbol = lut_table_[rem];
  507|  36.1k|    out->val = symbol;
  508|  36.1k|    out->prob = probability_table_[symbol].prob;
  509|  36.1k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  36.1k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     37|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    192|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    115|                                       uint32_t num_symbols) {
  482|    115|    lut_table_.resize(rans_precision);
  483|    115|    probability_table_.resize(num_symbols);
  484|    115|    uint32_t cum_prob = 0;
  485|    115|    uint32_t act_prob = 0;
  486|  3.55k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.46k, False: 96]
  ------------------
  487|  3.46k|      probability_table_[i].prob = token_probs[i];
  488|  3.46k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.46k|      cum_prob += token_probs[i];
  490|  3.46k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 19, False: 3.44k]
  ------------------
  491|     19|        return false;
  492|     19|      }
  493|  45.0M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 45.0M, False: 3.44k]
  ------------------
  494|  45.0M|        lut_table_[j] = i;
  495|  45.0M|      }
  496|  3.44k|      act_prob = cum_prob;
  497|  3.44k|    }
  498|     96|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 18, False: 78]
  ------------------
  499|     18|      return false;
  500|     18|    }
  501|     78|    return true;
  502|     96|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     61|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     61|    unsigned x;
  423|     61|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 60]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     60|    ans_.buf = buf;
  427|     60|    x = buf[offset - 1] >> 6;
  428|     60|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 18, False: 42]
  ------------------
  429|     18|      ans_.buf_offset = offset - 1;
  430|     18|      ans_.state = buf[offset - 1] & 0x3F;
  431|     42|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 10, False: 32]
  ------------------
  432|     10|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 10]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     10|      ans_.buf_offset = offset - 2;
  436|     10|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     32|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 15, False: 17]
  ------------------
  438|     15|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 12]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     12|      ans_.buf_offset = offset - 3;
  442|     12|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     17|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 17, False: 0]
  ------------------
  444|     17|      ans_.buf_offset = offset - 4;
  445|     17|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     17|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     57|    ans_.state += l_rans_base;
  450|     57|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     57|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 4, False: 53]
  ------------------
  451|      4|      return 1;
  452|      4|    }
  453|     53|    return 0;
  454|     57|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   161k|  inline int rans_read() {
  463|   161k|    unsigned rem;
  464|   161k|    unsigned quo;
  465|   161k|    struct rans_dec_sym sym;
  466|   162k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 81.9k, False: 80.1k]
  |  Branch (466:40): [True: 331, False: 81.6k]
  ------------------
  467|    331|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    331|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    331|    }
  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|   161k|    quo = ans_.state / rans_precision;
  472|   161k|    rem = ans_.state % rans_precision;
  473|   161k|    fetch_sym(&sym, rem);
  474|   161k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   161k|    return sym.val;
  476|   161k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   161k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   161k|    uint32_t symbol = lut_table_[rem];
  507|   161k|    out->val = symbol;
  508|   161k|    out->prob = probability_table_[symbol].prob;
  509|   161k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   161k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     53|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.13k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    720|                                       uint32_t num_symbols) {
  482|    720|    lut_table_.resize(rans_precision);
  483|    720|    probability_table_.resize(num_symbols);
  484|    720|    uint32_t cum_prob = 0;
  485|    720|    uint32_t act_prob = 0;
  486|  11.3k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 10.6k, False: 667]
  ------------------
  487|  10.6k|      probability_table_[i].prob = token_probs[i];
  488|  10.6k|      probability_table_[i].cum_prob = cum_prob;
  489|  10.6k|      cum_prob += token_probs[i];
  490|  10.6k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 53, False: 10.6k]
  ------------------
  491|     53|        return false;
  492|     53|      }
  493|   677M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 677M, False: 10.6k]
  ------------------
  494|   677M|        lut_table_[j] = i;
  495|   677M|      }
  496|  10.6k|      act_prob = cum_prob;
  497|  10.6k|    }
  498|    667|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 48, False: 619]
  ------------------
  499|     48|      return false;
  500|     48|    }
  501|    619|    return true;
  502|    667|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    379|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    379|    unsigned x;
  423|    379|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 24, False: 355]
  ------------------
  424|     24|      return 1;
  425|     24|    }
  426|    355|    ans_.buf = buf;
  427|    355|    x = buf[offset - 1] >> 6;
  428|    355|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 99, False: 256]
  ------------------
  429|     99|      ans_.buf_offset = offset - 1;
  430|     99|      ans_.state = buf[offset - 1] & 0x3F;
  431|    256|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 73, False: 183]
  ------------------
  432|     73|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 15, False: 58]
  ------------------
  433|     15|        return 1;
  434|     15|      }
  435|     58|      ans_.buf_offset = offset - 2;
  436|     58|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    183|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 72, False: 111]
  ------------------
  438|     72|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 26, False: 46]
  ------------------
  439|     26|        return 1;
  440|     26|      }
  441|     46|      ans_.buf_offset = offset - 3;
  442|     46|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    111|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 111, False: 0]
  ------------------
  444|    111|      ans_.buf_offset = offset - 4;
  445|    111|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    111|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    314|    ans_.state += l_rans_base;
  450|    314|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    314|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 43, False: 271]
  ------------------
  451|     43|      return 1;
  452|     43|    }
  453|    271|    return 0;
  454|    314|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  45.8M|  inline int rans_read() {
  463|  45.8M|    unsigned rem;
  464|  45.8M|    unsigned quo;
  465|  45.8M|    struct rans_dec_sym sym;
  466|  45.8M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 37.1M, False: 8.74M]
  |  Branch (466:40): [True: 6.26k, False: 37.1M]
  ------------------
  467|  6.26k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  6.26k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  6.26k|    }
  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|  45.8M|    quo = ans_.state / rans_precision;
  472|  45.8M|    rem = ans_.state % rans_precision;
  473|  45.8M|    fetch_sym(&sym, rem);
  474|  45.8M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  45.8M|    return sym.val;
  476|  45.8M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  45.8M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  45.8M|    uint32_t symbol = lut_table_[rem];
  507|  45.8M|    out->val = symbol;
  508|  45.8M|    out->prob = probability_table_[symbol].prob;
  509|  45.8M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  45.8M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    271|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    939|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    939|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    939|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 939]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    939|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    939|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    939|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 61, False: 878]
  ------------------
   67|     61|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 7, False: 54]
  ------------------
   68|      7|      return false;
   69|      7|    }
   70|       |
   71|     61|  } else
   72|    878|#endif
   73|    878|  {
   74|    878|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 17, False: 861]
  ------------------
   75|     17|      return false;
   76|     17|    }
   77|    878|  }
   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|    915|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 59, False: 856]
  ------------------
   83|     59|    return false;
   84|     59|  }
   85|    856|  probability_table_.resize(num_symbols_);
   86|    856|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 334, False: 522]
  ------------------
   87|    334|    return true;
   88|    334|  }
   89|       |  // Decode the table.
   90|  20.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 19.9k, False: 322]
  ------------------
   91|  19.9k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  19.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 19.8k]
  ------------------
   95|     36|      return false;
   96|     36|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  19.8k|    const int token = prob_data & 3;
  102|  19.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.00k, False: 13.8k]
  ------------------
  103|  6.00k|      const uint32_t offset = prob_data >> 2;
  104|  6.00k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 138, False: 5.86k]
  ------------------
  105|    138|        return false;
  106|    138|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   222k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 217k, False: 5.86k]
  ------------------
  109|   217k|        probability_table_[i + j] = 0;
  110|   217k|      }
  111|  5.86k|      i += offset;
  112|  13.8k|    } else {
  113|  13.8k|      const int extra_bytes = token;
  114|  13.8k|      uint32_t prob = prob_data >> 2;
  115|  21.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 7.30k, False: 13.8k]
  ------------------
  116|  7.30k|        uint8_t eb;
  117|  7.30k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 7.27k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  7.27k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  7.27k|      }
  124|  13.8k|      probability_table_[i] = prob;
  125|  13.8k|    }
  126|  19.8k|  }
  127|    322|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 111, False: 211]
  ------------------
  128|    111|    return false;
  129|    111|  }
  130|    211|  return true;
  131|    322|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    436|    DecoderBuffer *buffer) {
  136|    436|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    436|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    436|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    436|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 35, False: 401]
  ------------------
  140|     35|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 34]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     35|  } else
  145|    401|#endif
  146|    401|  {
  147|    401|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 8, False: 393]
  ------------------
  148|      8|      return false;
  149|      8|    }
  150|    401|  }
  151|    427|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 73, False: 354]
  ------------------
  152|     73|    return false;
  153|     73|  }
  154|    354|  const uint8_t *const data_head =
  155|    354|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    354|  buffer->Advance(bytes_encoded);
  158|    354|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 110, False: 244]
  ------------------
  159|    110|    return false;
  160|    110|  }
  161|    244|  return true;
  162|    354|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    358|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  12.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    201|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    201|  ans_.read_end();
  167|    201|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    438|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    438|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    438|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 438]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    438|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    438|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    438|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 35, False: 403]
  ------------------
   67|     35|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 31]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     35|  } else
   72|    403|#endif
   73|    403|  {
   74|    403|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 394]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    403|  }
   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|    425|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 26, False: 399]
  ------------------
   83|     26|    return false;
   84|     26|  }
   85|    399|  probability_table_.resize(num_symbols_);
   86|    399|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 389]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|   981k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 981k, False: 285]
  ------------------
   91|   981k|    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|   981k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 28, False: 981k]
  ------------------
   95|     28|      return false;
   96|     28|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   981k|    const int token = prob_data & 3;
  102|   981k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 581k, False: 399k]
  ------------------
  103|   581k|      const uint32_t offset = prob_data >> 2;
  104|   581k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 55, False: 581k]
  ------------------
  105|     55|        return false;
  106|     55|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  34.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 34.2M, False: 581k]
  ------------------
  109|  34.2M|        probability_table_[i + j] = 0;
  110|  34.2M|      }
  111|   581k|      i += offset;
  112|   581k|    } else {
  113|   399k|      const int extra_bytes = token;
  114|   399k|      uint32_t prob = prob_data >> 2;
  115|   533k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 133k, False: 399k]
  ------------------
  116|   133k|        uint8_t eb;
  117|   133k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 133k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   133k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   133k|      }
  124|   399k|      probability_table_[i] = prob;
  125|   399k|    }
  126|   981k|  }
  127|    285|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 123, False: 162]
  ------------------
  128|    123|    return false;
  129|    123|  }
  130|    162|  return true;
  131|    285|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    172|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_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: 3, False: 159]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 3]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      3|  } else
  145|    159|#endif
  146|    159|  {
  147|    159|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 17, False: 142]
  ------------------
  148|     17|      return false;
  149|     17|    }
  150|    159|  }
  151|    145|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 8, False: 137]
  ------------------
  152|      8|    return false;
  153|      8|  }
  154|    137|  const uint8_t *const data_head =
  155|    137|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    137|  buffer->Advance(bytes_encoded);
  158|    137|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 7, False: 130]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|    130|  return true;
  162|    137|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|   120M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    130|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    130|  ans_.read_end();
  167|    130|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    319|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    319|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    319|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 319]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    319|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    319|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    319|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 40, False: 279]
  ------------------
   67|     40|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 40]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     40|  } else
   72|    279|#endif
   73|    279|  {
   74|    279|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 279]
  ------------------
   75|      0|      return false;
   76|      0|    }
   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|    319|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 305]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    305|  probability_table_.resize(num_symbols_);
   86|    305|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 303]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   424k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 424k, False: 217]
  ------------------
   91|   424k|    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|   424k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 42, False: 424k]
  ------------------
   95|     42|      return false;
   96|     42|    }
   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|   424k|    const int token = prob_data & 3;
  102|   424k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 49.8k, False: 374k]
  ------------------
  103|  49.8k|      const uint32_t offset = prob_data >> 2;
  104|  49.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 49.8k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   865k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 815k, False: 49.8k]
  ------------------
  109|   815k|        probability_table_[i + j] = 0;
  110|   815k|      }
  111|  49.8k|      i += offset;
  112|   374k|    } else {
  113|   374k|      const int extra_bytes = token;
  114|   374k|      uint32_t prob = prob_data >> 2;
  115|   700k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 326k, False: 374k]
  ------------------
  116|   326k|        uint8_t eb;
  117|   326k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 326k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   326k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   326k|      }
  124|   374k|      probability_table_[i] = prob;
  125|   374k|    }
  126|   424k|  }
  127|    217|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 22, False: 195]
  ------------------
  128|     22|    return false;
  129|     22|  }
  130|    195|  return true;
  131|    217|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    197|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    195|    DecoderBuffer *buffer) {
  136|    195|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    195|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    195|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    195|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 18, False: 177]
  ------------------
  140|     18|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 18]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     18|  } else
  145|    177|#endif
  146|    177|  {
  147|    177|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 177]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    177|  }
  151|    195|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 52, False: 143]
  ------------------
  152|     52|    return false;
  153|     52|  }
  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: 23, False: 120]
  ------------------
  159|     23|    return false;
  160|     23|  }
  161|    120|  return true;
  162|    143|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  82.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    120|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    120|  ans_.read_end();
  167|    120|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    414|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    414|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    414|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 414]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    414|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    414|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    414|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 59, False: 355]
  ------------------
   67|     59|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 58]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     59|  } else
   72|    355|#endif
   73|    355|  {
   74|    355|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 352]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    355|  }
   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|    410|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 402]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|    402|  probability_table_.resize(num_symbols_);
   86|    402|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 400]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  18.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 18.5k, False: 328]
  ------------------
   91|  18.5k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  18.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 28, False: 18.5k]
  ------------------
   95|     28|      return false;
   96|     28|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  18.5k|    const int token = prob_data & 3;
  102|  18.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.90k, False: 13.6k]
  ------------------
  103|  4.90k|      const uint32_t offset = prob_data >> 2;
  104|  4.90k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 4.88k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   140k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 135k, False: 4.88k]
  ------------------
  109|   135k|        probability_table_[i + j] = 0;
  110|   135k|      }
  111|  4.88k|      i += offset;
  112|  13.6k|    } else {
  113|  13.6k|      const int extra_bytes = token;
  114|  13.6k|      uint32_t prob = prob_data >> 2;
  115|  24.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 11.0k, False: 13.5k]
  ------------------
  116|  11.0k|        uint8_t eb;
  117|  11.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 11.0k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  11.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  11.0k|      }
  124|  13.5k|      probability_table_[i] = prob;
  125|  13.5k|    }
  126|  18.5k|  }
  127|    328|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 314]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|    314|  return true;
  131|    328|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    316|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    314|    DecoderBuffer *buffer) {
  136|    314|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    314|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    314|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    314|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 46, False: 268]
  ------------------
  140|     46|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 45]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     46|  } else
  145|    268|#endif
  146|    268|  {
  147|    268|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 263]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    268|  }
  151|    308|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 85, False: 223]
  ------------------
  152|     85|    return false;
  153|     85|  }
  154|    223|  const uint8_t *const data_head =
  155|    223|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    223|  buffer->Advance(bytes_encoded);
  158|    223|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 197]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|    197|  return true;
  162|    223|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  11.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    197|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    197|  ans_.read_end();
  167|    197|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    263|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    263|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    263|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 263]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    263|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    263|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    263|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 253]
  ------------------
   67|     10|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 10]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     10|  } else
   72|    253|#endif
   73|    253|  {
   74|    253|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 247]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    253|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    257|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 243]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    243|  probability_table_.resize(num_symbols_);
   86|    243|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 242]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  16.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 15.9k, False: 189]
  ------------------
   91|  15.9k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  15.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 15.9k]
  ------------------
   95|     31|      return false;
   96|     31|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  15.9k|    const int token = prob_data & 3;
  102|  15.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.39k, False: 10.5k]
  ------------------
  103|  5.39k|      const uint32_t offset = prob_data >> 2;
  104|  5.39k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 12, False: 5.38k]
  ------------------
  105|     12|        return false;
  106|     12|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   217k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 212k, False: 5.38k]
  ------------------
  109|   212k|        probability_table_[i + j] = 0;
  110|   212k|      }
  111|  5.38k|      i += offset;
  112|  10.5k|    } else {
  113|  10.5k|      const int extra_bytes = token;
  114|  10.5k|      uint32_t prob = prob_data >> 2;
  115|  17.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.63k, False: 10.5k]
  ------------------
  116|  6.63k|        uint8_t eb;
  117|  6.63k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 6.62k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.62k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.62k|      }
  124|  10.5k|      probability_table_[i] = prob;
  125|  10.5k|    }
  126|  15.9k|  }
  127|    189|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 16, False: 173]
  ------------------
  128|     16|    return false;
  129|     16|  }
  130|    173|  return true;
  131|    189|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    174|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    173|    DecoderBuffer *buffer) {
  136|    173|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    173|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    173|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    173|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 173]
  ------------------
  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|    173|#endif
  146|    173|  {
  147|    173|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 170]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    173|  }
  151|    170|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 5, False: 165]
  ------------------
  152|      5|    return false;
  153|      5|  }
  154|    165|  const uint8_t *const data_head =
  155|    165|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    165|  buffer->Advance(bytes_encoded);
  158|    165|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 11, False: 154]
  ------------------
  159|     11|    return false;
  160|     11|  }
  161|    154|  return true;
  162|    165|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  3.99M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    154|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    154|  ans_.read_end();
  167|    154|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    257|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    257|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    257|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 257]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    257|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    257|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    257|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 58, False: 199]
  ------------------
   67|     58|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 58]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     58|  } else
   72|    199|#endif
   73|    199|  {
   74|    199|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 194]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    199|  }
   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|    252|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 18, False: 234]
  ------------------
   83|     18|    return false;
   84|     18|  }
   85|    234|  probability_table_.resize(num_symbols_);
   86|    234|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 232]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  9.44k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 9.25k, False: 183]
  ------------------
   91|  9.25k|    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|  9.25k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 20, False: 9.23k]
  ------------------
   95|     20|      return false;
   96|     20|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  9.23k|    const int token = prob_data & 3;
  102|  9.23k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.10k, False: 6.13k]
  ------------------
  103|  3.10k|      const uint32_t offset = prob_data >> 2;
  104|  3.10k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 16, False: 3.09k]
  ------------------
  105|     16|        return false;
  106|     16|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   104k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 100k, False: 3.09k]
  ------------------
  109|   100k|        probability_table_[i + j] = 0;
  110|   100k|      }
  111|  3.09k|      i += offset;
  112|  6.13k|    } else {
  113|  6.13k|      const int extra_bytes = token;
  114|  6.13k|      uint32_t prob = prob_data >> 2;
  115|  9.84k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.72k, False: 6.11k]
  ------------------
  116|  3.72k|        uint8_t eb;
  117|  3.72k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 3.71k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.71k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.71k|      }
  124|  6.11k|      probability_table_[i] = prob;
  125|  6.11k|    }
  126|  9.23k|  }
  127|    183|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 19, False: 164]
  ------------------
  128|     19|    return false;
  129|     19|  }
  130|    164|  return true;
  131|    183|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    166|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    164|    DecoderBuffer *buffer) {
  136|    164|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    164|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    164|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    164|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 43, False: 121]
  ------------------
  140|     43|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 42]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     43|  } else
  145|    121|#endif
  146|    121|  {
  147|    121|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 121]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    121|  }
  151|    163|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 52, False: 111]
  ------------------
  152|     52|    return false;
  153|     52|  }
  154|    111|  const uint8_t *const data_head =
  155|    111|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    111|  buffer->Advance(bytes_encoded);
  158|    111|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 28, False: 83]
  ------------------
  159|     28|    return false;
  160|     28|  }
  161|     83|  return true;
  162|    111|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  44.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|     83|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     83|  ans_.read_end();
  167|     83|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    298|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    298|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    298|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 298]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    298|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    298|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    298|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 30, False: 268]
  ------------------
   67|     30|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 30]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     30|  } else
   72|    268|#endif
   73|    268|  {
   74|    268|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 265]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    268|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    295|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 285]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    285|  probability_table_.resize(num_symbols_);
   86|    285|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 285]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   540k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 540k, False: 192]
  ------------------
   91|   540k|    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|   540k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 42, False: 540k]
  ------------------
   95|     42|      return false;
   96|     42|    }
   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|   540k|    const int token = prob_data & 3;
  102|   540k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 206k, False: 333k]
  ------------------
  103|   206k|      const uint32_t offset = prob_data >> 2;
  104|   206k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 206k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  8.07M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.87M, False: 206k]
  ------------------
  109|  7.87M|        probability_table_[i + j] = 0;
  110|  7.87M|      }
  111|   206k|      i += offset;
  112|   333k|    } else {
  113|   333k|      const int extra_bytes = token;
  114|   333k|      uint32_t prob = prob_data >> 2;
  115|   627k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 293k, False: 333k]
  ------------------
  116|   293k|        uint8_t eb;
  117|   293k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 293k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   293k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   293k|      }
  124|   333k|      probability_table_[i] = prob;
  125|   333k|    }
  126|   540k|  }
  127|    192|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 178]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|    178|  return true;
  131|    192|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    178|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_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: 13, False: 165]
  ------------------
  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|    165|#endif
  146|    165|  {
  147|    165|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 160]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    165|  }
  151|    172|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 16, False: 156]
  ------------------
  152|     16|    return false;
  153|     16|  }
  154|    156|  const uint8_t *const data_head =
  155|    156|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    156|  buffer->Advance(bytes_encoded);
  158|    156|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 130]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|    130|  return true;
  162|    156|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  12.0M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    130|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    130|  ans_.read_end();
  167|    130|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    238|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    238|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    238|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 238]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    238|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    238|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    238|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 53, False: 185]
  ------------------
   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|    185|#endif
   73|    185|  {
   74|    185|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 176]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    185|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    229|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 219]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    219|  probability_table_.resize(num_symbols_);
   86|    219|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 217]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   803k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 803k, False: 140]
  ------------------
   91|   803k|    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|   803k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 23, False: 803k]
  ------------------
   95|     23|      return false;
   96|     23|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   803k|    const int token = prob_data & 3;
  102|   803k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 134k, False: 668k]
  ------------------
  103|   134k|      const uint32_t offset = prob_data >> 2;
  104|   134k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 31, False: 134k]
  ------------------
  105|     31|        return false;
  106|     31|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.10M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.97M, False: 134k]
  ------------------
  109|  3.97M|        probability_table_[i + j] = 0;
  110|  3.97M|      }
  111|   134k|      i += offset;
  112|   668k|    } else {
  113|   668k|      const int extra_bytes = token;
  114|   668k|      uint32_t prob = prob_data >> 2;
  115|  1.30M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 639k, False: 668k]
  ------------------
  116|   639k|        uint8_t eb;
  117|   639k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 639k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   639k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   639k|      }
  124|   668k|      probability_table_[i] = prob;
  125|   668k|    }
  126|   803k|  }
  127|    140|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 127]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|    127|  return true;
  131|    140|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    129|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    127|    DecoderBuffer *buffer) {
  136|    127|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    127|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    127|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    127|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 35, False: 92]
  ------------------
  140|     35|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 34]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     35|  } else
  145|     92|#endif
  146|     92|  {
  147|     92|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 83]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|     92|  }
  151|    117|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 51, False: 66]
  ------------------
  152|     51|    return false;
  153|     51|  }
  154|     66|  const uint8_t *const data_head =
  155|     66|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     66|  buffer->Advance(bytes_encoded);
  158|     66|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 41]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     41|  return true;
  162|     66|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  12.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     41|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     41|  ans_.read_end();
  167|     41|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    242|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    242|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    242|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 242]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    242|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    242|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    242|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 37, False: 205]
  ------------------
   67|     37|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 37]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     37|  } else
   72|    205|#endif
   73|    205|  {
   74|    205|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 200]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    205|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    237|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 224]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    224|  probability_table_.resize(num_symbols_);
   86|    224|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 223]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  24.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 24.4k, False: 155]
  ------------------
   91|  24.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|  24.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 28, False: 24.4k]
  ------------------
   95|     28|      return false;
   96|     28|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  24.4k|    const int token = prob_data & 3;
  102|  24.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.66k, False: 18.7k]
  ------------------
  103|  5.66k|      const uint32_t offset = prob_data >> 2;
  104|  5.66k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 5.64k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   215k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 209k, False: 5.64k]
  ------------------
  109|   209k|        probability_table_[i + j] = 0;
  110|   209k|      }
  111|  5.64k|      i += offset;
  112|  18.7k|    } else {
  113|  18.7k|      const int extra_bytes = token;
  114|  18.7k|      uint32_t prob = prob_data >> 2;
  115|  29.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.8k, False: 18.7k]
  ------------------
  116|  10.8k|        uint8_t eb;
  117|  10.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 10.7k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.7k|      }
  124|  18.7k|      probability_table_[i] = prob;
  125|  18.7k|    }
  126|  24.4k|  }
  127|    155|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 29, False: 126]
  ------------------
  128|     29|    return false;
  129|     29|  }
  130|    126|  return true;
  131|    155|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    127|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    126|    DecoderBuffer *buffer) {
  136|    126|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    126|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    126|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    126|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 12, False: 114]
  ------------------
  140|     12|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 12]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     12|  } else
  145|    114|#endif
  146|    114|  {
  147|    114|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 114]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    114|  }
  151|    126|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 33, False: 93]
  ------------------
  152|     33|    return false;
  153|     33|  }
  154|     93|  const uint8_t *const data_head =
  155|     93|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     93|  buffer->Advance(bytes_encoded);
  158|     93|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 17, False: 76]
  ------------------
  159|     17|    return false;
  160|     17|  }
  161|     76|  return true;
  162|     93|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  9.84M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     76|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     76|  ans_.read_end();
  167|     76|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    233|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    233|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    233|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 233]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    233|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    233|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    233|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 33, False: 200]
  ------------------
   67|     33|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 33]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     33|  } else
   72|    200|#endif
   73|    200|  {
   74|    200|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 198]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    200|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    231|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 231]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|    231|  probability_table_.resize(num_symbols_);
   86|    231|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 229]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   873k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 873k, False: 158]
  ------------------
   91|   873k|    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|   873k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 34, False: 873k]
  ------------------
   95|     34|      return false;
   96|     34|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   873k|    const int token = prob_data & 3;
  102|   873k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 109k, False: 764k]
  ------------------
  103|   109k|      const uint32_t offset = prob_data >> 2;
  104|   109k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 17, False: 109k]
  ------------------
  105|     17|        return false;
  106|     17|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.59M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.48M, False: 109k]
  ------------------
  109|  2.48M|        probability_table_[i + j] = 0;
  110|  2.48M|      }
  111|   109k|      i += offset;
  112|   764k|    } else {
  113|   764k|      const int extra_bytes = token;
  114|   764k|      uint32_t prob = prob_data >> 2;
  115|  1.45M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 695k, False: 764k]
  ------------------
  116|   695k|        uint8_t eb;
  117|   695k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 695k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   695k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   695k|      }
  124|   764k|      probability_table_[i] = prob;
  125|   764k|    }
  126|   873k|  }
  127|    158|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 25, False: 133]
  ------------------
  128|     25|    return false;
  129|     25|  }
  130|    133|  return true;
  131|    158|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    135|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    133|    DecoderBuffer *buffer) {
  136|    133|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    133|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    133|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    133|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 17, False: 116]
  ------------------
  140|     17|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 16]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     17|  } else
  145|    116|#endif
  146|    116|  {
  147|    116|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 116]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    116|  }
  151|    132|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 32, False: 100]
  ------------------
  152|     32|    return false;
  153|     32|  }
  154|    100|  const uint8_t *const data_head =
  155|    100|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    100|  buffer->Advance(bytes_encoded);
  158|    100|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 47, False: 53]
  ------------------
  159|     47|    return false;
  160|     47|  }
  161|     53|  return true;
  162|    100|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   372k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     53|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     53|  ans_.read_end();
  167|     53|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    224|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    224|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    224|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 224]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    224|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    224|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    224|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 195]
  ------------------
   67|     29|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 26]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     29|  } else
   72|    195|#endif
   73|    195|  {
   74|    195|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 189]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    195|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    215|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 199]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    199|  probability_table_.resize(num_symbols_);
   86|    199|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 197]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  16.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 16.6k, False: 122]
  ------------------
   91|  16.6k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  16.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 17, False: 16.6k]
  ------------------
   95|     17|      return false;
   96|     17|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  16.6k|    const int token = prob_data & 3;
  102|  16.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.92k, False: 11.7k]
  ------------------
  103|  4.92k|      const uint32_t offset = prob_data >> 2;
  104|  4.92k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 4.89k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   180k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 176k, False: 4.89k]
  ------------------
  109|   176k|        probability_table_[i + j] = 0;
  110|   176k|      }
  111|  4.89k|      i += offset;
  112|  11.7k|    } else {
  113|  11.7k|      const int extra_bytes = token;
  114|  11.7k|      uint32_t prob = prob_data >> 2;
  115|  21.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 9.43k, False: 11.6k]
  ------------------
  116|  9.43k|        uint8_t eb;
  117|  9.43k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 9.41k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  9.41k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  9.41k|      }
  124|  11.6k|      probability_table_[i] = prob;
  125|  11.6k|    }
  126|  16.6k|  }
  127|    122|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 43, False: 79]
  ------------------
  128|     43|    return false;
  129|     43|  }
  130|     79|  return true;
  131|    122|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|     81|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|     79|    DecoderBuffer *buffer) {
  136|     79|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     79|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     79|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     79|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 79]
  ------------------
  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|     79|#endif
  146|     79|  {
  147|     79|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 79]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     79|  }
  151|     79|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 27, False: 52]
  ------------------
  152|     27|    return false;
  153|     27|  }
  154|     52|  const uint8_t *const data_head =
  155|     52|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     52|  buffer->Advance(bytes_encoded);
  158|     52|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 19, False: 33]
  ------------------
  159|     19|    return false;
  160|     19|  }
  161|     33|  return true;
  162|     52|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   235k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     33|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     33|  ans_.read_end();
  167|     33|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    196|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    196|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    196|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 196]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    196|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    196|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    196|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 17, False: 179]
  ------------------
   67|     17|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 17]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     17|  } else
   72|    179|#endif
   73|    179|  {
   74|    179|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 178]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    179|  }
   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|    195|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 195]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|    195|  probability_table_.resize(num_symbols_);
   86|    195|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 186]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  43.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 43.7k, False: 132]
  ------------------
   91|  43.7k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  43.7k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 37, False: 43.7k]
  ------------------
   95|     37|      return false;
   96|     37|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  43.7k|    const int token = prob_data & 3;
  102|  43.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 17.5k, False: 26.1k]
  ------------------
  103|  17.5k|      const uint32_t offset = prob_data >> 2;
  104|  17.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 9, False: 17.5k]
  ------------------
  105|      9|        return false;
  106|      9|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   690k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 672k, False: 17.5k]
  ------------------
  109|   672k|        probability_table_[i + j] = 0;
  110|   672k|      }
  111|  17.5k|      i += offset;
  112|  26.1k|    } else {
  113|  26.1k|      const int extra_bytes = token;
  114|  26.1k|      uint32_t prob = prob_data >> 2;
  115|  48.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 22.4k, False: 26.1k]
  ------------------
  116|  22.4k|        uint8_t eb;
  117|  22.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 22.4k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  22.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  22.4k|      }
  124|  26.1k|      probability_table_[i] = prob;
  125|  26.1k|    }
  126|  43.7k|  }
  127|    132|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 47, False: 85]
  ------------------
  128|     47|    return false;
  129|     47|  }
  130|     85|  return true;
  131|    132|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|     94|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|     85|    DecoderBuffer *buffer) {
  136|     85|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     85|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     85|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     85|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 13, False: 72]
  ------------------
  140|     13|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 13]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     13|  } else
  145|     72|#endif
  146|     72|  {
  147|     72|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 72]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     72|  }
  151|     85|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 29, False: 56]
  ------------------
  152|     29|    return false;
  153|     29|  }
  154|     56|  const uint8_t *const data_head =
  155|     56|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     56|  buffer->Advance(bytes_encoded);
  158|     56|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 19, False: 37]
  ------------------
  159|     19|    return false;
  160|     19|  }
  161|     37|  return true;
  162|     56|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  36.1k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     37|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     37|  ans_.read_end();
  167|     37|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    192|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    192|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    192|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 192]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    192|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    192|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    192|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 3, False: 189]
  ------------------
   67|      3|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 3]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      3|  } else
   72|    189|#endif
   73|    189|  {
   74|    189|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 185]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    189|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    188|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 177]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    177|  probability_table_.resize(num_symbols_);
   86|    177|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 177]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   500k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 500k, False: 115]
  ------------------
   91|   500k|    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|   500k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 23, False: 500k]
  ------------------
   95|     23|      return false;
   96|     23|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   500k|    const int token = prob_data & 3;
  102|   500k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 273k, False: 227k]
  ------------------
  103|   273k|      const uint32_t offset = prob_data >> 2;
  104|   273k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 273k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  9.13M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.86M, False: 273k]
  ------------------
  109|  8.86M|        probability_table_[i + j] = 0;
  110|  8.86M|      }
  111|   273k|      i += offset;
  112|   273k|    } else {
  113|   227k|      const int extra_bytes = token;
  114|   227k|      uint32_t prob = prob_data >> 2;
  115|   386k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 159k, False: 227k]
  ------------------
  116|   159k|        uint8_t eb;
  117|   159k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 159k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   159k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   159k|      }
  124|   227k|      probability_table_[i] = prob;
  125|   227k|    }
  126|   500k|  }
  127|    115|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 37, False: 78]
  ------------------
  128|     37|    return false;
  129|     37|  }
  130|     78|  return true;
  131|    115|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|     78|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|     78|    DecoderBuffer *buffer) {
  136|     78|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     78|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     78|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     78|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 78]
  ------------------
  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|     78|#endif
  146|     78|  {
  147|     78|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 77]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     78|  }
  151|     77|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 16, False: 61]
  ------------------
  152|     16|    return false;
  153|     16|  }
  154|     61|  const uint8_t *const data_head =
  155|     61|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     61|  buffer->Advance(bytes_encoded);
  158|     61|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 8, False: 53]
  ------------------
  159|      8|    return false;
  160|      8|  }
  161|     53|  return true;
  162|     61|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   161k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     53|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     53|  ans_.read_end();
  167|     53|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    262|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    262|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    262|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 262]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    262|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    262|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    262|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 41, False: 221]
  ------------------
   67|     41|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 38]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     41|  } else
   72|    221|#endif
   73|    221|  {
   74|    221|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 213]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    221|  }
   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|    251|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 237]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    237|  probability_table_.resize(num_symbols_);
   86|    237|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 235]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   152k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 152k, False: 161]
  ------------------
   91|   152k|    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|   152k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 30, False: 152k]
  ------------------
   95|     30|      return false;
   96|     30|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   152k|    const int token = prob_data & 3;
  102|   152k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 77.1k, False: 75.1k]
  ------------------
  103|  77.1k|      const uint32_t offset = prob_data >> 2;
  104|  77.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 77.0k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.05M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.98M, False: 77.0k]
  ------------------
  109|  3.98M|        probability_table_[i + j] = 0;
  110|  3.98M|      }
  111|  77.0k|      i += offset;
  112|  77.0k|    } else {
  113|  75.1k|      const int extra_bytes = token;
  114|  75.1k|      uint32_t prob = prob_data >> 2;
  115|   179k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 104k, False: 75.0k]
  ------------------
  116|   104k|        uint8_t eb;
  117|   104k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 104k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   104k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   104k|      }
  124|  75.0k|      probability_table_[i] = prob;
  125|  75.0k|    }
  126|   152k|  }
  127|    161|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 141]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|    141|  return true;
  131|    161|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    143|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_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: 11, False: 130]
  ------------------
  140|     11|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 9]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     11|  } else
  145|    130|#endif
  146|    130|  {
  147|    130|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 129]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    130|  }
  151|    138|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 50, False: 88]
  ------------------
  152|     50|    return false;
  153|     50|  }
  154|     88|  const uint8_t *const data_head =
  155|     88|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     88|  buffer->Advance(bytes_encoded);
  158|     88|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 63]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     63|  return true;
  162|     88|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|   148k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     63|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     63|  ans_.read_end();
  167|     63|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    176|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    176|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    176|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 176]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    176|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    176|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    176|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 32, False: 144]
  ------------------
   67|     32|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 32]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     32|  } else
   72|    144|#endif
   73|    144|  {
   74|    144|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 139]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    144|  }
   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|    171|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 159]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    159|  probability_table_.resize(num_symbols_);
   86|    159|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 156]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|  55.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 55.8k, False: 106]
  ------------------
   91|  55.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|  55.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 22, False: 55.8k]
  ------------------
   95|     22|      return false;
   96|     22|    }
   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|  55.8k|    const int token = prob_data & 3;
  102|  55.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.73k, False: 46.0k]
  ------------------
  103|  9.73k|      const uint32_t offset = prob_data >> 2;
  104|  9.73k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 10, False: 9.72k]
  ------------------
  105|     10|        return false;
  106|     10|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   355k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 345k, False: 9.72k]
  ------------------
  109|   345k|        probability_table_[i + j] = 0;
  110|   345k|      }
  111|  9.72k|      i += offset;
  112|  46.0k|    } else {
  113|  46.0k|      const int extra_bytes = token;
  114|  46.0k|      uint32_t prob = prob_data >> 2;
  115|  78.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 32.4k, False: 46.0k]
  ------------------
  116|  32.4k|        uint8_t eb;
  117|  32.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 32.3k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  32.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  32.3k|      }
  124|  46.0k|      probability_table_[i] = prob;
  125|  46.0k|    }
  126|  55.8k|  }
  127|    106|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 92]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|     92|  return true;
  131|    106|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|     95|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|     92|    DecoderBuffer *buffer) {
  136|     92|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     92|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     92|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     92|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 72]
  ------------------
  140|     20|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 20]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     20|  } else
  145|     72|#endif
  146|     72|  {
  147|     72|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 71]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     72|  }
  151|     91|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 27, False: 64]
  ------------------
  152|     27|    return false;
  153|     27|  }
  154|     64|  const uint8_t *const data_head =
  155|     64|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     64|  buffer->Advance(bytes_encoded);
  158|     64|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 18, False: 46]
  ------------------
  159|     18|    return false;
  160|     18|  }
  161|     46|  return true;
  162|     64|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  10.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     46|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     46|  ans_.read_end();
  167|     46|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    222|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    222|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    222|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 222]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    222|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    222|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    222|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 11, False: 211]
  ------------------
   67|     11|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 11]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     11|  } else
   72|    211|#endif
   73|    211|  {
   74|    211|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 209]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    211|  }
   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|    220|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 208]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    208|  probability_table_.resize(num_symbols_);
   86|    208|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 206]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  14.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 14.1k, False: 132]
  ------------------
   91|  14.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|  14.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 27, False: 14.0k]
  ------------------
   95|     27|      return false;
   96|     27|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  14.0k|    const int token = prob_data & 3;
  102|  14.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.87k, False: 9.20k]
  ------------------
  103|  4.87k|      const uint32_t offset = prob_data >> 2;
  104|  4.87k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 4.84k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   189k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 185k, False: 4.84k]
  ------------------
  109|   185k|        probability_table_[i + j] = 0;
  110|   185k|      }
  111|  4.84k|      i += offset;
  112|  9.20k|    } else {
  113|  9.20k|      const int extra_bytes = token;
  114|  9.20k|      uint32_t prob = prob_data >> 2;
  115|  15.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.53k, False: 9.18k]
  ------------------
  116|  6.53k|        uint8_t eb;
  117|  6.53k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 6.51k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.51k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.51k|      }
  124|  9.18k|      probability_table_[i] = prob;
  125|  9.18k|    }
  126|  14.0k|  }
  127|    132|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 119]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|    119|  return true;
  131|    132|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    121|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    119|    DecoderBuffer *buffer) {
  136|    119|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    119|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    119|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    119|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 118]
  ------------------
  140|      1|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 1]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      1|  } else
  145|    118|#endif
  146|    118|  {
  147|    118|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 13, False: 105]
  ------------------
  148|     13|      return false;
  149|     13|    }
  150|    118|  }
  151|    106|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 30, False: 76]
  ------------------
  152|     30|    return false;
  153|     30|  }
  154|     76|  const uint8_t *const data_head =
  155|     76|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     76|  buffer->Advance(bytes_encoded);
  158|     76|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 22, False: 54]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|     54|  return true;
  162|     76|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  22.2M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     54|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     54|  ans_.read_end();
  167|     54|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    220|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    220|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    220|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 220]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    220|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    220|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    220|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 210]
  ------------------
   67|     10|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 10]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     10|  } else
   72|    210|#endif
   73|    210|  {
   74|    210|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 203]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    210|  }
   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|    213|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 200]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    200|  probability_table_.resize(num_symbols_);
   86|    200|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 197]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   140k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 139k, False: 140]
  ------------------
   91|   139k|    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|   139k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 22, False: 139k]
  ------------------
   95|     22|      return false;
   96|     22|    }
   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|   139k|    const int token = prob_data & 3;
  102|   139k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 92.8k, False: 47.0k]
  ------------------
  103|  92.8k|      const uint32_t offset = prob_data >> 2;
  104|  92.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 19, False: 92.8k]
  ------------------
  105|     19|        return false;
  106|     19|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.55M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.46M, False: 92.8k]
  ------------------
  109|  4.46M|        probability_table_[i + j] = 0;
  110|  4.46M|      }
  111|  92.8k|      i += offset;
  112|  92.8k|    } else {
  113|  47.0k|      const int extra_bytes = token;
  114|  47.0k|      uint32_t prob = prob_data >> 2;
  115|  55.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.63k, False: 47.0k]
  ------------------
  116|  8.63k|        uint8_t eb;
  117|  8.63k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 8.61k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.61k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.61k|      }
  124|  47.0k|      probability_table_[i] = prob;
  125|  47.0k|    }
  126|   139k|  }
  127|    140|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 22, False: 118]
  ------------------
  128|     22|    return false;
  129|     22|  }
  130|    118|  return true;
  131|    140|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    121|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    118|    DecoderBuffer *buffer) {
  136|    118|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    118|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    118|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    118|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 5, False: 113]
  ------------------
  140|      5|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 5]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      5|  } else
  145|    113|#endif
  146|    113|  {
  147|    113|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 111]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    113|  }
  151|    116|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 38, False: 78]
  ------------------
  152|     38|    return false;
  153|     38|  }
  154|     78|  const uint8_t *const data_head =
  155|     78|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     78|  buffer->Advance(bytes_encoded);
  158|     78|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 17, False: 61]
  ------------------
  159|     17|    return false;
  160|     17|  }
  161|     61|  return true;
  162|     78|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  12.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     61|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     61|  ans_.read_end();
  167|     61|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    251|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    251|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    251|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 251]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    251|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    251|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    251|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 35, False: 216]
  ------------------
   67|     35|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 34]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     35|  } else
   72|    216|#endif
   73|    216|  {
   74|    216|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 214]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    216|  }
   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|    248|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 243]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    243|  probability_table_.resize(num_symbols_);
   86|    243|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 243]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  44.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 44.1k, False: 181]
  ------------------
   91|  44.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|  44.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 23, False: 44.1k]
  ------------------
   95|     23|      return false;
   96|     23|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  44.1k|    const int token = prob_data & 3;
  102|  44.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.18k, False: 34.9k]
  ------------------
  103|  9.18k|      const uint32_t offset = prob_data >> 2;
  104|  9.18k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 9.17k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   368k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 359k, False: 9.17k]
  ------------------
  109|   359k|        probability_table_[i + j] = 0;
  110|   359k|      }
  111|  9.17k|      i += offset;
  112|  34.9k|    } else {
  113|  34.9k|      const int extra_bytes = token;
  114|  34.9k|      uint32_t prob = prob_data >> 2;
  115|  51.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 16.0k, False: 34.9k]
  ------------------
  116|  16.0k|        uint8_t eb;
  117|  16.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 16.0k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  16.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  16.0k|      }
  124|  34.9k|      probability_table_[i] = prob;
  125|  34.9k|    }
  126|  44.1k|  }
  127|    181|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 32, False: 149]
  ------------------
  128|     32|    return false;
  129|     32|  }
  130|    149|  return true;
  131|    181|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    149|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    149|    DecoderBuffer *buffer) {
  136|    149|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    149|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    149|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    149|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 25, False: 124]
  ------------------
  140|     25|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 22]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     25|  } else
  145|    124|#endif
  146|    124|  {
  147|    124|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 114]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    124|  }
  151|    136|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 63, False: 73]
  ------------------
  152|     63|    return false;
  153|     63|  }
  154|     73|  const uint8_t *const data_head =
  155|     73|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     73|  buffer->Advance(bytes_encoded);
  158|     73|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 47]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     47|  return true;
  162|     73|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|   109k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     47|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     47|  ans_.read_end();
  167|     47|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  8.15k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  8.15k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 2, False: 8.15k]
  ------------------
   35|      2|    return true;
   36|      2|  }
   37|       |  // Decode which scheme to use.
   38|  8.15k|  uint8_t scheme;
   39|  8.15k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 72, False: 8.08k]
  ------------------
   40|     72|    return false;
   41|     72|  }
   42|  8.08k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 754, False: 7.33k]
  ------------------
   43|    754|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    754|                                                  src_buffer, out_values);
   45|  7.33k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 4.93k, False: 2.39k]
  ------------------
   46|  4.93k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  4.93k|                                               out_values);
   48|  4.93k|  }
   49|  2.39k|  return false;
   50|  8.08k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    754|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    754|  SymbolDecoderT<5> tag_decoder;
   57|    754|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 385, False: 369]
  ------------------
   58|    385|    return false;
   59|    385|  }
   60|       |
   61|    369|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 187, False: 182]
  ------------------
   62|    187|    return false;
   63|    187|  }
   64|       |
   65|    182|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 182, False: 0]
  |  Branch (65:25): [True: 38, False: 144]
  ------------------
   66|     38|    return false;  // Wrong number of symbols.
   67|     38|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    144|  src_buffer->StartBitDecoding(false, nullptr);
   72|    144|  int value_id = 0;
   73|   352k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 352k, False: 139]
  ------------------
   74|       |    // Decode the tag.
   75|   352k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|   719k|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 367k, False: 352k]
  ------------------
   78|   367k|      uint32_t val;
   79|   367k|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 5, False: 367k]
  ------------------
   80|      5|        return false;
   81|      5|      }
   82|   367k|      out_values[value_id++] = val;
   83|   367k|    }
   84|   352k|  }
   85|    139|  tag_decoder.EndDecoding();
   86|    139|  src_buffer->EndBitDecoding();
   87|    139|  return true;
   88|    144|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  4.93k|                      uint32_t *out_values) {
  117|  4.93k|  uint8_t max_bit_length;
  118|  4.93k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 22, False: 4.91k]
  ------------------
  119|     22|    return false;
  120|     22|  }
  121|  4.91k|  switch (max_bit_length) {
  122|    438|    case 1:
  ------------------
  |  Branch (122:5): [True: 438, False: 4.47k]
  ------------------
  123|    438|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    438|                                                         out_values);
  125|    319|    case 2:
  ------------------
  |  Branch (125:5): [True: 319, False: 4.59k]
  ------------------
  126|    319|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    319|                                                         out_values);
  128|    414|    case 3:
  ------------------
  |  Branch (128:5): [True: 414, False: 4.50k]
  ------------------
  129|    414|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    414|                                                         out_values);
  131|    263|    case 4:
  ------------------
  |  Branch (131:5): [True: 263, False: 4.65k]
  ------------------
  132|    263|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    263|                                                         out_values);
  134|    185|    case 5:
  ------------------
  |  Branch (134:5): [True: 185, False: 4.72k]
  ------------------
  135|    185|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    185|                                                         out_values);
  137|    257|    case 6:
  ------------------
  |  Branch (137:5): [True: 257, False: 4.65k]
  ------------------
  138|    257|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    257|                                                         out_values);
  140|    298|    case 7:
  ------------------
  |  Branch (140:5): [True: 298, False: 4.61k]
  ------------------
  141|    298|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    298|                                                         out_values);
  143|    238|    case 8:
  ------------------
  |  Branch (143:5): [True: 238, False: 4.67k]
  ------------------
  144|    238|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    238|                                                         out_values);
  146|    242|    case 9:
  ------------------
  |  Branch (146:5): [True: 242, False: 4.67k]
  ------------------
  147|    242|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    242|                                                         out_values);
  149|    233|    case 10:
  ------------------
  |  Branch (149:5): [True: 233, False: 4.68k]
  ------------------
  150|    233|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    233|          num_values, src_buffer, out_values);
  152|    224|    case 11:
  ------------------
  |  Branch (152:5): [True: 224, False: 4.69k]
  ------------------
  153|    224|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    224|          num_values, src_buffer, out_values);
  155|    196|    case 12:
  ------------------
  |  Branch (155:5): [True: 196, False: 4.71k]
  ------------------
  156|    196|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    196|          num_values, src_buffer, out_values);
  158|    192|    case 13:
  ------------------
  |  Branch (158:5): [True: 192, False: 4.72k]
  ------------------
  159|    192|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    192|          num_values, src_buffer, out_values);
  161|    262|    case 14:
  ------------------
  |  Branch (161:5): [True: 262, False: 4.65k]
  ------------------
  162|    262|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    262|          num_values, src_buffer, out_values);
  164|    176|    case 15:
  ------------------
  |  Branch (164:5): [True: 176, False: 4.73k]
  ------------------
  165|    176|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    176|          num_values, src_buffer, out_values);
  167|    222|    case 16:
  ------------------
  |  Branch (167:5): [True: 222, False: 4.69k]
  ------------------
  168|    222|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    222|          num_values, src_buffer, out_values);
  170|    220|    case 17:
  ------------------
  |  Branch (170:5): [True: 220, False: 4.69k]
  ------------------
  171|    220|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    220|          num_values, src_buffer, out_values);
  173|    251|    case 18:
  ------------------
  |  Branch (173:5): [True: 251, False: 4.66k]
  ------------------
  174|    251|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    251|          num_values, src_buffer, out_values);
  176|    284|    default:
  ------------------
  |  Branch (176:5): [True: 284, False: 4.63k]
  ------------------
  177|    284|      return false;
  178|  4.91k|  }
  179|  4.91k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    438|                              uint32_t *out_values) {
   93|    438|  SymbolDecoderT decoder;
   94|    438|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 266, False: 172]
  ------------------
   95|    266|    return false;
   96|    266|  }
   97|       |
   98|    172|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 172, False: 0]
  |  Branch (98:25): [True: 10, False: 162]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    162|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 32, False: 130]
  ------------------
  103|     32|    return false;
  104|     32|  }
  105|   120M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 120M, False: 130]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   120M|    const uint32_t value = decoder.DecodeSymbol();
  108|   120M|    out_values[i] = value;
  109|   120M|  }
  110|    130|  decoder.EndDecoding();
  111|    130|  return true;
  112|    162|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    319|                              uint32_t *out_values) {
   93|    319|  SymbolDecoderT decoder;
   94|    319|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 122, False: 197]
  ------------------
   95|    122|    return false;
   96|    122|  }
   97|       |
   98|    197|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 197, False: 0]
  |  Branch (98:25): [True: 2, False: 195]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    195|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 75, False: 120]
  ------------------
  103|     75|    return false;
  104|     75|  }
  105|  82.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 82.7M, False: 120]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  82.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  82.7M|    out_values[i] = value;
  109|  82.7M|  }
  110|    120|  decoder.EndDecoding();
  111|    120|  return true;
  112|    195|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    414|                              uint32_t *out_values) {
   93|    414|  SymbolDecoderT decoder;
   94|    414|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 98, False: 316]
  ------------------
   95|     98|    return false;
   96|     98|  }
   97|       |
   98|    316|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 316, False: 0]
  |  Branch (98:25): [True: 2, False: 314]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    314|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 117, False: 197]
  ------------------
  103|    117|    return false;
  104|    117|  }
  105|  11.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 11.5M, False: 197]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  11.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  11.5M|    out_values[i] = value;
  109|  11.5M|  }
  110|    197|  decoder.EndDecoding();
  111|    197|  return true;
  112|    314|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    263|                              uint32_t *out_values) {
   93|    263|  SymbolDecoderT decoder;
   94|    263|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 89, False: 174]
  ------------------
   95|     89|    return false;
   96|     89|  }
   97|       |
   98|    174|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 174, False: 0]
  |  Branch (98:25): [True: 1, False: 173]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    173|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 19, False: 154]
  ------------------
  103|     19|    return false;
  104|     19|  }
  105|  3.99M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.99M, False: 154]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.99M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.99M|    out_values[i] = value;
  109|  3.99M|  }
  110|    154|  decoder.EndDecoding();
  111|    154|  return true;
  112|    173|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    185|                              uint32_t *out_values) {
   93|    185|  SymbolDecoderT decoder;
   94|    185|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 9, False: 176]
  ------------------
   95|      9|    return false;
   96|      9|  }
   97|       |
   98|    176|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 176, False: 0]
  |  Branch (98:25): [True: 109, False: 67]
  ------------------
   99|    109|    return false;  // Wrong number of symbols.
  100|    109|  }
  101|       |
  102|     67|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 5, False: 62]
  ------------------
  103|      5|    return false;
  104|      5|  }
  105|  12.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.1M, False: 62]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.1M|    out_values[i] = value;
  109|  12.1M|  }
  110|     62|  decoder.EndDecoding();
  111|     62|  return true;
  112|     67|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    257|                              uint32_t *out_values) {
   93|    257|  SymbolDecoderT decoder;
   94|    257|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 91, False: 166]
  ------------------
   95|     91|    return false;
   96|     91|  }
   97|       |
   98|    166|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 166, False: 0]
  |  Branch (98:25): [True: 2, False: 164]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    164|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 81, False: 83]
  ------------------
  103|     81|    return false;
  104|     81|  }
  105|  44.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 44.5M, False: 83]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  44.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  44.5M|    out_values[i] = value;
  109|  44.5M|  }
  110|     83|  decoder.EndDecoding();
  111|     83|  return true;
  112|    164|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    298|                              uint32_t *out_values) {
   93|    298|  SymbolDecoderT decoder;
   94|    298|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 120, False: 178]
  ------------------
   95|    120|    return false;
   96|    120|  }
   97|       |
   98|    178|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 178, False: 0]
  |  Branch (98:25): [True: 0, False: 178]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    178|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 48, False: 130]
  ------------------
  103|     48|    return false;
  104|     48|  }
  105|  12.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.0M, False: 130]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.0M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.0M|    out_values[i] = value;
  109|  12.0M|  }
  110|    130|  decoder.EndDecoding();
  111|    130|  return true;
  112|    178|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    238|                              uint32_t *out_values) {
   93|    238|  SymbolDecoderT decoder;
   94|    238|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 109, False: 129]
  ------------------
   95|    109|    return false;
   96|    109|  }
   97|       |
   98|    129|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 129, False: 0]
  |  Branch (98:25): [True: 2, False: 127]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    127|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 86, False: 41]
  ------------------
  103|     86|    return false;
  104|     86|  }
  105|  12.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.7M, False: 41]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.7M|    out_values[i] = value;
  109|  12.7M|  }
  110|     41|  decoder.EndDecoding();
  111|     41|  return true;
  112|    127|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    242|                              uint32_t *out_values) {
   93|    242|  SymbolDecoderT decoder;
   94|    242|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 115, False: 127]
  ------------------
   95|    115|    return false;
   96|    115|  }
   97|       |
   98|    127|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 127, False: 0]
  |  Branch (98:25): [True: 1, False: 126]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    126|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 50, False: 76]
  ------------------
  103|     50|    return false;
  104|     50|  }
  105|  9.84M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.84M, False: 76]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.84M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.84M|    out_values[i] = value;
  109|  9.84M|  }
  110|     76|  decoder.EndDecoding();
  111|     76|  return true;
  112|    126|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    233|                              uint32_t *out_values) {
   93|    233|  SymbolDecoderT decoder;
   94|    233|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 98, False: 135]
  ------------------
   95|     98|    return false;
   96|     98|  }
   97|       |
   98|    135|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 135, False: 0]
  |  Branch (98:25): [True: 2, False: 133]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    133|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 80, False: 53]
  ------------------
  103|     80|    return false;
  104|     80|  }
  105|   372k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 372k, False: 53]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   372k|    const uint32_t value = decoder.DecodeSymbol();
  108|   372k|    out_values[i] = value;
  109|   372k|  }
  110|     53|  decoder.EndDecoding();
  111|     53|  return true;
  112|    133|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    224|                              uint32_t *out_values) {
   93|    224|  SymbolDecoderT decoder;
   94|    224|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 143, False: 81]
  ------------------
   95|    143|    return false;
   96|    143|  }
   97|       |
   98|     81|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 81, False: 0]
  |  Branch (98:25): [True: 2, False: 79]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|     79|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 46, False: 33]
  ------------------
  103|     46|    return false;
  104|     46|  }
  105|   235k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 235k, False: 33]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   235k|    const uint32_t value = decoder.DecodeSymbol();
  108|   235k|    out_values[i] = value;
  109|   235k|  }
  110|     33|  decoder.EndDecoding();
  111|     33|  return true;
  112|     79|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    196|                              uint32_t *out_values) {
   93|    196|  SymbolDecoderT decoder;
   94|    196|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 102, False: 94]
  ------------------
   95|    102|    return false;
   96|    102|  }
   97|       |
   98|     94|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 94, False: 0]
  |  Branch (98:25): [True: 9, False: 85]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|     85|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 48, False: 37]
  ------------------
  103|     48|    return false;
  104|     48|  }
  105|  36.2k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 36.1k, False: 37]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  36.1k|    const uint32_t value = decoder.DecodeSymbol();
  108|  36.1k|    out_values[i] = value;
  109|  36.1k|  }
  110|     37|  decoder.EndDecoding();
  111|     37|  return true;
  112|     85|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    192|                              uint32_t *out_values) {
   93|    192|  SymbolDecoderT decoder;
   94|    192|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 114, False: 78]
  ------------------
   95|    114|    return false;
   96|    114|  }
   97|       |
   98|     78|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 78, False: 0]
  |  Branch (98:25): [True: 0, False: 78]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     78|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 25, False: 53]
  ------------------
  103|     25|    return false;
  104|     25|  }
  105|   161k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 161k, False: 53]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   161k|    const uint32_t value = decoder.DecodeSymbol();
  108|   161k|    out_values[i] = value;
  109|   161k|  }
  110|     53|  decoder.EndDecoding();
  111|     53|  return true;
  112|     78|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    262|                              uint32_t *out_values) {
   93|    262|  SymbolDecoderT decoder;
   94|    262|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 119, False: 143]
  ------------------
   95|    119|    return false;
   96|    119|  }
   97|       |
   98|    143|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 143, False: 0]
  |  Branch (98:25): [True: 2, False: 141]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    141|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 78, False: 63]
  ------------------
  103|     78|    return false;
  104|     78|  }
  105|   148k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 148k, False: 63]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   148k|    const uint32_t value = decoder.DecodeSymbol();
  108|   148k|    out_values[i] = value;
  109|   148k|  }
  110|     63|  decoder.EndDecoding();
  111|     63|  return true;
  112|    141|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    176|                              uint32_t *out_values) {
   93|    176|  SymbolDecoderT decoder;
   94|    176|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 81, False: 95]
  ------------------
   95|     81|    return false;
   96|     81|  }
   97|       |
   98|     95|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 95, False: 0]
  |  Branch (98:25): [True: 3, False: 92]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|     92|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 46, False: 46]
  ------------------
  103|     46|    return false;
  104|     46|  }
  105|  10.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.5M, False: 46]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.5M|    out_values[i] = value;
  109|  10.5M|  }
  110|     46|  decoder.EndDecoding();
  111|     46|  return true;
  112|     92|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    222|                              uint32_t *out_values) {
   93|    222|  SymbolDecoderT decoder;
   94|    222|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 101, False: 121]
  ------------------
   95|    101|    return false;
   96|    101|  }
   97|       |
   98|    121|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 121, False: 0]
  |  Branch (98:25): [True: 2, False: 119]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    119|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 65, False: 54]
  ------------------
  103|     65|    return false;
  104|     65|  }
  105|  22.2M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 22.2M, False: 54]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  22.2M|    const uint32_t value = decoder.DecodeSymbol();
  108|  22.2M|    out_values[i] = value;
  109|  22.2M|  }
  110|     54|  decoder.EndDecoding();
  111|     54|  return true;
  112|    119|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    220|                              uint32_t *out_values) {
   93|    220|  SymbolDecoderT decoder;
   94|    220|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 99, False: 121]
  ------------------
   95|     99|    return false;
   96|     99|  }
   97|       |
   98|    121|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 121, False: 0]
  |  Branch (98:25): [True: 3, False: 118]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    118|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 57, False: 61]
  ------------------
  103|     57|    return false;
  104|     57|  }
  105|  12.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.7M, False: 61]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.7M|    out_values[i] = value;
  109|  12.7M|  }
  110|     61|  decoder.EndDecoding();
  111|     61|  return true;
  112|    118|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    251|                              uint32_t *out_values) {
   93|    251|  SymbolDecoderT decoder;
   94|    251|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 102, False: 149]
  ------------------
   95|    102|    return false;
   96|    102|  }
   97|       |
   98|    149|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 149, False: 0]
  |  Branch (98:25): [True: 0, False: 149]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    149|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 102, False: 47]
  ------------------
  103|    102|    return false;
  104|    102|  }
  105|   109k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 109k, False: 47]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   109k|    const uint32_t value = decoder.DecodeSymbol();
  108|   109k|    out_values[i] = value;
  109|   109k|  }
  110|     47|  decoder.EndDecoding();
  111|     47|  return true;
  112|    149|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  6.38k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  2.42k|  const CornerTable *GetCornerTable() const override {
   67|  2.42k|    return corner_table_.get();
   68|  2.42k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  2.46M|                       int *out_encoder_split_symbol_id) {
   87|  2.46M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 2.20M, False: 263k]
  ------------------
   88|  2.20M|      return false;
   89|  2.20M|    }
   90|   263k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 10, False: 263k]
  ------------------
   91|   263k|        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|     10|      *out_encoder_split_symbol_id = -1;
   98|     10|      return true;
   99|     10|    }
  100|   263k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 262k, False: 1.18k]
  ------------------
  101|   262k|      return false;
  102|   262k|    }
  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|   263k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  10.4M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  10.4M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  10.4M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  10.4M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  8.69k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  3.99k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  2.71k|  const CornerTable *GetCornerTable() const override {
   67|  2.71k|    return corner_table_.get();
   68|  2.71k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  16.6M|                       int *out_encoder_split_symbol_id) {
   87|  16.6M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 14.8M, False: 1.74M]
  ------------------
   88|  14.8M|      return false;
   89|  14.8M|    }
   90|  1.74M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 35, False: 1.74M]
  ------------------
   91|  1.74M|        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|     35|      *out_encoder_split_symbol_id = -1;
   98|     35|      return true;
   99|     35|    }
  100|  1.74M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 1.73M, False: 1.08k]
  ------------------
  101|  1.73M|      return false;
  102|  1.73M|    }
  103|  1.08k|    *out_face_edge =
  104|  1.08k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.08k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.08k|    topology_split_data_.pop_back();
  108|  1.08k|    return true;
  109|  1.74M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  49.3M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  49.3M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  49.3M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  49.3M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  4.89k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  8.88k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  1.81k|  const CornerTable *GetCornerTable() const override {
   67|  1.81k|    return corner_table_.get();
   68|  1.81k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  62.1M|                       int *out_encoder_split_symbol_id) {
   87|  62.1M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 61.6M, False: 495k]
  ------------------
   88|  61.6M|      return false;
   89|  61.6M|    }
   90|   495k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 40, False: 495k]
  ------------------
   91|   495k|        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|     40|      *out_encoder_split_symbol_id = -1;
   98|     40|      return true;
   99|     40|    }
  100|   495k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 494k, False: 987]
  ------------------
  101|   494k|      return false;
  102|   494k|    }
  103|    987|    *out_face_edge =
  104|    987|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    987|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    987|    topology_split_data_.pop_back();
  108|    987|    return true;
  109|   495k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  74.1M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  74.1M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  74.1M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  74.1M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  3.11k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  5.41k|      : attribute_connectivity_decoders_(nullptr),
   34|  5.41k|        num_attribute_data_(0),
   35|  5.41k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  5.04k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  5.04k|    decoder_impl_ = decoder;
   38|  5.04k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  5.04k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  5.04k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  5.04k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  4.14k|  uint16_t BitstreamVersion() const {
   45|  4.14k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  4.14k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  2.12k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  5.04k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  3.46k|  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.46k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 45, False: 3.41k]
  ------------------
   63|     45|      return false;
   64|     45|    }
   65|       |
   66|  3.41k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 57, False: 3.35k]
  ------------------
   67|     57|      return false;
   68|     57|    }
   69|       |
   70|  3.35k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 10, False: 3.34k]
  ------------------
   71|     10|      return false;
   72|     10|    }
   73|  3.34k|    *out_buffer = buffer_;
   74|  3.34k|    return true;
   75|  3.35k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  2.66M|  inline bool DecodeStartFaceConfiguration() {
   79|  2.66M|    uint32_t face_configuration;
   80|  2.66M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  2.66M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.66M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 712, False: 2.66M]
  ------------------
   82|    712|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    712|    } else
   85|  2.66M|#endif
   86|  2.66M|    {
   87|  2.66M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  2.66M|    }
   89|  2.66M|    return face_configuration;
   90|  2.66M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  7.19M|  inline uint32_t DecodeSymbol() {
   94|  7.19M|    uint32_t symbol;
   95|  7.19M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  7.19M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 3.52M, False: 3.66M]
  ------------------
   97|  3.52M|      return symbol;
   98|  3.52M|    }
   99|       |    // Else decode two additional bits.
  100|  3.66M|    uint32_t symbol_suffix;
  101|  3.66M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  3.66M|    symbol |= (symbol_suffix << 1);
  103|  3.66M|    return symbol;
  104|  7.19M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  7.11M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  1.17M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  16.3M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  16.3M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  16.3M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  3.27k|  void Done() {
  123|  3.27k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 3.05k, False: 220]
  ------------------
  124|  3.05k|      symbol_buffer_.EndBitDecoding();
  125|  3.05k|    }
  126|  3.27k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  3.27k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.27k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 302, False: 2.97k]
  ------------------
  128|    302|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    302|    } else
  131|  2.97k|#endif
  132|  2.97k|    {
  133|  2.97k|      start_face_decoder_.EndDecoding();
  134|  2.97k|    }
  135|  3.27k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  1.51k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  3.60k|  bool DecodeTraversalSymbols() {
  141|  3.60k|    uint64_t traversal_size;
  142|  3.60k|    symbol_buffer_ = buffer_;
  143|  3.60k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 11, False: 3.59k]
  ------------------
  144|     11|      return false;
  145|     11|    }
  146|  3.59k|    buffer_ = symbol_buffer_;
  147|  3.59k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 56, False: 3.53k]
  ------------------
  148|     56|      return false;
  149|     56|    }
  150|  3.53k|    buffer_.Advance(traversal_size);
  151|  3.53k|    return true;
  152|  3.59k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  4.97k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  4.97k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  4.97k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.97k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 500, False: 4.47k]
  ------------------
  158|    500|      start_face_buffer_ = buffer_;
  159|    500|      uint64_t traversal_size;
  160|    500|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 0, False: 500]
  ------------------
  161|      0|        return false;
  162|      0|      }
  163|    500|      buffer_ = start_face_buffer_;
  164|    500|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 83, False: 417]
  ------------------
  165|     83|        return false;
  166|     83|      }
  167|    417|      buffer_.Advance(traversal_size);
  168|    417|      return true;
  169|    500|    }
  170|  4.47k|#endif
  171|  4.47k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  4.97k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  4.88k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  4.88k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 3.25k, False: 1.63k]
  ------------------
  177|  3.25k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  3.25k|          new BinaryDecoder[num_attribute_data_]);
  179|  10.8k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 7.65k, False: 3.23k]
  ------------------
  180|  7.65k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 14, False: 7.64k]
  ------------------
  181|     14|          return false;
  182|     14|        }
  183|  7.65k|      }
  184|  3.25k|    }
  185|  4.86k|    return true;
  186|  4.88k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  1.76k|MeshSequentialDecoder::MeshSequentialDecoder() {}
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  1.60k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  1.60k|  uint32_t num_faces;
   31|  1.60k|  uint32_t num_points;
   32|  1.60k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  1.60k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.60k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 378, False: 1.23k]
  ------------------
   34|    378|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 0, False: 378]
  ------------------
   35|      0|      return false;
   36|      0|    }
   37|    378|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 0, False: 378]
  ------------------
   38|      0|      return false;
   39|      0|    }
   40|       |
   41|    378|  } else
   42|  1.23k|#endif
   43|  1.23k|  {
   44|  1.23k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 0, False: 1.23k]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|  1.23k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 0, False: 1.23k]
  ------------------
   48|      0|      return false;
   49|      0|    }
   50|  1.23k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  1.60k|  const uint64_t faces_64 = static_cast<uint64_t>(num_faces);
   54|       |  // Compressed sequential encoding can only handle (2^32 - 1) / 3 indices.
   55|  1.60k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 0, False: 1.60k]
  ------------------
   56|      0|    return false;
   57|      0|  }
   58|  1.60k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 0, False: 1.60k]
  ------------------
   59|       |    // The number of faces is unreasonably high, because face indices do not
   60|       |    // fit in the remaining size of the buffer.
   61|      0|    return false;
   62|      0|  }
   63|  1.60k|  uint8_t connectivity_method;
   64|  1.60k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 0, False: 1.60k]
  ------------------
   65|      0|    return false;
   66|      0|  }
   67|  1.60k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 1.24k, False: 360]
  ------------------
   68|  1.24k|    if (!DecodeAndDecompressIndices(num_faces)) {
  ------------------
  |  Branch (68:9): [True: 1.21k, False: 36]
  ------------------
   69|  1.21k|      return false;
   70|  1.21k|    }
   71|  1.24k|  } else {
   72|    360|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 194, False: 166]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|  2.11k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 1.92k, False: 190]
  ------------------
   75|  1.92k|        Mesh::Face face;
   76|  7.69k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 5.77k, False: 1.92k]
  ------------------
   77|  5.77k|          uint8_t val;
   78|  5.77k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 4, False: 5.77k]
  ------------------
   79|      4|            return false;
   80|      4|          }
   81|  5.77k|          face[j] = val;
   82|  5.77k|        }
   83|  1.92k|        mesh()->AddFace(face);
   84|  1.92k|      }
   85|    194|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (85:16): [True: 70, False: 96]
  ------------------
   86|       |      // Decode indices as uint16_t.
   87|    684|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (87:28): [True: 622, False: 62]
  ------------------
   88|    622|        Mesh::Face face;
   89|  2.46k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (89:25): [True: 1.85k, False: 614]
  ------------------
   90|  1.85k|          uint16_t val;
   91|  1.85k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (91:15): [True: 8, False: 1.84k]
  ------------------
   92|      8|            return false;
   93|      8|          }
   94|  1.84k|          face[j] = val;
   95|  1.84k|        }
   96|    614|        mesh()->AddFace(face);
   97|    614|      }
   98|     96|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (98:16): [True: 62, False: 34]
  ------------------
   99|     62|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     62|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (99:16): [True: 60, False: 2]
  ------------------
  100|       |      // Decode indices as uint32_t.
  101|    648|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (101:28): [True: 594, False: 54]
  ------------------
  102|    594|        Mesh::Face face;
  103|  2.36k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (103:25): [True: 1.78k, False: 588]
  ------------------
  104|  1.78k|          uint32_t val;
  105|  1.78k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (105:15): [True: 6, False: 1.77k]
  ------------------
  106|      6|            return false;
  107|      6|          }
  108|  1.77k|          face[j] = val;
  109|  1.77k|        }
  110|    588|        mesh()->AddFace(face);
  111|    588|      }
  112|     60|    } else {
  113|       |      // Decode faces as uint32_t (default).
  114|  3.03k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (114:28): [True: 3.01k, False: 21]
  ------------------
  115|  3.01k|        Mesh::Face face;
  116|  12.0k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (116:25): [True: 9.01k, False: 2.99k]
  ------------------
  117|  9.01k|          uint32_t val;
  118|  9.01k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (118:15): [True: 15, False: 8.99k]
  ------------------
  119|     15|            return false;
  120|     15|          }
  121|  8.99k|          face[j] = val;
  122|  8.99k|        }
  123|  2.99k|        mesh()->AddFace(face);
  124|  2.99k|      }
  125|     36|    }
  126|    360|  }
  127|    363|  point_cloud()->set_num_points(num_points);
  128|    363|  return true;
  129|  1.60k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  131|  6.90k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  132|       |  // Always create the basic attribute decoder.
  133|  6.90k|  return SetAttributesDecoder(
  134|  6.90k|      att_decoder_id,
  135|  6.90k|      std::unique_ptr<AttributesDecoder>(
  136|  6.90k|          new SequentialAttributeDecodersController(
  137|  6.90k|              std::unique_ptr<PointsSequencer>(
  138|  6.90k|                  new LinearSequencer(point_cloud()->num_points())))));
  139|  6.90k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEj:
  141|  1.24k|bool MeshSequentialDecoder::DecodeAndDecompressIndices(uint32_t num_faces) {
  142|       |  // Get decoded indices differences that were encoded with an entropy code.
  143|  1.24k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  144|  1.24k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (144:7): [True: 1.18k, False: 60]
  ------------------
  145|  1.18k|    return false;
  146|  1.18k|  }
  147|       |  // Reconstruct the indices from the differences.
  148|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  149|     60|  int32_t last_index_value = 0;  // This will always be >= 0.
  150|     60|  int vertex_index = 0;
  151|    805|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (151:24): [True: 769, False: 36]
  ------------------
  152|    769|    Mesh::Face face;
  153|  3.01k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (153:21): [True: 2.27k, False: 745]
  ------------------
  154|  2.27k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  155|  2.27k|      int32_t index_diff = (encoded_val >> 1);
  156|  2.27k|      if (encoded_val & 1) {
  ------------------
  |  Branch (156:11): [True: 830, False: 1.44k]
  ------------------
  157|    830|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (157:13): [True: 12, False: 818]
  ------------------
  158|       |          // Subtracting index_diff would result in a negative index.
  159|     12|          return false;
  160|     12|        }
  161|    818|        index_diff = -index_diff;
  162|  1.44k|      } else {
  163|  1.44k|        if (index_diff >
  ------------------
  |  Branch (163:13): [True: 12, False: 1.42k]
  ------------------
  164|  1.44k|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  165|       |          // Adding index_diff to last_index_value would overflow.
  166|     12|          return false;
  167|     12|        }
  168|  1.44k|      }
  169|  2.24k|      const int32_t index_value = index_diff + last_index_value;
  170|  2.24k|      face[j] = index_value;
  171|  2.24k|      last_index_value = index_value;
  172|  2.24k|    }
  173|    745|    mesh()->AddFace(face);
  174|    745|  }
  175|     36|  return true;
  176|     60|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.06k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.07M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.07M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.99M, False: 88.9k]
  ------------------
   61|  1.99M|      return true;  // Already traversed.
   62|  1.99M|    }
   63|       |
   64|  88.9k|    corner_traversal_stack_.clear();
   65|  88.9k|    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|  88.9k|    const VertexIndex next_vert =
   69|  88.9k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  88.9k|    const VertexIndex prev_vert =
   71|  88.9k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  88.9k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 88.9k]
  |  Branch (72:45): [True: 0, False: 88.9k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  88.9k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 88.5k, False: 478]
  ------------------
   76|  88.5k|      this->MarkVertexVisited(next_vert);
   77|  88.5k|      this->traversal_observer().OnNewVertexVisited(
   78|  88.5k|          next_vert, this->corner_table()->Next(corner_id));
   79|  88.5k|    }
   80|  88.9k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.21k, False: 85.7k]
  ------------------
   81|  3.21k|      this->MarkVertexVisited(prev_vert);
   82|  3.21k|      this->traversal_observer().OnNewVertexVisited(
   83|  3.21k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.21k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|   190k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 101k, False: 88.9k]
  ------------------
   88|       |      // Currently processed corner.
   89|   101k|      corner_id = corner_traversal_stack_.back();
   90|   101k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|   101k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 101k]
  |  Branch (92:47): [True: 633, False: 100k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    633|        corner_traversal_stack_.pop_back();
   95|    633|        continue;
   96|    633|      }
   97|  2.07M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.07M, Folded]
  ------------------
   98|  2.07M|        this->MarkFaceVisited(face_id);
   99|  2.07M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.07M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.07M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.07M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.07M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.00M, False: 1.07M]
  ------------------
  105|  1.00M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.00M|          this->MarkVertexVisited(vert_id);
  107|  1.00M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.00M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 982k, False: 25.8k]
  ------------------
  109|   982k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   982k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   982k|            continue;
  112|   982k|          }
  113|  1.00M|        }
  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.09M|        const CornerIndex right_corner_id =
  118|  1.09M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.09M|        const CornerIndex left_corner_id =
  120|  1.09M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.09M|        const FaceIndex right_face_id(
  122|  1.09M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 17.7k, False: 1.07M]
  ------------------
  123|  1.09M|                 ? kInvalidFaceIndex
  124|  1.09M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.09M|        const FaceIndex left_face_id(
  126|  1.09M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 96.0k, False: 1.00M]
  ------------------
  127|  1.09M|                 ? kInvalidFaceIndex
  128|  1.09M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.09M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.02M, False: 73.6k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.02M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 94.5k, False: 928k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  94.5k|            corner_traversal_stack_.pop_back();
  134|  94.5k|            break;  // Break from the while (true) loop.
  135|   928k|          } else {
  136|       |            // Go to the left face.
  137|   928k|            corner_id = left_corner_id;
  138|   928k|            face_id = left_face_id;
  139|   928k|          }
  140|  1.02M|        } else {
  141|       |          // Right face was not visited.
  142|  73.6k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 67.4k, False: 6.20k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  67.4k|            corner_id = right_corner_id;
  145|  67.4k|            face_id = right_face_id;
  146|  67.4k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  6.20k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  6.20k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  6.20k|            break;
  159|  6.20k|          }
  160|  73.6k|        }
  161|  1.09M|      }
  162|   100k|    }
  163|  88.9k|    return true;
  164|  88.9k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.06k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.23k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.45k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.09M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.09M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.08M, False: 2.00M]
  ------------------
   61|  1.08M|      return true;  // Already traversed.
   62|  1.08M|    }
   63|       |
   64|  2.00M|    corner_traversal_stack_.clear();
   65|  2.00M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  2.00M|    const VertexIndex next_vert =
   69|  2.00M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.00M|    const VertexIndex prev_vert =
   71|  2.00M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.00M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.00M]
  |  Branch (72:45): [True: 0, False: 2.00M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.00M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.00M, False: 968]
  ------------------
   76|  2.00M|      this->MarkVertexVisited(next_vert);
   77|  2.00M|      this->traversal_observer().OnNewVertexVisited(
   78|  2.00M|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.00M|    }
   80|  2.00M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 1.95M, False: 48.5k]
  ------------------
   81|  1.95M|      this->MarkVertexVisited(prev_vert);
   82|  1.95M|      this->traversal_observer().OnNewVertexVisited(
   83|  1.95M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  1.95M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  4.05M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.05M, False: 2.00M]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.05M|      corner_id = corner_traversal_stack_.back();
   90|  2.05M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.05M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.05M]
  |  Branch (92:47): [True: 3.56k, False: 2.05M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  3.56k|        corner_traversal_stack_.pop_back();
   95|  3.56k|        continue;
   96|  3.56k|      }
   97|  3.09M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.09M, Folded]
  ------------------
   98|  3.09M|        this->MarkFaceVisited(face_id);
   99|  3.09M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.09M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.09M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.09M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.09M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 2.51M, False: 572k]
  ------------------
  105|  2.51M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  2.51M|          this->MarkVertexVisited(vert_id);
  107|  2.51M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  2.51M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 514k, False: 2.00M]
  ------------------
  109|   514k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   514k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   514k|            continue;
  112|   514k|          }
  113|  2.51M|        }
  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|  2.57M|        const CornerIndex right_corner_id =
  118|  2.57M|            this->corner_table()->GetRightCorner(corner_id);
  119|  2.57M|        const CornerIndex left_corner_id =
  120|  2.57M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  2.57M|        const FaceIndex right_face_id(
  122|  2.57M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 1.98M, False: 593k]
  ------------------
  123|  2.57M|                 ? kInvalidFaceIndex
  124|  2.57M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  2.57M|        const FaceIndex left_face_id(
  126|  2.57M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.02M, False: 553k]
  ------------------
  127|  2.57M|                 ? kInvalidFaceIndex
  128|  2.57M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  2.57M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 2.49M, False: 82.7k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  2.49M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.02M, False: 468k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.02M|            corner_traversal_stack_.pop_back();
  134|  2.02M|            break;  // Break from the while (true) loop.
  135|  2.02M|          } else {
  136|       |            // Go to the left face.
  137|   468k|            corner_id = left_corner_id;
  138|   468k|            face_id = left_face_id;
  139|   468k|          }
  140|  2.49M|        } else {
  141|       |          // Right face was not visited.
  142|  82.7k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 55.8k, False: 26.9k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  55.8k|            corner_id = right_corner_id;
  145|  55.8k|            face_id = right_face_id;
  146|  55.8k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  26.9k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  26.9k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  26.9k|            break;
  159|  26.9k|          }
  160|  82.7k|        }
  161|  2.57M|      }
  162|  2.05M|    }
  163|  2.00M|    return true;
  164|  2.00M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.45k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.99k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    438|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    768|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    768|    const auto *corner_table = traverser_.corner_table();
   50|    768|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    768|    const size_t num_faces = mesh_->num_faces();
   52|    768|    const size_t num_points = mesh_->num_points();
   53|  3.70M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 3.70M, False: 768]
  ------------------
   54|  3.70M|      const auto &face = mesh_->face(f);
   55|  14.8M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 11.1M, False: 3.70M]
  ------------------
   56|  11.1M|        const PointIndex point_id = face[p];
   57|  11.1M|        const VertexIndex vert_id =
   58|  11.1M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  11.1M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 11.1M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  11.1M|        const AttributeValueIndex att_entry_id(
   63|  11.1M|            encoding_data_
   64|  11.1M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  11.1M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 11.1M]
  |  Branch (65:13): [True: 0, False: 11.1M]
  |  Branch (65:39): [True: 0, False: 11.1M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  11.1M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  11.1M|      }
   71|  3.70M|    }
   72|    768|    return true;
   73|    768|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    408|  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|    408|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    408|    traverser_.OnTraversalStart();
   82|    408|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 408]
  ------------------
   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|    408|    } else {
   89|    408|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.21M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.21M, False: 408]
  ------------------
   91|  2.21M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.21M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.21M|      }
   95|    408|    }
   96|    408|    traverser_.OnTraversalEnd();
   97|    408|    return true;
   98|    408|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.21M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.21M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.21M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    438|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.11k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.36k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  5.36k|    const auto *corner_table = traverser_.corner_table();
   50|  5.36k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.36k|    const size_t num_faces = mesh_->num_faces();
   52|  5.36k|    const size_t num_points = mesh_->num_points();
   53|  3.62M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 3.62M, False: 5.36k]
  ------------------
   54|  3.62M|      const auto &face = mesh_->face(f);
   55|  14.4M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 10.8M, False: 3.62M]
  ------------------
   56|  10.8M|        const PointIndex point_id = face[p];
   57|  10.8M|        const VertexIndex vert_id =
   58|  10.8M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  10.8M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 10.8M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  10.8M|        const AttributeValueIndex att_entry_id(
   63|  10.8M|            encoding_data_
   64|  10.8M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  10.8M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 10.8M]
  |  Branch (65:13): [True: 0, False: 10.8M]
  |  Branch (65:39): [True: 0, False: 10.8M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  10.8M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  10.8M|      }
   71|  3.62M|    }
   72|  5.36k|    return true;
   73|  5.36k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.06k|  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.06k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.06k|    traverser_.OnTraversalStart();
   82|  1.06k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.06k]
  ------------------
   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.06k|    } else {
   89|  1.06k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.08M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.07M, False: 1.06k]
  ------------------
   91|  2.07M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.07M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.07M|      }
   95|  1.06k|    }
   96|  1.06k|    traverser_.OnTraversalEnd();
   97|  1.06k|    return true;
   98|  1.06k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.07M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.07M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.07M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.11k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.49k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  4.38k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  4.38k|    const auto *corner_table = traverser_.corner_table();
   50|  4.38k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  4.38k|    const size_t num_faces = mesh_->num_faces();
   52|  4.38k|    const size_t num_points = mesh_->num_points();
   53|  5.12M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.11M, False: 4.38k]
  ------------------
   54|  5.11M|      const auto &face = mesh_->face(f);
   55|  20.4M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 15.3M, False: 5.11M]
  ------------------
   56|  15.3M|        const PointIndex point_id = face[p];
   57|  15.3M|        const VertexIndex vert_id =
   58|  15.3M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  15.3M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 15.3M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  15.3M|        const AttributeValueIndex att_entry_id(
   63|  15.3M|            encoding_data_
   64|  15.3M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  15.3M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 15.3M]
  |  Branch (65:13): [True: 1, False: 15.3M]
  |  Branch (65:39): [True: 1, False: 15.3M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      1|          return false;
   68|      1|        }
   69|  15.3M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  15.3M|      }
   71|  5.11M|    }
   72|  4.38k|    return true;
   73|  4.38k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.45k|  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.45k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.45k|    traverser_.OnTraversalStart();
   82|  1.45k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.45k]
  ------------------
   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.45k|    } else {
   89|  1.45k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.09M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.09M, False: 1.45k]
  ------------------
   91|  3.09M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.09M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.09M|      }
   95|  1.45k|    }
   96|  1.45k|    traverser_.OnTraversalEnd();
   97|  1.45k|    return true;
   98|  1.45k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.09M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.09M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.09M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.49k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  2.99k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  27.7M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  14.3M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  14.3M|    return is_vertex_visited_[vert_id.value()];
   65|  14.3M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.24M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.24M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.24M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  6.54M|  inline TraversalObserverT &traversal_observer() {
   75|  6.54M|    return traversal_observer_;
   76|  6.54M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  10.9M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  10.9M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 174k, False: 10.8M]
  ------------------
   47|   174k|      return true;  // Invalid faces are always considered as visited.
   48|   174k|    }
   49|  10.8M|    return is_face_visited_[face_id.value()];
   50|  10.9M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  4.29M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  4.29M|    is_face_visited_[face_id.value()] = true;
   62|  4.29M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.11k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.11k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.55k|                    TraversalObserver traversal_observer) {
   37|  1.55k|    corner_table_ = corner_table;
   38|  1.55k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.55k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.55k|    traversal_observer_ = traversal_observer;
   41|  1.55k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.07M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.07M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.07M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.07M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.07M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  23.2M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.09M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.09M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.09M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.09M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.09M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  7.09M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  7.09M|    return is_vertex_visited_[vert_id.value()];
   65|  7.09M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  6.47M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  6.47M|    is_vertex_visited_[vert_id.value()] = true;
   68|  6.47M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  9.56M|  inline TraversalObserverT &traversal_observer() {
   75|  9.56M|    return traversal_observer_;
   76|  9.56M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  7.21M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  7.21M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 4.00M, False: 3.20M]
  ------------------
   47|  4.00M|      return true;  // Invalid faces are always considered as visited.
   48|  4.00M|    }
   49|  3.20M|    return is_face_visited_[face_id.value()];
   50|  7.21M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.09M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.09M|    is_face_visited_[face_id.value()] = true;
   62|  3.09M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  2.99k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.49k|                    TraversalObserver traversal_observer) {
   37|  1.49k|    corner_table_ = corner_table;
   38|  1.49k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.49k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.49k|    traversal_observer_ = traversal_observer;
   41|  1.49k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    205|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    205|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 7, False: 198]
  ------------------
  187|      7|    return false;
  188|      7|  }
  189|    198|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 14, False: 184]
  ------------------
  190|     14|    return false;
  191|     14|  }
  192|    184|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 3, False: 181]
  ------------------
  193|      3|    return false;
  194|      3|  }
  195|    181|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 87, False: 94]
  ------------------
  196|     87|    return true;
  197|     87|  }
  198|     94|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 9, False: 85]
  ------------------
  199|      9|    return false;
  200|      9|  }
  201|     85|  num_decoded_points_ = 0;
  202|       |
  203|     85|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 9, False: 76]
  ------------------
  204|      9|    return false;
  205|      9|  }
  206|     76|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 74]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     74|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 74]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     74|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 72]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     72|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 53, False: 19]
  ------------------
  217|     53|    return false;
  218|     53|  }
  219|       |
  220|     19|  numbers_decoder_.EndDecoding();
  221|     19|  remaining_bits_decoder_.EndDecoding();
  222|     19|  axis_decoder_.EndDecoding();
  223|     19|  half_decoder_.EndDecoding();
  224|       |
  225|     19|  return true;
  226|     72|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     72|    uint32_t num_points, OutputIteratorT &oit) {
  254|     72|  typedef DecodingStatus Status;
  255|     72|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     72|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     72|  DecodingStatus init_status(num_points, 0, 0);
  258|     72|  std::stack<Status> status_stack;
  259|     72|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   600k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 600k, False: 19]
  ------------------
  263|   600k|    const DecodingStatus status = status_stack.top();
  264|   600k|    status_stack.pop();
  265|       |
  266|   600k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   600k|    const uint32_t last_axis = status.last_axis;
  268|   600k|    const uint32_t stack_pos = status.stack_pos;
  269|   600k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   600k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   600k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 600k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   600k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   600k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 600k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   600k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   600k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 297k, False: 303k]
  ------------------
  285|   127M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 127M, False: 297k]
  ------------------
  286|   127M|        *oit = old_base;
  287|   127M|        ++oit;
  288|   127M|        ++num_decoded_points_;
  289|   127M|      }
  290|   297k|      continue;
  291|   297k|    }
  292|       |
  293|   303k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   303k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 2.25k, False: 300k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  2.25k|      axes_[0] = axis;
  300|  7.19k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 4.94k, False: 2.25k]
  ------------------
  301|  4.94k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  4.94k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.21k, False: 3.73k]
  |  |  ------------------
  ------------------
  302|  4.94k|      }
  303|  5.99k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.76k, False: 2.22k]
  ------------------
  304|  14.5k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 10.8k, False: 3.74k]
  ------------------
  305|  10.8k|          p_[axes_[j]] = 0;
  306|  10.8k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  10.8k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 9.47k, False: 1.36k]
  ------------------
  308|  9.47k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 24, False: 9.44k]
  ------------------
  309|  9.47k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     24|              return false;
  311|     24|            }
  312|  9.47k|          }
  313|  10.8k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  10.8k|        }
  315|  3.74k|        *oit = p_;
  316|  3.74k|        ++oit;
  317|  3.74k|        ++num_decoded_points_;
  318|  3.74k|      }
  319|  2.22k|      continue;
  320|  2.25k|    }
  321|       |
  322|   300k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 300k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   300k|    const int num_remaining_bits = bit_length_ - level;
  327|   300k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   300k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   300k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   300k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   300k|    uint32_t number = 0;
  334|   300k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   300k|    uint32_t first_half = num_remaining_points / 2;
  337|   300k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 29, False: 300k]
  ------------------
  338|       |      // Invalid |number|.
  339|     29|      return false;
  340|     29|    }
  341|   300k|    first_half -= number;
  342|   300k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   300k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 177k, False: 123k]
  ------------------
  345|   177k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 174k, False: 2.54k]
  ------------------
  346|   174k|        std::swap(first_half, second_half);
  347|   174k|      }
  348|   177k|    }
  349|       |
  350|   300k|    levels_stack_[stack_pos][axis] += 1;
  351|   300k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   300k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 300k, False: 94]
  ------------------
  353|   300k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   300k|    }
  355|   300k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 300k, False: 226]
  ------------------
  356|   300k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   300k|    }
  358|   300k|  }
  359|     19|  return true;
  360|     72|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  2.24M|        : num_remaining_points(num_remaining_points_),
  135|  2.24M|          last_axis(last_axis_),
  136|  2.24M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  1.12M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.12M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.12M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     85|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    287|      : bit_length_(0),
   87|    287|        num_points_(0),
   88|    287|        num_decoded_points_(0),
   89|    287|        dimension_(dimension),
   90|    287|        p_(dimension, 0),
   91|    287|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    287|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    287|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    116|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    116|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 114]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|    114|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 4, False: 110]
  ------------------
  190|      4|    return false;
  191|      4|  }
  192|    110|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 109]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    109|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 20, False: 89]
  ------------------
  196|     20|    return true;
  197|     20|  }
  198|     89|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 87]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|     87|  num_decoded_points_ = 0;
  202|       |
  203|     87|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 83]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|     83|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 79]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     79|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 78]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     78|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 76]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     76|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 57, False: 19]
  ------------------
  217|     57|    return false;
  218|     57|  }
  219|       |
  220|     19|  numbers_decoder_.EndDecoding();
  221|     19|  remaining_bits_decoder_.EndDecoding();
  222|     19|  axis_decoder_.EndDecoding();
  223|     19|  half_decoder_.EndDecoding();
  224|       |
  225|     19|  return true;
  226|     76|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     76|    uint32_t num_points, OutputIteratorT &oit) {
  254|     76|  typedef DecodingStatus Status;
  255|     76|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     76|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     76|  DecodingStatus init_status(num_points, 0, 0);
  258|     76|  std::stack<Status> status_stack;
  259|     76|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.13M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.13M, False: 19]
  ------------------
  263|  2.13M|    const DecodingStatus status = status_stack.top();
  264|  2.13M|    status_stack.pop();
  265|       |
  266|  2.13M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.13M|    const uint32_t last_axis = status.last_axis;
  268|  2.13M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.13M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.13M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.13M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.13M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.13M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.13M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.13M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.13M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.13M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.06M, False: 1.06M]
  ------------------
  285|   155M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 154M, False: 1.06M]
  ------------------
  286|   154M|        *oit = old_base;
  287|   154M|        ++oit;
  288|   154M|        ++num_decoded_points_;
  289|   154M|      }
  290|  1.06M|      continue;
  291|  1.06M|    }
  292|       |
  293|  1.06M|    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.06M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.62k, False: 1.06M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.62k|      axes_[0] = axis;
  300|  9.80k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 8.17k, False: 1.62k]
  ------------------
  301|  8.17k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  8.17k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 359, False: 7.82k]
  |  |  ------------------
  ------------------
  302|  8.17k|      }
  303|  4.47k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.88k, False: 1.59k]
  ------------------
  304|  19.4k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 16.5k, False: 2.85k]
  ------------------
  305|  16.5k|          p_[axes_[j]] = 0;
  306|  16.5k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  16.5k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.98k, False: 11.6k]
  ------------------
  308|  4.98k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 27, False: 4.95k]
  ------------------
  309|  4.98k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     27|              return false;
  311|     27|            }
  312|  4.98k|          }
  313|  16.5k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  16.5k|        }
  315|  2.85k|        *oit = p_;
  316|  2.85k|        ++oit;
  317|  2.85k|        ++num_decoded_points_;
  318|  2.85k|      }
  319|  1.59k|      continue;
  320|  1.62k|    }
  321|       |
  322|  1.06M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.06M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.06M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.06M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.06M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.06M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.06M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.06M|    uint32_t number = 0;
  334|  1.06M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.06M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.06M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 30, False: 1.06M]
  ------------------
  338|       |      // Invalid |number|.
  339|     30|      return false;
  340|     30|    }
  341|  1.06M|    first_half -= number;
  342|  1.06M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.06M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 540k, False: 526k]
  ------------------
  345|   540k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 536k, False: 4.26k]
  ------------------
  346|   536k|        std::swap(first_half, second_half);
  347|   536k|      }
  348|   540k|    }
  349|       |
  350|  1.06M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.06M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.06M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.06M, False: 51]
  ------------------
  353|  1.06M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.06M|    }
  355|  1.06M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.06M, False: 226]
  ------------------
  356|  1.06M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.06M|    }
  358|  1.06M|  }
  359|     19|  return true;
  360|     76|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  4.95M|        : num_remaining_points(num_remaining_points_),
  135|  4.95M|          last_axis(last_axis_),
  136|  4.95M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.95M|    uint32_t last_axis) {
  232|  4.95M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.95M, Folded]
  ------------------
  233|  4.95M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.95M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.16M, False: 2.79M]
  |  |  ------------------
  ------------------
  234|  4.95M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  4.95M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  2.47M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.47M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.47M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|     18|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    119|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    119|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 118]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    118|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 111]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|    111|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 111]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    111|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 21, False: 90]
  ------------------
  196|     21|    return true;
  197|     21|  }
  198|     90|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 6, False: 84]
  ------------------
  199|      6|    return false;
  200|      6|  }
  201|     84|  num_decoded_points_ = 0;
  202|       |
  203|     84|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 7, False: 77]
  ------------------
  204|      7|    return false;
  205|      7|  }
  206|     77|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 74]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     74|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 72]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     72|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 70]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     70|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 67, False: 3]
  ------------------
  217|     67|    return false;
  218|     67|  }
  219|       |
  220|      3|  numbers_decoder_.EndDecoding();
  221|      3|  remaining_bits_decoder_.EndDecoding();
  222|      3|  axis_decoder_.EndDecoding();
  223|      3|  half_decoder_.EndDecoding();
  224|       |
  225|      3|  return true;
  226|     70|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     70|    uint32_t num_points, OutputIteratorT &oit) {
  254|     70|  typedef DecodingStatus Status;
  255|     70|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     70|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     70|  DecodingStatus init_status(num_points, 0, 0);
  258|     70|  std::stack<Status> status_stack;
  259|     70|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  34.4k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 34.4k, False: 3]
  ------------------
  263|  34.4k|    const DecodingStatus status = status_stack.top();
  264|  34.4k|    status_stack.pop();
  265|       |
  266|  34.4k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  34.4k|    const uint32_t last_axis = status.last_axis;
  268|  34.4k|    const uint32_t stack_pos = status.stack_pos;
  269|  34.4k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  34.4k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  34.4k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 34.4k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  34.4k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  34.4k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 34.4k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  34.4k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  34.4k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.93k, False: 29.5k]
  ------------------
  285|  6.53M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 6.52M, False: 4.93k]
  ------------------
  286|  6.52M|        *oit = old_base;
  287|  6.52M|        ++oit;
  288|  6.52M|        ++num_decoded_points_;
  289|  6.52M|      }
  290|  4.93k|      continue;
  291|  4.93k|    }
  292|       |
  293|  29.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|  29.5k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 518, False: 29.0k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    518|      axes_[0] = axis;
  300|  1.33k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 815, False: 518]
  ------------------
  301|    815|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    815|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 121, False: 694]
  |  |  ------------------
  ------------------
  302|    815|      }
  303|  1.39k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 897, False: 501]
  ------------------
  304|  3.02k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 2.14k, False: 880]
  ------------------
  305|  2.14k|          p_[axes_[j]] = 0;
  306|  2.14k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  2.14k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.53k, False: 614]
  ------------------
  308|  1.53k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 17, False: 1.51k]
  ------------------
  309|  1.53k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     17|              return false;
  311|     17|            }
  312|  1.53k|          }
  313|  2.13k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  2.13k|        }
  315|    880|        *oit = p_;
  316|    880|        ++oit;
  317|    880|        ++num_decoded_points_;
  318|    880|      }
  319|    501|      continue;
  320|    518|    }
  321|       |
  322|  29.0k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 29.0k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  29.0k|    const int num_remaining_bits = bit_length_ - level;
  327|  29.0k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  29.0k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  29.0k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  29.0k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  29.0k|    uint32_t number = 0;
  334|  29.0k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  29.0k|    uint32_t first_half = num_remaining_points / 2;
  337|  29.0k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 50, False: 28.9k]
  ------------------
  338|       |      // Invalid |number|.
  339|     50|      return false;
  340|     50|    }
  341|  28.9k|    first_half -= number;
  342|  28.9k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  28.9k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 26.3k, False: 2.66k]
  ------------------
  345|  26.3k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 22.8k, False: 3.43k]
  ------------------
  346|  22.8k|        std::swap(first_half, second_half);
  347|  22.8k|      }
  348|  26.3k|    }
  349|       |
  350|  28.9k|    levels_stack_[stack_pos][axis] += 1;
  351|  28.9k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  28.9k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 26.2k, False: 2.71k]
  ------------------
  353|  26.2k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  26.2k|    }
  355|  28.9k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 8.54k, False: 20.4k]
  ------------------
  356|  8.54k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  8.54k|    }
  358|  28.9k|  }
  359|      3|  return true;
  360|     70|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  4.26M|        : num_remaining_points(num_remaining_points_),
  135|  4.26M|          last_axis(last_axis_),
  136|  4.26M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  2.14M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.14M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.14M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|     23|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    215|      : bit_length_(0),
   87|    215|        num_points_(0),
   88|    215|        num_decoded_points_(0),
   89|    215|        dimension_(dimension),
   90|    215|        p_(dimension, 0),
   91|    215|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    215|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    215|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    138|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    138|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 137]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    137|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 12, False: 125]
  ------------------
  190|     12|    return false;
  191|     12|  }
  192|    125|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 124]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    124|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 16, False: 108]
  ------------------
  196|     16|    return true;
  197|     16|  }
  198|    108|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 11, False: 97]
  ------------------
  199|     11|    return false;
  200|     11|  }
  201|     97|  num_decoded_points_ = 0;
  202|       |
  203|     97|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 96]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|     96|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 95]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     95|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 94]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     94|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 94]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     94|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 83, False: 11]
  ------------------
  217|     83|    return false;
  218|     83|  }
  219|       |
  220|     11|  numbers_decoder_.EndDecoding();
  221|     11|  remaining_bits_decoder_.EndDecoding();
  222|     11|  axis_decoder_.EndDecoding();
  223|     11|  half_decoder_.EndDecoding();
  224|       |
  225|     11|  return true;
  226|     94|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     94|    uint32_t num_points, OutputIteratorT &oit) {
  254|     94|  typedef DecodingStatus Status;
  255|     94|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     94|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     94|  DecodingStatus init_status(num_points, 0, 0);
  258|     94|  std::stack<Status> status_stack;
  259|     94|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  32.2k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 32.2k, False: 11]
  ------------------
  263|  32.2k|    const DecodingStatus status = status_stack.top();
  264|  32.2k|    status_stack.pop();
  265|       |
  266|  32.2k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  32.2k|    const uint32_t last_axis = status.last_axis;
  268|  32.2k|    const uint32_t stack_pos = status.stack_pos;
  269|  32.2k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  32.2k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  32.2k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 32.2k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  32.2k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  32.2k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 32.2k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  32.2k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  32.2k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.02k, False: 30.1k]
  ------------------
  285|  5.37M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 5.36M, False: 2.02k]
  ------------------
  286|  5.36M|        *oit = old_base;
  287|  5.36M|        ++oit;
  288|  5.36M|        ++num_decoded_points_;
  289|  5.36M|      }
  290|  2.02k|      continue;
  291|  2.02k|    }
  292|       |
  293|  30.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|  30.1k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.79k, False: 28.4k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.79k|      axes_[0] = axis;
  300|  4.66k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.86k, False: 1.79k]
  ------------------
  301|  2.86k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.86k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 725, False: 2.14k]
  |  |  ------------------
  ------------------
  302|  2.86k|      }
  303|  4.69k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.92k, False: 1.77k]
  ------------------
  304|  10.3k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 7.47k, False: 2.90k]
  ------------------
  305|  7.47k|          p_[axes_[j]] = 0;
  306|  7.47k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  7.47k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 5.20k, False: 2.27k]
  ------------------
  308|  5.20k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 18, False: 5.18k]
  ------------------
  309|  5.20k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     18|              return false;
  311|     18|            }
  312|  5.20k|          }
  313|  7.46k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  7.46k|        }
  315|  2.90k|        *oit = p_;
  316|  2.90k|        ++oit;
  317|  2.90k|        ++num_decoded_points_;
  318|  2.90k|      }
  319|  1.77k|      continue;
  320|  1.79k|    }
  321|       |
  322|  28.4k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 28.4k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  28.4k|    const int num_remaining_bits = bit_length_ - level;
  327|  28.4k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  28.4k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  28.4k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  28.4k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  28.4k|    uint32_t number = 0;
  334|  28.4k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  28.4k|    uint32_t first_half = num_remaining_points / 2;
  337|  28.4k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 65, False: 28.3k]
  ------------------
  338|       |      // Invalid |number|.
  339|     65|      return false;
  340|     65|    }
  341|  28.3k|    first_half -= number;
  342|  28.3k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  28.3k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 26.1k, False: 2.15k]
  ------------------
  345|  26.1k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 23.2k, False: 2.89k]
  ------------------
  346|  23.2k|        std::swap(first_half, second_half);
  347|  23.2k|      }
  348|  26.1k|    }
  349|       |
  350|  28.3k|    levels_stack_[stack_pos][axis] += 1;
  351|  28.3k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  28.3k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 25.9k, False: 2.35k]
  ------------------
  353|  25.9k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  25.9k|    }
  355|  28.3k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 6.77k, False: 21.5k]
  ------------------
  356|  6.77k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  6.77k|    }
  358|  28.3k|  }
  359|     11|  return true;
  360|     94|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  94.4k|        : num_remaining_points(num_remaining_points_),
  135|  94.4k|          last_axis(last_axis_),
  136|  94.4k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  92.7k|    uint32_t last_axis) {
  232|  92.7k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 92.7k, Folded]
  ------------------
  233|  92.7k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  92.7k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 22.7k, False: 70.0k]
  |  |  ------------------
  ------------------
  234|  92.7k|  }
  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|  92.7k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  59.3k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  59.3k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  59.3k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|     22|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    138|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    138|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 137]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    137|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 4, False: 133]
  ------------------
  190|      4|    return false;
  191|      4|  }
  192|    133|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 133]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    133|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 21, False: 112]
  ------------------
  196|     21|    return true;
  197|     21|  }
  198|    112|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 12, False: 100]
  ------------------
  199|     12|    return false;
  200|     12|  }
  201|    100|  num_decoded_points_ = 0;
  202|       |
  203|    100|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 9, False: 91]
  ------------------
  204|      9|    return false;
  205|      9|  }
  206|     91|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 90]
  ------------------
  207|      1|    return false;
  208|      1|  }
  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: 54, False: 31]
  ------------------
  217|     54|    return false;
  218|     54|  }
  219|       |
  220|     31|  numbers_decoder_.EndDecoding();
  221|     31|  remaining_bits_decoder_.EndDecoding();
  222|     31|  axis_decoder_.EndDecoding();
  223|     31|  half_decoder_.EndDecoding();
  224|       |
  225|     31|  return true;
  226|     85|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_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|  3.30M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.30M, False: 31]
  ------------------
  263|  3.30M|    const DecodingStatus status = status_stack.top();
  264|  3.30M|    status_stack.pop();
  265|       |
  266|  3.30M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.30M|    const uint32_t last_axis = status.last_axis;
  268|  3.30M|    const uint32_t stack_pos = status.stack_pos;
  269|  3.30M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.30M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.30M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.30M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.30M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.30M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.30M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.30M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.30M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.56M, False: 1.74M]
  ------------------
  285|  73.3M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 71.7M, False: 1.56M]
  ------------------
  286|  71.7M|        *oit = old_base;
  287|  71.7M|        ++oit;
  288|  71.7M|        ++num_decoded_points_;
  289|  71.7M|      }
  290|  1.56M|      continue;
  291|  1.56M|    }
  292|       |
  293|  1.74M|    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.74M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 74.4k, False: 1.66M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  74.4k|      axes_[0] = axis;
  300|   118k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 44.4k, False: 74.4k]
  ------------------
  301|  44.4k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  44.4k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 15.9k, False: 28.4k]
  |  |  ------------------
  ------------------
  302|  44.4k|      }
  303|   189k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 114k, False: 74.3k]
  ------------------
  304|   289k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 175k, False: 114k]
  ------------------
  305|   175k|          p_[axes_[j]] = 0;
  306|   175k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   175k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 155k, False: 19.1k]
  ------------------
  308|   155k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 45, False: 155k]
  ------------------
  309|   155k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     45|              return false;
  311|     45|            }
  312|   155k|          }
  313|   175k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   175k|        }
  315|   114k|        *oit = p_;
  316|   114k|        ++oit;
  317|   114k|        ++num_decoded_points_;
  318|   114k|      }
  319|  74.3k|      continue;
  320|  74.4k|    }
  321|       |
  322|  1.66M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.66M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.66M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.66M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.66M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.66M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.66M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.66M|    uint32_t number = 0;
  334|  1.66M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.66M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.66M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 9, False: 1.66M]
  ------------------
  338|       |      // Invalid |number|.
  339|      9|      return false;
  340|      9|    }
  341|  1.66M|    first_half -= number;
  342|  1.66M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.66M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.61M, False: 51.4k]
  ------------------
  345|  1.61M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.58M, False: 28.8k]
  ------------------
  346|  1.58M|        std::swap(first_half, second_half);
  347|  1.58M|      }
  348|  1.61M|    }
  349|       |
  350|  1.66M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.66M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.66M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.65M, False: 11.3k]
  ------------------
  353|  1.65M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.65M|    }
  355|  1.66M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.65M, False: 17.3k]
  ------------------
  356|  1.65M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.65M|    }
  358|  1.66M|  }
  359|     31|  return true;
  360|     85|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  3.30M|        : num_remaining_points(num_remaining_points_),
  135|  3.30M|          last_axis(last_axis_),
  136|  3.30M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  1.66M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.66M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.66M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     52|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   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_j:
  185|    146|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    146|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 146]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    146|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 143]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|    143|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 143]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    143|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 5, False: 138]
  ------------------
  196|      5|    return true;
  197|      5|  }
  198|    138|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 8, False: 130]
  ------------------
  199|      8|    return false;
  200|      8|  }
  201|    130|  num_decoded_points_ = 0;
  202|       |
  203|    130|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 32, False: 98]
  ------------------
  204|     32|    return false;
  205|     32|  }
  206|     98|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 5, False: 93]
  ------------------
  207|      5|    return false;
  208|      5|  }
  209|     93|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 4, False: 89]
  ------------------
  210|      4|    return false;
  211|      4|  }
  212|     89|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 86]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     86|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 50, False: 36]
  ------------------
  217|     50|    return false;
  218|     50|  }
  219|       |
  220|     36|  numbers_decoder_.EndDecoding();
  221|     36|  remaining_bits_decoder_.EndDecoding();
  222|     36|  axis_decoder_.EndDecoding();
  223|     36|  half_decoder_.EndDecoding();
  224|       |
  225|     36|  return true;
  226|     86|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     86|    uint32_t num_points, OutputIteratorT &oit) {
  254|     86|  typedef DecodingStatus Status;
  255|     86|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     86|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     86|  DecodingStatus init_status(num_points, 0, 0);
  258|     86|  std::stack<Status> status_stack;
  259|     86|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.02M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.02M, False: 36]
  ------------------
  263|  2.02M|    const DecodingStatus status = status_stack.top();
  264|  2.02M|    status_stack.pop();
  265|       |
  266|  2.02M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.02M|    const uint32_t last_axis = status.last_axis;
  268|  2.02M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.02M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.02M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.02M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.02M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.02M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.02M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.02M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.02M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.02M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 927k, False: 1.09M]
  ------------------
  285|  96.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 95.2M, False: 927k]
  ------------------
  286|  95.2M|        *oit = old_base;
  287|  95.2M|        ++oit;
  288|  95.2M|        ++num_decoded_points_;
  289|  95.2M|      }
  290|   927k|      continue;
  291|   927k|    }
  292|       |
  293|  1.09M|    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.09M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 66.0k, False: 1.02M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  66.0k|      axes_[0] = axis;
  300|   227k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 160k, False: 66.0k]
  ------------------
  301|   160k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   160k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 22.0k, False: 138k]
  |  |  ------------------
  ------------------
  302|   160k|      }
  303|   161k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 95.8k, False: 65.9k]
  ------------------
  304|   454k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 358k, False: 95.7k]
  ------------------
  305|   358k|          p_[axes_[j]] = 0;
  306|   358k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   358k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 151k, False: 206k]
  ------------------
  308|   151k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 50, False: 151k]
  ------------------
  309|   151k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     50|              return false;
  311|     50|            }
  312|   151k|          }
  313|   358k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   358k|        }
  315|  95.7k|        *oit = p_;
  316|  95.7k|        ++oit;
  317|  95.7k|        ++num_decoded_points_;
  318|  95.7k|      }
  319|  65.9k|      continue;
  320|  66.0k|    }
  321|       |
  322|  1.02M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.02M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.02M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.02M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.02M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.02M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.02M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.02M|    uint32_t number = 0;
  334|  1.02M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.02M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.02M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 0, False: 1.02M]
  ------------------
  338|       |      // Invalid |number|.
  339|      0|      return false;
  340|      0|    }
  341|  1.02M|    first_half -= number;
  342|  1.02M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.02M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.00M, False: 24.2k]
  ------------------
  345|  1.00M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 963k, False: 41.4k]
  ------------------
  346|   963k|        std::swap(first_half, second_half);
  347|   963k|      }
  348|  1.00M|    }
  349|       |
  350|  1.02M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.02M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.02M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.01M, False: 13.2k]
  ------------------
  353|  1.01M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.01M|    }
  355|  1.02M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.00M, False: 21.9k]
  ------------------
  356|  1.00M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.00M|    }
  358|  1.02M|  }
  359|     36|  return true;
  360|     86|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  2.02M|        : num_remaining_points(num_remaining_points_),
  135|  2.02M|          last_axis(last_axis_),
  136|  2.02M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.02M|    uint32_t last_axis) {
  232|  2.02M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.02M, Folded]
  ------------------
  233|  2.02M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.02M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 685k, False: 1.33M]
  |  |  ------------------
  ------------------
  234|  2.02M|  }
  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.02M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.02M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.02M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.02M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     41|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_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: 2, False: 98]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|     98|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 98]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     98|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 17, False: 81]
  ------------------
  196|     17|    return true;
  197|     17|  }
  198|     81|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 79]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|     79|  num_decoded_points_ = 0;
  202|       |
  203|     79|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 74]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     74|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 72]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     72|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 71]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     71|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 70]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     70|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 55, False: 15]
  ------------------
  217|     55|    return false;
  218|     55|  }
  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|     70|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     70|    uint32_t num_points, OutputIteratorT &oit) {
  254|     70|  typedef DecodingStatus Status;
  255|     70|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     70|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     70|  DecodingStatus init_status(num_points, 0, 0);
  258|     70|  std::stack<Status> status_stack;
  259|     70|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   150k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 150k, False: 15]
  ------------------
  263|   150k|    const DecodingStatus status = status_stack.top();
  264|   150k|    status_stack.pop();
  265|       |
  266|   150k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   150k|    const uint32_t last_axis = status.last_axis;
  268|   150k|    const uint32_t stack_pos = status.stack_pos;
  269|   150k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   150k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   150k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 150k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   150k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   150k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 4, False: 150k]
  ------------------
  278|      4|      return false;
  279|      4|    }
  280|       |
  281|   150k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   150k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 433, False: 149k]
  ------------------
  285|  67.2k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 66.7k, False: 433]
  ------------------
  286|  66.7k|        *oit = old_base;
  287|  66.7k|        ++oit;
  288|  66.7k|        ++num_decoded_points_;
  289|  66.7k|      }
  290|    433|      continue;
  291|    433|    }
  292|       |
  293|   149k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   149k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 575, False: 149k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    575|      axes_[0] = axis;
  300|  39.2k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 38.7k, False: 575]
  ------------------
  301|  38.7k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  38.7k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 562, False: 38.1k]
  |  |  ------------------
  ------------------
  302|  38.7k|      }
  303|  1.30k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 766, False: 542]
  ------------------
  304|  50.2k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 49.4k, False: 733]
  ------------------
  305|  49.4k|          p_[axes_[j]] = 0;
  306|  49.4k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  49.4k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 49.2k, False: 212]
  ------------------
  308|  49.2k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 33, False: 49.2k]
  ------------------
  309|  49.2k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     33|              return false;
  311|     33|            }
  312|  49.2k|          }
  313|  49.4k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  49.4k|        }
  315|    733|        *oit = p_;
  316|    733|        ++oit;
  317|    733|        ++num_decoded_points_;
  318|    733|      }
  319|    542|      continue;
  320|    575|    }
  321|       |
  322|   149k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 149k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   149k|    const int num_remaining_bits = bit_length_ - level;
  327|   149k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   149k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   149k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   149k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   149k|    uint32_t number = 0;
  334|   149k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   149k|    uint32_t first_half = num_remaining_points / 2;
  337|   149k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 18, False: 149k]
  ------------------
  338|       |      // Invalid |number|.
  339|     18|      return false;
  340|     18|    }
  341|   149k|    first_half -= number;
  342|   149k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   149k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 149k, False: 73]
  ------------------
  345|   149k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 111k, False: 37.4k]
  ------------------
  346|   111k|        std::swap(first_half, second_half);
  347|   111k|      }
  348|   149k|    }
  349|       |
  350|   149k|    levels_stack_[stack_pos][axis] += 1;
  351|   149k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   149k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 112k, False: 36.9k]
  ------------------
  353|   112k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   112k|    }
  355|   149k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 38.1k, False: 111k]
  ------------------
  356|  38.1k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  38.1k|    }
  358|   149k|  }
  359|     15|  return true;
  360|     70|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   150k|        : num_remaining_points(num_remaining_points_),
  135|   150k|          last_axis(last_axis_),
  136|   150k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   149k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   149k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   149k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     30|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    116|      : bit_length_(0),
   87|    116|        num_points_(0),
   88|    116|        num_decoded_points_(0),
   89|    116|        dimension_(dimension),
   90|    116|        p_(dimension, 0),
   91|    116|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    116|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    116|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     87|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     87|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     87|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    200|      : bit_length_(0),
   87|    200|        num_points_(0),
   88|    200|        num_decoded_points_(0),
   89|    200|        dimension_(dimension),
   90|    200|        p_(dimension, 0),
   91|    200|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    200|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    200|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     90|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     90|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     90|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     32|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     32|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     32|}
_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|     37|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     37|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     37|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      3|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      3|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      3|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    159|      : bit_length_(0),
   87|    159|        num_points_(0),
   88|    159|        num_decoded_points_(0),
   89|    159|        dimension_(dimension),
   90|    159|        p_(dimension, 0),
   91|    159|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    159|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    159|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      2|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      2|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.24M|    uint32_t last_axis) {
  232|  2.24M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.24M, Folded]
  ------------------
  233|  2.24M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.24M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 645k, False: 1.59M]
  |  |  ------------------
  ------------------
  234|  2.24M|  }
  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.24M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.26M|    uint32_t last_axis) {
  232|  4.26M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.26M, Folded]
  ------------------
  233|  4.26M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.26M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.21M, False: 3.05M]
  |  |  ------------------
  ------------------
  234|  4.26M|  }
  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.26M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  3.30M|    uint32_t last_axis) {
  232|  3.30M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 3.30M, Folded]
  ------------------
  233|  3.30M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.30M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.18M, False: 118k]
  |  |  ------------------
  ------------------
  234|  3.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|  3.30M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   150k|    uint32_t last_axis) {
  232|   150k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 150k]
  ------------------
  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|   150k|  uint32_t best_axis = 0;
  237|   150k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 149k, False: 493]
  ------------------
  238|  16.3M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 16.1M, False: 149k]
  ------------------
  239|  16.1M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 177k, False: 16.0M]
  ------------------
  240|   177k|        best_axis = axis;
  241|   177k|      }
  242|  16.1M|    }
  243|   149k|  } else {
  244|    493|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|    493|  }
  246|       |
  247|   150k|  return best_axis;
  248|   150k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     82|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     82|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     82|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     82|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     82|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 82]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     82|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 5, False: 77]
  ------------------
  190|      5|    return false;
  191|      5|  }
  192|     77|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 77]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     77|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 77]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     77|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 77]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     77|  num_decoded_points_ = 0;
  202|       |
  203|     77|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 14, False: 63]
  ------------------
  204|     14|    return false;
  205|     14|  }
  206|     63|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 7, False: 56]
  ------------------
  207|      7|    return false;
  208|      7|  }
  209|     56|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 55]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     55|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 54]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     54|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 41, False: 13]
  ------------------
  217|     41|    return false;
  218|     41|  }
  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|     54|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     54|    uint32_t num_points, OutputIteratorT &oit) {
  254|     54|  typedef DecodingStatus Status;
  255|     54|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     54|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     54|  DecodingStatus init_status(num_points, 0, 0);
  258|     54|  std::stack<Status> status_stack;
  259|     54|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.64M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.64M, False: 13]
  ------------------
  263|  1.64M|    const DecodingStatus status = status_stack.top();
  264|  1.64M|    status_stack.pop();
  265|       |
  266|  1.64M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.64M|    const uint32_t last_axis = status.last_axis;
  268|  1.64M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.64M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.64M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.64M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.64M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.64M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.64M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.64M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.64M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.64M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 820k, False: 823k]
  ------------------
  285|   178M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 177M, False: 820k]
  ------------------
  286|   177M|        *oit = old_base;
  287|   177M|        ++oit;
  288|   177M|        ++num_decoded_points_;
  289|   177M|      }
  290|   820k|      continue;
  291|   820k|    }
  292|       |
  293|   823k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   823k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.30k, False: 822k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.30k|      axes_[0] = axis;
  300|  3.91k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.61k, False: 1.30k]
  ------------------
  301|  2.61k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.61k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 297, False: 2.31k]
  |  |  ------------------
  ------------------
  302|  2.61k|      }
  303|  3.60k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.31k, False: 1.28k]
  ------------------
  304|  9.21k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.92k, False: 2.29k]
  ------------------
  305|  6.92k|          p_[axes_[j]] = 0;
  306|  6.92k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.92k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.18k, False: 3.73k]
  ------------------
  308|  3.18k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 24, False: 3.16k]
  ------------------
  309|  3.18k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     24|              return false;
  311|     24|            }
  312|  3.18k|          }
  313|  6.89k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.89k|        }
  315|  2.29k|        *oit = p_;
  316|  2.29k|        ++oit;
  317|  2.29k|        ++num_decoded_points_;
  318|  2.29k|      }
  319|  1.28k|      continue;
  320|  1.30k|    }
  321|       |
  322|   822k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 822k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   822k|    const int num_remaining_bits = bit_length_ - level;
  327|   822k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   822k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   822k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   822k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   822k|    uint32_t number = 0;
  334|   822k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   822k|    uint32_t first_half = num_remaining_points / 2;
  337|   822k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 17, False: 822k]
  ------------------
  338|       |      // Invalid |number|.
  339|     17|      return false;
  340|     17|    }
  341|   822k|    first_half -= number;
  342|   822k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   822k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 389k, False: 433k]
  ------------------
  345|   389k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 372k, False: 17.2k]
  ------------------
  346|   372k|        std::swap(first_half, second_half);
  347|   372k|      }
  348|   389k|    }
  349|       |
  350|   822k|    levels_stack_[stack_pos][axis] += 1;
  351|   822k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   822k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 822k, False: 76]
  ------------------
  353|   822k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   822k|    }
  355|   822k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 822k, False: 152]
  ------------------
  356|   822k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   822k|    }
  358|   822k|  }
  359|     13|  return true;
  360|     54|}
_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: 0, False: 84]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     84|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 5, False: 79]
  ------------------
  190|      5|    return false;
  191|      5|  }
  192|     79|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 79]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     79|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 78]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     78|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 78]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     78|  num_decoded_points_ = 0;
  202|       |
  203|     78|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 15, False: 63]
  ------------------
  204|     15|    return false;
  205|     15|  }
  206|     63|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 6, False: 57]
  ------------------
  207|      6|    return false;
  208|      6|  }
  209|     57|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 56]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     56|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 53]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     53|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 39, False: 14]
  ------------------
  217|     39|    return false;
  218|     39|  }
  219|       |
  220|     14|  numbers_decoder_.EndDecoding();
  221|     14|  remaining_bits_decoder_.EndDecoding();
  222|     14|  axis_decoder_.EndDecoding();
  223|     14|  half_decoder_.EndDecoding();
  224|       |
  225|     14|  return true;
  226|     53|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     53|    uint32_t num_points, OutputIteratorT &oit) {
  254|     53|  typedef DecodingStatus Status;
  255|     53|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     53|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     53|  DecodingStatus init_status(num_points, 0, 0);
  258|     53|  std::stack<Status> status_stack;
  259|     53|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.82M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.82M, False: 14]
  ------------------
  263|  2.82M|    const DecodingStatus status = status_stack.top();
  264|  2.82M|    status_stack.pop();
  265|       |
  266|  2.82M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.82M|    const uint32_t last_axis = status.last_axis;
  268|  2.82M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.82M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.82M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.82M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.82M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.82M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.82M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.82M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.82M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.82M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.40M, False: 1.41M]
  ------------------
  285|   111M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 109M, False: 1.40M]
  ------------------
  286|   109M|        *oit = old_base;
  287|   109M|        ++oit;
  288|   109M|        ++num_decoded_points_;
  289|   109M|      }
  290|  1.40M|      continue;
  291|  1.40M|    }
  292|       |
  293|  1.41M|    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.41M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.24k, False: 1.41M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.24k|      axes_[0] = axis;
  300|  3.73k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.49k, False: 1.24k]
  ------------------
  301|  2.49k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.49k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 400, False: 2.09k]
  |  |  ------------------
  ------------------
  302|  2.49k|      }
  303|  3.40k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.19k, False: 1.21k]
  ------------------
  304|  8.69k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.53k, False: 2.16k]
  ------------------
  305|  6.53k|          p_[axes_[j]] = 0;
  306|  6.53k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.53k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.39k, False: 3.13k]
  ------------------
  308|  3.39k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 29, False: 3.36k]
  ------------------
  309|  3.39k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     29|              return false;
  311|     29|            }
  312|  3.39k|          }
  313|  6.50k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.50k|        }
  315|  2.16k|        *oit = p_;
  316|  2.16k|        ++oit;
  317|  2.16k|        ++num_decoded_points_;
  318|  2.16k|      }
  319|  1.21k|      continue;
  320|  1.24k|    }
  321|       |
  322|  1.41M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.41M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.41M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.41M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.41M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.41M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.41M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.41M|    uint32_t number = 0;
  334|  1.41M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.41M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.41M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 10, False: 1.41M]
  ------------------
  338|       |      // Invalid |number|.
  339|     10|      return false;
  340|     10|    }
  341|  1.41M|    first_half -= number;
  342|  1.41M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.41M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 888k, False: 522k]
  ------------------
  345|   888k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 885k, False: 2.27k]
  ------------------
  346|   885k|        std::swap(first_half, second_half);
  347|   885k|      }
  348|   888k|    }
  349|       |
  350|  1.41M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.41M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.41M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.41M, False: 124]
  ------------------
  353|  1.41M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.41M|    }
  355|  1.41M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.41M, False: 89]
  ------------------
  356|  1.41M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.41M|    }
  358|  1.41M|  }
  359|     14|  return true;
  360|     53|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     96|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     96|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     96|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     96|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     96|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 96]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     96|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 93]
  ------------------
  190|      3|    return false;
  191|      3|  }
  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: 0, False: 93]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     93|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 93]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     93|  num_decoded_points_ = 0;
  202|       |
  203|     93|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 25, False: 68]
  ------------------
  204|     25|    return false;
  205|     25|  }
  206|     68|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 64]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     64|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 62]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     62|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 61]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     61|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 58, False: 3]
  ------------------
  217|     58|    return false;
  218|     58|  }
  219|       |
  220|      3|  numbers_decoder_.EndDecoding();
  221|      3|  remaining_bits_decoder_.EndDecoding();
  222|      3|  axis_decoder_.EndDecoding();
  223|      3|  half_decoder_.EndDecoding();
  224|       |
  225|      3|  return true;
  226|     61|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  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|  4.23M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.23M, False: 3]
  ------------------
  263|  4.23M|    const DecodingStatus status = status_stack.top();
  264|  4.23M|    status_stack.pop();
  265|       |
  266|  4.23M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.23M|    const uint32_t last_axis = status.last_axis;
  268|  4.23M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.23M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.23M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.23M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.23M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.23M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.23M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.23M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.23M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.23M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.11M, False: 2.11M]
  ------------------
  285|  17.8M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 15.6M, False: 2.11M]
  ------------------
  286|  15.6M|        *oit = old_base;
  287|  15.6M|        ++oit;
  288|  15.6M|        ++num_decoded_points_;
  289|  15.6M|      }
  290|  2.11M|      continue;
  291|  2.11M|    }
  292|       |
  293|  2.11M|    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.11M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.03k, False: 2.11M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.03k|      axes_[0] = axis;
  300|  3.11k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.07k, False: 1.03k]
  ------------------
  301|  2.07k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.07k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 248, False: 1.82k]
  |  |  ------------------
  ------------------
  302|  2.07k|      }
  303|  2.81k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.79k, False: 1.02k]
  ------------------
  304|  7.12k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 5.34k, False: 1.77k]
  ------------------
  305|  5.34k|          p_[axes_[j]] = 0;
  306|  5.34k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  5.34k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.57k, False: 2.77k]
  ------------------
  308|  2.57k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 14, False: 2.56k]
  ------------------
  309|  2.57k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     14|              return false;
  311|     14|            }
  312|  2.57k|          }
  313|  5.33k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  5.33k|        }
  315|  1.77k|        *oit = p_;
  316|  1.77k|        ++oit;
  317|  1.77k|        ++num_decoded_points_;
  318|  1.77k|      }
  319|  1.02k|      continue;
  320|  1.03k|    }
  321|       |
  322|  2.11M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.11M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.11M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.11M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.11M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.11M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.11M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.11M|    uint32_t number = 0;
  334|  2.11M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.11M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.11M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 44, False: 2.11M]
  ------------------
  338|       |      // Invalid |number|.
  339|     44|      return false;
  340|     44|    }
  341|  2.11M|    first_half -= number;
  342|  2.11M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.11M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 994k, False: 1.12M]
  ------------------
  345|   994k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 988k, False: 6.15k]
  ------------------
  346|   988k|        std::swap(first_half, second_half);
  347|   988k|      }
  348|   994k|    }
  349|       |
  350|  2.11M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.11M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.11M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.11M, False: 93]
  ------------------
  353|  2.11M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.11M|    }
  355|  2.11M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.11M, False: 136]
  ------------------
  356|  2.11M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.11M|    }
  358|  2.11M|  }
  359|      3|  return true;
  360|     61|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    105|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    105|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    105|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    105|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    105|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 105]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    105|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 99]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|     99|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 99]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     99|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 99]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     99|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 99]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     99|  num_decoded_points_ = 0;
  202|       |
  203|     99|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 26, False: 73]
  ------------------
  204|     26|    return false;
  205|     26|  }
  206|     73|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 69]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     69|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 67]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     67|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 66]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     66|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 63, False: 3]
  ------------------
  217|     63|    return false;
  218|     63|  }
  219|       |
  220|      3|  numbers_decoder_.EndDecoding();
  221|      3|  remaining_bits_decoder_.EndDecoding();
  222|      3|  axis_decoder_.EndDecoding();
  223|      3|  half_decoder_.EndDecoding();
  224|       |
  225|      3|  return true;
  226|     66|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     66|    uint32_t num_points, OutputIteratorT &oit) {
  254|     66|  typedef DecodingStatus Status;
  255|     66|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     66|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     66|  DecodingStatus init_status(num_points, 0, 0);
  258|     66|  std::stack<Status> status_stack;
  259|     66|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  60.5k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 60.5k, False: 3]
  ------------------
  263|  60.5k|    const DecodingStatus status = status_stack.top();
  264|  60.5k|    status_stack.pop();
  265|       |
  266|  60.5k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  60.5k|    const uint32_t last_axis = status.last_axis;
  268|  60.5k|    const uint32_t stack_pos = status.stack_pos;
  269|  60.5k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  60.5k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  60.5k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 60.5k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  60.5k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  60.5k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 60.5k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  60.5k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  60.5k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 27.9k, False: 32.6k]
  ------------------
  285|  9.06M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 9.04M, False: 27.9k]
  ------------------
  286|  9.04M|        *oit = old_base;
  287|  9.04M|        ++oit;
  288|  9.04M|        ++num_decoded_points_;
  289|  9.04M|      }
  290|  27.9k|      continue;
  291|  27.9k|    }
  292|       |
  293|  32.6k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  32.6k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.72k, False: 30.9k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.72k|      axes_[0] = axis;
  300|  5.16k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 3.44k, False: 1.72k]
  ------------------
  301|  3.44k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  3.44k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 588, False: 2.85k]
  |  |  ------------------
  ------------------
  302|  3.44k|      }
  303|  4.82k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.12k, False: 1.70k]
  ------------------
  304|  12.4k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 9.34k, False: 3.10k]
  ------------------
  305|  9.34k|          p_[axes_[j]] = 0;
  306|  9.34k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  9.34k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 5.44k, False: 3.90k]
  ------------------
  308|  5.44k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 18, False: 5.42k]
  ------------------
  309|  5.44k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     18|              return false;
  311|     18|            }
  312|  5.44k|          }
  313|  9.32k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  9.32k|        }
  315|  3.10k|        *oit = p_;
  316|  3.10k|        ++oit;
  317|  3.10k|        ++num_decoded_points_;
  318|  3.10k|      }
  319|  1.70k|      continue;
  320|  1.72k|    }
  321|       |
  322|  30.9k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 30.9k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  30.9k|    const int num_remaining_bits = bit_length_ - level;
  327|  30.9k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  30.9k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  30.9k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  30.9k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  30.9k|    uint32_t number = 0;
  334|  30.9k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  30.9k|    uint32_t first_half = num_remaining_points / 2;
  337|  30.9k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 45, False: 30.8k]
  ------------------
  338|       |      // Invalid |number|.
  339|     45|      return false;
  340|     45|    }
  341|  30.8k|    first_half -= number;
  342|  30.8k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  30.8k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 18.3k, False: 12.5k]
  ------------------
  345|  18.3k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 13.0k, False: 5.30k]
  ------------------
  346|  13.0k|        std::swap(first_half, second_half);
  347|  13.0k|      }
  348|  18.3k|    }
  349|       |
  350|  30.8k|    levels_stack_[stack_pos][axis] += 1;
  351|  30.8k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  30.8k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 30.8k, False: 65]
  ------------------
  353|  30.8k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  30.8k|    }
  355|  30.8k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 30.7k, False: 160]
  ------------------
  356|  30.7k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  30.7k|    }
  358|  30.8k|  }
  359|      3|  return true;
  360|     66|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     43|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     43|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     43|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     43|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     43|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 43]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     43|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 17, False: 26]
  ------------------
  190|     17|    return false;
  191|     17|  }
  192|     26|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 26]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     26|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 25]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     25|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 25]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     25|  num_decoded_points_ = 0;
  202|       |
  203|     25|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 25, False: 0]
  ------------------
  204|     25|    return false;
  205|     25|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     13|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     13|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     13|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     13|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     13|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 13]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     13|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 12]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     12|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 12]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     12|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 11]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     11|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 11]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     11|  num_decoded_points_ = 0;
  202|       |
  203|     11|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 11, False: 0]
  ------------------
  204|     11|    return false;
  205|     11|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     14|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     14|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     14|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     14|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     14|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 14]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     14|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 11]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     11|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 11]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     11|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 10]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     10|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 10]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     10|  num_decoded_points_ = 0;
  202|       |
  203|     10|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 10, False: 0]
  ------------------
  204|     10|    return false;
  205|     10|  }
  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|    463|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    463|  qinfo_.quantization_bits = 0;
   67|    463|  qinfo_.range = 0;
   68|    463|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    451|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    451|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 451]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|    451|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 0, False: 451]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|    451|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 451]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|    451|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 451]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|    451|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 19, False: 432]
  |  Branch (84:38): [True: 10, False: 9]
  ------------------
   85|     10|    return false;
   86|     10|  }
   87|    441|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 441]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    441|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 3, False: 438]
  ------------------
   93|      3|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      3|#define DRACO_LOGE printf
  ------------------
   94|      3|               compression_level_);
   95|      3|    return false;
   96|      3|  }
   97|       |
   98|    438|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    438|      std::back_inserter(*qpoints);
  100|    438|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    438|                           Converter>
  102|    438|      oit(oit_qpoints);
  103|    438|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 437, False: 1]
  ------------------
  104|    437|    qpoints->reserve(num_points_);
  105|    437|    switch (compression_level_) {
  106|     82|      case 0: {
  ------------------
  |  Branch (106:7): [True: 82, False: 355]
  ------------------
  107|     82|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|     82|        qpoints_decoder.DecodePoints(buffer, oit);
  109|     82|        break;
  110|      0|      }
  111|     84|      case 1: {
  ------------------
  |  Branch (111:7): [True: 84, False: 353]
  ------------------
  112|     84|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     84|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     84|        break;
  115|      0|      }
  116|     96|      case 2: {
  ------------------
  |  Branch (116:7): [True: 96, False: 341]
  ------------------
  117|     96|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     96|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     96|        break;
  120|      0|      }
  121|    105|      case 3: {
  ------------------
  |  Branch (121:7): [True: 105, False: 332]
  ------------------
  122|    105|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|    105|        qpoints_decoder.DecodePoints(buffer, oit);
  124|    105|        break;
  125|      0|      }
  126|     43|      case 4: {
  ------------------
  |  Branch (126:7): [True: 43, False: 394]
  ------------------
  127|     43|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     43|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     43|        break;
  130|      0|      }
  131|     13|      case 5: {
  ------------------
  |  Branch (131:7): [True: 13, False: 424]
  ------------------
  132|     13|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|     13|        qpoints_decoder.DecodePoints(buffer, oit);
  134|     13|        break;
  135|      0|      }
  136|     14|      case 6: {
  ------------------
  |  Branch (136:7): [True: 14, False: 423]
  ------------------
  137|     14|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|     14|        qpoints_decoder.DecodePoints(buffer, oit);
  139|     14|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 437]
  ------------------
  142|      0|        return false;
  143|    437|    }
  144|    437|  }
  145|       |
  146|    438|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 428, False: 10]
  ------------------
  147|    428|    return false;
  148|    428|  }
  149|     10|  return true;
  150|    438|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    438|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   312M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   312M|  const Self &operator=(const SourceType &source) {
   56|   312M|    *oit_ = Converter()(source);
   57|   312M|    return *this;
   58|   312M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   312M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   312M|    return Point3ui(v[0], v[1], v[2]);
   31|   312M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   312M|  const Self &operator++() {
   46|   312M|    ++oit_;
   47|   312M|    return *this;
   48|   312M|  }

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  11.2M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  11.2M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 11.2M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  11.2M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  11.2M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   644M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   644M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 355, False: 644M]
  ------------------
   78|    355|      return false;  // Buffer overflow.
   79|    355|    }
   80|   644M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   644M|    pos_ += size_to_decode;
   82|   644M|    return true;
   83|   644M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  32.1k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  8.91k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  42.9k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   265k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  5.04k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  11.2M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  2.72M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  5.93k|    inline void reset(const void *b, size_t s) {
  131|  5.93k|      bit_offset_ = 0;
  132|  5.93k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  5.93k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  5.93k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  5.19k|    inline uint64_t BitsDecoded() const {
  138|  5.19k|      return static_cast<uint64_t>(bit_offset_);
  139|  5.19k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  11.2M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  11.2M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 5, False: 11.2M]
  ------------------
  162|      5|        return false;
  163|      5|      }
  164|  11.2M|      uint32_t value = 0;
  165|  26.2M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 15.0M, False: 11.2M]
  ------------------
  166|  15.0M|        value |= GetBit() << bit;
  167|  15.0M|      }
  168|  11.2M|      *x = value;
  169|  11.2M|      return true;
  170|  11.2M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  15.0M|    inline int GetBit() {
  176|  15.0M|      const size_t off = bit_offset_;
  177|  15.0M|      const size_t byte_offset = off >> 3;
  178|  15.0M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  15.0M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 14.4M, False: 553k]
  ------------------
  180|  14.4M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  14.4M|        bit_offset_ = off + 1;
  182|  14.4M|        return bit;
  183|  14.4M|      }
  184|   553k|      return 0;
  185|  15.0M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  8.39M|  bool Decode(T *out_val) {
   69|  8.39M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2.14k, False: 8.39M]
  ------------------
   70|  2.14k|      return false;
   71|  2.14k|    }
   72|  8.39M|    pos_ += sizeof(T);
   73|  8.39M|    return true;
   74|  8.39M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  8.39M|  bool Peek(T *out_val) {
   88|  8.39M|    const size_t size_to_decode = sizeof(T);
   89|  8.39M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2.14k, False: 8.39M]
  ------------------
   90|  2.14k|      return false;  // Buffer overflow.
   91|  2.14k|    }
   92|  8.39M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  8.39M|    return true;
   94|  8.39M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  10.9k|  bool Decode(T *out_val) {
   69|  10.9k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 116, False: 10.8k]
  ------------------
   70|    116|      return false;
   71|    116|    }
   72|  10.8k|    pos_ += sizeof(T);
   73|  10.8k|    return true;
   74|  10.9k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  10.9k|  bool Peek(T *out_val) {
   88|  10.9k|    const size_t size_to_decode = sizeof(T);
   89|  10.9k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 116, False: 10.8k]
  ------------------
   90|    116|      return false;  // Buffer overflow.
   91|    116|    }
   92|  10.8k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  10.8k|    return true;
   94|  10.9k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   309k|  bool Decode(T *out_val) {
   69|   309k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 152, False: 309k]
  ------------------
   70|    152|      return false;
   71|    152|    }
   72|   309k|    pos_ += sizeof(T);
   73|   309k|    return true;
   74|   309k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   309k|  bool Peek(T *out_val) {
   88|   309k|    const size_t size_to_decode = sizeof(T);
   89|   309k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 152, False: 309k]
  ------------------
   90|    152|      return false;  // Buffer overflow.
   91|    152|    }
   92|   309k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   309k|    return true;
   94|   309k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  17.5k|  bool Decode(T *out_val) {
   69|  17.5k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 147, False: 17.3k]
  ------------------
   70|    147|      return false;
   71|    147|    }
   72|  17.3k|    pos_ += sizeof(T);
   73|  17.3k|    return true;
   74|  17.5k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  17.5k|  bool Peek(T *out_val) {
   88|  17.5k|    const size_t size_to_decode = sizeof(T);
   89|  17.5k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 147, False: 17.3k]
  ------------------
   90|    147|      return false;  // Buffer overflow.
   91|    147|    }
   92|  17.3k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  17.3k|    return true;
   94|  17.5k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   410k|  bool Decode(T *out_val) {
   69|   410k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 98, False: 410k]
  ------------------
   70|     98|      return false;
   71|     98|    }
   72|   410k|    pos_ += sizeof(T);
   73|   410k|    return true;
   74|   410k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   410k|  bool Peek(T *out_val) {
   88|   410k|    const size_t size_to_decode = sizeof(T);
   89|   410k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 98, False: 410k]
  ------------------
   90|     98|      return false;  // Buffer overflow.
   91|     98|    }
   92|   410k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   410k|    return true;
   94|   410k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  28.6k|  bool Decode(T *out_val) {
   69|  28.6k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 8, False: 28.6k]
  ------------------
   70|      8|      return false;
   71|      8|    }
   72|  28.6k|    pos_ += sizeof(T);
   73|  28.6k|    return true;
   74|  28.6k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  28.6k|  bool Peek(T *out_val) {
   88|  28.6k|    const size_t size_to_decode = sizeof(T);
   89|  28.6k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 8, False: 28.6k]
  ------------------
   90|      8|      return false;  // Buffer overflow.
   91|      8|    }
   92|  28.6k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  28.6k|    return true;
   94|  28.6k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.33k|  bool Decode(T *out_val) {
   69|  1.33k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 11, False: 1.32k]
  ------------------
   70|     11|      return false;
   71|     11|    }
   72|  1.32k|    pos_ += sizeof(T);
   73|  1.32k|    return true;
   74|  1.33k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.33k|  bool Peek(T *out_val) {
   88|  1.33k|    const size_t size_to_decode = sizeof(T);
   89|  1.33k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 11, False: 1.32k]
  ------------------
   90|     11|      return false;  // Buffer overflow.
   91|     11|    }
   92|  1.32k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.32k|    return true;
   94|  1.33k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    648|  bool Decode(T *out_val) {
   69|    648|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 4, False: 644]
  ------------------
   70|      4|      return false;
   71|      4|    }
   72|    644|    pos_ += sizeof(T);
   73|    644|    return true;
   74|    648|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    648|  bool Peek(T *out_val) {
   88|    648|    const size_t size_to_decode = sizeof(T);
   89|    648|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 4, False: 644]
  ------------------
   90|      4|      return false;  // Buffer overflow.
   91|      4|    }
   92|    644|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    644|    return true;
   94|    648|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   370M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   613M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  9.09M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  9.09M|    return value_ >= val;
  100|  9.09M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   223M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  2.72G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  21.5M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  77.5M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  77.5M|    value_ = i.value_;
  153|  77.5M|    return *this;
  154|  77.5M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   640M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   640M|    value_ = i.value_;
  153|   640M|    return *this;
  154|   640M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  21.5M|  inline ThisIndexType &operator++() {
  103|  21.5M|    ++value_;
  104|  21.5M|    return *this;
  105|  21.5M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  2.01G|  constexpr bool operator==(const IndexType &i) const {
   76|  2.01G|    return value_ == i.value_;
   77|  2.01G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   828M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  7.22k|  constexpr bool operator<(const IndexType &i) const {
   88|  7.22k|    return value_ < i.value_;
   89|  7.22k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|  96.5M|  constexpr bool operator==(const IndexType &i) const {
   76|  96.5M|    return value_ == i.value_;
   77|  96.5M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   153M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   153M|    return ThisIndexType(value_ - val);
  133|   153M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   606M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   606M|    return ThisIndexType(value_ + val);
  127|   606M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  18.2M|  constexpr bool operator==(const IndexType &i) const {
   76|  18.2M|    return value_ == i.value_;
   77|  18.2M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   220M|  constexpr bool operator!=(const IndexType &i) const {
   82|   220M|    return value_ != i.value_;
   83|   220M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   289M|  constexpr bool operator!=(const IndexType &i) const {
   82|   289M|    return value_ != i.value_;
   83|   289M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   413M|  inline ThisIndexType &operator++() {
  103|   413M|    ++value_;
  104|   413M|    return *this;
  105|   413M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   367M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   367M|    value_ = i.value_;
  153|   367M|    return *this;
  154|   367M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   922M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   922M|    value_ = i.value_;
  153|   922M|    return *this;
  154|   922M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  37.3M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  37.3M|    return value_ >= val;
  100|  37.3M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  7.93M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   928M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  14.0G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   165M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  9.84G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   233M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  12.9M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  12.9M|    return ThisIndexType(value_ + val);
  127|  12.9M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   144M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  21.9M|  constexpr bool operator<(const IndexType &i) const {
   88|  21.9M|    return value_ < i.value_;
   89|  21.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   716M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   640M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  58.6M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   588M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   522M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  5.23M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  5.23M|    value_ = i.value_;
  153|  5.23M|    return *this;
  154|  5.23M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  7.93M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  7.93M|    value_ += val;
  141|  7.93M|    return *this;
  142|  7.93M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  27.2M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  27.2M|    value_ = val;
  157|  27.2M|    return *this;
  158|  27.2M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   613M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  6.06M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  6.06M|  inline ThisIndexType &operator++() {
  103|  6.06M|    ++value_;
  104|  6.06M|    return *this;
  105|  6.06M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  19.9M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|    217|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   481M|  inline ThisIndexType &operator++() {
  103|   481M|    ++value_;
  104|   481M|    return *this;
  105|   481M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|     76|  inline ThisIndexType &operator++() {
  103|     76|    ++value_;
  104|     76|    return *this;
  105|     76|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   525M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   525M|    return value_ >= val;
  100|   525M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  31.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  31.3M|    return vector_[index.value()];
   75|  31.3M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  20.0M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  10.5k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  13.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|  57.3M|  inline reference operator[](const IndexTypeT &index) {
   71|  57.3M|    return vector_[index.value()];
   72|  57.3M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  6.86k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  18.1M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  3.27k|  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|  9.09M|  inline reference operator[](const IndexTypeT &index) {
   71|  9.09M|    return vector_[index.value()];
   72|  9.09M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  21.1M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  21.1M|    return vector_[index.value()];
   75|  21.1M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   185M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  10.2M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   262M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   262M|    return vector_[index.value()];
   75|   262M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   740M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   740M|    return vector_[index.value()];
   75|   740M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   334M|  inline reference operator[](const IndexTypeT &index) {
   71|   334M|    return vector_[index.value()];
   72|   334M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  42.1M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  42.1M|    return vector_[index.value()];
   75|  42.1M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   268M|  inline reference operator[](const IndexTypeT &index) {
   71|   268M|    return vector_[index.value()];
   72|   268M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  94.1M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   197M|  inline reference operator[](const IndexTypeT &index) {
   71|   197M|    return vector_[index.value()];
   72|   197M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  1.92k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   266M|  inline reference operator[](const IndexTypeT &index) {
   71|   266M|    return vector_[index.value()];
   72|   266M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  36.6k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.21M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  34.0k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  5.35k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  5.35k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  5.35k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  5.35k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  12.0k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  12.0k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  12.0k|    vector_.swap(arg.vector_);
   57|  12.0k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  12.0k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  12.0k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  12.0k|    vector_.swap(arg.vector_);
   57|  12.0k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  5.35k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  5.35k|  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.35k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  7.37k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  28.9k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  55.0k|int32_t DataTypeLength(DataType dt) {
   20|  55.0k|  switch (dt) {
   21|  14.7k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 14.7k, False: 40.3k]
  ------------------
   22|  18.0k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.31k, False: 51.7k]
  ------------------
   23|  18.0k|      return 1;
   24|  3.46k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 3.46k, False: 51.6k]
  ------------------
   25|  8.29k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 4.83k, False: 50.2k]
  ------------------
   26|  8.29k|      return 2;
   27|  21.5k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 21.5k, False: 33.5k]
  ------------------
   28|  23.2k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.72k, False: 53.3k]
  ------------------
   29|  23.2k|      return 4;
   30|    583|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 583, False: 54.4k]
  ------------------
   31|  1.01k|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 428, False: 54.6k]
  ------------------
   32|  1.01k|      return 8;
   33|  3.96k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.96k, False: 51.1k]
  ------------------
   34|  3.96k|      return 4;
   35|     84|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 84, False: 54.9k]
  ------------------
   36|     84|      return 8;
   37|    430|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 430, False: 54.6k]
  ------------------
   38|    430|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 55.0k]
  ------------------
   40|      0|      return -1;
   41|  55.0k|  }
   42|  55.0k|}

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

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

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

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

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

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

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

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   557k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   557k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 557k, Folded]
  ------------------
   65|   557k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 772, False: 556k]
  ------------------
   66|    772|      return false;
   67|    772|    }
   68|   557k|  } 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|   556k|  return true;
   77|   557k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   252k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   252k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   252k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 78, False: 252k]
  ------------------
   33|     78|    return false;
   34|     78|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   252k|  uint8_t in;
   39|   252k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 470, False: 251k]
  ------------------
   40|    470|    return false;
   41|    470|  }
   42|   251k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 29.0k, False: 222k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  29.0k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 439, False: 28.5k]
  ------------------
   45|    439|      return false;
   46|    439|    }
   47|       |    // Append decoded info from this byte.
   48|  28.5k|    *out_val <<= 7;
   49|  28.5k|    *out_val |= in & ((1 << 7) - 1);
   50|   222k|  } else {
   51|       |    // Last byte reached
   52|   222k|    *out_val = in;
   53|   222k|  }
   54|   251k|  return true;
   55|   251k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  4.91k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.91k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.91k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 4.91k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.91k|  uint8_t in;
   39|  4.91k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 5, False: 4.90k]
  ------------------
   40|      5|    return false;
   41|      5|  }
   42|  4.90k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 673, False: 4.23k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    673|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 6, False: 667]
  ------------------
   45|      6|      return false;
   46|      6|    }
   47|       |    // Append decoded info from this byte.
   48|    667|    *out_val <<= 7;
   49|    667|    *out_val |= in & ((1 << 7) - 1);
   50|  4.23k|  } else {
   51|       |    // Last byte reached
   52|  4.23k|    *out_val = in;
   53|  4.23k|  }
   54|  4.90k|  return true;
   55|  4.90k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  5.63k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  5.63k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 5.63k, Folded]
  ------------------
   65|  5.63k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 86, False: 5.55k]
  ------------------
   66|     86|      return false;
   67|     86|    }
   68|  5.63k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  5.55k|  return true;
   77|  5.63k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  3.17k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.17k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.17k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 3.17k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.17k|  uint8_t in;
   39|  3.17k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 11, False: 3.16k]
  ------------------
   40|     11|    return false;
   41|     11|  }
   42|  3.16k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 113, False: 3.05k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    113|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 3, False: 110]
  ------------------
   45|      3|      return false;
   46|      3|    }
   47|       |    // Append decoded info from this byte.
   48|    110|    *out_val <<= 7;
   49|    110|    *out_val |= in & ((1 << 7) - 1);
   50|  3.05k|  } else {
   51|       |    // Last byte reached
   52|  3.05k|    *out_val = in;
   53|  3.05k|  }
   54|  3.16k|  return true;
   55|  3.16k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   268k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   268k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   268k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 11, False: 268k]
  ------------------
   33|     11|    return false;
   34|     11|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   268k|  uint8_t in;
   39|   268k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 56, False: 268k]
  ------------------
   40|     56|    return false;
   41|     56|  }
   42|   268k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.14k, False: 267k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.14k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 60, False: 1.08k]
  ------------------
   45|     60|      return false;
   46|     60|    }
   47|       |    // Append decoded info from this byte.
   48|  1.08k|    *out_val <<= 7;
   49|  1.08k|    *out_val |= in & ((1 << 7) - 1);
   50|   267k|  } else {
   51|       |    // Last byte reached
   52|   267k|    *out_val = in;
   53|   267k|  }
   54|   268k|  return true;
   55|   268k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  3.06k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  3.06k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 3.06k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  3.06k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  3.06k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  3.06k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 27, False: 3.03k]
  ------------------
   72|     27|      return false;
   73|     27|    }
   74|  3.03k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  3.03k|  }
   76|  3.03k|  return true;
   77|  3.06k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.49k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.49k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.49k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 3.49k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.49k|  uint8_t in;
   39|  3.49k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 21, False: 3.47k]
  ------------------
   40|     21|    return false;
   41|     21|  }
   42|  3.47k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 431, False: 3.03k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    431|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 39, False: 392]
  ------------------
   45|     39|      return false;
   46|     39|    }
   47|       |    // Append decoded info from this byte.
   48|    392|    *out_val <<= 7;
   49|    392|    *out_val |= in & ((1 << 7) - 1);
   50|  3.03k|  } else {
   51|       |    // Last byte reached
   52|  3.03k|    *out_val = in;
   53|  3.03k|  }
   54|  3.43k|  return true;
   55|  3.47k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.34k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.34k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.34k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 3.34k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.34k|  uint8_t in;
   39|  3.34k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 18, False: 3.33k]
  ------------------
   40|     18|    return false;
   41|     18|  }
   42|  3.33k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 569, False: 2.76k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    569|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 12, False: 557]
  ------------------
   45|     12|      return false;
   46|     12|    }
   47|       |    // Append decoded info from this byte.
   48|    557|    *out_val <<= 7;
   49|    557|    *out_val |= in & ((1 << 7) - 1);
   50|  2.76k|  } else {
   51|       |    // Last byte reached
   52|  2.76k|    *out_val = in;
   53|  2.76k|  }
   54|  3.31k|  return true;
   55|  3.33k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  25.5k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  25.5k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  25.5k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 25.5k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  25.5k|  uint8_t in;
   39|  25.5k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 17, False: 25.5k]
  ------------------
   40|     17|    return false;
   41|     17|  }
   42|  25.5k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 545, False: 24.9k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    545|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 26, False: 519]
  ------------------
   45|     26|      return false;
   46|     26|    }
   47|       |    // Append decoded info from this byte.
   48|    519|    *out_val <<= 7;
   49|    519|    *out_val |= in & ((1 << 7) - 1);
   50|  24.9k|  } else {
   51|       |    // Last byte reached
   52|  24.9k|    *out_val = in;
   53|  24.9k|  }
   54|  25.4k|  return true;
   55|  25.5k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  6.36k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  6.36k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.36k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 59, False: 6.30k]
  ------------------
   33|     59|    return false;
   34|     59|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.30k|  uint8_t in;
   39|  6.30k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 35, False: 6.27k]
  ------------------
   40|     35|    return false;
   41|     35|  }
   42|  6.27k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.57k, False: 4.69k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.57k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 302, False: 1.27k]
  ------------------
   45|    302|      return false;
   46|    302|    }
   47|       |    // Append decoded info from this byte.
   48|  1.27k|    *out_val <<= 7;
   49|  1.27k|    *out_val |= in & ((1 << 7) - 1);
   50|  4.69k|  } else {
   51|       |    // Last byte reached
   52|  4.69k|    *out_val = in;
   53|  4.69k|  }
   54|  5.97k|  return true;
   55|  6.27k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  5.00k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  5.00k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  5.00k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 49, False: 4.95k]
  ------------------
   33|     49|    return false;
   34|     49|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.95k|  uint8_t in;
   39|  4.95k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 26, False: 4.93k]
  ------------------
   40|     26|    return false;
   41|     26|  }
   42|  4.93k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.43k, False: 2.49k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.43k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 587, False: 1.84k]
  ------------------
   45|    587|      return false;
   46|    587|    }
   47|       |    // Append decoded info from this byte.
   48|  1.84k|    *out_val <<= 7;
   49|  1.84k|    *out_val |= in & ((1 << 7) - 1);
   50|  2.49k|  } else {
   51|       |    // Last byte reached
   52|  2.49k|    *out_val = in;
   53|  2.49k|  }
   54|  4.34k|  return true;
   55|  4.93k|}
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: 1, False: 32.8k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   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: 15, False: 32.8k]
  ------------------
   40|     15|    return false;
   41|     15|  }
   42|  32.8k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.15k, False: 29.6k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.15k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 15, False: 3.14k]
  ------------------
   45|     15|      return false;
   46|     15|    }
   47|       |    // Append decoded info from this byte.
   48|  3.14k|    *out_val <<= 7;
   49|  3.14k|    *out_val |= in & ((1 << 7) - 1);
   50|  29.6k|  } else {
   51|       |    // Last byte reached
   52|  29.6k|    *out_val = in;
   53|  29.6k|  }
   54|  32.8k|  return true;
   55|  32.8k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   135k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   172k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  14.4k|  Self operator-(const Self &o) const {
  138|  14.4k|    Self ret;
  139|  57.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 43.2k, False: 14.4k]
  ------------------
  140|  43.2k|      ret[i] = (*this)[i] - o[i];
  141|  43.2k|    }
  142|  14.4k|    return ret;
  143|  14.4k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  35.7k|  VectorD() {
   41|   142k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 107k, False: 35.7k]
  ------------------
   42|   107k|      (*this)[i] = Scalar(0);
   43|   107k|    }
   44|  35.7k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  2.18G|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|     17|      : v_({{c0, c1, c2}}) {
   60|     17|    DRACO_DCHECK_EQ(dimension, 3);
   61|     17|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   116M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  9.63M|  Self operator-(const Self &o) const {
  138|  9.63M|    Self ret;
  139|  38.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 28.9M, False: 9.63M]
  ------------------
  140|  28.9M|      ret[i] = (*this)[i] - o[i];
  141|  28.9M|    }
  142|  9.63M|    return ret;
  143|  9.63M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  4.80M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  4.80M|  static_assert(std::is_signed<ScalarT>::value,
  321|  4.80M|                "ScalarT must be a signed type. ");
  322|  4.80M|  VectorD<ScalarT, 3> r;
  323|  4.80M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  4.80M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  4.80M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  4.80M|  return r;
  327|  4.80M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  4.80M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  4.80M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  1.63M|  Scalar AbsSum() const {
  238|  1.63M|    Scalar result(0);
  239|  6.51M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 4.89M, False: 1.62M]
  ------------------
  240|  4.89M|      Scalar next_value = std::abs(v_[i]);
  241|  4.89M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 10.0k, False: 4.88M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  10.0k|        return std::numeric_limits<Scalar>::max();
  244|  10.0k|      }
  245|  4.88M|      result += next_value;
  246|  4.88M|    }
  247|  1.62M|    return result;
  248|  1.63M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   214k|  Self operator/(const Scalar &o) const {
  183|   214k|    Self ret;
  184|   857k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 642k, False: 214k]
  ------------------
  185|   642k|      ret[i] = (*this)[i] / o;
  186|   642k|    }
  187|   214k|    return ret;
  188|   214k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   142M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  8.90M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  4.89M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.48M|  Self operator-() const {
  121|  1.48M|    Self ret;
  122|  5.93M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 4.45M, False: 1.48M]
  ------------------
  123|  4.45M|      ret[i] = -(*this)[i];
  124|  4.45M|    }
  125|  1.48M|    return ret;
  126|  1.48M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  4.45M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  31.8M|  Self operator-(const Self &o) const {
  138|  31.8M|    Self ret;
  139|  95.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 63.7M, False: 31.8M]
  ------------------
  140|  63.7M|      ret[i] = (*this)[i] - o[i];
  141|  63.7M|    }
  142|  31.8M|    return ret;
  143|  31.8M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|   382M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|   573M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|   456M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  63.7M|  Self operator+(const Self &o) const {
  130|  63.7M|    Self ret;
  131|   191M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 127M, False: 63.7M]
  ------------------
  132|   127M|      ret[i] = (*this)[i] + o[i];
  133|   127M|    }
  134|  63.7M|    return ret;
  135|  63.7M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|   597M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  4.16M|  Self operator-(const Self &o) const {
  138|  4.16M|    Self ret;
  139|  12.4M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 8.32M, False: 4.16M]
  ------------------
  140|  8.32M|      ret[i] = (*this)[i] - o[i];
  141|  8.32M|    }
  142|  4.16M|    return ret;
  143|  4.16M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  4.16M|  Self operator+(const Self &o) const {
  130|  4.16M|    Self ret;
  131|  12.4M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 8.32M, False: 4.16M]
  ------------------
  132|  8.32M|      ret[i] = (*this)[i] + o[i];
  133|  8.32M|    }
  134|  4.16M|    return ret;
  135|  4.16M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   404k|  bool operator==(const Self &o) const {
  207|  1.20M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 802k, False: 397k]
  ------------------
  208|   802k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 6.94k, False: 795k]
  ------------------
  209|  6.94k|        return false;
  210|  6.94k|      }
  211|   802k|    }
  212|   397k|    return true;
  213|   404k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  4.85M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  7.45k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  7.96k|  Scalar Dot(const Self &o) const {
  251|  7.96k|    Scalar ret(0);
  252|  31.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 23.8k, False: 7.96k]
  ------------------
  253|  23.8k|      ret += (*this)[i] * o[i];
  254|  23.8k|    }
  255|  7.96k|    return ret;
  256|  7.96k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    510|  Self operator*(const Scalar &o) const {
  175|    510|    Self ret;
  176|  2.04k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.53k, False: 510]
  ------------------
  177|  1.53k|      ret[i] = (*this)[i] * o;
  178|  1.53k|    }
  179|    510|    return ret;
  180|    510|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  6.94k|  Self operator-(const Self &o) const {
  138|  6.94k|    Self ret;
  139|  20.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 13.8k, False: 6.94k]
  ------------------
  140|  13.8k|      ret[i] = (*this)[i] - o[i];
  141|  13.8k|    }
  142|  6.94k|    return ret;
  143|  6.94k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  13.8k|  VectorD() {
   41|  41.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 27.7k, False: 13.8k]
  ------------------
   42|  27.7k|      (*this)[i] = Scalar(0);
   43|  27.7k|    }
   44|  13.8k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   815k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   815k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   815k|    v_[0] = c0;
   55|   815k|    v_[1] = c1;
   56|   815k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  55.4k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   284k|  bool operator==(const Self &o) const {
  207|   827k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 556k, False: 271k]
  ------------------
  208|   556k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 13.6k, False: 543k]
  ------------------
  209|  13.6k|        return false;
  210|  13.6k|      }
  211|   556k|    }
  212|   271k|    return true;
  213|   284k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.74M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  27.5M|  VectorD() {
   41|   110M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 82.7M, False: 27.5M]
  ------------------
   42|  82.7M|      (*this)[i] = Scalar(0);
   43|  82.7M|    }
   44|  27.5M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  17.0k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  20.4k|  Scalar Dot(const Self &o) const {
  251|  20.4k|    Scalar ret(0);
  252|  81.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 61.3k, False: 20.4k]
  ------------------
  253|  61.3k|      ret += (*this)[i] * o[i];
  254|  61.3k|    }
  255|  20.4k|    return ret;
  256|  20.4k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  3.44k|  Self operator-(const Self &o) const {
  138|  3.44k|    Self ret;
  139|  10.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 6.88k, False: 3.44k]
  ------------------
  140|  6.88k|      ret[i] = (*this)[i] - o[i];
  141|  6.88k|    }
  142|  3.44k|    return ret;
  143|  3.44k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  10.1k|  Self operator*(const Scalar &o) const {
  175|  10.1k|    Self ret;
  176|  30.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 20.2k, False: 10.1k]
  ------------------
  177|  20.2k|      ret[i] = (*this)[i] * o;
  178|  20.2k|    }
  179|  10.1k|    return ret;
  180|  10.1k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  3.38k|  Self operator+(const Self &o) const {
  130|  3.38k|    Self ret;
  131|  10.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 6.76k, False: 3.38k]
  ------------------
  132|  6.76k|      ret[i] = (*this)[i] + o[i];
  133|  6.76k|    }
  134|  3.38k|    return ret;
  135|  3.38k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.38k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.38k|  return v * o;
  294|  3.38k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  3.36k|  Self operator+(const Self &o) const {
  130|  3.36k|    Self ret;
  131|  13.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 10.1k, False: 3.36k]
  ------------------
  132|  10.1k|      ret[i] = (*this)[i] + o[i];
  133|  10.1k|    }
  134|  3.36k|    return ret;
  135|  3.36k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.36k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.36k|  return v * o;
  294|  3.36k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  3.36k|  Self operator*(const Scalar &o) const {
  175|  3.36k|    Self ret;
  176|  13.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 10.1k, False: 3.36k]
  ------------------
  177|  10.1k|      ret[i] = (*this)[i] * o;
  178|  10.1k|    }
  179|  3.36k|    return ret;
  180|  3.36k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   573k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   573k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   573k|    v_[0] = c0;
   55|   573k|    v_[1] = c1;
   56|   573k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  23.6k|  VectorD() {
   41|  71.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 47.3k, False: 23.6k]
  ------------------
   42|  47.3k|      (*this)[i] = Scalar(0);
   43|  47.3k|    }
   44|  23.6k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  6.70k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  20.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 13.4k, False: 6.70k]
  ------------------
  104|  13.4k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 13.4k, False: 0]
  ------------------
  105|  13.4k|        v_[i] = Scalar(src_vector[i]);
  106|  13.4k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  13.4k|    }
  110|  6.70k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|  1.28k|  Self operator+(const Self &o) const {
  130|  1.28k|    Self ret;
  131|  3.86k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.57k, False: 1.28k]
  ------------------
  132|  2.57k|      ret[i] = (*this)[i] + o[i];
  133|  2.57k|    }
  134|  1.28k|    return ret;
  135|  1.28k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  3.35k|  VectorD() {
   41|  10.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.70k, False: 3.35k]
  ------------------
   42|  6.70k|      (*this)[i] = Scalar(0);
   43|  6.70k|    }
   44|  3.35k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  20.1k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  13.4k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  3.35k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  10.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 6.70k, False: 3.35k]
  ------------------
  104|  6.70k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 6.70k, False: 0]
  ------------------
  105|  6.70k|        v_[i] = Scalar(src_vector[i]);
  106|  6.70k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  6.70k|    }
  110|  3.35k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  3.35k|  Self operator/(const Scalar &o) const {
  183|  3.35k|    Self ret;
  184|  10.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 6.70k, False: 3.35k]
  ------------------
  185|  6.70k|      ret[i] = (*this)[i] / o;
  186|  6.70k|    }
  187|  3.35k|    return ret;
  188|  3.35k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  2.06k|  Self operator-(const Self &o) const {
  138|  2.06k|    Self ret;
  139|  6.18k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.12k, False: 2.06k]
  ------------------
  140|  4.12k|      ret[i] = (*this)[i] - o[i];
  141|  4.12k|    }
  142|  2.06k|    return ret;
  143|  2.06k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  94.6k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.48M|  VectorD() {
   41|  5.93M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.45M, False: 1.48M]
  ------------------
   42|  4.45M|      (*this)[i] = Scalar(0);
   43|  4.45M|    }
   44|  1.48M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|   116M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   116M|    DRACO_DCHECK_EQ(dimension, 2);
   54|   116M|    v_[0] = c0;
   55|   116M|    v_[1] = c1;
   56|   116M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|   191M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|   573M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 382M, False: 191M]
  ------------------
  104|   382M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 382M, False: 0]
  ------------------
  105|   382M|        v_[i] = Scalar(src_vector[i]);
  106|   382M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   382M|    }
  110|   191M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  95.6M|  VectorD() {
   41|   286M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 191M, False: 95.6M]
  ------------------
   42|   191M|      (*this)[i] = Scalar(0);
   43|   191M|    }
   44|  95.6M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  95.6M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|   286M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 191M, False: 95.6M]
  ------------------
  104|   191M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 191M, False: 0]
  ------------------
  105|   191M|        v_[i] = Scalar(src_vector[i]);
  106|   191M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   191M|    }
  110|  95.6M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  49.0M|  VectorD(const Self &o) {
   89|   147M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 98.0M, False: 49.0M]
  ------------------
   90|  98.0M|      (*this)[i] = o[i];
   91|  98.0M|    }
   92|  49.0M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  8.32M|  VectorD() {
   41|  24.9M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 16.6M, False: 8.32M]
  ------------------
   42|  16.6M|      (*this)[i] = Scalar(0);
   43|  16.6M|    }
   44|  8.32M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   728M|  VectorD(const Self &o) {
   89|  2.91G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 2.18G, False: 728M]
  ------------------
   90|  2.18G|      (*this)[i] = o[i];
   91|  2.18G|    }
   92|   728M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  2.18G|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   312M|      : v_({{c0, c1, c2}}) {
   60|   312M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   312M|  }

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

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

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  6.70k|      : corner_table_(table),
  229|  6.70k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  6.70k|        corner_(start_corner_),
  231|  6.70k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  3.79M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  21.9k|  VertexCornersIterator &operator++() {
  268|  21.9k|    Next();
  269|  21.9k|    return *this;
  270|  21.9k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.24M|  void Next() {
  248|  3.24M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.21M, False: 30.5k]
  ------------------
  249|  3.21M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.21M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 23.4k, False: 3.18M]
  ------------------
  251|       |        // Open boundary reached.
  252|  23.4k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  23.4k|        left_traversal_ = false;
  254|  3.18M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 531k, False: 2.65M]
  ------------------
  255|       |        // End reached.
  256|   531k|        corner_ = kInvalidCornerIndex;
  257|   531k|      }
  258|  3.21M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  30.5k|      corner_ = corner_table_->SwingRight(corner_);
  262|  30.5k|    }
  263|  3.24M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  5.64M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  2.67M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  2.80M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  1.58M|  void Next() {
  248|  1.58M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 1.57M, False: 17.1k]
  ------------------
  249|  1.57M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  1.57M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 987k, False: 584k]
  ------------------
  251|       |        // Open boundary reached.
  252|   987k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|   987k|        left_traversal_ = false;
  254|   987k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 96.0k, False: 488k]
  ------------------
  255|       |        // End reached.
  256|  96.0k|        corner_ = kInvalidCornerIndex;
  257|  96.0k|      }
  258|  1.57M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  17.1k|      corner_ = corner_table_->SwingRight(corner_);
  262|  17.1k|    }
  263|  1.58M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  1.08M|      : corner_table_(table),
  236|  1.08M|        start_corner_(corner_id),
  237|  1.08M|        corner_(start_corner_),
  238|  1.08M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   547k|      : corner_table_(table),
  236|   547k|        start_corner_(corner_id),
  237|   547k|        corner_(start_corner_),
  238|   547k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  48.6M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  48.6M|    return is_edge_on_seam_[corner.value()];
   47|  48.6M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  21.8M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  21.8M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 21.8M]
  |  Branch (50:42): [True: 17.0M, False: 4.79M]
  ------------------
   51|  17.0M|      return kInvalidCornerIndex;
   52|  17.0M|    }
   53|  4.79M|    return corner_table_->Opposite(corner);
   54|  21.8M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  31.0M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  31.0M|    return corner_table_->Next(corner);
   58|  31.0M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  16.4M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  16.4M|    return corner_table_->Previous(corner);
   62|  16.4M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  3.96M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  3.96M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  3.96M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.57M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  2.57M|    return Opposite(Previous(corner));
   73|  2.57M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  3.09M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  3.09M|    return Opposite(Next(corner));
   76|  3.09M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  3.04M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  3.04M|    return Previous(Opposite(Previous(corner)));
   81|  3.04M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  10.0M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  10.0M|    return Next(Opposite(Next(corner)));
   86|  10.0M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  9.63k|  int num_vertices() const {
   89|  9.63k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  9.63k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  2.95k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.35k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  81.0M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  81.0M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  81.0M|    return ConfidentVertex(corner);
   97|  81.0M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  81.0M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  81.0M|    return corner_to_vertex_map_[corner.value()];
  100|  81.0M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  2.51M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  2.51M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  2.51M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  2.51M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  2.51M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  2.51M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 2.51M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  2.51M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 2.00M, False: 514k]
  ------------------
  128|  2.00M|      return true;
  129|  2.00M|    }
  130|   514k|    return false;
  131|  2.51M|  }

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

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

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

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

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

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

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

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

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

