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

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

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

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

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

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

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

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

_ZNK5draco17GeometryAttribute10GetBytePosENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  118|  8.05k|  inline int64_t GetBytePos(AttributeValueIndex att_index) const {
  119|  8.05k|    return byte_offset_ + byte_stride_ * att_index.value();
  120|  8.05k|  }
_ZNK5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  122|  7.69k|  inline const uint8_t *GetAddress(AttributeValueIndex att_index) const {
  123|  7.69k|    const int64_t byte_pos = GetBytePos(att_index);
  124|  7.69k|    return buffer_->data() + byte_pos;
  125|  7.69k|  }
_ZN5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  126|    366|  inline uint8_t *GetAddress(AttributeValueIndex att_index) {
  127|    366|    const int64_t byte_pos = GetBytePos(att_index);
  128|    366|    return buffer_->data() + byte_pos;
  129|    366|  }
_ZNK5draco17GeometryAttribute14IsAddressValidEPKh:
  130|  23.0k|  inline bool IsAddressValid(const uint8_t *address) const {
  131|  23.0k|    return ((buffer_->data() + buffer_->data_size()) > address);
  132|  23.0k|  }
_ZN5draco17GeometryAttribute17SetAttributeValueENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPKv:
  143|  11.5M|  void SetAttributeValue(AttributeValueIndex entry_index, const void *value) {
  144|  11.5M|    const int64_t byte_pos = entry_index.value() * byte_stride();
  145|  11.5M|    buffer_->Write(byte_pos, value, byte_stride());
  146|  11.5M|  }
_ZNK5draco17GeometryAttribute14attribute_typeEv:
  266|   164k|  Type attribute_type() const { return attribute_type_; }
_ZNK5draco17GeometryAttribute9data_typeEv:
  269|  1.69k|  DataType data_type() const { return data_type_; }
_ZNK5draco17GeometryAttribute14num_componentsEv:
  273|  2.50k|  uint8_t num_components() const { return num_components_; }
_ZNK5draco17GeometryAttribute11byte_strideEv:
  282|  23.1M|  int64_t byte_stride() const { return byte_stride_; }
_ZNK5draco17GeometryAttribute9unique_idEv:
  287|    312|  uint32_t unique_id() const { return unique_id_; }
_ZN5draco17GeometryAttribute13set_unique_idEj:
  288|   246k|  void set_unique_id(uint32_t id) { unique_id_ = id; }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  5.60k|  bool ConvertValue(AttributeValueIndex att_index, OutT *out_value) const {
  230|  5.60k|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  5.60k|  }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  5.60k|                    OutT *out_val) const {
  180|  5.60k|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 5.60k]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  5.60k|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 5.60k]
  ------------------
  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: 5.60k]
  ------------------
  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: 5.60k]
  ------------------
  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: 5.60k]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  5.60k|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 5.60k, False: 0]
  ------------------
  197|  5.60k|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  5.60k|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 5.60k]
  ------------------
  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: 5.60k]
  ------------------
  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: 5.60k]
  ------------------
  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: 5.60k]
  ------------------
  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: 5.60k]
  ------------------
  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: 5.60k]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 5.60k]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  5.60k|    }
  221|  5.60k|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIilEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  5.60k|                         OutT *out_value) const {
  307|  5.60k|    const uint8_t *src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|  22.4k|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 16.8k, False: 5.60k]
  ------------------
  311|  16.8k|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 16.8k]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|  16.8k|      const T in_value = *reinterpret_cast<const T *>(src_address);
  315|  16.8k|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 16.8k]
  ------------------
  316|  16.8k|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|  16.8k|      src_address += sizeof(T);
  320|  16.8k|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  5.60k|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 5.60k]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  5.60k|    return true;
  326|  5.60k|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIilEEbRKT_bPT0_:
  364|  16.8k|                                    OutT *out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|  16.8k|    if (std::is_integral<OutT>::value) {
  ------------------
  |  Branch (366:9): [Folded - Ignored]
  ------------------
  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|  16.8k|      if (!std::is_same<T, bool>::value && std::is_integral<T>::value) {
  ------------------
  |  Branch (369:11): [Folded - Ignored]
  |  Branch (369:44): [Folded - Ignored]
  ------------------
  370|  16.8k|        static constexpr OutT kOutMin =
  371|  16.8k|            std::is_signed<T>::value ? std::numeric_limits<OutT>::min() : 0;
  ------------------
  |  Branch (371:13): [Folded - Ignored]
  ------------------
  372|  16.8k|        if (in_value < kOutMin || in_value > std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (372:13): [True: 0, False: 16.8k]
  |  Branch (372:35): [True: 0, False: 16.8k]
  ------------------
  373|      0|          return false;
  374|      0|        }
  375|  16.8k|      }
  376|       |
  377|       |      // Check conversion of floating point |in_value| to integral value OutT.
  378|  16.8k|      if (std::is_floating_point<T>::value) {
  ------------------
  |  Branch (378:11): [Folded - Ignored]
  ------------------
  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 - Ignored]
  ------------------
  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 - Ignored]
  ------------------
  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|  16.8k|    }
  406|       |
  407|  16.8k|    if (std::is_integral<T>::value && std::is_floating_point<OutT>::value &&
  ------------------
  |  Branch (407:9): [Folded - Ignored]
  |  Branch (407:39): [Folded - Ignored]
  ------------------
  408|  16.8k|        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|  16.8k|    } else if (std::is_floating_point<T>::value &&
  ------------------
  |  Branch (413:16): [Folded - Ignored]
  ------------------
  414|  16.8k|               std::is_integral<OutT>::value && normalized) {
  ------------------
  |  Branch (414:16): [Folded - Ignored]
  |  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 - Ignored]
  ------------------
  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|  16.8k|    } else {
  433|  16.8k|      *out_value = static_cast<OutT>(in_value);
  434|  16.8k|    }
  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|  16.8k|    return true;
  442|  16.8k|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  2.07k|  bool ConvertValue(AttributeValueIndex att_index, OutT *out_value) const {
  230|  2.07k|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  2.07k|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  2.07k|                    OutT *out_val) const {
  180|  2.07k|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 2.07k]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  2.07k|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 2.07k]
  ------------------
  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: 2.07k]
  ------------------
  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: 2.07k]
  ------------------
  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: 2.07k]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  2.07k|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 2.07k, False: 0]
  ------------------
  197|  2.07k|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  2.07k|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 2.07k]
  ------------------
  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: 2.07k]
  ------------------
  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: 2.07k]
  ------------------
  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: 2.07k]
  ------------------
  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: 2.07k]
  ------------------
  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: 2.07k]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 2.07k]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  2.07k|    }
  221|  2.07k|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIifEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  2.07k|                         OutT *out_value) const {
  307|  2.07k|    const uint8_t *src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|  8.30k|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 6.22k, False: 2.07k]
  ------------------
  311|  6.22k|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 6.22k]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|  6.22k|      const T in_value = *reinterpret_cast<const T *>(src_address);
  315|  6.22k|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 6.22k]
  ------------------
  316|  6.22k|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|  6.22k|      src_address += sizeof(T);
  320|  6.22k|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  2.07k|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 2.07k]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  2.07k|    return true;
  326|  2.07k|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIifEEbRKT_bPT0_:
  364|  6.22k|                                    OutT *out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|  6.22k|    if (std::is_integral<OutT>::value) {
  ------------------
  |  Branch (366:9): [Folded - Ignored]
  ------------------
  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): [Folded - Ignored]
  |  Branch (369:44): [Folded - Ignored]
  ------------------
  370|      0|        static constexpr OutT kOutMin =
  371|      0|            std::is_signed<T>::value ? std::numeric_limits<OutT>::min() : 0;
  ------------------
  |  Branch (371:13): [Folded - Ignored]
  ------------------
  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 - Ignored]
  ------------------
  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 - Ignored]
  ------------------
  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 - Ignored]
  ------------------
  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|  6.22k|    if (std::is_integral<T>::value && std::is_floating_point<OutT>::value &&
  ------------------
  |  Branch (407:9): [Folded - Ignored]
  |  Branch (407:39): [Folded - Ignored]
  ------------------
  408|  6.22k|        normalized) {
  ------------------
  |  Branch (408:9): [True: 0, False: 6.22k]
  ------------------
  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|  6.22k|    } else if (std::is_floating_point<T>::value &&
  ------------------
  |  Branch (413:16): [Folded - Ignored]
  ------------------
  414|  6.22k|               std::is_integral<OutT>::value && normalized) {
  ------------------
  |  Branch (414:16): [Folded - Ignored]
  |  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 - Ignored]
  ------------------
  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|  6.22k|    } else {
  433|  6.22k|      *out_value = static_cast<OutT>(in_value);
  434|  6.22k|    }
  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|  6.22k|    return true;
  442|  6.22k|  }

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

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

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

_ZNK5draco17AttributesDecoder14GetAttributeIdEi:
   44|  15.0k|  int32_t GetAttributeId(int i) const override {
   45|  15.0k|    return point_attribute_ids_[i];
   46|  15.0k|  }
_ZNK5draco17AttributesDecoder16GetNumAttributesEv:
   47|  2.83k|  int32_t GetNumAttributes() const override {
   48|  2.83k|    return static_cast<int32_t>(point_attribute_ids_.size());
   49|  2.83k|  }
_ZNK5draco17AttributesDecoder10GetDecoderEv:
   50|  7.16k|  PointCloudDecoder *GetDecoder() const override {
   51|  7.16k|    return point_cloud_decoder_;
   52|  7.16k|  }
_ZN5draco17AttributesDecoder16DecodeAttributesEPNS_13DecoderBufferE:
   55|    356|  bool DecodeAttributes(DecoderBuffer *in_buffer) override {
   56|    356|    if (!DecodePortableAttributes(in_buffer)) {
  ------------------
  |  Branch (56:9): [True: 242, False: 114]
  ------------------
   57|    242|      return false;
   58|    242|    }
   59|    114|    if (!DecodeDataNeededByPortableTransforms(in_buffer)) {
  ------------------
  |  Branch (59:9): [True: 81, False: 33]
  ------------------
   60|     81|      return false;
   61|     81|    }
   62|     33|    if (!TransformAttributesToOriginalFormat()) {
  ------------------
  |  Branch (62:9): [True: 7, False: 26]
  ------------------
   63|      7|      return false;
   64|      7|    }
   65|     26|    return true;
   66|     33|  }
_ZNK5draco17AttributesDecoder27GetLocalIdForPointAttributeEi:
   69|     93|  int32_t GetLocalIdForPointAttribute(int32_t point_attribute_id) const {
   70|     93|    const int id_map_size =
   71|     93|        static_cast<int>(point_attribute_to_local_id_map_.size());
   72|     93|    if (point_attribute_id >= id_map_size) {
  ------------------
  |  Branch (72:9): [True: 0, False: 93]
  ------------------
   73|      0|      return -1;
   74|      0|    }
   75|     93|    return point_attribute_to_local_id_map_[point_attribute_id];
   76|     93|  }
_ZN5draco17AttributesDecoderD2Ev:
   35|  4.83k|  virtual ~AttributesDecoder() = default;

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   57|     79|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|     62|  bool SetQuantizationBits(int32_t q) {
   60|     62|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 7, False: 55]
  |  Branch (60:18): [True: 6, False: 49]
  ------------------
   61|     13|      return false;
   62|     13|    }
   63|     49|    quantization_bits_ = q;
   64|     49|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|     49|    max_value_ = max_quantized_value_ - 1;
   66|     49|    dequantization_scale_ = 2.f / max_value_;
   67|     49|    center_value_ = max_value_ / 2;
   68|     49|    return true;
   69|     62|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|    668|                                           int32_t *out_t) const {
   77|    668|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 2, False: 666]
  |  Branch (77:20): [True: 0, False: 2]
  |  Branch (77:32): [True: 2, False: 666]
  |  Branch (77:42): [True: 0, False: 2]
  ------------------
   78|    668|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 367, False: 301]
  |  Branch (78:29): [True: 63, False: 304]
  ------------------
   79|     63|      s = max_value_;
   80|     63|      t = max_value_;
   81|    605|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 2, False: 603]
  |  Branch (81:26): [True: 2, False: 0]
  ------------------
   82|      2|      t = center_value_ - (t - center_value_);
   83|    603|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 304, False: 299]
  |  Branch (83:35): [True: 97, False: 207]
  ------------------
   84|     97|      t = center_value_ + (center_value_ - t);
   85|    506|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 216, False: 290]
  |  Branch (85:35): [True: 6, False: 210]
  ------------------
   86|      6|      s = center_value_ + (center_value_ - s);
   87|    500|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 17, False: 483]
  |  Branch (87:26): [True: 12, False: 5]
  ------------------
   88|     12|      s = center_value_ - (s - center_value_);
   89|     12|    }
   90|       |
   91|    668|    *out_s = s;
   92|    668|    *out_t = t;
   93|    668|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|    668|                                                       int32_t *out_t) const {
  100|    668|    DRACO_DCHECK_EQ(
  101|    668|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|    668|        center_value_);
  103|    668|    int32_t s, t;
  104|    668|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 442, False: 226]
  ------------------
  105|       |      // Right hemisphere.
  106|    442|      s = (int_vec[1] + center_value_);
  107|    442|      t = (int_vec[2] + center_value_);
  108|    442|    } else {
  109|       |      // Left hemisphere.
  110|    226|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 60, False: 166]
  ------------------
  111|     60|        s = std::abs(int_vec[2]);
  112|    166|      } else {
  113|    166|        s = (max_value_ - std::abs(int_vec[2]));
  114|    166|      }
  115|    226|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 75, False: 151]
  ------------------
  116|     75|        t = std::abs(int_vec[1]);
  117|    151|      } else {
  118|    151|        t = (max_value_ - std::abs(int_vec[1]));
  119|    151|      }
  120|    226|    }
  121|    668|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|    668|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  5.00k|                                                    float *out_vector) const {
  199|  5.00k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  5.00k|                                 in_t * dequantization_scale_ - 1.f,
  201|  5.00k|                                 out_vector);
  202|  5.00k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  5.38k|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  5.38k|    DRACO_DCHECK_LE(s, center_value_);
  208|  5.38k|    DRACO_DCHECK_LE(t, center_value_);
  209|  5.38k|    DRACO_DCHECK_GE(s, -center_value_);
  210|  5.38k|    DRACO_DCHECK_GE(t, -center_value_);
  211|  5.38k|    const uint32_t st =
  212|  5.38k|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  5.38k|    return st <= center_value_;
  214|  5.38k|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  10.4k|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  10.4k|    DRACO_DCHECK_LE(*s, center_value_);
  219|  10.4k|    DRACO_DCHECK_LE(*t, center_value_);
  220|  10.4k|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  10.4k|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  10.4k|    int32_t sign_s = 0;
  223|  10.4k|    int32_t sign_t = 0;
  224|  10.4k|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 9.93k, False: 477]
  |  Branch (224:20): [True: 9.76k, False: 162]
  ------------------
  225|  9.76k|      sign_s = 1;
  226|  9.76k|      sign_t = 1;
  227|  9.76k|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 577, False: 62]
  |  Branch (227:27): [True: 514, False: 63]
  ------------------
  228|    514|      sign_s = -1;
  229|    514|      sign_t = -1;
  230|    514|    } else {
  231|    125|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 62, False: 63]
  ------------------
  232|    125|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 63, False: 62]
  ------------------
  233|    125|    }
  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|  10.4k|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  10.4k|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  10.4k|    uint32_t us = *s;
  241|  10.4k|    uint32_t ut = *t;
  242|  10.4k|    us = us + us - corner_point_s;
  243|  10.4k|    ut = ut + ut - corner_point_t;
  244|  10.4k|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 10.2k, False: 125]
  ------------------
  245|  10.2k|      uint32_t temp = us;
  246|  10.2k|      us = -ut;
  247|  10.2k|      ut = -temp;
  248|  10.2k|    } else {
  249|    125|      std::swap(us, ut);
  250|    125|    }
  251|  10.4k|    us = us + corner_point_s;
  252|  10.4k|    ut = ut + corner_point_t;
  253|       |
  254|  10.4k|    *s = us;
  255|  10.4k|    *t = ut;
  256|  10.4k|    *s /= 2;
  257|  10.4k|    *t /= 2;
  258|  10.4k|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  10.7k|  int32_t ModMax(int32_t x) const {
  273|  10.7k|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 4, False: 10.7k]
  ------------------
  274|      4|      return x - this->max_quantized_value();
  275|      4|    }
  276|  10.7k|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 2, False: 10.7k]
  ------------------
  277|      2|      return x + this->max_quantized_value();
  278|      2|    }
  279|  10.7k|    return x;
  280|  10.7k|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|     51|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|      6|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  32.3k|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  5.00k|                                           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|  5.00k|    float y = in_s_scaled;
  329|  5.00k|    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|  5.00k|    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|  5.00k|    float x_offset = -x;
  342|  5.00k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 1, False: 5.00k]
  ------------------
  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|  5.00k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 100, False: 4.90k]
  ------------------
  348|  5.00k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 102, False: 4.90k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  5.00k|    const float norm_squared = x * x + y * y + z * z;
  352|  5.00k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 5.00k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  5.00k|    } else {
  357|  5.00k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  5.00k|      out_vector[0] = x * d;
  359|  5.00k|      out_vector[1] = y * d;
  360|  5.00k|      out_vector[2] = z * d;
  361|  5.00k|    }
  362|  5.00k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|    668|  void CanonicalizeIntegerVector(T *vec) const {
  174|    668|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|    668|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|    668|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|    668|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|    668|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|    668|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 220, False: 448]
  ------------------
  181|    220|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|    448|    } else {
  183|    448|      vec[0] =
  184|    448|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|    448|          abs_sum;
  186|    448|      vec[1] =
  187|    448|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|    448|          abs_sum;
  189|    448|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 224, False: 224]
  ------------------
  190|    224|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|    224|      } else {
  192|    224|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|    224|      }
  194|    448|    }
  195|    668|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   52|     18|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|     18|                                                                *buffer) {
  194|     18|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|     18|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     18|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 0, False: 18]
  ------------------
  196|       |    // Decode prediction mode.
  197|      0|    uint8_t mode;
  198|      0|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 0]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      0|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 0, False: 0]
  ------------------
  203|       |      // Unsupported mode.
  204|      0|      return false;
  205|      0|    }
  206|      0|  }
  207|     18|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|     67|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 58, False: 9]
  ------------------
  211|     58|    uint32_t num_flags;
  212|     58|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 0, False: 58]
  ------------------
  213|      0|      return false;
  214|      0|    }
  215|     58|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 9, False: 49]
  ------------------
  216|      9|      return false;
  217|      9|    }
  218|     49|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 31, False: 18]
  ------------------
  219|     31|      is_crease_edge_[i].resize(num_flags);
  220|     31|      RAnsBitDecoder decoder;
  221|     31|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 0, False: 31]
  ------------------
  222|      0|        return false;
  223|      0|      }
  224|    879|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 848, False: 31]
  ------------------
  225|    848|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|    848|      }
  227|     31|      decoder.EndDecoding();
  228|     31|    }
  229|     49|  }
  230|      9|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|      9|                                     MeshDataT>::DecodePredictionData(buffer);
  232|     18|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|      7|                          const PointIndex * /* entry_to_point_id_map */) {
   87|      7|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|      7|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|     35|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 28, False: 7]
  ------------------
   93|     28|    pred_vals[i].resize(num_components, 0);
   94|     28|  }
   95|      7|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|      7|                                         out_data);
   97|       |
   98|      7|  const CornerTable *const table = this->mesh_data().corner_table();
   99|      7|  const std::vector<int32_t> *const vertex_to_data_map =
  100|      7|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|      7|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|      7|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|      7|  const int corner_map_size =
  109|      7|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  1.04k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 1.04k, False: 5]
  ------------------
  111|  1.04k|    const CornerIndex start_corner_id =
  112|  1.04k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  1.04k|    CornerIndex corner_id(start_corner_id);
  115|  1.04k|    int num_parallelograms = 0;
  116|  1.04k|    bool first_pass = true;
  117|  2.21k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 1.18k, False: 1.03k]
  ------------------
  118|  1.18k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 62, False: 1.12k]
  ------------------
  119|  1.18k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  1.18k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|     62|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|     62|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 0, False: 62]
  ------------------
  127|      0|          break;
  128|      0|        }
  129|     62|      }
  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|  1.18k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 1.11k, False: 64]
  ------------------
  134|  1.11k|        corner_id = table->SwingLeft(corner_id);
  135|  1.11k|      } else {
  136|     64|        corner_id = table->SwingRight(corner_id);
  137|     64|      }
  138|  1.18k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 4, False: 1.17k]
  ------------------
  139|      4|        break;
  140|      4|      }
  141|  1.17k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 1.09k, False: 87]
  |  Branch (141:47): [True: 1.03k, False: 55]
  ------------------
  142|  1.03k|        first_pass = false;
  143|  1.03k|        corner_id = table->SwingRight(start_corner_id);
  144|  1.03k|      }
  145|  1.17k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  1.04k|    int num_used_parallelograms = 0;
  150|  1.04k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 60, False: 980]
  ------------------
  151|    511|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 451, False: 60]
  ------------------
  152|    451|        multi_pred_vals[i] = 0;
  153|    451|      }
  154|       |      // Check which parallelograms are actually used.
  155|    120|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 62, False: 58]
  ------------------
  156|     62|        const int context = num_parallelograms - 1;
  157|     62|        const int pos = is_crease_edge_pos[context]++;
  158|     62|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 2, False: 60]
  ------------------
  159|      2|          return false;
  160|      2|        }
  161|     60|        const bool is_crease = is_crease_edge_[context][pos];
  162|     60|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 11, False: 49]
  ------------------
  163|     11|          ++num_used_parallelograms;
  164|    176|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 165, False: 11]
  ------------------
  165|    165|            multi_pred_vals[j] =
  166|    165|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|    165|          }
  168|     11|        }
  169|     60|      }
  170|     60|    }
  171|  1.03k|    const int dst_offset = p * num_components;
  172|  1.03k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 1.02k, False: 10]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  1.02k|      const int src_offset = (p - 1) * num_components;
  176|  1.02k|      this->transform().ComputeOriginalValue(
  177|  1.02k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  1.02k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|     43|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 33, False: 10]
  ------------------
  181|     33|        multi_pred_vals[c] /= num_used_parallelograms;
  182|     33|      }
  183|     10|      this->transform().ComputeOriginalValue(
  184|     10|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|     10|    }
  186|  1.03k|  }
  187|      5|  return true;
  188|      7|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   52|     34|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|     32|                                                                *buffer) {
  194|     32|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|     32|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     32|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 0, False: 32]
  ------------------
  196|       |    // Decode prediction mode.
  197|      0|    uint8_t mode;
  198|      0|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 0]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      0|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 0, False: 0]
  ------------------
  203|       |      // Unsupported mode.
  204|      0|      return false;
  205|      0|    }
  206|      0|  }
  207|     32|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    135|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 112, False: 23]
  ------------------
  211|    112|    uint32_t num_flags;
  212|    112|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 0, False: 112]
  ------------------
  213|      0|      return false;
  214|      0|    }
  215|    112|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 8, False: 104]
  ------------------
  216|      8|      return false;
  217|      8|    }
  218|    104|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 53, False: 51]
  ------------------
  219|     53|      is_crease_edge_[i].resize(num_flags);
  220|     53|      RAnsBitDecoder decoder;
  221|     53|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 1, False: 52]
  ------------------
  222|      1|        return false;
  223|      1|      }
  224|  3.31k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 3.26k, False: 52]
  ------------------
  225|  3.26k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  3.26k|      }
  227|     52|      decoder.EndDecoding();
  228|     52|    }
  229|    104|  }
  230|     23|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|     23|                                     MeshDataT>::DecodePredictionData(buffer);
  232|     32|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|     21|                          const PointIndex * /* entry_to_point_id_map */) {
   87|     21|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|     21|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    105|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 84, False: 21]
  ------------------
   93|     84|    pred_vals[i].resize(num_components, 0);
   94|     84|  }
   95|     21|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|     21|                                         out_data);
   97|       |
   98|     21|  const CornerTable *const table = this->mesh_data().corner_table();
   99|     21|  const std::vector<int32_t> *const vertex_to_data_map =
  100|     21|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|     21|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|     21|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|     21|  const int corner_map_size =
  109|     21|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    782|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 775, False: 7]
  ------------------
  111|    775|    const CornerIndex start_corner_id =
  112|    775|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|    775|    CornerIndex corner_id(start_corner_id);
  115|    775|    int num_parallelograms = 0;
  116|    775|    bool first_pass = true;
  117|  87.6k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 87.0k, False: 657]
  ------------------
  118|  87.0k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 690, False: 86.3k]
  ------------------
  119|  87.0k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  87.0k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|    690|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|    690|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 0, False: 690]
  ------------------
  127|      0|          break;
  128|      0|        }
  129|    690|      }
  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|  87.0k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 86.4k, False: 600]
  ------------------
  134|  86.4k|        corner_id = table->SwingLeft(corner_id);
  135|  86.4k|      } else {
  136|    600|        corner_id = table->SwingRight(corner_id);
  137|    600|      }
  138|  87.0k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 118, False: 86.9k]
  ------------------
  139|    118|        break;
  140|    118|      }
  141|  86.9k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 1.19k, False: 85.7k]
  |  Branch (141:47): [True: 657, False: 535]
  ------------------
  142|    657|        first_pass = false;
  143|    657|        corner_id = table->SwingRight(start_corner_id);
  144|    657|      }
  145|  86.9k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|    775|    int num_used_parallelograms = 0;
  150|    775|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 625, False: 150]
  ------------------
  151|  30.4k|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 29.8k, False: 625]
  ------------------
  152|  29.8k|        multi_pred_vals[i] = 0;
  153|  29.8k|      }
  154|       |      // Check which parallelograms are actually used.
  155|  1.30k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 690, False: 611]
  ------------------
  156|    690|        const int context = num_parallelograms - 1;
  157|    690|        const int pos = is_crease_edge_pos[context]++;
  158|    690|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 14, False: 676]
  ------------------
  159|     14|          return false;
  160|     14|        }
  161|    676|        const bool is_crease = is_crease_edge_[context][pos];
  162|    676|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 153, False: 523]
  ------------------
  163|    153|          ++num_used_parallelograms;
  164|  6.30k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 6.15k, False: 153]
  ------------------
  165|  6.15k|            multi_pred_vals[j] =
  166|  6.15k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  6.15k|          }
  168|    153|        }
  169|    676|      }
  170|    625|    }
  171|    761|    const int dst_offset = p * num_components;
  172|    761|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 613, False: 148]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|    613|      const int src_offset = (p - 1) * num_components;
  176|    613|      this->transform().ComputeOriginalValue(
  177|    613|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|    613|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  6.28k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 6.14k, False: 148]
  ------------------
  181|  6.14k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  6.14k|      }
  183|    148|      this->transform().ComputeOriginalValue(
  184|    148|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|    148|    }
  186|    761|  }
  187|      7|  return true;
  188|     21|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|     74|           const std::vector<int32_t> *vertex_to_data_map) {
   38|     74|    mesh_ = mesh;
   39|     74|    corner_table_ = table;
   40|     74|    data_to_corner_map_ = data_to_corner_map;
   41|     74|    vertex_to_data_map_ = vertex_to_data_map;
   42|     74|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  10.2k|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  5.40k|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  5.40k|    return vertex_to_data_map_;
   48|  5.40k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  5.04k|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  5.04k|    return data_to_corner_map_;
   51|  5.04k|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|    151|           const std::vector<int32_t> *vertex_to_data_map) {
   38|    151|    mesh_ = mesh;
   39|    151|    corner_table_ = table;
   40|    151|    data_to_corner_map_ = data_to_corner_map;
   41|    151|    vertex_to_data_map_ = vertex_to_data_map;
   42|    151|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  30.9k|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  17.4k|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  17.4k|    return vertex_to_data_map_;
   48|  17.4k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  63.3k|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  63.3k|    return data_to_corner_map_;
   51|  63.3k|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   33|     74|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   33|    151|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|      9|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|    363|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     67|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  16.8k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    129|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  83.4k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|      6|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|      7|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|      1|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     12|        mesh_data_(mesh_data) {}

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

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|      9|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|      9|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 2, False: 7]
  ------------------
  105|      2|      this->normal_prediction_mode_ = mode;
  106|      2|      return true;
  107|      7|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 7, False: 0]
  ------------------
  108|      7|      this->normal_prediction_mode_ = mode;
  109|      7|      return true;
  110|      7|    }
  111|      0|    return false;
  112|      9|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|      7|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|      7|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 7]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|      7|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 7, False: 0]
  ------------------
  108|      7|      this->normal_prediction_mode_ = mode;
  109|      7|      return true;
  110|      7|    }
  111|      0|    return false;
  112|      7|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|      1|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|      1|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 1]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|      1|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 1, False: 0]
  ------------------
  108|      1|      this->normal_prediction_mode_ = mode;
  109|      1|      return true;
  110|      1|    }
  111|      0|    return false;
  112|      1|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|      8|                             DataTypeT *prediction) override {
   42|      8|    DRACO_DCHECK(this->IsInitialized());
   43|      8|    typedef typename MeshDataT::CornerTable CornerTable;
   44|      8|    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|      8|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|      8|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|      8|    VectorD<int64_t, 3> normal;
   53|      8|    CornerIndex c_next, c_prev;
   54|     29|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 21, False: 8]
  ------------------
   55|       |      // Getting corners.
   56|     21|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 21]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|     21|      } else {
   60|     21|        c_next = corner_table->Next(cit.Corner());
   61|     21|        c_prev = corner_table->Previous(cit.Corner());
   62|     21|      }
   63|     21|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|     21|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|     21|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|     21|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|     21|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|     21|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|     21|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|     21|      normal_data[0] = normal_data[0] + cross_data[0];
   77|     21|      normal_data[1] = normal_data[1] + cross_data[1];
   78|     21|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|     21|      cit.Next();
   81|     21|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|      8|    constexpr int64_t upper_bound = 1 << 29;
   85|      8|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 8]
  ------------------
   86|      0|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|      0|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 0]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|      8|    } else {
   92|      8|      const int64_t abs_sum = normal.AbsSum();
   93|      8|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 8, False: 0]
  ------------------
   94|      8|        const int64_t quotient = abs_sum / upper_bound;
   95|      8|        normal = normal / quotient;
   96|      8|      }
   97|      8|    }
   98|      8|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|      8|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|      8|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|      8|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|      8|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     12|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     12|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 12]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|     12|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 12, False: 0]
  ------------------
  108|     12|      this->normal_prediction_mode_ = mode;
  109|     12|      return true;
  110|     12|    }
  111|      0|    return false;
  112|     12|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|    351|                             DataTypeT *prediction) override {
   42|    351|    DRACO_DCHECK(this->IsInitialized());
   43|    351|    typedef typename MeshDataT::CornerTable CornerTable;
   44|    351|    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|    351|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|    351|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|    351|    VectorD<int64_t, 3> normal;
   53|    351|    CornerIndex c_next, c_prev;
   54|  1.98k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.63k, False: 351]
  ------------------
   55|       |      // Getting corners.
   56|  1.63k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 1.63k]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|  1.63k|      } else {
   60|  1.63k|        c_next = corner_table->Next(cit.Corner());
   61|  1.63k|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.63k|      }
   63|  1.63k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.63k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.63k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.63k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.63k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.63k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.63k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.63k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.63k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.63k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.63k|      cit.Next();
   81|  1.63k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|    351|    constexpr int64_t upper_bound = 1 << 29;
   85|    351|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 351]
  ------------------
   86|      0|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|      0|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 0]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|    351|    } else {
   92|    351|      const int64_t abs_sum = normal.AbsSum();
   93|    351|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 243, False: 108]
  ------------------
   94|    243|        const int64_t quotient = abs_sum / upper_bound;
   95|    243|        normal = normal / quotient;
   96|    243|      }
   97|    351|    }
   98|    351|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|    351|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|    351|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|    351|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|    351|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|      1|      : Base(md) {
   35|      1|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|      1|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|      1|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|      1|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 1]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|      1|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 1, False: 0]
  ------------------
  108|      1|      this->normal_prediction_mode_ = mode;
  109|      1|      return true;
  110|      1|    }
  111|      0|    return false;
  112|      1|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|    234|                             DataTypeT *prediction) override {
   42|    234|    DRACO_DCHECK(this->IsInitialized());
   43|    234|    typedef typename MeshDataT::CornerTable CornerTable;
   44|    234|    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|    234|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|    234|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|    234|    VectorD<int64_t, 3> normal;
   53|    234|    CornerIndex c_next, c_prev;
   54|    522|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 288, False: 234]
  ------------------
   55|       |      // Getting corners.
   56|    288|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 288]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|    288|      } else {
   60|    288|        c_next = corner_table->Next(cit.Corner());
   61|    288|        c_prev = corner_table->Previous(cit.Corner());
   62|    288|      }
   63|    288|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|    288|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|    288|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|    288|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|    288|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|    288|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|    288|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|    288|      normal_data[0] = normal_data[0] + cross_data[0];
   77|    288|      normal_data[1] = normal_data[1] + cross_data[1];
   78|    288|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|    288|      cit.Next();
   81|    288|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|    234|    constexpr int64_t upper_bound = 1 << 29;
   85|    234|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 234]
  ------------------
   86|      0|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|      0|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 0]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|    234|    } else {
   92|    234|      const int64_t abs_sum = normal.AbsSum();
   93|    234|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 163, False: 71]
  ------------------
   94|    163|        const int64_t quotient = abs_sum / upper_bound;
   95|    163|        normal = normal / quotient;
   96|    163|      }
   97|    234|    }
   98|    234|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|    234|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|    234|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|    234|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|    234|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|      3|      : Base(md) {
   35|      3|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|      3|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|      3|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|      3|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 3]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|      3|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 3, False: 0]
  ------------------
  108|      3|      this->normal_prediction_mode_ = mode;
  109|      3|      return true;
  110|      3|    }
  111|      0|    return false;
  112|      3|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|     75|                             DataTypeT *prediction) override {
   42|     75|    DRACO_DCHECK(this->IsInitialized());
   43|     75|    typedef typename MeshDataT::CornerTable CornerTable;
   44|     75|    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|     75|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|     75|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|     75|    VectorD<int64_t, 3> normal;
   53|     75|    CornerIndex c_next, c_prev;
   54|    427|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 352, False: 75]
  ------------------
   55|       |      // Getting corners.
   56|    352|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 352]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|    352|      } else {
   60|    352|        c_next = corner_table->Next(cit.Corner());
   61|    352|        c_prev = corner_table->Previous(cit.Corner());
   62|    352|      }
   63|    352|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|    352|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|    352|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|    352|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|    352|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|    352|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|    352|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|    352|      normal_data[0] = normal_data[0] + cross_data[0];
   77|    352|      normal_data[1] = normal_data[1] + cross_data[1];
   78|    352|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|    352|      cit.Next();
   81|    352|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|     75|    constexpr int64_t upper_bound = 1 << 29;
   85|     75|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 75]
  ------------------
   86|      0|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|      0|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 0]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|     75|    } else {
   92|     75|      const int64_t abs_sum = normal.AbsSum();
   93|     75|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 4, False: 71]
  ------------------
   94|      4|        const int64_t quotient = abs_sum / upper_bound;
   95|      4|        normal = normal / quotient;
   96|      4|      }
   97|     75|    }
   98|     75|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|     75|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|     75|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|     75|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|     75|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|      6|      : Base(md) {
   35|      6|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|      6|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|      7|      : Base(md) {
   35|      7|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|      7|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|      1|      : Base(md) {
   35|      1|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|      1|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     12|      : Base(md) {
   35|     12|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     12|  };

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|      6|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|      6|    pos_attribute_ = &position_attribute;
   43|      6|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|      7|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|      7|    pos_attribute_ = &position_attribute;
   43|      7|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|     50|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|     50|    DRACO_DCHECK(this->IsInitialized());
   73|     50|    const auto corner_table = mesh_data_.corner_table();
   74|     50|    const auto vert_id = corner_table->Vertex(ci).value();
   75|     50|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|     50|    return GetPositionForDataId(data_id);
   77|     50|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|     50|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|     50|    DRACO_DCHECK(this->IsInitialized());
   65|     50|    const auto point_id = entry_to_point_id_map_[data_id];
   66|     50|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|     50|    VectorD<int64_t, 3> pos;
   68|     50|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|     50|    return pos;
   70|     50|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|      1|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|      1|    pos_attribute_ = &position_attribute;
   43|      1|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|      1|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|      1|    entry_to_point_id_map_ = map;
   46|      1|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.62k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.62k|    DRACO_DCHECK(this->IsInitialized());
   73|  3.62k|    const auto corner_table = mesh_data_.corner_table();
   74|  3.62k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.62k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.62k|    return GetPositionForDataId(data_id);
   77|  3.62k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.62k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.62k|    DRACO_DCHECK(this->IsInitialized());
   65|  3.62k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.62k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.62k|    VectorD<int64_t, 3> pos;
   68|  3.62k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.62k|    return pos;
   70|  3.62k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     12|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     12|    pos_attribute_ = &position_attribute;
   43|     12|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     12|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     12|    entry_to_point_id_map_ = map;
   46|     12|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   37|      1|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|      1|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|    810|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|    810|    DRACO_DCHECK(this->IsInitialized());
   73|    810|    const auto corner_table = mesh_data_.corner_table();
   74|    810|    const auto vert_id = corner_table->Vertex(ci).value();
   75|    810|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|    810|    return GetPositionForDataId(data_id);
   77|    810|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|    810|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|    810|    DRACO_DCHECK(this->IsInitialized());
   65|    810|    const auto point_id = entry_to_point_id_map_[data_id];
   66|    810|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|    810|    VectorD<int64_t, 3> pos;
   68|    810|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|    810|    return pos;
   70|    810|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|      1|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|      1|    pos_attribute_ = &position_attribute;
   43|      1|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|      1|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|      1|    entry_to_point_id_map_ = map;
   46|      1|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   37|      3|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|      3|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|    779|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|    779|    DRACO_DCHECK(this->IsInitialized());
   73|    779|    const auto corner_table = mesh_data_.corner_table();
   74|    779|    const auto vert_id = corner_table->Vertex(ci).value();
   75|    779|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|    779|    return GetPositionForDataId(data_id);
   77|    779|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|    779|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|    779|    DRACO_DCHECK(this->IsInitialized());
   65|    779|    const auto point_id = entry_to_point_id_map_[data_id];
   66|    779|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|    779|    VectorD<int64_t, 3> pos;
   68|    779|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|    779|    return pos;
   70|    779|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|      3|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|      3|    pos_attribute_ = &position_attribute;
   43|      3|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|      3|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|      3|    entry_to_point_id_map_ = map;
   46|      3|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   37|      6|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|      6|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   37|      7|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|      7|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   37|      1|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|      1|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   37|     12|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|     12|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   44|     11|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|     11|                          const PointIndex * /* entry_to_point_id_map */) {
   64|     11|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|     11|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|     11|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|     11|      new DataTypeT[num_components]());
   70|       |
   71|     11|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|     11|  const CornerTable *const table = this->mesh_data().corner_table();
   74|     11|  const std::vector<int32_t> *const vertex_to_data_map =
   75|     11|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|     11|  const int corner_map_size =
   78|     11|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    890|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 879, False: 11]
  ------------------
   80|    879|    const CornerIndex start_corner_id =
   81|    879|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|    879|    CornerIndex corner_id(start_corner_id);
   84|    879|    int num_parallelograms = 0;
   85|  5.03k|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 4.15k, False: 879]
  ------------------
   86|  4.15k|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  4.15k|    }
   88|  1.82k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 950, False: 879]
  ------------------
   89|    950|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 49, False: 901]
  ------------------
   90|    950|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|    950|              num_components, parallelogram_pred_vals.get())) {
   92|    937|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 888, False: 49]
  ------------------
   93|    888|          pred_vals[c] =
   94|    888|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|    888|        }
   96|     49|        ++num_parallelograms;
   97|     49|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|    950|      corner_id = table->SwingRight(corner_id);
  101|    950|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 12, False: 938]
  ------------------
  102|     12|        corner_id = kInvalidCornerIndex;
  103|     12|      }
  104|    950|    }
  105|       |
  106|    879|    const int dst_offset = p * num_components;
  107|    879|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 835, False: 44]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|    835|      const int src_offset = (p - 1) * num_components;
  111|    835|      this->transform().ComputeOriginalValue(
  112|    835|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|    835|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|    729|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 685, False: 44]
  ------------------
  116|    685|        pred_vals[c] /= num_parallelograms;
  117|    685|      }
  118|     44|      this->transform().ComputeOriginalValue(
  119|     44|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|     44|    }
  121|    879|  }
  122|     11|  return true;
  123|     11|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   44|     10|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|      9|                          const PointIndex * /* entry_to_point_id_map */) {
   64|      9|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|      9|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|      9|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|      9|      new DataTypeT[num_components]());
   70|       |
   71|      9|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|      9|  const CornerTable *const table = this->mesh_data().corner_table();
   74|      9|  const std::vector<int32_t> *const vertex_to_data_map =
   75|      9|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|      9|  const int corner_map_size =
   78|      9|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    275|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 266, False: 9]
  ------------------
   80|    266|    const CornerIndex start_corner_id =
   81|    266|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|    266|    CornerIndex corner_id(start_corner_id);
   84|    266|    int num_parallelograms = 0;
   85|  1.06k|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 798, False: 266]
  ------------------
   86|    798|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|    798|    }
   88|  1.42k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.16k, False: 266]
  ------------------
   89|  1.16k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 376, False: 787]
  ------------------
   90|  1.16k|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.16k|              num_components, parallelogram_pred_vals.get())) {
   92|  1.50k|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 1.12k, False: 376]
  ------------------
   93|  1.12k|          pred_vals[c] =
   94|  1.12k|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  1.12k|        }
   96|    376|        ++num_parallelograms;
   97|    376|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.16k|      corner_id = table->SwingRight(corner_id);
  101|  1.16k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 168, False: 995]
  ------------------
  102|    168|        corner_id = kInvalidCornerIndex;
  103|    168|      }
  104|  1.16k|    }
  105|       |
  106|    266|    const int dst_offset = p * num_components;
  107|    266|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 66, False: 200]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|     66|      const int src_offset = (p - 1) * num_components;
  111|     66|      this->transform().ComputeOriginalValue(
  112|     66|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|    200|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|    800|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 600, False: 200]
  ------------------
  116|    600|        pred_vals[c] /= num_parallelograms;
  117|    600|      }
  118|    200|      this->transform().ComputeOriginalValue(
  119|    200|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|    200|    }
  121|    266|  }
  122|      9|  return true;
  123|      9|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  2.71k|    int num_components, DataTypeT *out_prediction) {
   49|  2.71k|  const CornerIndex oci = table->Opposite(ci);
   50|  2.71k|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 2.33k, False: 386]
  ------------------
   51|  2.33k|    return false;
   52|  2.33k|  }
   53|    386|  int vert_opp, vert_next, vert_prev;
   54|    386|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|    386|                                        &vert_opp, &vert_next, &vert_prev);
   56|    386|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 183, False: 203]
  |  Branch (56:35): [True: 176, False: 7]
  ------------------
   57|    386|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 173, False: 3]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|    173|    const int v_opp_off = vert_opp * num_components;
   60|    173|    const int v_next_off = vert_next * num_components;
   61|    173|    const int v_prev_off = vert_prev * num_components;
   62|  1.96k|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 1.79k, False: 173]
  ------------------
   63|  1.79k|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  1.79k|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  1.79k|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  1.79k|      const int64_t result =
   67|  1.79k|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  1.79k|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  1.79k|    }
   71|    173|    return true;
   72|    173|  }
   73|    213|  return false;  // Not all data is available for prediction
   74|    386|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|    386|    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|    386|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|    386|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|    386|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|    386|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|   143k|    int num_components, DataTypeT *out_prediction) {
   49|   143k|  const CornerIndex oci = table->Opposite(ci);
   50|   143k|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 54.8k, False: 88.7k]
  ------------------
   51|  54.8k|    return false;
   52|  54.8k|  }
   53|  88.7k|  int vert_opp, vert_next, vert_prev;
   54|  88.7k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  88.7k|                                        &vert_opp, &vert_next, &vert_prev);
   56|  88.7k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 56.3k, False: 32.3k]
  |  Branch (56:35): [True: 56.2k, False: 137]
  ------------------
   57|  88.7k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 56.1k, False: 67]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  56.1k|    const int v_opp_off = vert_opp * num_components;
   60|  56.1k|    const int v_next_off = vert_next * num_components;
   61|  56.1k|    const int v_prev_off = vert_prev * num_components;
   62|   590k|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 534k, False: 56.1k]
  ------------------
   63|   534k|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|   534k|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|   534k|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|   534k|      const int64_t result =
   67|   534k|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|   534k|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|   534k|    }
   71|  56.1k|    return true;
   72|  56.1k|  }
   73|  32.5k|  return false;  // Not all data is available for prediction
   74|  88.7k|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  88.7k|    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|  88.7k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  88.7k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  88.7k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  88.7k|}

_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   49|     12|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   71|     24|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   73|     12|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|     12|    DRACO_DCHECK_EQ(i, 0);
   75|     12|    (void)i;
   76|     12|    return GeometryAttribute::POSITION;
   77|     12|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|     12|  bool SetParentAttribute(const PointAttribute *att) override {
   80|     12|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 12]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|     12|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 12]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|     12|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 0, False: 12]
  ------------------
   87|      0|      return false;  // Currently works only for 3 component positions.
   88|      0|    }
   89|     12|    pos_attribute_ = att;
   90|     12|    return true;
   91|     12|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|     12|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|     12|  uint32_t num_orientations = 0;
  156|     12|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     12|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 0, False: 12]
  ------------------
  157|      0|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 0]
  ------------------
  158|      0|      return false;
  159|      0|    }
  160|     12|  } else {
  161|     12|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 0, False: 12]
  ------------------
  162|      0|      return false;
  163|      0|    }
  164|     12|  }
  165|     12|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 2, False: 10]
  ------------------
  166|      2|    return false;
  167|      2|  }
  168|     10|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 2, False: 8]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      2|    return false;
  172|      2|  }
  173|      8|  orientations_.resize(num_orientations);
  174|      8|  bool last_orientation = true;
  175|      8|  RAnsBitDecoder decoder;
  176|      8|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 0, False: 8]
  ------------------
  177|      0|    return false;
  178|      0|  }
  179|    742|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 734, False: 8]
  ------------------
  180|    734|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 195, False: 539]
  ------------------
  181|    195|      last_orientation = !last_orientation;
  182|    195|    }
  183|    734|    orientations_[i] = last_orientation;
  184|    734|  }
  185|      8|  decoder.EndDecoding();
  186|      8|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|      8|                                     MeshDataT>::DecodePredictionData(buffer);
  188|      8|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|      8|                          const PointIndex *entry_to_point_id_map) {
  126|      8|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 0, False: 8]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      0|    return false;
  129|      0|  }
  130|      8|  num_components_ = num_components;
  131|      8|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|      8|  predicted_value_ =
  133|      8|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|      8|  this->transform().Init(num_components);
  135|       |
  136|      8|  const int corner_map_size =
  137|      8|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|  1.95k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 1.94k, False: 6]
  ------------------
  139|  1.94k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|  1.94k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 1.94k]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|  1.94k|    const int dst_offset = p * num_components;
  145|  1.94k|    this->transform().ComputeOriginalValue(
  146|  1.94k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|  1.94k|  }
  148|      6|  return true;
  149|      8|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|  1.94k|                          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|  1.94k|  const CornerIndex next_corner_id =
  198|  1.94k|      this->mesh_data().corner_table()->Next(corner_id);
  199|  1.94k|  const CornerIndex prev_corner_id =
  200|  1.94k|      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|  1.94k|  int next_data_id, prev_data_id;
  204|       |
  205|  1.94k|  int next_vert_id, prev_vert_id;
  206|  1.94k|  next_vert_id =
  207|  1.94k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|  1.94k|  prev_vert_id =
  209|  1.94k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|  1.94k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|  1.94k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|  1.94k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 1.32k, False: 620]
  |  Branch (214:33): [True: 706, False: 620]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|    706|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|    706|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|    706|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 142, False: 564]
  ------------------
  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|    284|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 284, False: 142]
  ------------------
  223|    284|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 284]
  |  Branch (223:36): [True: 48, False: 236]
  ------------------
  224|    284|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 236]
  ------------------
  225|     48|          predicted_value_[i] = INT_MIN;
  226|    236|        } else {
  227|    236|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|    236|        }
  229|    284|      }
  230|    142|      return true;
  231|    142|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|    564|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|    564|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|    564|    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|    564|    const Vector3f pn = prev_pos - next_pos;
  261|    564|    const Vector3f cn = tip_pos - next_pos;
  262|    564|    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|    564|    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|    564|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  1.12k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 564]
  |  Branch (273:53): [True: 391, False: 173]
  ------------------
  274|    391|      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|    391|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|    391|    } else {
  280|    173|      s = 0;
  281|    173|      t = 0;
  282|    173|    }
  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|    564|    const Vector2f pn_uv = p_uv - n_uv;
  299|    564|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|    564|    const float pnut = pn_uv[0] * t;
  301|    564|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|    564|    const float pnvt = pn_uv[1] * t;
  303|    564|    Vector2f predicted_uv;
  304|    564|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 2, False: 562]
  ------------------
  305|      2|      return false;
  306|      2|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|    562|    const bool orientation = orientations_.back();
  310|    562|    orientations_.pop_back();
  311|    562|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 262, False: 300]
  ------------------
  312|    262|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|    300|    } else {
  314|    300|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|    300|    }
  316|    562|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [Folded - Ignored]
  ------------------
  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|    562|      const double u = floor(predicted_uv[0] + 0.5);
  321|    562|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 562]
  |  Branch (321:28): [True: 76, False: 486]
  |  Branch (321:43): [True: 66, False: 420]
  ------------------
  322|    142|        predicted_value_[0] = INT_MIN;
  323|    420|      } else {
  324|    420|        predicted_value_[0] = static_cast<int>(u);
  325|    420|      }
  326|    562|      const double v = floor(predicted_uv[1] + 0.5);
  327|    562|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 562]
  |  Branch (327:28): [True: 79, False: 483]
  |  Branch (327:43): [True: 56, False: 427]
  ------------------
  328|    135|        predicted_value_[1] = INT_MIN;
  329|    427|      } else {
  330|    427|        predicted_value_[1] = static_cast<int>(v);
  331|    427|      }
  332|    562|    } 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|    562|    return true;
  338|    564|  }
  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|  1.24k|  int data_offset = 0;
  343|  1.24k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 620, False: 620]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|    620|    data_offset = prev_data_id * num_components_;
  346|    620|  }
  347|  1.24k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 0, False: 1.24k]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|      0|    data_offset = next_data_id * num_components_;
  350|  1.24k|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|  1.24k|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 1.23k, False: 8]
  ------------------
  354|  1.23k|      data_offset = (data_id - 1) * num_components_;
  355|  1.23k|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|     24|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 16, False: 8]
  ------------------
  358|     16|        predicted_value_[i] = 0;
  359|     16|      }
  360|      8|      return true;
  361|      8|    }
  362|  1.24k|  }
  363|  3.69k|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 2.46k, False: 1.23k]
  ------------------
  364|  2.46k|    predicted_value_[i] = data[data_offset + i];
  365|  2.46k|  }
  366|  1.23k|  return true;
  367|  1.24k|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|  1.41k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|  1.41k|    const int data_offset = entry_id * num_components_;
  104|  1.41k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|  1.41k|                    static_cast<float>(data[data_offset + 1]));
  106|  1.41k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   94|  1.69k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  1.69k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  1.69k|    Vector3f pos;
   97|  1.69k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  1.69k|                                 &pos[0]);
   99|  1.69k|    return pos;
  100|  1.69k|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   49|     25|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   71|     50|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   73|     25|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|     25|    DRACO_DCHECK_EQ(i, 0);
   75|     25|    (void)i;
   76|     25|    return GeometryAttribute::POSITION;
   77|     25|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|     25|  bool SetParentAttribute(const PointAttribute *att) override {
   80|     25|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 25]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|     25|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 25]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|     25|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 0, False: 25]
  ------------------
   87|      0|      return false;  // Currently works only for 3 component positions.
   88|      0|    }
   89|     25|    pos_attribute_ = att;
   90|     25|    return true;
   91|     25|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|     25|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|     25|  uint32_t num_orientations = 0;
  156|     25|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     25|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 15, False: 10]
  ------------------
  157|     15|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 15]
  ------------------
  158|      0|      return false;
  159|      0|    }
  160|     15|  } else {
  161|     10|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 0, False: 10]
  ------------------
  162|      0|      return false;
  163|      0|    }
  164|     10|  }
  165|     25|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 0, False: 25]
  ------------------
  166|      0|    return false;
  167|      0|  }
  168|     25|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 0, False: 25]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      0|    return false;
  172|      0|  }
  173|     25|  orientations_.resize(num_orientations);
  174|     25|  bool last_orientation = true;
  175|     25|  RAnsBitDecoder decoder;
  176|     25|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 3, False: 22]
  ------------------
  177|      3|    return false;
  178|      3|  }
  179|  17.9k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 17.9k, False: 22]
  ------------------
  180|  17.9k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 322, False: 17.6k]
  ------------------
  181|    322|      last_orientation = !last_orientation;
  182|    322|    }
  183|  17.9k|    orientations_[i] = last_orientation;
  184|  17.9k|  }
  185|     22|  decoder.EndDecoding();
  186|     22|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|     22|                                     MeshDataT>::DecodePredictionData(buffer);
  188|     25|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|      7|                          const PointIndex *entry_to_point_id_map) {
  126|      7|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 0, False: 7]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      0|    return false;
  129|      0|  }
  130|      7|  num_components_ = num_components;
  131|      7|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|      7|  predicted_value_ =
  133|      7|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|      7|  this->transform().Init(num_components);
  135|       |
  136|      7|  const int corner_map_size =
  137|      7|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|  3.35k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 3.35k, False: 6]
  ------------------
  139|  3.35k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|  3.35k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 3.35k]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|  3.35k|    const int dst_offset = p * num_components;
  145|  3.35k|    this->transform().ComputeOriginalValue(
  146|  3.35k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|  3.35k|  }
  148|      6|  return true;
  149|      7|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|  3.35k|                          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|  3.35k|  const CornerIndex next_corner_id =
  198|  3.35k|      this->mesh_data().corner_table()->Next(corner_id);
  199|  3.35k|  const CornerIndex prev_corner_id =
  200|  3.35k|      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|  3.35k|  int next_data_id, prev_data_id;
  204|       |
  205|  3.35k|  int next_vert_id, prev_vert_id;
  206|  3.35k|  next_vert_id =
  207|  3.35k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|  3.35k|  prev_vert_id =
  209|  3.35k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|  3.35k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|  3.35k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|  3.35k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 3.32k, False: 25]
  |  Branch (214:33): [True: 3.30k, False: 25]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|  3.30k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|  3.30k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|  3.30k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 3.17k, False: 128]
  ------------------
  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|  6.34k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 6.34k, False: 3.17k]
  ------------------
  223|  6.34k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 6.34k]
  |  Branch (223:36): [True: 0, False: 6.34k]
  ------------------
  224|  6.34k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 6.34k]
  ------------------
  225|      0|          predicted_value_[i] = INT_MIN;
  226|  6.34k|        } else {
  227|  6.34k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|  6.34k|        }
  229|  6.34k|      }
  230|  3.17k|      return true;
  231|  3.17k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|    128|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|    128|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|    128|    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|    128|    const Vector3f pn = prev_pos - next_pos;
  261|    128|    const Vector3f cn = tip_pos - next_pos;
  262|    128|    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|    128|    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|    128|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|    256|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 128]
  |  Branch (273:53): [True: 79, False: 49]
  ------------------
  274|     79|      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|     79|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|     79|    } else {
  280|     49|      s = 0;
  281|     49|      t = 0;
  282|     49|    }
  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|    128|    const Vector2f pn_uv = p_uv - n_uv;
  299|    128|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|    128|    const float pnut = pn_uv[0] * t;
  301|    128|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|    128|    const float pnvt = pn_uv[1] * t;
  303|    128|    Vector2f predicted_uv;
  304|    128|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 1, False: 127]
  ------------------
  305|      1|      return false;
  306|      1|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|    127|    const bool orientation = orientations_.back();
  310|    127|    orientations_.pop_back();
  311|    127|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 102, False: 25]
  ------------------
  312|    102|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|    102|    } else {
  314|     25|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|     25|    }
  316|    127|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [Folded - Ignored]
  ------------------
  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|    127|      const double u = floor(predicted_uv[0] + 0.5);
  321|    127|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 127]
  |  Branch (321:28): [True: 0, False: 127]
  |  Branch (321:43): [True: 0, False: 127]
  ------------------
  322|      0|        predicted_value_[0] = INT_MIN;
  323|    127|      } else {
  324|    127|        predicted_value_[0] = static_cast<int>(u);
  325|    127|      }
  326|    127|      const double v = floor(predicted_uv[1] + 0.5);
  327|    127|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 127]
  |  Branch (327:28): [True: 0, False: 127]
  |  Branch (327:43): [True: 0, False: 127]
  ------------------
  328|      0|        predicted_value_[1] = INT_MIN;
  329|    127|      } else {
  330|    127|        predicted_value_[1] = static_cast<int>(v);
  331|    127|      }
  332|    127|    } 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|    127|    return true;
  338|    128|  }
  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|     50|  int data_offset = 0;
  343|     50|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 25, False: 25]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|     25|    data_offset = prev_data_id * num_components_;
  346|     25|  }
  347|     50|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 3, False: 47]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|      3|    data_offset = next_data_id * num_components_;
  350|     47|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|     47|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 40, False: 7]
  ------------------
  354|     40|      data_offset = (data_id - 1) * num_components_;
  355|     40|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|     21|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 14, False: 7]
  ------------------
  358|     14|        predicted_value_[i] = 0;
  359|     14|      }
  360|      7|      return true;
  361|      7|    }
  362|     47|  }
  363|    129|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 86, False: 43]
  ------------------
  364|     86|    predicted_value_[i] = data[data_offset + i];
  365|     86|  }
  366|     43|  return true;
  367|     50|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|  6.60k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|  6.60k|    const int data_offset = entry_id * num_components_;
  104|  6.60k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|  6.60k|                    static_cast<float>(data[data_offset + 1]));
  106|  6.60k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   94|    384|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|    384|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|    384|    Vector3f pos;
   97|    384|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|    384|                                 &pos[0]);
   99|    384|    return pos;
  100|    384|  }

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

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

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|      6|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|     19|  bool AreCorrectionsPositive() override {
   71|     19|    return transform_.AreCorrectionsPositive();
   72|     19|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|      6|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|      6|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 4, False: 2]
  ------------------
   50|      4|      return false;
   51|      4|    }
   52|      2|    return true;
   53|      6|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|     29|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|      8|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|     21|  bool AreCorrectionsPositive() override {
   71|     21|    return transform_.AreCorrectionsPositive();
   72|     21|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|      8|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|      8|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 2, False: 6]
  ------------------
   50|      2|      return false;
   51|      2|    }
   52|      6|    return true;
   53|      8|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  5.40k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    223|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|    156|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|    214|  bool AreCorrectionsPositive() override {
   71|    214|    return transform_.AreCorrectionsPositive();
   72|    214|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    179|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    179|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 22, False: 157]
  ------------------
   50|     22|      return false;
   51|     22|    }
   52|    157|    return true;
   53|    179|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  72.9k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|     19|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|     21|      : attribute_(attribute), transform_(transform) {}

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

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|      2|    const PointIndex *) {
   50|      2|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|      2|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|      2|  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|     14|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 12, False: 2]
  ------------------
   57|     12|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|     12|                                           in_corr + i, out_data + i);
   59|     12|  }
   60|      2|  return true;
   61|      2|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|      6|    const PointIndex *) {
   50|      6|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|      6|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|      6|  this->transform().ComputeOriginalValue(zero_vals.get(), in_corr, out_data);
   54|       |
   55|       |  // Decode data from the front using D(i) = D(i) + D(i - 1).
   56|  5.01k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 5.00k, False: 6]
  ------------------
   57|  5.00k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  5.00k|                                           in_corr + i, out_data + i);
   59|  5.00k|  }
   60|      6|  return true;
   61|      6|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     27|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     25|    const PointIndex *) {
   50|     25|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     25|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     25|  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|  4.77k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 4.74k, False: 25]
  ------------------
   57|  4.74k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  4.74k|                                           in_corr + i, out_data + i);
   59|  4.74k|  }
   60|     25|  return true;
   61|     25|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|      6|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|      8|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|     19|    uint16_t bitstream_version) {
   38|     19|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|     19|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 19, False: 0]
  ------------------
   40|     19|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 0, False: 19]
  ------------------
   41|     19|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 0, False: 19]
  ------------------
   42|     19|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 19]
  ------------------
   43|     19|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 2, False: 17]
  ------------------
   44|     19|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 13, False: 4]
  ------------------
   45|     19|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 0, False: 4]
  ------------------
   46|     15|    const CornerTable *const ct = source->GetCornerTable();
   47|     15|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|     15|        source->GetAttributeEncodingData(att_id);
   49|     15|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 2, False: 13]
  |  Branch (49:26): [True: 0, False: 13]
  ------------------
   50|       |      // No connectivity data found.
   51|      2|      return nullptr;
   52|      2|    }
   53|       |    // Connectivity data exists.
   54|     13|    const MeshAttributeCornerTable *const att_ct =
   55|     13|        source->GetAttributeCornerTable(att_id);
   56|     13|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 6, False: 7]
  ------------------
   57|      6|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|      6|      MeshData md;
   59|      6|      md.Set(source->mesh(), att_ct,
   60|      6|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|      6|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|      6|      MeshPredictionSchemeFactoryT factory;
   63|      6|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|      6|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 6, False: 0]
  ------------------
   65|      6|        return ret;
   66|      6|      }
   67|      7|    } else {
   68|      7|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|      7|      MeshData md;
   70|      7|      md.Set(source->mesh(), ct,
   71|      7|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|      7|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|      7|      MeshPredictionSchemeFactoryT factory;
   74|      7|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|      7|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 7, False: 0]
  ------------------
   76|      7|        return ret;
   77|      7|      }
   78|      7|    }
   79|     13|  }
   80|      4|  return nullptr;
   81|     19|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|     21|    uint16_t bitstream_version) {
   38|     21|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|     21|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 21, False: 0]
  ------------------
   40|     21|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 0, False: 21]
  ------------------
   41|     21|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 3, False: 18]
  ------------------
   42|     21|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 18]
  ------------------
   43|     21|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 18]
  ------------------
   44|     21|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 13, False: 5]
  ------------------
   45|     21|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 0, False: 5]
  ------------------
   46|     16|    const CornerTable *const ct = source->GetCornerTable();
   47|     16|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|     16|        source->GetAttributeEncodingData(att_id);
   49|     16|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 0, False: 16]
  |  Branch (49:26): [True: 0, False: 16]
  ------------------
   50|       |      // No connectivity data found.
   51|      0|      return nullptr;
   52|      0|    }
   53|       |    // Connectivity data exists.
   54|     16|    const MeshAttributeCornerTable *const att_ct =
   55|     16|        source->GetAttributeCornerTable(att_id);
   56|     16|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1, False: 15]
  ------------------
   57|      1|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|      1|      MeshData md;
   59|      1|      md.Set(source->mesh(), att_ct,
   60|      1|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|      1|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|      1|      MeshPredictionSchemeFactoryT factory;
   63|      1|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|      1|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1, False: 0]
  ------------------
   65|      1|        return ret;
   66|      1|      }
   67|     15|    } else {
   68|     15|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     15|      MeshData md;
   70|     15|      md.Set(source->mesh(), ct,
   71|     15|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     15|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     15|      MeshPredictionSchemeFactoryT factory;
   74|     15|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     15|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 12, False: 3]
  ------------------
   76|     12|        return ret;
   77|     12|      }
   78|     15|    }
   79|     16|  }
   80|      8|  return nullptr;
   81|     21|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    223|    uint16_t bitstream_version) {
   38|    223|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    223|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 223, False: 0]
  ------------------
   40|    223|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 57, False: 166]
  ------------------
   41|    223|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 21, False: 145]
  ------------------
   42|    223|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 52, False: 93]
  ------------------
   43|    223|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 26, False: 67]
  ------------------
   44|    223|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 4, False: 63]
  ------------------
   45|    223|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 37, False: 26]
  ------------------
   46|    197|    const CornerTable *const ct = source->GetCornerTable();
   47|    197|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    197|        source->GetAttributeEncodingData(att_id);
   49|    197|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 1, False: 196]
  |  Branch (49:26): [True: 0, False: 196]
  ------------------
   50|       |      // No connectivity data found.
   51|      1|      return nullptr;
   52|      1|    }
   53|       |    // Connectivity data exists.
   54|    196|    const MeshAttributeCornerTable *const att_ct =
   55|    196|        source->GetAttributeCornerTable(att_id);
   56|    196|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 67, False: 129]
  ------------------
   57|     67|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|     67|      MeshData md;
   59|     67|      md.Set(source->mesh(), att_ct,
   60|     67|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|     67|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|     67|      MeshPredictionSchemeFactoryT factory;
   63|     67|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|     67|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 67, False: 0]
  ------------------
   65|     67|        return ret;
   66|     67|      }
   67|    129|    } else {
   68|    129|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    129|      MeshData md;
   70|    129|      md.Set(source->mesh(), ct,
   71|    129|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    129|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    129|      MeshPredictionSchemeFactoryT factory;
   74|    129|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    129|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 129, False: 0]
  ------------------
   76|    129|        return ret;
   77|    129|      }
   78|    129|    }
   79|    196|  }
   80|     26|  return nullptr;
   81|    223|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  5.37k|  bool IsInBottomLeft(const Point2 &p) const {
   93|  5.37k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 4.76k, False: 608]
  |  Branch (93:22): [True: 242, False: 4.52k]
  ------------------
   94|    242|      return true;
   95|    242|    }
   96|  5.12k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 211, False: 4.91k]
  |  Branch (96:25): [True: 176, False: 35]
  ------------------
   97|  5.37k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  5.37k|  int32_t GetRotationCount(Point2 pred) const {
   51|  5.37k|    const DataType sign_x = pred[0];
   52|  5.37k|    const DataType sign_y = pred[1];
   53|       |
   54|  5.37k|    int32_t rotation_count = 0;
   55|  5.37k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 4.76k, False: 608]
  ------------------
   56|  4.76k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 242, False: 4.52k]
  ------------------
   57|    242|        rotation_count = 0;
   58|  4.52k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 4.40k, False: 120]
  ------------------
   59|  4.40k|        rotation_count = 3;
   60|  4.40k|      } else {
   61|    120|        rotation_count = 1;
   62|    120|      }
   63|  4.76k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 397, False: 211]
  ------------------
   64|    397|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 322, False: 75]
  ------------------
   65|    322|        rotation_count = 2;
   66|    322|      } else {
   67|     75|        rotation_count = 1;
   68|     75|      }
   69|    397|    } else {
   70|    211|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 176, False: 35]
  ------------------
   71|    176|        rotation_count = 0;
   72|    176|      } else {
   73|     35|        rotation_count = 3;
   74|     35|      }
   75|    211|    }
   76|  5.37k|    return rotation_count;
   77|  5.37k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|  9.90k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|  9.90k|    switch (rotation_count) {
   81|  4.63k|      case 1:
  ------------------
  |  Branch (81:7): [True: 4.63k, False: 5.27k]
  ------------------
   82|  4.63k|        return Point2(p[1], -p[0]);
   83|    644|      case 2:
  ------------------
  |  Branch (83:7): [True: 644, False: 9.26k]
  ------------------
   84|    644|        return Point2(-p[0], -p[1]);
   85|  4.63k|      case 3:
  ------------------
  |  Branch (85:7): [True: 4.63k, False: 5.27k]
  ------------------
   86|  4.63k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 9.90k]
  ------------------
   88|      0|        return p;
   89|  9.90k|    }
   90|  9.90k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|     21|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|    214|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|    161|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|    161|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|    161|  bool InitCorrectionBounds() {
   84|    161|    const int64_t dif =
   85|    161|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|    161|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 161]
  |  Branch (86:20): [True: 0, False: 161]
  ------------------
   87|      0|      return false;
   88|      0|    }
   89|    161|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|    161|    max_correction_ = max_dif_ / 2;
   91|    161|    min_correction_ = -max_correction_;
   92|    161|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 43, False: 118]
  ------------------
   93|     43|      max_correction_ -= 1;
   94|     43|    }
   95|    161|    return true;
   96|    161|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|    156|  void Init(int num_components) {
   56|    156|    num_components_ = num_components;
   57|    156|    clamped_value_.resize(num_components);
   58|    156|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  72.7k|      const DataTypeT *predicted_val) const {
   64|   655k|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 583k, False: 72.7k]
  ------------------
   65|   583k|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 12.6k, False: 570k]
  ------------------
   66|  12.6k|        clamped_value_[i] = max_value_;
   67|   570k|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 23.6k, False: 546k]
  ------------------
   68|  23.6k|        clamped_value_[i] = min_value_;
   69|   546k|      } else {
   70|   546k|        clamped_value_[i] = predicted_val[i];
   71|   546k|      }
   72|   583k|    }
   73|  72.7k|    return clamped_value_.data();
   74|  72.7k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|  1.31M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|   583k|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|  37.7k|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|   573k|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|      4|  int quantization_bits() const {
   78|      4|    DRACO_DCHECK(false);
   79|      4|    return -1;
   80|      4|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   49|    223|        min_correction_(0) {}

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|    268|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  7.35k|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|    263|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|    912|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|    312|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|    312|    portable_attribute_ = std::move(att);
   71|    312|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|    981|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  5.92k|  virtual ~SequentialAttributeDecoder() = default;

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

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

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

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|   201k|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|   201k|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|   201k|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|   201k|    const int remaining = 32 - num_used_bits_;
   54|   201k|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 195k, False: 6.51k]
  ------------------
   55|   195k|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 131k, False: 63.9k]
  ------------------
   56|   131k|        return false;
   57|   131k|      }
   58|  63.9k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|  63.9k|      num_used_bits_ += nbits;
   60|  63.9k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 2.28k, False: 61.6k]
  ------------------
   61|  2.28k|        ++pos_;
   62|  2.28k|        num_used_bits_ = 0;
   63|  2.28k|      }
   64|  63.9k|    } else {
   65|  6.51k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 22, False: 6.49k]
  ------------------
   66|     22|        return false;
   67|     22|      }
   68|  6.49k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  6.49k|      num_used_bits_ = nbits - remaining;
   70|  6.49k|      ++pos_;
   71|  6.49k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  6.49k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  6.49k|    }
   74|  70.4k|    return true;
   75|   201k|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|   561k|  bool DecodeNextBit() {
   35|   561k|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|   561k|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 314k, False: 246k]
  ------------------
   37|   314k|      return false;
   38|   314k|    }
   39|   246k|    const bool bit = *pos_ & selector;
   40|   246k|    ++num_used_bits_;
   41|   246k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 7.68k, False: 239k]
  ------------------
   42|  7.68k|      ++pos_;
   43|  7.68k|      num_used_bits_ = 0;
   44|  7.68k|    }
   45|   246k|    return bit;
   46|   561k|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|     64|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    107|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    106|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  3.02k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 2.93k, False: 84]
  ------------------
   35|  2.93k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 22, False: 2.91k]
  ------------------
   36|     22|        return false;
   37|     22|      }
   38|  2.93k|    }
   39|     84|    return bit_decoder_.StartDecoding(source_buffer);
   40|    106|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|   500k|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|   500k|    uint32_t result = 0;
   49|  2.43M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 1.93M, False: 500k]
  ------------------
   50|  1.93M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  1.93M|      result = (result << 1) + bit;
   52|  1.93M|    }
   53|   500k|    *value = result;
   54|   500k|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     20|  void EndDecoding() {
   57|    660|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 640, False: 20]
  ------------------
   58|    640|      folded_number_decoders_[i].EndDecoding();
   59|    640|    }
   60|     20|    bit_decoder_.EndDecoding();
   61|     20|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    107|  FoldedBit32Decoder() {}

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

_ZN5draco14RAnsBitDecoder11EndDecodingEv:
   44|    953|  void EndDecoding() {}

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  5.03k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  3.86k|                                const uint8_t *const buf, int offset) {
  301|  3.86k|  unsigned x;
  302|  3.86k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 10, False: 3.85k]
  ------------------
  303|     10|    return 1;
  304|     10|  }
  305|  3.85k|  ans->buf = buf;
  306|  3.85k|  x = buf[offset - 1] >> 6;
  307|  3.85k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 3.45k, False: 393]
  ------------------
  308|  3.45k|    ans->buf_offset = offset - 1;
  309|  3.45k|    ans->state = buf[offset - 1] & 0x3F;
  310|  3.45k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 366, False: 27]
  ------------------
  311|    366|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 0, False: 366]
  ------------------
  312|      0|      return 1;
  313|      0|    }
  314|    366|    ans->buf_offset = offset - 2;
  315|    366|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|    366|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 18, False: 9]
  ------------------
  317|     18|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 2, False: 16]
  ------------------
  318|      2|      return 1;
  319|      2|    }
  320|     16|    ans->buf_offset = offset - 3;
  321|     16|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|     16|  } else {
  323|      9|    return 1;
  324|      9|  }
  325|  3.83k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  3.83k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  3.83k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  3.83k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  3.83k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 0, False: 3.83k]
  ------------------
  327|      0|    return 1;
  328|      0|  }
  329|  3.83k|  return 0;
  330|  3.83k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    366|static uint32_t mem_get_le16(const void *vmem) {
   68|    366|  uint32_t val;
   69|    366|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    366|  val = mem[1] << 8;
   72|    366|  val |= mem[0];
   73|    366|  return val;
   74|    366|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|     16|static uint32_t mem_get_le24(const void *vmem) {
   77|     16|  uint32_t val;
   78|     16|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|     16|  val = mem[2] << 16;
   81|     16|  val |= mem[1] << 8;
   82|     16|  val |= mem[0];
   83|     16|  return val;
   84|     16|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|   452M|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|   452M|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|   452M|  unsigned quot, rem, x, xn;
  172|   452M|#endif
  173|   452M|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|   452M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|   452M|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|   905M|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 338M, False: 113M]
  |  Branch (174:40): [True: 283k, False: 338M]
  ------------------
  175|   283k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   283k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   283k|  }
  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|   452M|  x = ans->state;
  184|   452M|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   452M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|   452M|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   452M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|   452M|  xn = quot * p;
  187|   452M|  val = rem < p;
  188|   452M|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|   905M|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 340M, False: 112M]
  |  |  ------------------
  ------------------
  189|   340M|    ans->state = xn + rem;
  190|   340M|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   112M|    ans->state = x - xn - p;
  193|   112M|  }
  194|   452M|#endif
  195|   452M|  return val;
  196|   452M|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  8.51k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  8.51k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  8.51k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  8.51k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|    264|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|    117|                                       uint32_t num_symbols) {
  482|    117|    lut_table_.resize(rans_precision);
  483|    117|    probability_table_.resize(num_symbols);
  484|    117|    uint32_t cum_prob = 0;
  485|    117|    uint32_t act_prob = 0;
  486|  8.50k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 8.41k, False: 82]
  ------------------
  487|  8.41k|      probability_table_[i].prob = token_probs[i];
  488|  8.41k|      probability_table_[i].cum_prob = cum_prob;
  489|  8.41k|      cum_prob += token_probs[i];
  490|  8.41k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 35, False: 8.38k]
  ------------------
  491|     35|        return false;
  492|     35|      }
  493|   267k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 259k, False: 8.38k]
  ------------------
  494|   259k|        lut_table_[j] = i;
  495|   259k|      }
  496|  8.38k|      act_prob = cum_prob;
  497|  8.38k|    }
  498|     82|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 25, False: 57]
  ------------------
  499|     25|      return false;
  500|     25|    }
  501|     57|    return true;
  502|     82|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|     55|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     55|    unsigned x;
  423|     55|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 8, False: 47]
  ------------------
  424|      8|      return 1;
  425|      8|    }
  426|     47|    ans_.buf = buf;
  427|     47|    x = buf[offset - 1] >> 6;
  428|     47|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 32, False: 15]
  ------------------
  429|     32|      ans_.buf_offset = offset - 1;
  430|     32|      ans_.state = buf[offset - 1] & 0x3F;
  431|     32|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 15, False: 0]
  ------------------
  432|     15|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 15]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     15|      ans_.buf_offset = offset - 2;
  436|     15|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     15|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 0]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      0|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     47|    ans_.state += l_rans_base;
  450|     47|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     47|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 47]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|     47|    return 0;
  454|     47|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|     18|static uint32_t mem_get_le16(const void *vmem) {
   68|     18|  uint32_t val;
   69|     18|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|     18|  val = mem[1] << 8;
   72|     18|  val |= mem[0];
   73|     18|  return val;
   74|     18|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|      3|static uint32_t mem_get_le24(const void *vmem) {
   77|      3|  uint32_t val;
   78|      3|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|      3|  val = mem[2] << 16;
   81|      3|  val |= mem[1] << 8;
   82|      3|  val |= mem[0];
   83|      3|  return val;
   84|      3|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|      2|static inline uint32_t mem_get_le32(const void *vmem) {
   87|      2|  uint32_t val;
   88|      2|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|      2|  val = mem[3] << 24;
   91|      2|  val |= mem[2] << 16;
   92|      2|  val |= mem[1] << 8;
   93|      2|  val |= mem[0];
   94|      2|  return val;
   95|      2|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|   252k|  inline int rans_read() {
  463|   252k|    unsigned rem;
  464|   252k|    unsigned quo;
  465|   252k|    struct rans_dec_sym sym;
  466|   253k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 170k, False: 83.0k]
  |  Branch (466:40): [True: 1.47k, False: 169k]
  ------------------
  467|  1.47k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.47k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.47k|    }
  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|   252k|    quo = ans_.state / rans_precision;
  472|   252k|    rem = ans_.state % rans_precision;
  473|   252k|    fetch_sym(&sym, rem);
  474|   252k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   252k|    return sym.val;
  476|   252k|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|   252k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   252k|    uint32_t symbol = lut_table_[rem];
  507|   252k|    out->val = symbol;
  508|   252k|    out->prob = probability_table_[symbol].prob;
  509|   252k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   252k|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|     46|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|     24|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|     22|                                       uint32_t num_symbols) {
  482|     22|    lut_table_.resize(rans_precision);
  483|     22|    probability_table_.resize(num_symbols);
  484|     22|    uint32_t cum_prob = 0;
  485|     22|    uint32_t act_prob = 0;
  486|    252|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 231, False: 21]
  ------------------
  487|    231|      probability_table_[i].prob = token_probs[i];
  488|    231|      probability_table_[i].cum_prob = cum_prob;
  489|    231|      cum_prob += token_probs[i];
  490|    231|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 1, False: 230]
  ------------------
  491|      1|        return false;
  492|      1|      }
  493|   172k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 172k, False: 230]
  ------------------
  494|   172k|        lut_table_[j] = i;
  495|   172k|      }
  496|    230|      act_prob = cum_prob;
  497|    230|    }
  498|     21|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 2, False: 19]
  ------------------
  499|      2|      return false;
  500|      2|    }
  501|     19|    return true;
  502|     21|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     17|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     17|    unsigned x;
  423|     17|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 16]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     16|    ans_.buf = buf;
  427|     16|    x = buf[offset - 1] >> 6;
  428|     16|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 15, False: 1]
  ------------------
  429|     15|      ans_.buf_offset = offset - 1;
  430|     15|      ans_.state = buf[offset - 1] & 0x3F;
  431|     15|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 1]
  ------------------
  432|      0|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      0|      ans_.buf_offset = offset - 2;
  436|      0|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      1|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 1, False: 0]
  ------------------
  438|      1|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 1]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      1|      ans_.buf_offset = offset - 3;
  442|      1|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      1|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     16|    ans_.state += l_rans_base;
  450|     16|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     16|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 16]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|     16|    return 0;
  454|     16|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  5.29M|  inline int rans_read() {
  463|  5.29M|    unsigned rem;
  464|  5.29M|    unsigned quo;
  465|  5.29M|    struct rans_dec_sym sym;
  466|  5.29M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 5.29M, False: 2.65k]
  |  Branch (466:40): [True: 789, False: 5.29M]
  ------------------
  467|    789|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    789|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    789|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  5.29M|    quo = ans_.state / rans_precision;
  472|  5.29M|    rem = ans_.state % rans_precision;
  473|  5.29M|    fetch_sym(&sym, rem);
  474|  5.29M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  5.29M|    return sym.val;
  476|  5.29M|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  5.29M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  5.29M|    uint32_t symbol = lut_table_[rem];
  507|  5.29M|    out->val = symbol;
  508|  5.29M|    out->prob = probability_table_[symbol].prob;
  509|  5.29M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  5.29M|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     16|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|      6|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|      2|                                       uint32_t num_symbols) {
  482|      2|    lut_table_.resize(rans_precision);
  483|      2|    probability_table_.resize(num_symbols);
  484|      2|    uint32_t cum_prob = 0;
  485|      2|    uint32_t act_prob = 0;
  486|    518|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 517, False: 1]
  ------------------
  487|    517|      probability_table_[i].prob = token_probs[i];
  488|    517|      probability_table_[i].cum_prob = cum_prob;
  489|    517|      cum_prob += token_probs[i];
  490|    517|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 1, False: 516]
  ------------------
  491|      1|        return false;
  492|      1|      }
  493|  36.0k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 35.5k, False: 516]
  ------------------
  494|  35.5k|        lut_table_[j] = i;
  495|  35.5k|      }
  496|    516|      act_prob = cum_prob;
  497|    516|    }
  498|      1|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 1]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|      1|    return true;
  502|      1|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|      1|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      1|    unsigned x;
  423|      1|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 1]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      1|    ans_.buf = buf;
  427|      1|    x = buf[offset - 1] >> 6;
  428|      1|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 0, False: 1]
  ------------------
  429|      0|      ans_.buf_offset = offset - 1;
  430|      0|      ans_.state = buf[offset - 1] & 0x3F;
  431|      1|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 1, False: 0]
  ------------------
  432|      1|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 1]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      1|      ans_.buf_offset = offset - 2;
  436|      1|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      1|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 0]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      0|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      1|    ans_.state += l_rans_base;
  450|      1|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      1|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 1]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      1|    return 0;
  454|      1|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|     96|  inline int rans_read() {
  463|     96|    unsigned rem;
  464|     96|    unsigned quo;
  465|     96|    struct rans_dec_sym sym;
  466|     97|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 1, False: 96]
  |  Branch (466:40): [True: 1, False: 0]
  ------------------
  467|      1|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|      1|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|      1|    }
  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|     96|    quo = ans_.state / rans_precision;
  472|     96|    rem = ans_.state % rans_precision;
  473|     96|    fetch_sym(&sym, rem);
  474|     96|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|     96|    return sym.val;
  476|     96|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|     96|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|     96|    uint32_t symbol = lut_table_[rem];
  507|     96|    out->val = symbol;
  508|     96|    out->prob = probability_table_[symbol].prob;
  509|     96|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|     96|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|      1|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|      4|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|      1|                                       uint32_t num_symbols) {
  482|      1|    lut_table_.resize(rans_precision);
  483|      1|    probability_table_.resize(num_symbols);
  484|      1|    uint32_t cum_prob = 0;
  485|      1|    uint32_t act_prob = 0;
  486|      1|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1, False: 0]
  ------------------
  487|      1|      probability_table_[i].prob = token_probs[i];
  488|      1|      probability_table_[i].cum_prob = cum_prob;
  489|      1|      cum_prob += token_probs[i];
  490|      1|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 1, False: 0]
  ------------------
  491|      1|        return false;
  492|      1|      }
  493|      0|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 0, False: 0]
  ------------------
  494|      0|        lut_table_[j] = i;
  495|      0|      }
  496|      0|      act_prob = cum_prob;
  497|      0|    }
  498|      0|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 0]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|      0|    return true;
  502|      0|  }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|     14|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|      2|                                       uint32_t num_symbols) {
  482|      2|    lut_table_.resize(rans_precision);
  483|      2|    probability_table_.resize(num_symbols);
  484|      2|    uint32_t cum_prob = 0;
  485|      2|    uint32_t act_prob = 0;
  486|     73|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 72, False: 1]
  ------------------
  487|     72|      probability_table_[i].prob = token_probs[i];
  488|     72|      probability_table_[i].cum_prob = cum_prob;
  489|     72|      cum_prob += token_probs[i];
  490|     72|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 1, False: 71]
  ------------------
  491|      1|        return false;
  492|      1|      }
  493|   303k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 303k, False: 71]
  ------------------
  494|   303k|        lut_table_[j] = i;
  495|   303k|      }
  496|     71|      act_prob = cum_prob;
  497|     71|    }
  498|      1|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 1]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|      1|    return true;
  502|      1|  }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|      2|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|      2|                                       uint32_t num_symbols) {
  482|      2|    lut_table_.resize(rans_precision);
  483|      2|    probability_table_.resize(num_symbols);
  484|      2|    uint32_t cum_prob = 0;
  485|      2|    uint32_t act_prob = 0;
  486|  5.26k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 5.26k, False: 2]
  ------------------
  487|  5.26k|      probability_table_[i].prob = token_probs[i];
  488|  5.26k|      probability_table_[i].cum_prob = cum_prob;
  489|  5.26k|      cum_prob += token_probs[i];
  490|  5.26k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 0, False: 5.26k]
  ------------------
  491|      0|        return false;
  492|      0|      }
  493|   747k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 742k, False: 5.26k]
  ------------------
  494|   742k|        lut_table_[j] = i;
  495|   742k|      }
  496|  5.26k|      act_prob = cum_prob;
  497|  5.26k|    }
  498|      2|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 1, False: 1]
  ------------------
  499|      1|      return false;
  500|      1|    }
  501|      1|    return true;
  502|      2|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|      1|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      1|    unsigned x;
  423|      1|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 1]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      1|    ans_.buf = buf;
  427|      1|    x = buf[offset - 1] >> 6;
  428|      1|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1, False: 0]
  ------------------
  429|      1|      ans_.buf_offset = offset - 1;
  430|      1|      ans_.state = buf[offset - 1] & 0x3F;
  431|      1|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 0]
  ------------------
  432|      0|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      0|      ans_.buf_offset = offset - 2;
  436|      0|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      0|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 0]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      0|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      1|    ans_.state += l_rans_base;
  450|      1|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      1|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 1]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      1|    return 0;
  454|      1|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|     21|  inline int rans_read() {
  463|     21|    unsigned rem;
  464|     21|    unsigned quo;
  465|     21|    struct rans_dec_sym sym;
  466|     51|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 30, False: 21]
  |  Branch (466:40): [True: 30, False: 0]
  ------------------
  467|     30|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|     30|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|     30|    }
  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|     21|    quo = ans_.state / rans_precision;
  472|     21|    rem = ans_.state % rans_precision;
  473|     21|    fetch_sym(&sym, rem);
  474|     21|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|     21|    return sym.val;
  476|     21|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|     21|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|     21|    uint32_t symbol = lut_table_[rem];
  507|     21|    out->val = symbol;
  508|     21|    out->prob = probability_table_[symbol].prob;
  509|     21|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|     21|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|      1|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|     86|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|     44|                                       uint32_t num_symbols) {
  482|     44|    lut_table_.resize(rans_precision);
  483|     44|    probability_table_.resize(num_symbols);
  484|     44|    uint32_t cum_prob = 0;
  485|     44|    uint32_t act_prob = 0;
  486|  7.70k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 7.66k, False: 32]
  ------------------
  487|  7.66k|      probability_table_[i].prob = token_probs[i];
  488|  7.66k|      probability_table_[i].cum_prob = cum_prob;
  489|  7.66k|      cum_prob += token_probs[i];
  490|  7.66k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 12, False: 7.65k]
  ------------------
  491|     12|        return false;
  492|     12|      }
  493|  32.5M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 32.5M, False: 7.65k]
  ------------------
  494|  32.5M|        lut_table_[j] = i;
  495|  32.5M|      }
  496|  7.65k|      act_prob = cum_prob;
  497|  7.65k|    }
  498|     32|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 3, False: 29]
  ------------------
  499|      3|      return false;
  500|      3|    }
  501|     29|    return true;
  502|     32|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|     11|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     11|    unsigned x;
  423|     11|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 11]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     11|    ans_.buf = buf;
  427|     11|    x = buf[offset - 1] >> 6;
  428|     11|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 5, False: 6]
  ------------------
  429|      5|      ans_.buf_offset = offset - 1;
  430|      5|      ans_.state = buf[offset - 1] & 0x3F;
  431|      6|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 2, False: 4]
  ------------------
  432|      2|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 2]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      2|      ans_.buf_offset = offset - 2;
  436|      2|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      4|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 2, False: 2]
  ------------------
  438|      2|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 2]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      2|      ans_.buf_offset = offset - 3;
  442|      2|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      2|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 2, False: 0]
  ------------------
  444|      2|      ans_.buf_offset = offset - 4;
  445|      2|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      2|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     11|    ans_.state += l_rans_base;
  450|     11|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     11|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 2, False: 9]
  ------------------
  451|      2|      return 1;
  452|      2|    }
  453|      9|    return 0;
  454|     11|  }
_ZN5draco11RAnsDecoderILi20EE9rans_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.5k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 24.1k, False: 12.3k]
  |  Branch (466:40): [True: 408, False: 23.7k]
  ------------------
  467|    408|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    408|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    408|    }
  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|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_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|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|      9|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    116|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    116|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    116|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 116]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    116|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    116|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    116|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 33, False: 83]
  ------------------
   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|     83|#endif
   73|     83|  {
   74|     83|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 83]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     83|  }
   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|    116|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 114]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    114|  probability_table_.resize(num_symbols_);
   86|    114|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 15, False: 99]
  ------------------
   87|     15|    return true;
   88|     15|  }
   89|       |  // Decode the table.
   90|  1.04M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.04M, False: 67]
  ------------------
   91|  1.04M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.04M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 7, False: 1.04M]
  ------------------
   95|      7|      return false;
   96|      7|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.04M|    const int token = prob_data & 3;
  102|  1.04M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 87.4k, False: 960k]
  ------------------
  103|  87.4k|      const uint32_t offset = prob_data >> 2;
  104|  87.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 87.4k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.25M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.16M, False: 87.4k]
  ------------------
  109|  3.16M|        probability_table_[i + j] = 0;
  110|  3.16M|      }
  111|  87.4k|      i += offset;
  112|   960k|    } else {
  113|   960k|      const int extra_bytes = token;
  114|   960k|      uint32_t prob = prob_data >> 2;
  115|  1.83M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 871k, False: 960k]
  ------------------
  116|   871k|        uint8_t eb;
  117|   871k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 871k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   871k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   871k|      }
  124|   960k|      probability_table_[i] = prob;
  125|   960k|    }
  126|  1.04M|  }
  127|     67|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 34, False: 33]
  ------------------
  128|     34|    return false;
  129|     34|  }
  130|     33|  return true;
  131|     67|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|     48|    DecoderBuffer *buffer) {
  136|     48|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     48|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     48|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     48|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 46]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      2|  } else
  145|     46|#endif
  146|     46|  {
  147|     46|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 46]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     46|  }
  151|     48|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 8, False: 40]
  ------------------
  152|      8|    return false;
  153|      8|  }
  154|     40|  const uint8_t *const data_head =
  155|     40|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     40|  buffer->Advance(bytes_encoded);
  158|     40|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 8, False: 32]
  ------------------
  159|      8|    return false;
  160|      8|  }
  161|     32|  return true;
  162|     40|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|     32|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  91.7k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|     31|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     31|  ans_.read_end();
  167|     31|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|     26|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|     26|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     26|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 26]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     26|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     26|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     26|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 16]
  ------------------
   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|     16|#endif
   73|     16|  {
   74|     16|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 16]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     16|  }
   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|     26|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 20]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|     20|  probability_table_.resize(num_symbols_);
   86|     20|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 19]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   986k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 986k, False: 14]
  ------------------
   91|   986k|    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|   986k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 986k]
  ------------------
   95|      1|      return false;
   96|      1|    }
   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|   986k|    const int token = prob_data & 3;
  102|   986k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 85.9k, False: 900k]
  ------------------
  103|  85.9k|      const uint32_t offset = prob_data >> 2;
  104|  85.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 1, False: 85.9k]
  ------------------
  105|      1|        return false;
  106|      1|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.89M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.80M, False: 85.9k]
  ------------------
  109|  3.80M|        probability_table_[i + j] = 0;
  110|  3.80M|      }
  111|  85.9k|      i += offset;
  112|   900k|    } else {
  113|   900k|      const int extra_bytes = token;
  114|   900k|      uint32_t prob = prob_data >> 2;
  115|  1.28M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 383k, False: 900k]
  ------------------
  116|   383k|        uint8_t eb;
  117|   383k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 383k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   383k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   383k|      }
  124|   900k|      probability_table_[i] = prob;
  125|   900k|    }
  126|   986k|  }
  127|     14|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 0]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|      0|  return true;
  131|     14|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|      1|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|     24|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|     24|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     24|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 24]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     24|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     24|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     24|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 9, False: 15]
  ------------------
   67|      9|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 9]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      9|  } else
   72|     15|#endif
   73|     15|  {
   74|     15|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 15]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     15|  }
   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|     24|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 24]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     24|  probability_table_.resize(num_symbols_);
   86|     24|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 24]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   142k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 142k, False: 13]
  ------------------
   91|   142k|    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|   142k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 6, False: 142k]
  ------------------
   95|      6|      return false;
   96|      6|    }
   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|   142k|    const int token = prob_data & 3;
  102|   142k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 22.6k, False: 119k]
  ------------------
  103|  22.6k|      const uint32_t offset = prob_data >> 2;
  104|  22.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 22.6k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   674k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 651k, False: 22.6k]
  ------------------
  109|   651k|        probability_table_[i + j] = 0;
  110|   651k|      }
  111|  22.6k|      i += offset;
  112|   119k|    } else {
  113|   119k|      const int extra_bytes = token;
  114|   119k|      uint32_t prob = prob_data >> 2;
  115|   189k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 69.4k, False: 119k]
  ------------------
  116|  69.4k|        uint8_t eb;
  117|  69.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 69.4k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  69.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  69.4k|      }
  124|   119k|      probability_table_[i] = prob;
  125|   119k|    }
  126|   142k|  }
  127|     13|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 8]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|      8|  return true;
  131|     13|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|      8|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|      8|    DecoderBuffer *buffer) {
  136|      8|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      8|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      8|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      8|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 1]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 7]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      7|  } else
  145|      1|#endif
  146|      1|  {
  147|      1|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 1]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      1|  }
  151|      8|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 7, False: 1]
  ------------------
  152|      7|    return false;
  153|      7|  }
  154|      1|  const uint8_t *const data_head =
  155|      1|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      1|  buffer->Advance(bytes_encoded);
  158|      1|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 1]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      1|  return true;
  162|      1|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  1.03k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|      1|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      1|  ans_.read_end();
  167|      1|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|     21|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|     21|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     21|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 21]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     21|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     21|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     21|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 4, False: 17]
  ------------------
   67|      4|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 4]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      4|  } else
   72|     17|#endif
   73|     17|  {
   74|     17|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 17]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     17|  }
   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|     21|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 21]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     21|  probability_table_.resize(num_symbols_);
   86|     21|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 21]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   503k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 503k, False: 11]
  ------------------
   91|   503k|    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|   503k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 3, False: 503k]
  ------------------
   95|      3|      return false;
   96|      3|    }
   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|   503k|    const int token = prob_data & 3;
  102|   503k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 63.7k, False: 439k]
  ------------------
  103|  63.7k|      const uint32_t offset = prob_data >> 2;
  104|  63.7k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 63.7k]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.25M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.19M, False: 63.7k]
  ------------------
  109|  3.19M|        probability_table_[i + j] = 0;
  110|  3.19M|      }
  111|  63.7k|      i += offset;
  112|   439k|    } else {
  113|   439k|      const int extra_bytes = token;
  114|   439k|      uint32_t prob = prob_data >> 2;
  115|   589k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 150k, False: 439k]
  ------------------
  116|   150k|        uint8_t eb;
  117|   150k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 4, False: 150k]
  ------------------
  118|      4|          return false;
  119|      4|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   150k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   150k|      }
  124|   439k|      probability_table_[i] = prob;
  125|   439k|    }
  126|   503k|  }
  127|     11|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 10]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|     10|  return true;
  131|     11|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|     10|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|     10|    DecoderBuffer *buffer) {
  136|     10|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     10|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     10|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     10|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 10]
  ------------------
  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|     10|#endif
  146|     10|  {
  147|     10|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 10]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     10|  }
  151|     10|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 10]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|     10|  const uint8_t *const data_head =
  155|     10|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     10|  buffer->Advance(bytes_encoded);
  158|     10|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 10]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|     10|  return true;
  162|     10|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|   124k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|     10|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     10|  ans_.read_end();
  167|     10|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|     44|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|     44|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     44|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 44]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     44|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     44|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     44|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 36, False: 8]
  ------------------
   67|     36|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 36]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     36|  } else
   72|      8|#endif
   73|      8|  {
   74|      8|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 8]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      8|  }
   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|     44|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 18, False: 26]
  ------------------
   83|     18|    return false;
   84|     18|  }
   85|     26|  probability_table_.resize(num_symbols_);
   86|     26|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 14]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|   196k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 196k, False: 9]
  ------------------
   91|   196k|    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|   196k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 3, False: 196k]
  ------------------
   95|      3|      return false;
   96|      3|    }
   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|   196k|    const int token = prob_data & 3;
  102|   196k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.57k, False: 194k]
  ------------------
  103|  2.57k|      const uint32_t offset = prob_data >> 2;
  104|  2.57k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 1, False: 2.57k]
  ------------------
  105|      1|        return false;
  106|      1|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  89.7k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 87.2k, False: 2.57k]
  ------------------
  109|  87.2k|        probability_table_[i + j] = 0;
  110|  87.2k|      }
  111|  2.57k|      i += offset;
  112|   194k|    } else {
  113|   194k|      const int extra_bytes = token;
  114|   194k|      uint32_t prob = prob_data >> 2;
  115|   269k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 75.3k, False: 194k]
  ------------------
  116|  75.3k|        uint8_t eb;
  117|  75.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 75.3k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  75.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  75.3k|      }
  124|   194k|      probability_table_[i] = prob;
  125|   194k|    }
  126|   196k|  }
  127|      9|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 4]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|      4|  return true;
  131|      9|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|     16|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|      4|    DecoderBuffer *buffer) {
  136|      4|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      4|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      4|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      4|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 4]
  ------------------
  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|      4|#endif
  146|      4|  {
  147|      4|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 4]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      4|  }
  151|      4|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 4]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|      4|  const uint8_t *const data_head =
  155|      4|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      4|  buffer->Advance(bytes_encoded);
  158|      4|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 4]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      4|  return true;
  162|      4|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  34.9k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|      4|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      4|  ans_.read_end();
  167|      4|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|      5|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|      5|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      5|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 5]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      5|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      5|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      5|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 3]
  ------------------
   67|      2|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 2]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      2|  } else
   72|      3|#endif
   73|      3|  {
   74|      3|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 3]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      3|  }
   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|      5|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 4]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|      4|  probability_table_.resize(num_symbols_);
   86|      4|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 4]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  5.52k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 5.52k, False: 1]
  ------------------
   91|  5.52k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  5.52k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 5.52k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  5.52k|    const int token = prob_data & 3;
  102|  5.52k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 988, False: 4.53k]
  ------------------
  103|    988|      const uint32_t offset = prob_data >> 2;
  104|    988|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 985]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  39.4k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 38.4k, False: 985]
  ------------------
  109|  38.4k|        probability_table_[i + j] = 0;
  110|  38.4k|      }
  111|    985|      i += offset;
  112|  4.53k|    } else {
  113|  4.53k|      const int extra_bytes = token;
  114|  4.53k|      uint32_t prob = prob_data >> 2;
  115|  6.41k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.88k, False: 4.53k]
  ------------------
  116|  1.88k|        uint8_t eb;
  117|  1.88k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 1.88k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.88k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.88k|      }
  124|  4.53k|      probability_table_[i] = prob;
  125|  4.53k|    }
  126|  5.52k|  }
  127|      1|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 0]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      0|  return true;
  131|      1|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|     21|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|     21|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     21|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 21]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     21|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     21|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     21|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 18, False: 3]
  ------------------
   67|     18|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 18]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     18|  } else
   72|      3|#endif
   73|      3|  {
   74|      3|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 3]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      3|  }
   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|     21|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 13]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|     13|  probability_table_.resize(num_symbols_);
   86|     13|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 13]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  58.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 58.6k, False: 2]
  ------------------
   91|  58.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|  58.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 4, False: 58.6k]
  ------------------
   95|      4|      return false;
   96|      4|    }
   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|  58.6k|    const int token = prob_data & 3;
  102|  58.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 7.93k, False: 50.7k]
  ------------------
  103|  7.93k|      const uint32_t offset = prob_data >> 2;
  104|  7.93k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 7, False: 7.92k]
  ------------------
  105|      7|        return false;
  106|      7|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   325k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 317k, False: 7.92k]
  ------------------
  109|   317k|        probability_table_[i + j] = 0;
  110|   317k|      }
  111|  7.92k|      i += offset;
  112|  50.7k|    } else {
  113|  50.7k|      const int extra_bytes = token;
  114|  50.7k|      uint32_t prob = prob_data >> 2;
  115|  79.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 28.5k, False: 50.7k]
  ------------------
  116|  28.5k|        uint8_t eb;
  117|  28.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 28.5k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  28.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  28.5k|      }
  124|  50.7k|      probability_table_[i] = prob;
  125|  50.7k|    }
  126|  58.6k|  }
  127|      2|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 0, False: 2]
  ------------------
  128|      0|    return false;
  129|      0|  }
  130|      2|  return true;
  131|      2|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|      2|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|      2|    DecoderBuffer *buffer) {
  136|      2|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      2|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      2|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      2|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 1]
  ------------------
  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|      1|#endif
  146|      1|  {
  147|      1|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 1]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      1|  }
  151|      2|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 2, False: 0]
  ------------------
  152|      2|    return false;
  153|      2|  }
  154|      0|  const uint8_t *const data_head =
  155|      0|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      0|  buffer->Advance(bytes_encoded);
  158|      0|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 0]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      0|  return true;
  162|      0|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|      7|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|      7|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      7|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 7]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      7|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      7|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      7|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 7, False: 0]
  ------------------
   67|      7|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 7]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      7|  } else
   72|      0|#endif
   73|      0|  {
   74|      0|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 0]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      0|  }
   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|      7|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 1]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|      1|  probability_table_.resize(num_symbols_);
   86|      1|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 1]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   183k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 183k, False: 0]
  ------------------
   91|   183k|    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|   183k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 183k]
  ------------------
   95|      1|      return false;
   96|      1|    }
   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|   183k|    const int token = prob_data & 3;
  102|   183k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 19.6k, False: 163k]
  ------------------
  103|  19.6k|      const uint32_t offset = prob_data >> 2;
  104|  19.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 0, False: 19.6k]
  ------------------
  105|      0|        return false;
  106|      0|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   473k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 454k, False: 19.6k]
  ------------------
  109|   454k|        probability_table_[i + j] = 0;
  110|   454k|      }
  111|  19.6k|      i += offset;
  112|   163k|    } else {
  113|   163k|      const int extra_bytes = token;
  114|   163k|      uint32_t prob = prob_data >> 2;
  115|   243k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 79.9k, False: 163k]
  ------------------
  116|  79.9k|        uint8_t eb;
  117|  79.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 79.9k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  79.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  79.9k|      }
  124|   163k|      probability_table_[i] = prob;
  125|   163k|    }
  126|   183k|  }
  127|      0|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 0, False: 0]
  ------------------
  128|      0|    return false;
  129|      0|  }
  130|      0|  return true;
  131|      0|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|     24|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|     24|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     24|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 24]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     24|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     24|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     24|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 24]
  ------------------
   67|      0|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 0]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      0|  } else
   72|     24|#endif
   73|     24|  {
   74|     24|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 24]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     24|  }
   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|     24|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 24]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     24|  probability_table_.resize(num_symbols_);
   86|     24|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 24]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  6.06k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 6.04k, False: 22]
  ------------------
   91|  6.04k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  6.04k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 6.04k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  6.04k|    const int token = prob_data & 3;
  102|  6.04k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 207, False: 5.83k]
  ------------------
  103|    207|      const uint32_t offset = prob_data >> 2;
  104|    207|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 205]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.17k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.97k, False: 205]
  ------------------
  109|  4.97k|        probability_table_[i + j] = 0;
  110|  4.97k|      }
  111|    205|      i += offset;
  112|  5.83k|    } else {
  113|  5.83k|      const int extra_bytes = token;
  114|  5.83k|      uint32_t prob = prob_data >> 2;
  115|  11.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.36k, False: 5.83k]
  ------------------
  116|  5.36k|        uint8_t eb;
  117|  5.36k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 5.36k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.36k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.36k|      }
  124|  5.83k|      probability_table_[i] = prob;
  125|  5.83k|    }
  126|  6.04k|  }
  127|     22|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 19]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|     19|  return true;
  131|     22|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|     19|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|     19|    DecoderBuffer *buffer) {
  136|     19|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     19|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     19|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     19|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 19]
  ------------------
  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|     19|#endif
  146|     19|  {
  147|     19|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 19]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     19|  }
  151|     19|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 2, False: 17]
  ------------------
  152|      2|    return false;
  153|      2|  }
  154|     17|  const uint8_t *const data_head =
  155|     17|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     17|  buffer->Advance(bytes_encoded);
  158|     17|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 16]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|     16|  return true;
  162|     17|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  5.29M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     16|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     16|  ans_.read_end();
  167|     16|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|      6|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|      6|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      6|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 6]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      6|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      6|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      6|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 6]
  ------------------
   67|      0|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 0]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      0|  } else
   72|      6|#endif
   73|      6|  {
   74|      6|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 6]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      6|  }
   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|      6|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 6]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      6|  probability_table_.resize(num_symbols_);
   86|      6|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 5]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  3.75k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 3.75k, False: 2]
  ------------------
   91|  3.75k|    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|  3.75k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 3.75k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   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|  3.75k|    const int token = prob_data & 3;
  102|  3.75k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.17k, False: 2.57k]
  ------------------
  103|  1.17k|      const uint32_t offset = prob_data >> 2;
  104|  1.17k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 1.17k]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  50.7k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 49.5k, False: 1.17k]
  ------------------
  109|  49.5k|        probability_table_[i + j] = 0;
  110|  49.5k|      }
  111|  1.17k|      i += offset;
  112|  2.57k|    } else {
  113|  2.57k|      const int extra_bytes = token;
  114|  2.57k|      uint32_t prob = prob_data >> 2;
  115|  4.54k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.96k, False: 2.57k]
  ------------------
  116|  1.96k|        uint8_t eb;
  117|  1.96k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 1.96k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.96k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.96k|      }
  124|  2.57k|      probability_table_[i] = prob;
  125|  2.57k|    }
  126|  3.75k|  }
  127|      2|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 1]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      1|  return true;
  131|      2|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|      2|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|      1|    DecoderBuffer *buffer) {
  136|      1|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      1|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      1|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      1|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 1]
  ------------------
  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|      1|#endif
  146|      1|  {
  147|      1|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 1]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      1|  }
  151|      1|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 1]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|      1|  const uint8_t *const data_head =
  155|      1|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      1|  buffer->Advance(bytes_encoded);
  158|      1|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 1]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      1|  return true;
  162|      1|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|     96|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|      1|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      1|  ans_.read_end();
  167|      1|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|      4|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|      4|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      4|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 4]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      4|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      4|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      4|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 4]
  ------------------
   67|      0|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 0]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      0|  } else
   72|      4|#endif
   73|      4|  {
   74|      4|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 4]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      4|  }
   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|      4|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 4]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      4|  probability_table_.resize(num_symbols_);
   86|      4|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 4]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  75.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 75.1k, False: 1]
  ------------------
   91|  75.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|  75.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 75.1k]
  ------------------
   95|      1|      return false;
   96|      1|    }
   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|  75.1k|    const int token = prob_data & 3;
  102|  75.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 13.3k, False: 61.8k]
  ------------------
  103|  13.3k|      const uint32_t offset = prob_data >> 2;
  104|  13.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 13.3k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   566k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 552k, False: 13.3k]
  ------------------
  109|   552k|        probability_table_[i + j] = 0;
  110|   552k|      }
  111|  13.3k|      i += offset;
  112|  61.8k|    } else {
  113|  61.8k|      const int extra_bytes = token;
  114|  61.8k|      uint32_t prob = prob_data >> 2;
  115|   119k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 57.7k, False: 61.8k]
  ------------------
  116|  57.7k|        uint8_t eb;
  117|  57.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 57.7k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  57.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  57.7k|      }
  124|  61.8k|      probability_table_[i] = prob;
  125|  61.8k|    }
  126|  75.1k|  }
  127|      1|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 0]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      0|  return true;
  131|      1|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|     14|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|     14|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     14|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 14]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     14|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     14|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     14|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 5, False: 9]
  ------------------
   67|      5|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 5]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      5|  } else
   72|      9|#endif
   73|      9|  {
   74|      9|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 9]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      9|  }
   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|     14|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 11]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|     11|  probability_table_.resize(num_symbols_);
   86|     11|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 11]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   287k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 287k, False: 2]
  ------------------
   91|   287k|    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|   287k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 287k]
  ------------------
   95|      1|      return false;
   96|      1|    }
   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|   287k|    const int token = prob_data & 3;
  102|   287k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 75.7k, False: 211k]
  ------------------
  103|  75.7k|      const uint32_t offset = prob_data >> 2;
  104|  75.7k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 5, False: 75.7k]
  ------------------
  105|      5|        return false;
  106|      5|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.31M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.23M, False: 75.7k]
  ------------------
  109|  2.23M|        probability_table_[i + j] = 0;
  110|  2.23M|      }
  111|  75.7k|      i += offset;
  112|   211k|    } else {
  113|   211k|      const int extra_bytes = token;
  114|   211k|      uint32_t prob = prob_data >> 2;
  115|   290k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 78.7k, False: 211k]
  ------------------
  116|  78.7k|        uint8_t eb;
  117|  78.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 78.7k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  78.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  78.7k|      }
  124|   211k|      probability_table_[i] = prob;
  125|   211k|    }
  126|   287k|  }
  127|      2|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 1]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      1|  return true;
  131|      2|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|      1|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|      1|    DecoderBuffer *buffer) {
  136|      1|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      1|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      1|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      1|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 1]
  ------------------
  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|      1|#endif
  146|      1|  {
  147|      1|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 1]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      1|  }
  151|      1|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 0]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|      0|  const uint8_t *const data_head =
  155|      0|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      0|  buffer->Advance(bytes_encoded);
  158|      0|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 0]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      0|  return true;
  162|      0|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|      2|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|      2|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      2|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 2]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      2|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      2|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      2|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 2]
  ------------------
   67|      0|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 0]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      0|  } else
   72|      2|#endif
   73|      2|  {
   74|      2|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 2]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      2|  }
   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|      2|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 2]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      2|  probability_table_.resize(num_symbols_);
   86|      2|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 2]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|    863|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 861, False: 2]
  ------------------
   91|    861|    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|    861|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 861]
  ------------------
   95|      0|      return false;
   96|      0|    }
   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|    861|    const int token = prob_data & 3;
  102|    861|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 116, False: 745]
  ------------------
  103|    116|      const uint32_t offset = prob_data >> 2;
  104|    116|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 0, False: 116]
  ------------------
  105|      0|        return false;
  106|      0|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.63k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.51k, False: 116]
  ------------------
  109|  4.51k|        probability_table_[i + j] = 0;
  110|  4.51k|      }
  111|    116|      i += offset;
  112|    745|    } else {
  113|    745|      const int extra_bytes = token;
  114|    745|      uint32_t prob = prob_data >> 2;
  115|  1.45k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 713, False: 745]
  ------------------
  116|    713|        uint8_t eb;
  117|    713|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 713]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|    713|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|    713|      }
  124|    745|      probability_table_[i] = prob;
  125|    745|    }
  126|    861|  }
  127|      2|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 1]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      1|  return true;
  131|      2|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|      1|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|      1|    DecoderBuffer *buffer) {
  136|      1|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      1|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      1|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      1|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 1]
  ------------------
  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|      1|#endif
  146|      1|  {
  147|      1|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 1]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      1|  }
  151|      1|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 1]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|      1|  const uint8_t *const data_head =
  155|      1|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      1|  buffer->Advance(bytes_encoded);
  158|      1|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 1]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      1|  return true;
  162|      1|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|     21|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|      1|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      1|  ans_.read_end();
  167|      1|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|     12|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|     12|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     12|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 12]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     12|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     12|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     12|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 1, False: 11]
  ------------------
   67|      1|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 1]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      1|  } else
   72|     11|#endif
   73|     11|  {
   74|     11|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 11]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     11|  }
   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|     12|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 11]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|     11|  probability_table_.resize(num_symbols_);
   86|     11|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 11]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  20.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 20.7k, False: 5]
  ------------------
   91|  20.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|  20.7k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 2, False: 20.7k]
  ------------------
   95|      2|      return false;
   96|      2|    }
   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|  20.7k|    const int token = prob_data & 3;
  102|  20.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.95k, False: 14.7k]
  ------------------
  103|  5.95k|      const uint32_t offset = prob_data >> 2;
  104|  5.95k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 5.95k]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   173k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 167k, False: 5.95k]
  ------------------
  109|   167k|        probability_table_[i + j] = 0;
  110|   167k|      }
  111|  5.95k|      i += offset;
  112|  14.7k|    } else {
  113|  14.7k|      const int extra_bytes = token;
  114|  14.7k|      uint32_t prob = prob_data >> 2;
  115|  22.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 7.85k, False: 14.7k]
  ------------------
  116|  7.85k|        uint8_t eb;
  117|  7.85k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 7.85k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  7.85k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  7.85k|      }
  124|  14.7k|      probability_table_[i] = prob;
  125|  14.7k|    }
  126|  20.7k|  }
  127|      5|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 4]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      4|  return true;
  131|      5|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|      4|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|      4|    DecoderBuffer *buffer) {
  136|      4|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      4|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      4|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      4|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 4]
  ------------------
  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|      4|#endif
  146|      4|  {
  147|      4|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 4]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      4|  }
  151|      4|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 4]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|      4|  const uint8_t *const data_head =
  155|      4|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      4|  buffer->Advance(bytes_encoded);
  158|      4|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 2, False: 2]
  ------------------
  159|      2|    return false;
  160|      2|  }
  161|      2|  return true;
  162|      4|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|    122|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|      9|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|      9|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      9|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 9]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      9|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      9|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      9|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 6, False: 3]
  ------------------
   67|      6|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 6]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      6|  } else
   72|      3|#endif
   73|      3|  {
   74|      3|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 3]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      3|  }
   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|      9|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 8]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|      8|  probability_table_.resize(num_symbols_);
   86|      8|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 8]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  81.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 81.6k, False: 2]
  ------------------
   91|  81.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|  81.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 81.6k]
  ------------------
   95|      1|      return false;
   96|      1|    }
   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|  81.6k|    const int token = prob_data & 3;
  102|  81.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 37.5k, False: 44.1k]
  ------------------
  103|  37.5k|      const uint32_t offset = prob_data >> 2;
  104|  37.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 37.5k]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   246k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 208k, False: 37.5k]
  ------------------
  109|   208k|        probability_table_[i + j] = 0;
  110|   208k|      }
  111|  37.5k|      i += offset;
  112|  44.1k|    } else {
  113|  44.1k|      const int extra_bytes = token;
  114|  44.1k|      uint32_t prob = prob_data >> 2;
  115|  63.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 19.7k, False: 44.1k]
  ------------------
  116|  19.7k|        uint8_t eb;
  117|  19.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 19.7k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  19.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  19.7k|      }
  124|  44.1k|      probability_table_[i] = prob;
  125|  44.1k|    }
  126|  81.6k|  }
  127|      2|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 1]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      1|  return true;
  131|      2|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|      1|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|      1|    DecoderBuffer *buffer) {
  136|      1|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      1|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      1|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      1|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 1]
  ------------------
  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|      1|#endif
  146|      1|  {
  147|      1|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 1]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      1|  }
  151|      1|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 0]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|      0|  const uint8_t *const data_head =
  155|      0|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      0|  buffer->Advance(bytes_encoded);
  158|      0|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 0]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      0|  return true;
  162|      0|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|     20|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|     20|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     20|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 20]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     20|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     20|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     20|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 20]
  ------------------
   67|      0|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 0]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      0|  } else
   72|     20|#endif
   73|     20|  {
   74|     20|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 20]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     20|  }
   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|     20|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 20]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     20|  probability_table_.resize(num_symbols_);
   86|     20|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 20]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  3.61k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 3.59k, False: 19]
  ------------------
   91|  3.59k|    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|  3.59k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 3.59k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   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|  3.59k|    const int token = prob_data & 3;
  102|  3.59k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 920, False: 2.67k]
  ------------------
  103|    920|      const uint32_t offset = prob_data >> 2;
  104|    920|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 1, False: 919]
  ------------------
  105|      1|        return false;
  106|      1|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  46.9k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 46.0k, False: 919]
  ------------------
  109|  46.0k|        probability_table_[i + j] = 0;
  110|  46.0k|      }
  111|    919|      i += offset;
  112|  2.67k|    } else {
  113|  2.67k|      const int extra_bytes = token;
  114|  2.67k|      uint32_t prob = prob_data >> 2;
  115|  4.13k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.45k, False: 2.67k]
  ------------------
  116|  1.45k|        uint8_t eb;
  117|  1.45k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 1.45k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.45k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.45k|      }
  124|  2.67k|      probability_table_[i] = prob;
  125|  2.67k|    }
  126|  3.59k|  }
  127|     19|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 15]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|     15|  return true;
  131|     19|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|     15|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|     15|    DecoderBuffer *buffer) {
  136|     15|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     15|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     15|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     15|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 15]
  ------------------
  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|     15|#endif
  146|     15|  {
  147|     15|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 15]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     15|  }
  151|     15|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 12, False: 3]
  ------------------
  152|     12|    return false;
  153|     12|  }
  154|      3|  const uint8_t *const data_head =
  155|      3|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      3|  buffer->Advance(bytes_encoded);
  158|      3|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 3]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      3|  return true;
  162|      3|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  23.7k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|      3|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      3|  ans_.read_end();
  167|      3|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|     28|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|     28|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     28|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 28]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     28|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     28|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     28|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 11, False: 17]
  ------------------
   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|     17|#endif
   73|     17|  {
   74|     17|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 17]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     17|  }
   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|     28|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 25]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|     25|  probability_table_.resize(num_symbols_);
   86|     25|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 25]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  75.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 75.3k, False: 8]
  ------------------
   91|  75.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  75.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 5, False: 75.3k]
  ------------------
   95|      5|      return false;
   96|      5|    }
   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|  75.3k|    const int token = prob_data & 3;
  102|  75.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 27.2k, False: 48.0k]
  ------------------
  103|  27.2k|      const uint32_t offset = prob_data >> 2;
  104|  27.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 27.2k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   579k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 551k, False: 27.2k]
  ------------------
  109|   551k|        probability_table_[i + j] = 0;
  110|   551k|      }
  111|  27.2k|      i += offset;
  112|  48.0k|    } else {
  113|  48.0k|      const int extra_bytes = token;
  114|  48.0k|      uint32_t prob = prob_data >> 2;
  115|  80.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 32.3k, False: 48.0k]
  ------------------
  116|  32.3k|        uint8_t eb;
  117|  32.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 4, False: 32.3k]
  ------------------
  118|      4|          return false;
  119|      4|        }
  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|  48.0k|      probability_table_[i] = prob;
  125|  48.0k|    }
  126|  75.3k|  }
  127|      8|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 6]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|      6|  return true;
  131|      8|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|      6|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|      6|    DecoderBuffer *buffer) {
  136|      6|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      6|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      6|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      6|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 6]
  ------------------
  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|      6|#endif
  146|      6|  {
  147|      6|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 6]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      6|  }
  151|      6|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 4, False: 2]
  ------------------
  152|      4|    return false;
  153|      4|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  4.24k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|     17|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|     17|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     17|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 17]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     17|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     17|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     17|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 4, False: 13]
  ------------------
   67|      4|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 4]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      4|  } else
   72|     13|#endif
   73|     13|  {
   74|     13|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 13]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     13|  }
   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|     17|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 17]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     17|  probability_table_.resize(num_symbols_);
   86|     17|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 17]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  25.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 25.3k, False: 10]
  ------------------
   91|  25.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  25.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 2, False: 25.3k]
  ------------------
   95|      2|      return false;
   96|      2|    }
   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|  25.3k|    const int token = prob_data & 3;
  102|  25.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.75k, False: 20.5k]
  ------------------
  103|  4.75k|      const uint32_t offset = prob_data >> 2;
  104|  4.75k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 4.74k]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   200k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 196k, False: 4.74k]
  ------------------
  109|   196k|        probability_table_[i + j] = 0;
  110|   196k|      }
  111|  4.74k|      i += offset;
  112|  20.5k|    } else {
  113|  20.5k|      const int extra_bytes = token;
  114|  20.5k|      uint32_t prob = prob_data >> 2;
  115|  31.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.4k, False: 20.5k]
  ------------------
  116|  10.4k|        uint8_t eb;
  117|  10.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 10.4k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.4k|      }
  124|  20.5k|      probability_table_[i] = prob;
  125|  20.5k|    }
  126|  25.3k|  }
  127|     10|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 7, False: 3]
  ------------------
  128|      7|    return false;
  129|      7|  }
  130|      3|  return true;
  131|     10|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|      3|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|      3|    DecoderBuffer *buffer) {
  136|      3|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      3|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      3|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      3|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 3]
  ------------------
  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|      3|#endif
  146|      3|  {
  147|      3|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 3]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      3|  }
  151|      3|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 2]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  7.98k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|    644|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|    644|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 0, False: 644]
  ------------------
   35|      0|    return true;
   36|      0|  }
   37|       |  // Decode which scheme to use.
   38|    644|  uint8_t scheme;
   39|    644|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 644]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    644|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 104, False: 540]
  ------------------
   43|    104|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    104|                                                  src_buffer, out_values);
   45|    540|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 338, False: 202]
  ------------------
   46|    338|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|    338|                                               out_values);
   48|    338|  }
   49|    202|  return false;
   50|    644|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    104|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    104|  SymbolDecoderT<5> tag_decoder;
   57|    104|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 60, False: 44]
  ------------------
   58|     60|    return false;
   59|     60|  }
   60|       |
   61|     44|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 16, False: 28]
  ------------------
   62|     16|    return false;
   63|     16|  }
   64|       |
   65|     28|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 28, False: 0]
  |  Branch (65:25): [True: 1, False: 27]
  ------------------
   66|      1|    return false;  // Wrong number of symbols.
   67|      1|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|     27|  src_buffer->StartBitDecoding(false, nullptr);
   72|     27|  int value_id = 0;
   73|  43.1k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 43.1k, False: 27]
  ------------------
   74|       |    // Decode the tag.
   75|  43.1k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|   841k|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 798k, False: 43.1k]
  ------------------
   78|   798k|      uint32_t val;
   79|   798k|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 798k]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|   798k|      out_values[value_id++] = val;
   83|   798k|    }
   84|  43.1k|  }
   85|     27|  tag_decoder.EndDecoding();
   86|     27|  src_buffer->EndBitDecoding();
   87|     27|  return true;
   88|     27|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|    338|                      uint32_t *out_values) {
  117|    338|  uint8_t max_bit_length;
  118|    338|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 1, False: 337]
  ------------------
  119|      1|    return false;
  120|      1|  }
  121|    337|  switch (max_bit_length) {
  122|     26|    case 1:
  ------------------
  |  Branch (122:5): [True: 26, False: 311]
  ------------------
  123|     26|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|     26|                                                         out_values);
  125|     24|    case 2:
  ------------------
  |  Branch (125:5): [True: 24, False: 313]
  ------------------
  126|     24|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|     24|                                                         out_values);
  128|     21|    case 3:
  ------------------
  |  Branch (128:5): [True: 21, False: 316]
  ------------------
  129|     21|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|     21|                                                         out_values);
  131|     44|    case 4:
  ------------------
  |  Branch (131:5): [True: 44, False: 293]
  ------------------
  132|     44|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|     44|                                                         out_values);
  134|     12|    case 5:
  ------------------
  |  Branch (134:5): [True: 12, False: 325]
  ------------------
  135|     12|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|     12|                                                         out_values);
  137|      5|    case 6:
  ------------------
  |  Branch (137:5): [True: 5, False: 332]
  ------------------
  138|      5|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|      5|                                                         out_values);
  140|     21|    case 7:
  ------------------
  |  Branch (140:5): [True: 21, False: 316]
  ------------------
  141|     21|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|     21|                                                         out_values);
  143|      7|    case 8:
  ------------------
  |  Branch (143:5): [True: 7, False: 330]
  ------------------
  144|      7|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|      7|                                                         out_values);
  146|     24|    case 9:
  ------------------
  |  Branch (146:5): [True: 24, False: 313]
  ------------------
  147|     24|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|     24|                                                         out_values);
  149|      6|    case 10:
  ------------------
  |  Branch (149:5): [True: 6, False: 331]
  ------------------
  150|      6|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|      6|          num_values, src_buffer, out_values);
  152|      4|    case 11:
  ------------------
  |  Branch (152:5): [True: 4, False: 333]
  ------------------
  153|      4|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|      4|          num_values, src_buffer, out_values);
  155|     14|    case 12:
  ------------------
  |  Branch (155:5): [True: 14, False: 323]
  ------------------
  156|     14|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|     14|          num_values, src_buffer, out_values);
  158|      2|    case 13:
  ------------------
  |  Branch (158:5): [True: 2, False: 335]
  ------------------
  159|      2|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|      2|          num_values, src_buffer, out_values);
  161|     12|    case 14:
  ------------------
  |  Branch (161:5): [True: 12, False: 325]
  ------------------
  162|     12|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|     12|          num_values, src_buffer, out_values);
  164|      9|    case 15:
  ------------------
  |  Branch (164:5): [True: 9, False: 328]
  ------------------
  165|      9|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|      9|          num_values, src_buffer, out_values);
  167|     20|    case 16:
  ------------------
  |  Branch (167:5): [True: 20, False: 317]
  ------------------
  168|     20|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|     20|          num_values, src_buffer, out_values);
  170|     28|    case 17:
  ------------------
  |  Branch (170:5): [True: 28, False: 309]
  ------------------
  171|     28|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|     28|          num_values, src_buffer, out_values);
  173|     17|    case 18:
  ------------------
  |  Branch (173:5): [True: 17, False: 320]
  ------------------
  174|     17|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|     17|          num_values, src_buffer, out_values);
  176|     41|    default:
  ------------------
  |  Branch (176:5): [True: 41, False: 296]
  ------------------
  177|     41|      return false;
  178|    337|  }
  179|    337|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|     26|                              uint32_t *out_values) {
   93|     26|  SymbolDecoderT decoder;
   94|     26|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 25, False: 1]
  ------------------
   95|     25|    return false;
   96|     25|  }
   97|       |
   98|      1|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 1, False: 0]
  |  Branch (98:25): [True: 1, False: 0]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|      0|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 0]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|      0|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 0, False: 0]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      0|    const uint32_t value = decoder.DecodeSymbol();
  108|      0|    out_values[i] = value;
  109|      0|  }
  110|      0|  decoder.EndDecoding();
  111|      0|  return true;
  112|      0|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|     24|                              uint32_t *out_values) {
   93|     24|  SymbolDecoderT decoder;
   94|     24|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 16, False: 8]
  ------------------
   95|     16|    return false;
   96|     16|  }
   97|       |
   98|      8|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 8, False: 0]
  |  Branch (98:25): [True: 0, False: 8]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      8|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 7, False: 1]
  ------------------
  103|      7|    return false;
  104|      7|  }
  105|  1.03k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.03k, False: 1]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.03k|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.03k|    out_values[i] = value;
  109|  1.03k|  }
  110|      1|  decoder.EndDecoding();
  111|      1|  return true;
  112|      8|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|     21|                              uint32_t *out_values) {
   93|     21|  SymbolDecoderT decoder;
   94|     21|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 11, False: 10]
  ------------------
   95|     11|    return false;
   96|     11|  }
   97|       |
   98|     10|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 10, False: 0]
  |  Branch (98:25): [True: 0, False: 10]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     10|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 10]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|   124k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 124k, False: 10]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   124k|    const uint32_t value = decoder.DecodeSymbol();
  108|   124k|    out_values[i] = value;
  109|   124k|  }
  110|     10|  decoder.EndDecoding();
  111|     10|  return true;
  112|     10|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|     44|                              uint32_t *out_values) {
   93|     44|  SymbolDecoderT decoder;
   94|     44|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 28, False: 16]
  ------------------
   95|     28|    return false;
   96|     28|  }
   97|       |
   98|     16|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 16, False: 0]
  |  Branch (98:25): [True: 12, False: 4]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|      4|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 4]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  34.9k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 34.9k, False: 4]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  34.9k|    const uint32_t value = decoder.DecodeSymbol();
  108|  34.9k|    out_values[i] = value;
  109|  34.9k|  }
  110|      4|  decoder.EndDecoding();
  111|      4|  return true;
  112|      4|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|     12|                              uint32_t *out_values) {
   93|     12|  SymbolDecoderT decoder;
   94|     12|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 8, False: 4]
  ------------------
   95|      8|    return false;
   96|      8|  }
   97|       |
   98|      4|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 4, False: 0]
  |  Branch (98:25): [True: 0, False: 4]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      4|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 4]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  48.6k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 48.6k, False: 4]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  48.6k|    const uint32_t value = decoder.DecodeSymbol();
  108|  48.6k|    out_values[i] = value;
  109|  48.6k|  }
  110|      4|  decoder.EndDecoding();
  111|      4|  return true;
  112|      4|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|      5|                              uint32_t *out_values) {
   93|      5|  SymbolDecoderT decoder;
   94|      5|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 5, False: 0]
  ------------------
   95|      5|    return false;
   96|      5|  }
   97|       |
   98|      0|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 0, False: 0]
  |  Branch (98:25): [True: 0, False: 0]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      0|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 0]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|      0|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 0, False: 0]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      0|    const uint32_t value = decoder.DecodeSymbol();
  108|      0|    out_values[i] = value;
  109|      0|  }
  110|      0|  decoder.EndDecoding();
  111|      0|  return true;
  112|      0|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|     21|                              uint32_t *out_values) {
   93|     21|  SymbolDecoderT decoder;
   94|     21|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 19, False: 2]
  ------------------
   95|     19|    return false;
   96|     19|  }
   97|       |
   98|      2|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 2, False: 0]
  |  Branch (98:25): [True: 0, False: 2]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      2|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 2, False: 0]
  ------------------
  103|      2|    return false;
  104|      2|  }
  105|      0|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 0, False: 0]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      0|    const uint32_t value = decoder.DecodeSymbol();
  108|      0|    out_values[i] = value;
  109|      0|  }
  110|      0|  decoder.EndDecoding();
  111|      0|  return true;
  112|      2|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|      7|                              uint32_t *out_values) {
   93|      7|  SymbolDecoderT decoder;
   94|      7|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 7, False: 0]
  ------------------
   95|      7|    return false;
   96|      7|  }
   97|       |
   98|      0|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 0, False: 0]
  |  Branch (98:25): [True: 0, False: 0]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      0|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 0]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|      0|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 0, False: 0]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      0|    const uint32_t value = decoder.DecodeSymbol();
  108|      0|    out_values[i] = value;
  109|      0|  }
  110|      0|  decoder.EndDecoding();
  111|      0|  return true;
  112|      0|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|     24|                              uint32_t *out_values) {
   93|     24|  SymbolDecoderT decoder;
   94|     24|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 5, False: 19]
  ------------------
   95|      5|    return false;
   96|      5|  }
   97|       |
   98|     19|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 19, False: 0]
  |  Branch (98:25): [True: 0, False: 19]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     19|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 3, False: 16]
  ------------------
  103|      3|    return false;
  104|      3|  }
  105|  5.29M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.29M, False: 16]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.29M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.29M|    out_values[i] = value;
  109|  5.29M|  }
  110|     16|  decoder.EndDecoding();
  111|     16|  return true;
  112|     19|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|      6|                              uint32_t *out_values) {
   93|      6|  SymbolDecoderT decoder;
   94|      6|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 4, False: 2]
  ------------------
   95|      4|    return false;
   96|      4|  }
   97|       |
   98|      2|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 2, False: 0]
  |  Branch (98:25): [True: 1, False: 1]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|      1|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 1]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|     97|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 96, False: 1]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|     96|    const uint32_t value = decoder.DecodeSymbol();
  108|     96|    out_values[i] = value;
  109|     96|  }
  110|      1|  decoder.EndDecoding();
  111|      1|  return true;
  112|      1|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|      4|                              uint32_t *out_values) {
   93|      4|  SymbolDecoderT decoder;
   94|      4|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 4, False: 0]
  ------------------
   95|      4|    return false;
   96|      4|  }
   97|       |
   98|      0|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 0, False: 0]
  |  Branch (98:25): [True: 0, False: 0]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      0|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 0]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|      0|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 0, False: 0]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      0|    const uint32_t value = decoder.DecodeSymbol();
  108|      0|    out_values[i] = value;
  109|      0|  }
  110|      0|  decoder.EndDecoding();
  111|      0|  return true;
  112|      0|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|     14|                              uint32_t *out_values) {
   93|     14|  SymbolDecoderT decoder;
   94|     14|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 13, False: 1]
  ------------------
   95|     13|    return false;
   96|     13|  }
   97|       |
   98|      1|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 1, False: 0]
  |  Branch (98:25): [True: 0, False: 1]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      1|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 1, False: 0]
  ------------------
  103|      1|    return false;
  104|      1|  }
  105|      0|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 0, False: 0]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      0|    const uint32_t value = decoder.DecodeSymbol();
  108|      0|    out_values[i] = value;
  109|      0|  }
  110|      0|  decoder.EndDecoding();
  111|      0|  return true;
  112|      1|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|      2|                              uint32_t *out_values) {
   93|      2|  SymbolDecoderT decoder;
   94|      2|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 1, False: 1]
  ------------------
   95|      1|    return false;
   96|      1|  }
   97|       |
   98|      1|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 1, False: 0]
  |  Branch (98:25): [True: 0, False: 1]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      1|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 1]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|     22|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 21, False: 1]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|     21|    const uint32_t value = decoder.DecodeSymbol();
  108|     21|    out_values[i] = value;
  109|     21|  }
  110|      1|  decoder.EndDecoding();
  111|      1|  return true;
  112|      1|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|     12|                              uint32_t *out_values) {
   93|     12|  SymbolDecoderT decoder;
   94|     12|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 8, False: 4]
  ------------------
   95|      8|    return false;
   96|      8|  }
   97|       |
   98|      4|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 4, False: 0]
  |  Branch (98:25): [True: 0, False: 4]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      4|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 2, False: 2]
  ------------------
  103|      2|    return false;
  104|      2|  }
  105|    124|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 122, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|    122|    const uint32_t value = decoder.DecodeSymbol();
  108|    122|    out_values[i] = value;
  109|    122|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      4|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|      9|                              uint32_t *out_values) {
   93|      9|  SymbolDecoderT decoder;
   94|      9|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 8, False: 1]
  ------------------
   95|      8|    return false;
   96|      8|  }
   97|       |
   98|      1|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 1, False: 0]
  |  Branch (98:25): [True: 0, False: 1]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      1|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 1, False: 0]
  ------------------
  103|      1|    return false;
  104|      1|  }
  105|      0|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 0, False: 0]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      0|    const uint32_t value = decoder.DecodeSymbol();
  108|      0|    out_values[i] = value;
  109|      0|  }
  110|      0|  decoder.EndDecoding();
  111|      0|  return true;
  112|      1|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|     20|                              uint32_t *out_values) {
   93|     20|  SymbolDecoderT decoder;
   94|     20|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 5, False: 15]
  ------------------
   95|      5|    return false;
   96|      5|  }
   97|       |
   98|     15|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 15, False: 0]
  |  Branch (98:25): [True: 0, False: 15]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     15|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 12, False: 3]
  ------------------
  103|     12|    return false;
  104|     12|  }
  105|  23.7k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 23.7k, False: 3]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  23.7k|    const uint32_t value = decoder.DecodeSymbol();
  108|  23.7k|    out_values[i] = value;
  109|  23.7k|  }
  110|      3|  decoder.EndDecoding();
  111|      3|  return true;
  112|     15|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|     28|                              uint32_t *out_values) {
   93|     28|  SymbolDecoderT decoder;
   94|     28|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 22, False: 6]
  ------------------
   95|     22|    return false;
   96|     22|  }
   97|       |
   98|      6|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 6, False: 0]
  |  Branch (98:25): [True: 0, False: 6]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      6|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 4, False: 2]
  ------------------
  103|      4|    return false;
  104|      4|  }
  105|  4.24k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.24k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.24k|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.24k|    out_values[i] = value;
  109|  4.24k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      6|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|     17|                              uint32_t *out_values) {
   93|     17|  SymbolDecoderT decoder;
   94|     17|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 14, False: 3]
  ------------------
   95|     14|    return false;
   96|     14|  }
   97|       |
   98|      3|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 3, False: 0]
  |  Branch (98:25): [True: 0, False: 3]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      3|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 1, False: 2]
  ------------------
  103|      1|    return false;
  104|      1|  }
  105|  7.98k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.98k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.98k|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.98k|    out_values[i] = value;
  109|  7.98k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      3|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|    474|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|    150|  const CornerTable *GetCornerTable() const override {
   67|    150|    return corner_table_.get();
   68|    150|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|   722k|                       int *out_encoder_split_symbol_id) {
   87|   722k|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 607k, False: 114k]
  ------------------
   88|   607k|      return false;
   89|   607k|    }
   90|   114k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 0, False: 114k]
  ------------------
   91|   114k|        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|      0|      *out_encoder_split_symbol_id = -1;
   98|      0|      return true;
   99|      0|    }
  100|   114k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 114k, False: 139]
  ------------------
  101|   114k|      return false;
  102|   114k|    }
  103|    139|    *out_face_edge =
  104|    139|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    139|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    139|    topology_split_data_.pop_back();
  108|    139|    return true;
  109|   114k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  2.46M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  2.46M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  2.46M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  2.46M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  1.56k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|    111|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|     97|  const CornerTable *GetCornerTable() const override {
   67|     97|    return corner_table_.get();
   68|     97|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|   103k|                       int *out_encoder_split_symbol_id) {
   87|   103k|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 53.9k, False: 49.3k]
  ------------------
   88|  53.9k|      return false;
   89|  53.9k|    }
   90|  49.3k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 0, False: 49.3k]
  ------------------
   91|  49.3k|        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|      0|      *out_encoder_split_symbol_id = -1;
   98|      0|      return true;
   99|      0|    }
  100|  49.3k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 49.3k, False: 0]
  ------------------
  101|  49.3k|      return false;
  102|  49.3k|    }
  103|      0|    *out_face_edge =
  104|      0|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|      0|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|      0|    topology_split_data_.pop_back();
  108|      0|    return true;
  109|  49.3k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|   303k|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|   303k|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|   303k|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|   303k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|     52|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|    834|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|    158|  const CornerTable *GetCornerTable() const override {
   67|    158|    return corner_table_.get();
   68|    158|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|   113k|                       int *out_encoder_split_symbol_id) {
   87|   113k|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 113k, False: 48]
  ------------------
   88|   113k|      return false;
   89|   113k|    }
   90|     48|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 1, False: 47]
  ------------------
   91|     48|        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|      1|      *out_encoder_split_symbol_id = -1;
   98|      1|      return true;
   99|      1|    }
  100|     47|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 46, False: 1]
  ------------------
  101|     46|      return false;
  102|     46|    }
  103|      1|    *out_face_edge =
  104|      1|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|      1|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|      1|    topology_split_data_.pop_back();
  108|      1|    return true;
  109|     47|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|   180k|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|   180k|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|   180k|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|   180k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|    198|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

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

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|     90|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|   249k|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|   249k|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 188k, False: 60.7k]
  ------------------
   61|   188k|      return true;  // Already traversed.
   62|   188k|    }
   63|       |
   64|  60.7k|    corner_traversal_stack_.clear();
   65|  60.7k|    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|  60.7k|    const VertexIndex next_vert =
   69|  60.7k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  60.7k|    const VertexIndex prev_vert =
   71|  60.7k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  60.7k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 60.7k]
  |  Branch (72:45): [True: 0, False: 60.7k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  60.7k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 60.7k, False: 8]
  ------------------
   76|  60.7k|      this->MarkVertexVisited(next_vert);
   77|  60.7k|      this->traversal_observer().OnNewVertexVisited(
   78|  60.7k|          next_vert, this->corner_table()->Next(corner_id));
   79|  60.7k|    }
   80|  60.7k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 214, False: 60.5k]
  ------------------
   81|    214|      this->MarkVertexVisited(prev_vert);
   82|    214|      this->traversal_observer().OnNewVertexVisited(
   83|    214|          prev_vert, this->corner_table()->Previous(corner_id));
   84|    214|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|   122k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 61.8k, False: 60.7k]
  ------------------
   88|       |      // Currently processed corner.
   89|  61.8k|      corner_id = corner_traversal_stack_.back();
   90|  61.8k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  61.8k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 61.8k]
  |  Branch (92:47): [True: 31, False: 61.7k]
  ------------------
   93|       |        // This face has been already traversed.
   94|     31|        corner_traversal_stack_.pop_back();
   95|     31|        continue;
   96|     31|      }
   97|   249k|      while (true) {
  ------------------
  |  Branch (97:14): [Folded - Ignored]
  ------------------
   98|   249k|        this->MarkFaceVisited(face_id);
   99|   249k|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|   249k|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|   249k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 249k]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|   249k|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 95.0k, False: 154k]
  ------------------
  105|  95.0k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  95.0k|          this->MarkVertexVisited(vert_id);
  107|  95.0k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  95.0k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 93.6k, False: 1.34k]
  ------------------
  109|  93.6k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  93.6k|            face_id = FaceIndex(corner_id.value() / 3);
  111|  93.6k|            continue;
  112|  93.6k|          }
  113|  95.0k|        }
  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|   155k|        const CornerIndex right_corner_id =
  118|   155k|            this->corner_table()->GetRightCorner(corner_id);
  119|   155k|        const CornerIndex left_corner_id =
  120|   155k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   155k|        const FaceIndex right_face_id(
  122|   155k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 1.12k, False: 154k]
  ------------------
  123|   155k|                 ? kInvalidFaceIndex
  124|   155k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   155k|        const FaceIndex left_face_id(
  126|   155k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 60.9k, False: 94.8k]
  ------------------
  127|   155k|                 ? kInvalidFaceIndex
  128|   155k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   155k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 120k, False: 35.5k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   120k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 61.2k, False: 58.9k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  61.2k|            corner_traversal_stack_.pop_back();
  134|  61.2k|            break;  // Break from the while (true) loop.
  135|  61.2k|          } else {
  136|       |            // Go to the left face.
  137|  58.9k|            corner_id = left_corner_id;
  138|  58.9k|            face_id = left_face_id;
  139|  58.9k|          }
  140|   120k|        } else {
  141|       |          // Right face was not visited.
  142|  35.5k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 35.0k, False: 516]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  35.0k|            corner_id = right_corner_id;
  145|  35.0k|            face_id = right_face_id;
  146|  35.0k|          } 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|    516|            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|    516|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|    516|            break;
  159|    516|          }
  160|  35.5k|        }
  161|   155k|      }
  162|  61.7k|    }
  163|  60.7k|    return true;
  164|  60.7k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|     90|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|    184|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|     55|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.75k|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.75k|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 360, False: 2.39k]
  ------------------
   61|    360|      return true;  // Already traversed.
   62|    360|    }
   63|       |
   64|  2.39k|    corner_traversal_stack_.clear();
   65|  2.39k|    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.39k|    const VertexIndex next_vert =
   69|  2.39k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.39k|    const VertexIndex prev_vert =
   71|  2.39k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.39k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.39k]
  |  Branch (72:45): [True: 0, False: 2.39k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.39k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.33k, False: 57]
  ------------------
   76|  2.33k|      this->MarkVertexVisited(next_vert);
   77|  2.33k|      this->traversal_observer().OnNewVertexVisited(
   78|  2.33k|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.33k|    }
   80|  2.39k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.28k, False: 111]
  ------------------
   81|  2.28k|      this->MarkVertexVisited(prev_vert);
   82|  2.28k|      this->traversal_observer().OnNewVertexVisited(
   83|  2.28k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.28k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  4.85k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.46k, False: 2.39k]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.46k|      corner_id = corner_traversal_stack_.back();
   90|  2.46k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.46k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.46k]
  |  Branch (92:47): [True: 5, False: 2.45k]
  ------------------
   93|       |        // This face has been already traversed.
   94|      5|        corner_traversal_stack_.pop_back();
   95|      5|        continue;
   96|      5|      }
   97|  2.75k|      while (true) {
  ------------------
  |  Branch (97:14): [Folded - Ignored]
  ------------------
   98|  2.75k|        this->MarkFaceVisited(face_id);
   99|  2.75k|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.75k|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.75k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.75k]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.75k|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 2.46k, False: 288]
  ------------------
  105|  2.46k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  2.46k|          this->MarkVertexVisited(vert_id);
  107|  2.46k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  2.46k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 70, False: 2.39k]
  ------------------
  109|     70|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|     70|            face_id = FaceIndex(corner_id.value() / 3);
  111|     70|            continue;
  112|     70|          }
  113|  2.46k|        }
  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.68k|        const CornerIndex right_corner_id =
  118|  2.68k|            this->corner_table()->GetRightCorner(corner_id);
  119|  2.68k|        const CornerIndex left_corner_id =
  120|  2.68k|            this->corner_table()->GetLeftCorner(corner_id);
  121|  2.68k|        const FaceIndex right_face_id(
  122|  2.68k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 2.42k, False: 263]
  ------------------
  123|  2.68k|                 ? kInvalidFaceIndex
  124|  2.68k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  2.68k|        const FaceIndex left_face_id(
  126|  2.68k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.36k, False: 320]
  ------------------
  127|  2.68k|                 ? kInvalidFaceIndex
  128|  2.68k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  2.68k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 2.56k, False: 118]
  ------------------
  130|       |          // Right face has been already visited.
  131|  2.56k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.42k, False: 145]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.42k|            corner_traversal_stack_.pop_back();
  134|  2.42k|            break;  // Break from the while (true) loop.
  135|  2.42k|          } else {
  136|       |            // Go to the left face.
  137|    145|            corner_id = left_corner_id;
  138|    145|            face_id = left_face_id;
  139|    145|          }
  140|  2.56k|        } else {
  141|       |          // Right face was not visited.
  142|    118|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 86, False: 32]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|     86|            corner_id = right_corner_id;
  145|     86|            face_id = right_face_id;
  146|     86|          } 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|     32|            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|     32|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|     32|            break;
  159|     32|          }
  160|    118|        }
  161|  2.68k|      }
  162|  2.45k|    }
  163|  2.39k|    return true;
  164|  2.39k|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|     55|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|    110|  DepthFirstTraverser() {}

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

_ZN5draco36MeshAttributeIndicesEncodingObserverINS_11CornerTableEE18OnNewVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS3_IjNS_21CornerIndex_tag_type_EEE:
   50|   199k|  inline void OnNewVertexVisited(VertexIndex vertex, CornerIndex corner) {
   51|   199k|    const PointIndex point_id =
   52|   199k|        mesh_->face(FaceIndex(corner.value() / 3))[corner.value() % 3];
   53|       |    // Append the visited attribute to the encoding order.
   54|   199k|    sequencer_->AddPointId(point_id);
   55|       |
   56|       |    // Keep track of visited corners.
   57|   199k|    encoding_data_->encoded_attribute_value_index_to_corner_map.push_back(
   58|   199k|        corner);
   59|       |
   60|   199k|    encoding_data_
   61|   199k|        ->vertex_to_encoded_attribute_value_index_map[vertex.value()] =
   62|   199k|        encoding_data_->num_values;
   63|       |
   64|   199k|    encoding_data_->num_values++;
   65|   199k|  }
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_11CornerTableEE16OnNewFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   48|   334k|  void OnNewFaceVisited(FaceIndex /* face */) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_11CornerTableEEC2EPKS1_PKNS_4MeshEPNS_15PointsSequencerEPNS_32MeshAttributeIndicesEncodingDataE:
   44|    108|        sequencer_(sequencer) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_11CornerTableEEC2Ev:
   36|    216|        sequencer_(nullptr) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_24MeshAttributeCornerTableEE18OnNewVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS3_IjNS_21CornerIndex_tag_type_EEE:
   50|  7.09k|  inline void OnNewVertexVisited(VertexIndex vertex, CornerIndex corner) {
   51|  7.09k|    const PointIndex point_id =
   52|  7.09k|        mesh_->face(FaceIndex(corner.value() / 3))[corner.value() % 3];
   53|       |    // Append the visited attribute to the encoding order.
   54|  7.09k|    sequencer_->AddPointId(point_id);
   55|       |
   56|       |    // Keep track of visited corners.
   57|  7.09k|    encoding_data_->encoded_attribute_value_index_to_corner_map.push_back(
   58|  7.09k|        corner);
   59|       |
   60|  7.09k|    encoding_data_
   61|  7.09k|        ->vertex_to_encoded_attribute_value_index_map[vertex.value()] =
   62|  7.09k|        encoding_data_->num_values;
   63|       |
   64|  7.09k|    encoding_data_->num_values++;
   65|  7.09k|  }
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_24MeshAttributeCornerTableEE16OnNewFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   48|  2.75k|  void OnNewFaceVisited(FaceIndex /* face */) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_24MeshAttributeCornerTableEEC2EPKS1_PKNS_4MeshEPNS_15PointsSequencerEPNS_32MeshAttributeIndicesEncodingDataE:
   44|     55|        sequencer_(sequencer) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_24MeshAttributeCornerTableEEC2Ev:
   36|    110|        sequencer_(nullptr) {}

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|     16|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|     30|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|     30|    const auto *corner_table = traverser_.corner_table();
   50|     30|    attribute->SetExplicitMapping(mesh_->num_points());
   51|     30|    const size_t num_faces = mesh_->num_faces();
   52|     30|    const size_t num_points = mesh_->num_points();
   53|  85.8k|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 85.7k, False: 30]
  ------------------
   54|  85.7k|      const auto &face = mesh_->face(f);
   55|   343k|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 257k, False: 85.7k]
  ------------------
   56|   257k|        const PointIndex point_id = face[p];
   57|   257k|        const VertexIndex vert_id =
   58|   257k|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|   257k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 257k]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|   257k|        const AttributeValueIndex att_entry_id(
   63|   257k|            encoding_data_
   64|   257k|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|   257k|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 257k]
  |  Branch (65:13): [True: 0, False: 257k]
  |  Branch (65:39): [True: 0, False: 257k]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|   257k|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|   257k|      }
   71|  85.7k|    }
   72|     30|    return true;
   73|     30|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|     16|  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|     16|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|     16|    traverser_.OnTraversalStart();
   82|     16|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 16]
  ------------------
   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|     16|    } else {
   89|     16|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  84.8k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 84.8k, False: 16]
  ------------------
   91|  84.8k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 84.8k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  84.8k|      }
   95|     16|    }
   96|     16|    traverser_.OnTraversalEnd();
   97|     16|    return true;
   98|     16|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  84.8k|  bool ProcessCorner(CornerIndex corner_id) {
  102|  84.8k|    return traverser_.TraverseFromCorner(corner_id);
  103|  84.8k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|     16|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|     92|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    251|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    251|    const auto *corner_table = traverser_.corner_table();
   50|    251|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    251|    const size_t num_faces = mesh_->num_faces();
   52|    251|    const size_t num_points = mesh_->num_points();
   53|   449k|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 448k, False: 251]
  ------------------
   54|   448k|      const auto &face = mesh_->face(f);
   55|  1.79M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 1.34M, False: 448k]
  ------------------
   56|  1.34M|        const PointIndex point_id = face[p];
   57|  1.34M|        const VertexIndex vert_id =
   58|  1.34M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  1.34M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 1.34M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  1.34M|        const AttributeValueIndex att_entry_id(
   63|  1.34M|            encoding_data_
   64|  1.34M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  1.34M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 1.34M]
  |  Branch (65:13): [True: 0, False: 1.34M]
  |  Branch (65:39): [True: 0, False: 1.34M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  1.34M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  1.34M|      }
   71|   448k|    }
   72|    251|    return true;
   73|    251|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|     90|  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|     90|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|     90|    traverser_.OnTraversalStart();
   82|     90|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 90]
  ------------------
   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|     90|    } else {
   89|     90|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|   249k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 249k, False: 90]
  ------------------
   91|   249k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 249k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|   249k|      }
   95|     90|    }
   96|     90|    traverser_.OnTraversalEnd();
   97|     90|    return true;
   98|     90|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   249k|  bool ProcessCorner(CornerIndex corner_id) {
  102|   249k|    return traverser_.TraverseFromCorner(corner_id);
  103|   249k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|     92|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|     55|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    143|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    143|    const auto *corner_table = traverser_.corner_table();
   50|    143|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    143|    const size_t num_faces = mesh_->num_faces();
   52|    143|    const size_t num_points = mesh_->num_points();
   53|  8.25k|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 8.11k, False: 143]
  ------------------
   54|  8.11k|      const auto &face = mesh_->face(f);
   55|  32.4k|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 24.3k, False: 8.11k]
  ------------------
   56|  24.3k|        const PointIndex point_id = face[p];
   57|  24.3k|        const VertexIndex vert_id =
   58|  24.3k|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  24.3k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 24.3k]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  24.3k|        const AttributeValueIndex att_entry_id(
   63|  24.3k|            encoding_data_
   64|  24.3k|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  24.3k|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 24.3k]
  |  Branch (65:13): [True: 0, False: 24.3k]
  |  Branch (65:39): [True: 0, False: 24.3k]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  24.3k|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  24.3k|      }
   71|  8.11k|    }
   72|    143|    return true;
   73|    143|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|     55|  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|     55|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|     55|    traverser_.OnTraversalStart();
   82|     55|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 55]
  ------------------
   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|     55|    } else {
   89|     55|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.81k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.75k, False: 55]
  ------------------
   91|  2.75k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.75k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.75k|      }
   95|     55|    }
   96|     55|    traverser_.OnTraversalEnd();
   97|     55|    return true;
   98|     55|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.75k|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.75k|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.75k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|     55|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|    110|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  1.85M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|   836k|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|   836k|    return is_vertex_visited_[vert_id.value()];
   65|   836k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|   199k|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|   199k|    is_vertex_visited_[vert_id.value()] = true;
   68|   199k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|   533k|  inline TraversalObserverT &traversal_observer() {
   75|   533k|    return traversal_observer_;
   76|   533k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|   726k|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|   726k|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 64.1k, False: 661k]
  ------------------
   47|  64.1k|      return true;  // Invalid faces are always considered as visited.
   48|  64.1k|    }
   49|   661k|    return is_face_visited_[face_id.value()];
   50|   726k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|   334k|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|   334k|    is_face_visited_[face_id.value()] = true;
   62|   334k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|    216|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|    216|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    108|                    TraversalObserver traversal_observer) {
   37|    108|    corner_table_ = corner_table;
   38|    108|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    108|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    108|    traversal_observer_ = traversal_observer;
   41|    108|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|   249k|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|   249k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 249k]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|   249k|    return is_face_visited_[corner_id.value() / 3];
   58|   249k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  25.1k|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.75k|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.75k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.75k]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.75k|    return is_face_visited_[corner_id.value() / 3];
   58|  2.75k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  7.54k|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  7.54k|    return is_vertex_visited_[vert_id.value()];
   65|  7.54k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  7.09k|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  7.09k|    is_vertex_visited_[vert_id.value()] = true;
   68|  7.09k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  9.84k|  inline TraversalObserverT &traversal_observer() {
   75|  9.84k|    return traversal_observer_;
   76|  9.84k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  7.83k|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  7.83k|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 4.78k, False: 3.04k]
  ------------------
   47|  4.78k|      return true;  // Invalid faces are always considered as visited.
   48|  4.78k|    }
   49|  3.04k|    return is_face_visited_[face_id.value()];
   50|  7.83k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.75k|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.75k|    is_face_visited_[face_id.value()] = true;
   62|  2.75k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|    110|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|     55|                    TraversalObserver traversal_observer) {
   37|     55|    corner_table_ = corner_table;
   38|     55|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|     55|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|     55|    traversal_observer_ = traversal_observer;
   41|     55|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_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: 4, False: 10]
  ------------------
  190|      4|    return false;
  191|      4|  }
  192|     10|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 10]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     10|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 3, False: 7]
  ------------------
  196|      3|    return true;
  197|      3|  }
  198|      7|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 7]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      7|  num_decoded_points_ = 0;
  202|       |
  203|      7|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 7]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      7|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 6]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|      6|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 4]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|      4|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 4]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      4|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 4, False: 0]
  ------------------
  217|      4|    return false;
  218|      4|  }
  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|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|      4|    uint32_t num_points, OutputIteratorT &oit) {
  254|      4|  typedef DecodingStatus Status;
  255|      4|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      4|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      4|  DecodingStatus init_status(num_points, 0, 0);
  258|      4|  std::stack<Status> status_stack;
  259|      4|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.32k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.32k, False: 0]
  ------------------
  263|  3.32k|    const DecodingStatus status = status_stack.top();
  264|  3.32k|    status_stack.pop();
  265|       |
  266|  3.32k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.32k|    const uint32_t last_axis = status.last_axis;
  268|  3.32k|    const uint32_t stack_pos = status.stack_pos;
  269|  3.32k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.32k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.32k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.32k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.32k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.32k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.32k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.32k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.32k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 11, False: 3.31k]
  ------------------
  285|     32|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 21, False: 11]
  ------------------
  286|     21|        *oit = old_base;
  287|     21|        ++oit;
  288|     21|        ++num_decoded_points_;
  289|     21|      }
  290|     11|      continue;
  291|     11|    }
  292|       |
  293|  3.31k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  3.31k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.52k, False: 1.79k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.52k|      axes_[0] = axis;
  300|  4.57k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 3.05k, False: 1.52k]
  ------------------
  301|  3.05k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  3.05k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 958, False: 2.09k]
  |  |  ------------------
  ------------------
  302|  3.05k|      }
  303|  4.06k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.54k, False: 1.52k]
  ------------------
  304|  10.1k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 7.62k, False: 2.54k]
  ------------------
  305|  7.62k|          p_[axes_[j]] = 0;
  306|  7.62k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  7.62k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 7.35k, False: 277]
  ------------------
  308|  7.35k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 2, False: 7.34k]
  ------------------
  309|  7.35k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      2|              return false;
  311|      2|            }
  312|  7.35k|          }
  313|  7.62k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  7.62k|        }
  315|  2.54k|        *oit = p_;
  316|  2.54k|        ++oit;
  317|  2.54k|        ++num_decoded_points_;
  318|  2.54k|      }
  319|  1.52k|      continue;
  320|  1.52k|    }
  321|       |
  322|  1.79k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.79k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.79k|    const int num_remaining_bits = bit_length_ - level;
  327|  1.79k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.79k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.79k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.79k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.79k|    uint32_t number = 0;
  334|  1.79k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.79k|    uint32_t first_half = num_remaining_points / 2;
  337|  1.79k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 2, False: 1.78k]
  ------------------
  338|       |      // Invalid |number|.
  339|      2|      return false;
  340|      2|    }
  341|  1.78k|    first_half -= number;
  342|  1.78k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.78k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.33k, False: 449]
  ------------------
  345|  1.33k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 812, False: 527]
  ------------------
  346|    812|        std::swap(first_half, second_half);
  347|    812|      }
  348|  1.33k|    }
  349|       |
  350|  1.78k|    levels_stack_[stack_pos][axis] += 1;
  351|  1.78k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.78k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.71k, False: 73]
  ------------------
  353|  1.71k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.71k|    }
  355|  1.78k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.70k, False: 86]
  ------------------
  356|  1.70k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.70k|    }
  358|  1.78k|  }
  359|      0|  return true;
  360|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  136|  3.61k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  1.89k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.89k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.89k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|      2|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   95|     21|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|      4|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      4|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 4]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      4|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 4]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      4|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 4]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      4|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 4]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      4|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 4]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      4|  num_decoded_points_ = 0;
  202|       |
  203|      4|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 4]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      4|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 3]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|      3|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 3]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      3|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 2]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|      2|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 1, False: 1]
  ------------------
  217|      1|    return false;
  218|      1|  }
  219|       |
  220|      1|  numbers_decoder_.EndDecoding();
  221|      1|  remaining_bits_decoder_.EndDecoding();
  222|      1|  axis_decoder_.EndDecoding();
  223|      1|  half_decoder_.EndDecoding();
  224|       |
  225|      1|  return true;
  226|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|      2|    uint32_t num_points, OutputIteratorT &oit) {
  254|      2|  typedef DecodingStatus Status;
  255|      2|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      2|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      2|  DecodingStatus init_status(num_points, 0, 0);
  258|      2|  std::stack<Status> status_stack;
  259|      2|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   262k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 262k, False: 1]
  ------------------
  263|   262k|    const DecodingStatus status = status_stack.top();
  264|   262k|    status_stack.pop();
  265|       |
  266|   262k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   262k|    const uint32_t last_axis = status.last_axis;
  268|   262k|    const uint32_t stack_pos = status.stack_pos;
  269|   262k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   262k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   262k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 262k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   262k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   262k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 262k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   262k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   262k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 131k, False: 131k]
  ------------------
  285|   335M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 335M, False: 131k]
  ------------------
  286|   335M|        *oit = old_base;
  287|   335M|        ++oit;
  288|   335M|        ++num_decoded_points_;
  289|   335M|      }
  290|   131k|      continue;
  291|   131k|    }
  292|       |
  293|   131k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   131k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 100, False: 131k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    100|      axes_[0] = axis;
  300|    500|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 400, False: 100]
  ------------------
  301|    400|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    400|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 70, False: 330]
  |  |  ------------------
  ------------------
  302|    400|      }
  303|    259|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 159, False: 100]
  ------------------
  304|    954|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 795, False: 159]
  ------------------
  305|    795|          p_[axes_[j]] = 0;
  306|    795|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|    795|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 795, False: 0]
  ------------------
  308|    795|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 795]
  ------------------
  309|    795|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|    795|          }
  313|    795|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|    795|        }
  315|    159|        *oit = p_;
  316|    159|        ++oit;
  317|    159|        ++num_decoded_points_;
  318|    159|      }
  319|    100|      continue;
  320|    100|    }
  321|       |
  322|   131k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 131k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   131k|    const int num_remaining_bits = bit_length_ - level;
  327|   131k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   131k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   131k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   131k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   131k|    uint32_t number = 0;
  334|   131k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   131k|    uint32_t first_half = num_remaining_points / 2;
  337|   131k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 131k]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|   131k|    first_half -= number;
  342|   131k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   131k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 62.5k, False: 68.6k]
  ------------------
  345|  62.5k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 59.2k, False: 3.25k]
  ------------------
  346|  59.2k|        std::swap(first_half, second_half);
  347|  59.2k|      }
  348|  62.5k|    }
  349|       |
  350|   131k|    levels_stack_[stack_pos][axis] += 1;
  351|   131k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   131k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 131k, False: 0]
  ------------------
  353|   131k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   131k|    }
  355|   131k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 131k, False: 8]
  ------------------
  356|   131k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   131k|    }
  358|   131k|  }
  359|      1|  return true;
  360|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  136|   262k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   262k|    uint32_t last_axis) {
  232|   262k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  233|   262k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|   262k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 262k, False: 174]
  |  |  ------------------
  ------------------
  234|   262k|  }
  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|   262k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|   131k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   131k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   131k|  }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|      4|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      4|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 4]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      4|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 4]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      4|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 4]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      4|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 4]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      4|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 2]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|      2|  num_decoded_points_ = 0;
  202|       |
  203|      2|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 2]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      2|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 2]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      2|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 1]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|      1|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 1]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      1|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 1, False: 0]
  ------------------
  217|      1|    return false;
  218|      1|  }
  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|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|      1|    uint32_t num_points, OutputIteratorT &oit) {
  254|      1|  typedef DecodingStatus Status;
  255|      1|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      1|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      1|  DecodingStatus init_status(num_points, 0, 0);
  258|      1|  std::stack<Status> status_stack;
  259|      1|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|    812|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 812, False: 0]
  ------------------
  263|    812|    const DecodingStatus status = status_stack.top();
  264|    812|    status_stack.pop();
  265|       |
  266|    812|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|    812|    const uint32_t last_axis = status.last_axis;
  268|    812|    const uint32_t stack_pos = status.stack_pos;
  269|    812|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|    812|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|    812|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 812]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|    812|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|    812|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 812]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|    812|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|    812|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1, False: 811]
  ------------------
  285|      8|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 7, False: 1]
  ------------------
  286|      7|        *oit = old_base;
  287|      7|        ++oit;
  288|      7|        ++num_decoded_points_;
  289|      7|      }
  290|      1|      continue;
  291|      1|    }
  292|       |
  293|    811|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|    811|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 0, False: 811]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|      0|      axes_[0] = axis;
  300|      0|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 0, False: 0]
  ------------------
  301|      0|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|      0|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  302|      0|      }
  303|      0|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 0, False: 0]
  ------------------
  304|      0|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 0, False: 0]
  ------------------
  305|      0|          p_[axes_[j]] = 0;
  306|      0|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|      0|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 0, False: 0]
  ------------------
  308|      0|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 0]
  ------------------
  309|      0|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|      0|          }
  313|      0|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|      0|        }
  315|      0|        *oit = p_;
  316|      0|        ++oit;
  317|      0|        ++num_decoded_points_;
  318|      0|      }
  319|      0|      continue;
  320|      0|    }
  321|       |
  322|    811|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 811]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|    811|    const int num_remaining_bits = bit_length_ - level;
  327|    811|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|    811|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|    811|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|    811|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|    811|    uint32_t number = 0;
  334|    811|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|    811|    uint32_t first_half = num_remaining_points / 2;
  337|    811|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 810]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|    810|    first_half -= number;
  342|    810|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|    810|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 807, False: 3]
  ------------------
  345|    807|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 287, False: 520]
  ------------------
  346|    287|        std::swap(first_half, second_half);
  347|    287|      }
  348|    807|    }
  349|       |
  350|    810|    levels_stack_[stack_pos][axis] += 1;
  351|    810|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|    810|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 290, False: 520]
  ------------------
  353|    290|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|    290|    }
  355|    810|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 529, False: 281]
  ------------------
  356|    529|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|    529|    }
  358|    810|  }
  359|      0|  return true;
  360|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  136|  4.27k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  2.54k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.54k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.54k|  }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   95|     10|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     12|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     12|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 12]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     12|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 12]
  ------------------
  190|      0|    return false;
  191|      0|  }
  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: 6, False: 5]
  ------------------
  199|      6|    return false;
  200|      6|  }
  201|      5|  num_decoded_points_ = 0;
  202|       |
  203|      5|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 2]
  ------------------
  204|      3|    return false;
  205|      3|  }
  206|      2|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 1]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|      1|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 1]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      1|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 1]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      1|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 1, False: 0]
  ------------------
  217|      1|    return false;
  218|      1|  }
  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|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|      1|    uint32_t num_points, OutputIteratorT &oit) {
  254|      1|  typedef DecodingStatus Status;
  255|      1|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      1|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      1|  DecodingStatus init_status(num_points, 0, 0);
  258|      1|  std::stack<Status> status_stack;
  259|      1|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|    314|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 314, False: 0]
  ------------------
  263|    314|    const DecodingStatus status = status_stack.top();
  264|    314|    status_stack.pop();
  265|       |
  266|    314|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|    314|    const uint32_t last_axis = status.last_axis;
  268|    314|    const uint32_t stack_pos = status.stack_pos;
  269|    314|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|    314|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|    314|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 314]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|    314|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|    314|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 314]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|    314|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|    314|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 152, False: 162]
  ------------------
  285|    511|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 359, False: 152]
  ------------------
  286|    359|        *oit = old_base;
  287|    359|        ++oit;
  288|    359|        ++num_decoded_points_;
  289|    359|      }
  290|    152|      continue;
  291|    152|    }
  292|       |
  293|    162|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|    162|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1, False: 161]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|      1|      axes_[0] = axis;
  300|      1|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 0, False: 1]
  ------------------
  301|      0|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|      0|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  302|      0|      }
  303|      2|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1, False: 1]
  ------------------
  304|      2|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 1, False: 1]
  ------------------
  305|      1|          p_[axes_[j]] = 0;
  306|      1|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|      1|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1, False: 0]
  ------------------
  308|      1|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 1]
  ------------------
  309|      1|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|      1|          }
  313|      1|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|      1|        }
  315|      1|        *oit = p_;
  316|      1|        ++oit;
  317|      1|        ++num_decoded_points_;
  318|      1|      }
  319|      1|      continue;
  320|      1|    }
  321|       |
  322|    161|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 161]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|    161|    const int num_remaining_bits = bit_length_ - level;
  327|    161|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|    161|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|    161|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|    161|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|    161|    uint32_t number = 0;
  334|    161|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|    161|    uint32_t first_half = num_remaining_points / 2;
  337|    161|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 160]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|    160|    first_half -= number;
  342|    160|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|    160|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 100, False: 60]
  ------------------
  345|    100|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 87, False: 13]
  ------------------
  346|     87|        std::swap(first_half, second_half);
  347|     87|      }
  348|    100|    }
  349|       |
  350|    160|    levels_stack_[stack_pos][axis] += 1;
  351|    160|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|    160|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 160, False: 0]
  ------------------
  353|    160|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|    160|    }
  355|    160|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 160, False: 0]
  ------------------
  356|    160|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|    160|    }
  358|    160|  }
  359|      0|  return true;
  360|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  136|  10.8k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  10.7k|    uint32_t last_axis) {
  232|  10.7k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  233|  10.7k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  10.7k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.32k, False: 7.42k]
  |  |  ------------------
  ------------------
  234|  10.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|  10.7k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  5.40k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  5.40k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  5.40k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|      1|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     23|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     23|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 23]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     23|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 23]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     23|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 23]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     23|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 22]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     22|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 22]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     22|  num_decoded_points_ = 0;
  202|       |
  203|     22|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 21]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|     21|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 21]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     21|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 21]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     21|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 21]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     21|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 21, False: 0]
  ------------------
  217|     21|    return false;
  218|     21|  }
  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|     21|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     21|    uint32_t num_points, OutputIteratorT &oit) {
  254|     21|  typedef DecodingStatus Status;
  255|     21|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     21|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     21|  DecodingStatus init_status(num_points, 0, 0);
  258|     21|  std::stack<Status> status_stack;
  259|     21|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   118k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 118k, False: 0]
  ------------------
  263|   118k|    const DecodingStatus status = status_stack.top();
  264|   118k|    status_stack.pop();
  265|       |
  266|   118k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   118k|    const uint32_t last_axis = status.last_axis;
  268|   118k|    const uint32_t stack_pos = status.stack_pos;
  269|   118k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   118k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   118k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 118k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   118k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   118k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 118k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   118k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   118k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 3.71k, False: 114k]
  ------------------
  285|   451k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 448k, False: 3.71k]
  ------------------
  286|   448k|        *oit = old_base;
  287|   448k|        ++oit;
  288|   448k|        ++num_decoded_points_;
  289|   448k|      }
  290|  3.71k|      continue;
  291|  3.71k|    }
  292|       |
  293|   114k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   114k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 5.88k, False: 108k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  5.88k|      axes_[0] = axis;
  300|  14.7k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 8.84k, False: 5.88k]
  ------------------
  301|  8.84k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  8.84k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.71k, False: 6.12k]
  |  |  ------------------
  ------------------
  302|  8.84k|      }
  303|  13.6k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 7.80k, False: 5.86k]
  ------------------
  304|  25.9k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 18.1k, False: 7.78k]
  ------------------
  305|  18.1k|          p_[axes_[j]] = 0;
  306|  18.1k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  18.1k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 16.7k, False: 1.46k]
  ------------------
  308|  16.7k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 18, False: 16.7k]
  ------------------
  309|  16.7k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     18|              return false;
  311|     18|            }
  312|  16.7k|          }
  313|  18.1k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  18.1k|        }
  315|  7.78k|        *oit = p_;
  316|  7.78k|        ++oit;
  317|  7.78k|        ++num_decoded_points_;
  318|  7.78k|      }
  319|  5.86k|      continue;
  320|  5.88k|    }
  321|       |
  322|   108k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 108k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   108k|    const int num_remaining_bits = bit_length_ - level;
  327|   108k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   108k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   108k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   108k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   108k|    uint32_t number = 0;
  334|   108k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   108k|    uint32_t first_half = num_remaining_points / 2;
  337|   108k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 3, False: 108k]
  ------------------
  338|       |      // Invalid |number|.
  339|      3|      return false;
  340|      3|    }
  341|   108k|    first_half -= number;
  342|   108k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   108k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 108k, False: 0]
  ------------------
  345|   108k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 83.6k, False: 24.9k]
  ------------------
  346|  83.6k|        std::swap(first_half, second_half);
  347|  83.6k|      }
  348|   108k|    }
  349|       |
  350|   108k|    levels_stack_[stack_pos][axis] += 1;
  351|   108k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   108k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 87.0k, False: 21.5k]
  ------------------
  353|  87.0k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  87.0k|    }
  355|   108k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 31.2k, False: 77.2k]
  ------------------
  356|  31.2k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  31.2k|    }
  358|   108k|  }
  359|      0|  return true;
  360|     21|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  136|   118k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|   108k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   108k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   108k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|      1|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   95|     24|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     20|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     20|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 20]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     20|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 20]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     20|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 20]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     20|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 20]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     20|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 20]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     20|  num_decoded_points_ = 0;
  202|       |
  203|     20|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 19]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|     19|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 19]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     19|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 19]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     19|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 19]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     19|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 4, False: 15]
  ------------------
  217|      4|    return false;
  218|      4|  }
  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|     19|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     19|    uint32_t num_points, OutputIteratorT &oit) {
  254|     19|  typedef DecodingStatus Status;
  255|     19|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     19|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     19|  DecodingStatus init_status(num_points, 0, 0);
  258|     19|  std::stack<Status> status_stack;
  259|     19|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   542k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 542k, False: 15]
  ------------------
  263|   542k|    const DecodingStatus status = status_stack.top();
  264|   542k|    status_stack.pop();
  265|       |
  266|   542k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   542k|    const uint32_t last_axis = status.last_axis;
  268|   542k|    const uint32_t stack_pos = status.stack_pos;
  269|   542k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   542k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   542k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 542k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   542k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   542k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 542k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   542k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   542k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 250k, False: 291k]
  ------------------
  285|  11.3M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 11.0M, False: 250k]
  ------------------
  286|  11.0M|        *oit = old_base;
  287|  11.0M|        ++oit;
  288|  11.0M|        ++num_decoded_points_;
  289|  11.0M|      }
  290|   250k|      continue;
  291|   250k|    }
  292|       |
  293|   291k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   291k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 10.5k, False: 280k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  10.5k|      axes_[0] = axis;
  300|  21.7k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 11.2k, False: 10.5k]
  ------------------
  301|  11.2k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  11.2k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.85k, False: 9.34k]
  |  |  ------------------
  ------------------
  302|  11.2k|      }
  303|  27.2k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 16.6k, False: 10.5k]
  ------------------
  304|  47.4k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 30.8k, False: 16.6k]
  ------------------
  305|  30.8k|          p_[axes_[j]] = 0;
  306|  30.8k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  30.8k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 28.9k, False: 1.83k]
  ------------------
  308|  28.9k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 4, False: 28.9k]
  ------------------
  309|  28.9k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      4|              return false;
  311|      4|            }
  312|  28.9k|          }
  313|  30.8k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  30.8k|        }
  315|  16.6k|        *oit = p_;
  316|  16.6k|        ++oit;
  317|  16.6k|        ++num_decoded_points_;
  318|  16.6k|      }
  319|  10.5k|      continue;
  320|  10.5k|    }
  321|       |
  322|   280k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 280k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   280k|    const int num_remaining_bits = bit_length_ - level;
  327|   280k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   280k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   280k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   280k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   280k|    uint32_t number = 0;
  334|   280k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   280k|    uint32_t first_half = num_remaining_points / 2;
  337|   280k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 0, False: 280k]
  ------------------
  338|       |      // Invalid |number|.
  339|      0|      return false;
  340|      0|    }
  341|   280k|    first_half -= number;
  342|   280k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   280k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 272k, False: 8.16k]
  ------------------
  345|   272k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 261k, False: 11.1k]
  ------------------
  346|   261k|        std::swap(first_half, second_half);
  347|   261k|      }
  348|   272k|    }
  349|       |
  350|   280k|    levels_stack_[stack_pos][axis] += 1;
  351|   280k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   280k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 274k, False: 6.92k]
  ------------------
  353|   274k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   274k|    }
  355|   280k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 268k, False: 12.4k]
  ------------------
  356|   268k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   268k|    }
  358|   280k|  }
  359|     15|  return true;
  360|     19|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  136|   542k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   542k|    uint32_t last_axis) {
  232|   542k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  233|   542k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|   542k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 514k, False: 27.9k]
  |  |  ------------------
  ------------------
  234|   542k|  }
  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|   542k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|   280k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   280k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   280k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     15|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     55|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     55|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 55]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     55|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 55]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     55|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 55]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     55|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 55]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     55|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 55]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     55|  num_decoded_points_ = 0;
  202|       |
  203|     55|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 11, False: 44]
  ------------------
  204|     11|    return false;
  205|     11|  }
  206|     44|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 44]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     44|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 44]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     44|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 43]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     43|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 38, False: 5]
  ------------------
  217|     38|    return false;
  218|     38|  }
  219|       |
  220|      5|  numbers_decoder_.EndDecoding();
  221|      5|  remaining_bits_decoder_.EndDecoding();
  222|      5|  axis_decoder_.EndDecoding();
  223|      5|  half_decoder_.EndDecoding();
  224|       |
  225|      5|  return true;
  226|     43|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     43|    uint32_t num_points, OutputIteratorT &oit) {
  254|     43|  typedef DecodingStatus Status;
  255|     43|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     43|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     43|  DecodingStatus init_status(num_points, 0, 0);
  258|     43|  std::stack<Status> status_stack;
  259|     43|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   111k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 111k, False: 5]
  ------------------
  263|   111k|    const DecodingStatus status = status_stack.top();
  264|   111k|    status_stack.pop();
  265|       |
  266|   111k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   111k|    const uint32_t last_axis = status.last_axis;
  268|   111k|    const uint32_t stack_pos = status.stack_pos;
  269|   111k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   111k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   111k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 111k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   111k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   111k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 111k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   111k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   111k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 224, False: 110k]
  ------------------
  285|  20.5k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 20.2k, False: 224]
  ------------------
  286|  20.2k|        *oit = old_base;
  287|  20.2k|        ++oit;
  288|  20.2k|        ++num_decoded_points_;
  289|  20.2k|      }
  290|    224|      continue;
  291|    224|    }
  292|       |
  293|   110k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   110k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 202, False: 110k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    202|      axes_[0] = axis;
  300|  11.8k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 11.6k, False: 202]
  ------------------
  301|  11.6k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  11.6k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 193, False: 11.4k]
  |  |  ------------------
  ------------------
  302|  11.6k|      }
  303|    435|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 250, False: 185]
  ------------------
  304|  14.2k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 14.0k, False: 233]
  ------------------
  305|  14.0k|          p_[axes_[j]] = 0;
  306|  14.0k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  14.0k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 14.0k, False: 9]
  ------------------
  308|  14.0k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 17, False: 14.0k]
  ------------------
  309|  14.0k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     17|              return false;
  311|     17|            }
  312|  14.0k|          }
  313|  14.0k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  14.0k|        }
  315|    233|        *oit = p_;
  316|    233|        ++oit;
  317|    233|        ++num_decoded_points_;
  318|    233|      }
  319|    185|      continue;
  320|    202|    }
  321|       |
  322|   110k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 110k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   110k|    const int num_remaining_bits = bit_length_ - level;
  327|   110k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   110k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   110k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   110k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   110k|    uint32_t number = 0;
  334|   110k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   110k|    uint32_t first_half = num_remaining_points / 2;
  337|   110k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 21, False: 110k]
  ------------------
  338|       |      // Invalid |number|.
  339|     21|      return false;
  340|     21|    }
  341|   110k|    first_half -= number;
  342|   110k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   110k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 110k, False: 7]
  ------------------
  345|   110k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 70.9k, False: 39.6k]
  ------------------
  346|  70.9k|        std::swap(first_half, second_half);
  347|  70.9k|      }
  348|   110k|    }
  349|       |
  350|   110k|    levels_stack_[stack_pos][axis] += 1;
  351|   110k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   110k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 71.1k, False: 39.4k]
  ------------------
  353|  71.1k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  71.1k|    }
  355|   110k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 39.9k, False: 70.6k]
  ------------------
  356|  39.9k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  39.9k|    }
  358|   110k|  }
  359|      5|  return true;
  360|     43|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  136|   111k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   110k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   110k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   110k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|      5|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   95|     63|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     10|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     10|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     10|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   95|      6|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   95|     31|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      3|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      3|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      3|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   95|     20|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  3.51k|    uint32_t last_axis) {
  232|  3.51k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  233|  3.51k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.51k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.24k, False: 2.27k]
  |  |  ------------------
  ------------------
  234|  3.51k|  }
  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.51k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.25k|    uint32_t last_axis) {
  232|  4.25k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  233|  4.25k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.25k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.00k, False: 3.25k]
  |  |  ------------------
  ------------------
  234|  4.25k|  }
  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.25k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   118k|    uint32_t last_axis) {
  232|   118k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  233|   118k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|   118k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 10.0k, False: 108k]
  |  |  ------------------
  ------------------
  234|   118k|  }
  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|   118k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   111k|    uint32_t last_axis) {
  232|   111k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  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|   111k|  uint32_t best_axis = 0;
  237|   111k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 110k, False: 233]
  ------------------
  238|  7.10M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 6.99M, False: 110k]
  ------------------
  239|  6.99M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 117k, False: 6.87M]
  ------------------
  240|   117k|        best_axis = axis;
  241|   117k|      }
  242|  6.99M|    }
  243|   110k|  } else {
  244|    233|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|    233|  }
  246|       |
  247|   111k|  return best_axis;
  248|   111k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      7|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      7|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      7|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      7|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      7|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 7]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      7|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 7]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      7|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 7]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      7|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 5]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|      5|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 5]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      5|  num_decoded_points_ = 0;
  202|       |
  203|      5|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 2]
  ------------------
  204|      3|    return false;
  205|      3|  }
  206|      2|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 1]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|      1|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 1]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      1|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 1]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      1|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 1, False: 0]
  ------------------
  217|      1|    return false;
  218|      1|  }
  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|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|      1|    uint32_t num_points, OutputIteratorT &oit) {
  254|      1|  typedef DecodingStatus Status;
  255|      1|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      1|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      1|  DecodingStatus init_status(num_points, 0, 0);
  258|      1|  std::stack<Status> status_stack;
  259|      1|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|    189|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 189, False: 0]
  ------------------
  263|    189|    const DecodingStatus status = status_stack.top();
  264|    189|    status_stack.pop();
  265|       |
  266|    189|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|    189|    const uint32_t last_axis = status.last_axis;
  268|    189|    const uint32_t stack_pos = status.stack_pos;
  269|    189|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|    189|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|    189|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 189]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|    189|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|    189|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 189]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|    189|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|    189|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 6, False: 183]
  ------------------
  285|     15|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 9, False: 6]
  ------------------
  286|      9|        *oit = old_base;
  287|      9|        ++oit;
  288|      9|        ++num_decoded_points_;
  289|      9|      }
  290|      6|      continue;
  291|      6|    }
  292|       |
  293|    183|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|    183|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 77, False: 106]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     77|      axes_[0] = axis;
  300|    231|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 154, False: 77]
  ------------------
  301|    154|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    154|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 28, False: 126]
  |  |  ------------------
  ------------------
  302|    154|      }
  303|    205|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 129, False: 76]
  ------------------
  304|    514|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 386, False: 128]
  ------------------
  305|    386|          p_[axes_[j]] = 0;
  306|    386|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|    386|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 211, False: 175]
  ------------------
  308|    211|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 1, False: 210]
  ------------------
  309|    211|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      1|              return false;
  311|      1|            }
  312|    211|          }
  313|    385|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|    385|        }
  315|    128|        *oit = p_;
  316|    128|        ++oit;
  317|    128|        ++num_decoded_points_;
  318|    128|      }
  319|     76|      continue;
  320|     77|    }
  321|       |
  322|    106|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 106]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|    106|    const int num_remaining_bits = bit_length_ - level;
  327|    106|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|    106|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|    106|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|    106|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|    106|    uint32_t number = 0;
  334|    106|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|    106|    uint32_t first_half = num_remaining_points / 2;
  337|    106|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 0, False: 106]
  ------------------
  338|       |      // Invalid |number|.
  339|      0|      return false;
  340|      0|    }
  341|    106|    first_half -= number;
  342|    106|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|    106|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 78, False: 28]
  ------------------
  345|     78|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 49, False: 29]
  ------------------
  346|     49|        std::swap(first_half, second_half);
  347|     49|      }
  348|     78|    }
  349|       |
  350|    106|    levels_stack_[stack_pos][axis] += 1;
  351|    106|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|    106|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 103, False: 3]
  ------------------
  353|    103|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|    103|    }
  355|    106|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 94, False: 12]
  ------------------
  356|     94|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|     94|    }
  358|    106|  }
  359|      0|  return true;
  360|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      2|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      2|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      2|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      2|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 2]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      2|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 2]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      2|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 2]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      2|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 2]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      2|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 2]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      2|  num_decoded_points_ = 0;
  202|       |
  203|      2|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 1]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|      1|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 1]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      1|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 0]
  ------------------
  210|      1|    return false;
  211|      1|  }
  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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      6|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      6|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      6|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      6|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      6|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 6]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      6|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 6]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      6|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 6]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      6|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 6]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      6|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 6]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      6|  num_decoded_points_ = 0;
  202|       |
  203|      6|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 5]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|      5|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 2]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|      2|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 1]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|      1|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 1]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      1|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 1, False: 0]
  ------------------
  217|      1|    return false;
  218|      1|  }
  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|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|      1|    uint32_t num_points, OutputIteratorT &oit) {
  254|      1|  typedef DecodingStatus Status;
  255|      1|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      1|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      1|  DecodingStatus init_status(num_points, 0, 0);
  258|      1|  std::stack<Status> status_stack;
  259|      1|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.43k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.43k, False: 0]
  ------------------
  263|  3.43k|    const DecodingStatus status = status_stack.top();
  264|  3.43k|    status_stack.pop();
  265|       |
  266|  3.43k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.43k|    const uint32_t last_axis = status.last_axis;
  268|  3.43k|    const uint32_t stack_pos = status.stack_pos;
  269|  3.43k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.43k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.43k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.43k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.43k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.43k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.43k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.43k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.43k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.69k, False: 1.74k]
  ------------------
  285|  4.48k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 2.79k, False: 1.69k]
  ------------------
  286|  2.79k|        *oit = old_base;
  287|  2.79k|        ++oit;
  288|  2.79k|        ++num_decoded_points_;
  289|  2.79k|      }
  290|  1.69k|      continue;
  291|  1.69k|    }
  292|       |
  293|  1.74k|    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.74k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 14, False: 1.73k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     14|      axes_[0] = axis;
  300|     42|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 28, False: 14]
  ------------------
  301|     28|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|     28|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3, False: 25]
  |  |  ------------------
  ------------------
  302|     28|      }
  303|     39|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 25, False: 14]
  ------------------
  304|    100|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 75, False: 25]
  ------------------
  305|     75|          p_[axes_[j]] = 0;
  306|     75|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|     75|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 31, False: 44]
  ------------------
  308|     31|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 31]
  ------------------
  309|     31|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|     31|          }
  313|     75|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|     75|        }
  315|     25|        *oit = p_;
  316|     25|        ++oit;
  317|     25|        ++num_decoded_points_;
  318|     25|      }
  319|     14|      continue;
  320|     14|    }
  321|       |
  322|  1.73k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.73k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.73k|    const int num_remaining_bits = bit_length_ - level;
  327|  1.73k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.73k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.73k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.73k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.73k|    uint32_t number = 0;
  334|  1.73k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.73k|    uint32_t first_half = num_remaining_points / 2;
  337|  1.73k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 1.73k]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|  1.73k|    first_half -= number;
  342|  1.73k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.73k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.10k, False: 627]
  ------------------
  345|  1.10k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 977, False: 129]
  ------------------
  346|    977|        std::swap(first_half, second_half);
  347|    977|      }
  348|  1.10k|    }
  349|       |
  350|  1.73k|    levels_stack_[stack_pos][axis] += 1;
  351|  1.73k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.73k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.73k, False: 0]
  ------------------
  353|  1.73k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.73k|    }
  355|  1.73k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.72k, False: 9]
  ------------------
  356|  1.72k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.72k|    }
  358|  1.73k|  }
  359|      0|  return true;
  360|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     19|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     19|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     19|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     19|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     19|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 19]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     19|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 19]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     19|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 19]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     19|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 18]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     18|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 18]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     18|  num_decoded_points_ = 0;
  202|       |
  203|     18|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 14]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|     14|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 6, False: 8]
  ------------------
  207|      6|    return false;
  208|      6|  }
  209|      8|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 6, False: 2]
  ------------------
  210|      6|    return false;
  211|      6|  }
  212|      2|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 2]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      2|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 2, False: 0]
  ------------------
  217|      2|    return false;
  218|      2|  }
  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|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|      2|    uint32_t num_points, OutputIteratorT &oit) {
  254|      2|  typedef DecodingStatus Status;
  255|      2|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      2|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      2|  DecodingStatus init_status(num_points, 0, 0);
  258|      2|  std::stack<Status> status_stack;
  259|      2|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  10.4k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 10.4k, False: 0]
  ------------------
  263|  10.4k|    const DecodingStatus status = status_stack.top();
  264|  10.4k|    status_stack.pop();
  265|       |
  266|  10.4k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  10.4k|    const uint32_t last_axis = status.last_axis;
  268|  10.4k|    const uint32_t stack_pos = status.stack_pos;
  269|  10.4k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  10.4k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  10.4k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 10.4k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  10.4k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  10.4k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 10.4k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  10.4k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  10.4k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 5.12k, False: 5.31k]
  ------------------
  285|  13.1k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 7.99k, False: 5.12k]
  ------------------
  286|  7.99k|        *oit = old_base;
  287|  7.99k|        ++oit;
  288|  7.99k|        ++num_decoded_points_;
  289|  7.99k|      }
  290|  5.12k|      continue;
  291|  5.12k|    }
  292|       |
  293|  5.31k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  5.31k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 65, False: 5.24k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     65|      axes_[0] = axis;
  300|    195|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 130, False: 65]
  ------------------
  301|    130|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    130|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 15, False: 115]
  |  |  ------------------
  ------------------
  302|    130|      }
  303|    188|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 123, False: 65]
  ------------------
  304|    492|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 369, False: 123]
  ------------------
  305|    369|          p_[axes_[j]] = 0;
  306|    369|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|    369|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 153, False: 216]
  ------------------
  308|    153|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 153]
  ------------------
  309|    153|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|    153|          }
  313|    369|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|    369|        }
  315|    123|        *oit = p_;
  316|    123|        ++oit;
  317|    123|        ++num_decoded_points_;
  318|    123|      }
  319|     65|      continue;
  320|     65|    }
  321|       |
  322|  5.24k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 5.24k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  5.24k|    const int num_remaining_bits = bit_length_ - level;
  327|  5.24k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  5.24k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  5.24k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  5.24k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  5.24k|    uint32_t number = 0;
  334|  5.24k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  5.24k|    uint32_t first_half = num_remaining_points / 2;
  337|  5.24k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 2, False: 5.24k]
  ------------------
  338|       |      // Invalid |number|.
  339|      2|      return false;
  340|      2|    }
  341|  5.24k|    first_half -= number;
  342|  5.24k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  5.24k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 3.13k, False: 2.10k]
  ------------------
  345|  3.13k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.37k, False: 1.76k]
  ------------------
  346|  1.37k|        std::swap(first_half, second_half);
  347|  1.37k|      }
  348|  3.13k|    }
  349|       |
  350|  5.24k|    levels_stack_[stack_pos][axis] += 1;
  351|  5.24k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  5.24k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 5.23k, False: 8]
  ------------------
  353|  5.23k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  5.23k|    }
  355|  5.24k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 5.24k, False: 5]
  ------------------
  356|  5.24k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  5.24k|    }
  358|  5.24k|  }
  359|      0|  return true;
  360|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      1|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      1|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      1|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      1|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 1]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      1|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 1]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      1|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 1]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      1|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 1]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      1|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 1]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      1|  num_decoded_points_ = 0;
  202|       |
  203|      1|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 0]
  ------------------
  204|      1|    return false;
  205|      1|  }
  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|      8|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      8|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      8|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      8|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      8|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 8]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      8|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 8]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      8|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 8]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      8|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 8]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      8|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 8]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      8|  num_decoded_points_ = 0;
  202|       |
  203|      8|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 8, False: 0]
  ------------------
  204|      8|    return false;
  205|      8|  }
  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|     45|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|     45|  qinfo_.quantization_bits = 0;
   67|     45|  qinfo_.range = 0;
   68|     45|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|     44|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|     44|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 44]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|     44|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 0, False: 44]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|     44|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 44]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|     44|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 44]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|     44|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 0, False: 44]
  |  Branch (84:38): [True: 0, False: 0]
  ------------------
   85|      0|    return false;
   86|      0|  }
   87|     44|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 44]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|     44|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 1, False: 43]
  ------------------
   93|      1|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      1|#define DRACO_LOGE printf
  ------------------
   94|      1|               compression_level_);
   95|      1|    return false;
   96|      1|  }
   97|       |
   98|     43|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|     43|      std::back_inserter(*qpoints);
  100|     43|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|     43|                           Converter>
  102|     43|      oit(oit_qpoints);
  103|     43|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 43, False: 0]
  ------------------
  104|     43|    qpoints->reserve(num_points_);
  105|     43|    switch (compression_level_) {
  106|      7|      case 0: {
  ------------------
  |  Branch (106:7): [True: 7, False: 36]
  ------------------
  107|      7|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|      7|        qpoints_decoder.DecodePoints(buffer, oit);
  109|      7|        break;
  110|      0|      }
  111|      2|      case 1: {
  ------------------
  |  Branch (111:7): [True: 2, False: 41]
  ------------------
  112|      2|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|      2|        qpoints_decoder.DecodePoints(buffer, oit);
  114|      2|        break;
  115|      0|      }
  116|      6|      case 2: {
  ------------------
  |  Branch (116:7): [True: 6, False: 37]
  ------------------
  117|      6|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|      6|        qpoints_decoder.DecodePoints(buffer, oit);
  119|      6|        break;
  120|      0|      }
  121|     19|      case 3: {
  ------------------
  |  Branch (121:7): [True: 19, False: 24]
  ------------------
  122|     19|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|     19|        qpoints_decoder.DecodePoints(buffer, oit);
  124|     19|        break;
  125|      0|      }
  126|      1|      case 4: {
  ------------------
  |  Branch (126:7): [True: 1, False: 42]
  ------------------
  127|      1|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|      1|        qpoints_decoder.DecodePoints(buffer, oit);
  129|      1|        break;
  130|      0|      }
  131|      0|      case 5: {
  ------------------
  |  Branch (131:7): [True: 0, False: 43]
  ------------------
  132|      0|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|      0|        qpoints_decoder.DecodePoints(buffer, oit);
  134|      0|        break;
  135|      0|      }
  136|      8|      case 6: {
  ------------------
  |  Branch (136:7): [True: 8, False: 35]
  ------------------
  137|      8|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|      8|        qpoints_decoder.DecodePoints(buffer, oit);
  139|      8|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 43]
  ------------------
  142|      0|        return false;
  143|     43|    }
  144|     43|  }
  145|       |
  146|     43|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 43, False: 0]
  ------------------
  147|     43|    return false;
  148|     43|  }
  149|      0|  return true;
  150|     43|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|     43|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|  11.0k|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|  11.0k|  const Self &operator=(const SourceType &source) {
   56|  11.0k|    *oit_ = Converter()(source);
   57|  11.0k|    return *this;
   58|  11.0k|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|  11.0k|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|  11.0k|    return Point3ui(v[0], v[1], v[2]);
   31|  11.0k|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|  11.0k|  const Self &operator++() {
   46|  11.0k|    ++oit_;
   47|  11.0k|    return *this;
   48|  11.0k|  }

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

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

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

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

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

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

_ZN5draco18MostSignificantBitEj:
   58|   641k|inline int MostSignificantBit(uint32_t n) {
   59|   641k|#if defined(__GNUC__)
   60|   641k|  return 31 ^ __builtin_clz(n);
   61|       |#elif defined(_MSC_VER)
   62|       |
   63|       |  unsigned long where;
   64|       |  _BitScanReverse(&where, n);
   65|       |  return (int)where;
   66|       |#else
   67|       |  // TODO(fgalligan): Optimize this code.
   68|       |  int msb = -1;
   69|       |  while (n != 0) {
   70|       |    msb++;
   71|       |    n >>= 1;
   72|       |  }
   73|       |  return msb;
   74|       |#endif
   75|   641k|}
_ZN5draco24ConvertSymbolToSignedIntIjEENSt3__111make_signedIT_E4typeES3_:
  109|  6.97M|    IntTypeT val) {
  110|  6.97M|  static_assert(std::is_integral<IntTypeT>::value, "IntTypeT is not integral.");
  111|  6.97M|  typedef typename std::make_signed<IntTypeT>::type SignedType;
  112|  6.97M|  const bool is_positive = !static_cast<bool>(val & 1);
  113|  6.97M|  val >>= 1;
  114|  6.97M|  if (is_positive) {
  ------------------
  |  Branch (114:7): [True: 1.55M, False: 5.42M]
  ------------------
  115|  1.55M|    return static_cast<SignedType>(val);
  116|  1.55M|  }
  117|  5.42M|  SignedType ret = static_cast<SignedType>(val);
  118|  5.42M|  ret = -ret - 1;
  119|  5.42M|  return ret;
  120|  6.97M|}

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  3.44M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  3.44M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 3.44M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  3.44M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  3.44M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  1.38M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|  1.38M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 37, False: 1.38M]
  ------------------
   78|     37|      return false;  // Buffer overflow.
   79|     37|    }
   80|  1.38M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  1.38M|    pos_ += size_to_decode;
   82|  1.38M|    return true;
   83|  1.38M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  4.28k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|    814|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  5.12k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   322k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|    338|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  3.44M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  30.5k|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|    514|    inline void reset(const void *b, size_t s) {
  131|    514|      bit_offset_ = 0;
  132|    514|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|    514|      bit_buffer_end_ = bit_buffer_ + s;
  134|    514|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|    347|    inline uint64_t BitsDecoded() const {
  138|    347|      return static_cast<uint64_t>(bit_offset_);
  139|    347|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  3.44M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  3.44M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 3.44M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  3.44M|      uint32_t value = 0;
  165|  7.70M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 4.26M, False: 3.44M]
  ------------------
  166|  4.26M|        value |= GetBit() << bit;
  167|  4.26M|      }
  168|  3.44M|      *x = value;
  169|  3.44M|      return true;
  170|  3.44M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  4.26M|    inline int GetBit() {
  176|  4.26M|      const size_t off = bit_offset_;
  177|  4.26M|      const size_t byte_offset = off >> 3;
  178|  4.26M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  4.26M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 4.21M, False: 50.0k]
  ------------------
  180|  4.21M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  4.21M|        bit_offset_ = off + 1;
  182|  4.21M|        return bit;
  183|  4.21M|      }
  184|  50.0k|      return 0;
  185|  4.26M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  6.98M|  bool Decode(T *out_val) {
   69|  6.98M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 125, False: 6.98M]
  ------------------
   70|    125|      return false;
   71|    125|    }
   72|  6.98M|    pos_ += sizeof(T);
   73|  6.98M|    return true;
   74|  6.98M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  6.98M|  bool Peek(T *out_val) {
   88|  6.98M|    const size_t size_to_decode = sizeof(T);
   89|  6.98M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 125, False: 6.98M]
  ------------------
   90|    125|      return false;  // Buffer overflow.
   91|    125|    }
   92|  6.98M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  6.98M|    return true;
   94|  6.98M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|    694|  bool Decode(T *out_val) {
   69|    694|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 694]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|    694|    pos_ += sizeof(T);
   73|    694|    return true;
   74|    694|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|    694|  bool Peek(T *out_val) {
   88|    694|    const size_t size_to_decode = sizeof(T);
   89|    694|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 694]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|    694|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    694|    return true;
   94|    694|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   500k|  bool Decode(T *out_val) {
   69|   500k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 15, False: 500k]
  ------------------
   70|     15|      return false;
   71|     15|    }
   72|   500k|    pos_ += sizeof(T);
   73|   500k|    return true;
   74|   500k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   500k|  bool Peek(T *out_val) {
   88|   500k|    const size_t size_to_decode = sizeof(T);
   89|   500k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 15, False: 500k]
  ------------------
   90|     15|      return false;  // Buffer overflow.
   91|     15|    }
   92|   500k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   500k|    return true;
   94|   500k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|    861|  bool Decode(T *out_val) {
   69|    861|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 861]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|    861|    pos_ += sizeof(T);
   73|    861|    return true;
   74|    861|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|    861|  bool Peek(T *out_val) {
   88|    861|    const size_t size_to_decode = sizeof(T);
   89|    861|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 861]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|    861|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    861|    return true;
   94|    861|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   446k|  bool Decode(T *out_val) {
   69|   446k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 32, False: 446k]
  ------------------
   70|     32|      return false;
   71|     32|    }
   72|   446k|    pos_ += sizeof(T);
   73|   446k|    return true;
   74|   446k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   446k|  bool Peek(T *out_val) {
   88|   446k|    const size_t size_to_decode = sizeof(T);
   89|   446k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 32, False: 446k]
  ------------------
   90|     32|      return false;  // Buffer overflow.
   91|     32|    }
   92|   446k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   446k|    return true;
   94|   446k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  2.85k|  bool Decode(T *out_val) {
   69|  2.85k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 2.85k]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|  2.85k|    pos_ += sizeof(T);
   73|  2.85k|    return true;
   74|  2.85k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  2.85k|  bool Peek(T *out_val) {
   88|  2.85k|    const size_t size_to_decode = sizeof(T);
   89|  2.85k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 2.85k]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|  2.85k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.85k|    return true;
   94|  2.85k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|    200|  bool Decode(T *out_val) {
   69|    200|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 200]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|    200|    pos_ += sizeof(T);
   73|    200|    return true;
   74|    200|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|    200|  bool Peek(T *out_val) {
   88|    200|    const size_t size_to_decode = sizeof(T);
   89|    200|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 200]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|    200|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    200|    return true;
   94|    200|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|     70|  bool Decode(T *out_val) {
   69|     70|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 70]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|     70|    pos_ += sizeof(T);
   73|     70|    return true;
   74|     70|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|     70|  bool Peek(T *out_val) {
   88|     70|    const size_t size_to_decode = sizeof(T);
   89|     70|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 70]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|     70|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|     70|    return true;
   94|     70|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   72|  14.5M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   72|   349M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   97|   436k|  constexpr bool operator>=(const ValueTypeT &val) const {
   98|   436k|    return value_ >= val;
   99|   436k|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   72|  6.86M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   72|  62.6M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   89|   979k|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  150|  2.59M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|  2.59M|    value_ = i.value_;
  152|  2.59M|    return *this;
  153|  2.59M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  150|  1.33M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|  1.33M|    value_ = i.value_;
  152|  1.33M|    return *this;
  153|  1.33M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  101|   978k|  inline ThisIndexType &operator++() {
  102|   978k|    ++value_;
  103|   978k|    return *this;
  104|   978k|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   74|  46.1M|  constexpr bool operator==(const IndexType &i) const {
   75|  46.1M|    return value_ == i.value_;
   76|  46.1M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   72|  14.1M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   86|  5.64k|  constexpr bool operator<(const IndexType &i) const {
   87|  5.64k|    return value_ < i.value_;
   88|  5.64k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   74|  3.91M|  constexpr bool operator==(const IndexType &i) const {
   75|  3.91M|    return value_ == i.value_;
   76|  3.91M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  130|  6.06M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  131|  6.06M|    return ThisIndexType(value_ - val);
  132|  6.06M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  124|  13.5M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  125|  13.5M|    return ThisIndexType(value_ + val);
  126|  13.5M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   74|   733k|  constexpr bool operator==(const IndexType &i) const {
   75|   733k|    return value_ == i.value_;
   76|   733k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   80|  4.54M|  constexpr bool operator!=(const IndexType &i) const {
   81|  4.54M|    return value_ != i.value_;
   82|  4.54M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   80|  9.55M|  constexpr bool operator!=(const IndexType &i) const {
   81|  9.55M|    return value_ != i.value_;
   82|  9.55M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  101|  10.2M|  inline ThisIndexType &operator++() {
  102|  10.2M|    ++value_;
  103|  10.2M|    return *this;
  104|  10.2M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  150|  8.67M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|  8.67M|    value_ = i.value_;
  152|  8.67M|    return *this;
  153|  8.67M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  150|  18.4M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|  18.4M|    value_ = i.value_;
  152|  18.4M|    return *this;
  153|  18.4M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   97|  1.62M|  constexpr bool operator>=(const ValueTypeT &val) const {
   98|  1.62M|    return value_ >= val;
   99|  1.62M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   89|   265k|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   70|  24.4M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   70|  3.74M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|  2.23M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  124|   578k|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  125|   578k|    return ThisIndexType(value_ + val);
  126|   578k|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   70|  3.54M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   86|   436k|  constexpr bool operator<(const IndexType &i) const {
   87|   436k|    return value_ < i.value_;
   88|   436k|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|  1.55M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   70|   349M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  150|   272k|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|   272k|    value_ = i.value_;
  152|   272k|    return *this;
  153|   272k|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  138|   265k|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  139|   265k|    value_ += val;
  140|   265k|    return *this;
  141|   265k|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  154|  1.53M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  155|  1.53M|    value_ = val;
  156|  1.53M|    return *this;
  157|  1.53M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   70|  23.2k|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   89|   284k|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  101|   284k|  inline ThisIndexType &operator++() {
  102|   284k|    ++value_;
  103|   284k|    return *this;
  104|   284k|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   89|   336k|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   89|      2|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  101|   347M|  inline ThisIndexType &operator++() {
  102|   347M|    ++value_;
  103|   347M|    return *this;
  104|   347M|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   97|   347M|  constexpr bool operator>=(const ValueTypeT &val) const {
   98|   347M|    return value_ >= val;
   99|   347M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|   344k|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   344k|    return vector_[index.value()];
   75|   344k|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|   336k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|    784|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|    562|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  1.96M|  inline reference operator[](const IndexTypeT &index) {
   71|  1.96M|    return vector_[index.value()];
   72|  1.96M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  75.6k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|   872k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|    172|  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|   436k|  inline reference operator[](const IndexTypeT &index) {
   71|   436k|    return vector_[index.value()];
   72|   436k|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|   749k|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   749k|    return vector_[index.value()];
   75|   749k|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|  2.91M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|   272k|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|  8.61M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  8.61M|    return vector_[index.value()];
   75|  8.61M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|  11.9M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  11.9M|    return vector_[index.value()];
   75|  11.9M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|  7.40M|  inline reference operator[](const IndexTypeT &index) {
   71|  7.40M|    return vector_[index.value()];
   72|  7.40M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  1.71M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  1.71M|    return vector_[index.value()];
   75|  1.71M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|  5.89M|  inline reference operator[](const IndexTypeT &index) {
   71|  5.89M|    return vector_[index.value()];
   72|  5.89M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  1.51M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|  3.69M|  inline reference operator[](const IndexTypeT &index) {
   71|  3.69M|    return vector_[index.value()];
   72|  3.69M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|    143|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   644k|  inline reference operator[](const IndexTypeT &index) {
   71|   644k|    return vector_[index.value()];
   72|   644k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  3.14k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  84.8k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  2.94k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|    397|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|    397|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|    397|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|    397|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|    740|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|    740|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|    740|    vector_.swap(arg.vector_);
   57|    740|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|    740|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|    740|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|    740|    vector_.swap(arg.vector_);
   57|    740|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|    397|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|    397|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|    397|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|    589|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  82.2k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  83.6k|int32_t DataTypeLength(DataType dt) {
   20|  83.6k|  switch (dt) {
   21|  16.4k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 16.4k, False: 67.2k]
  ------------------
   22|  25.8k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 9.42k, False: 74.2k]
  ------------------
   23|  25.8k|      return 1;
   24|  56.3k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 56.3k, False: 27.3k]
  ------------------
   25|  56.5k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 210, False: 83.4k]
  ------------------
   26|  56.5k|      return 2;
   27|    890|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 890, False: 82.7k]
  ------------------
   28|    988|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 98, False: 83.5k]
  ------------------
   29|    988|      return 4;
   30|     12|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 12, False: 83.6k]
  ------------------
   31|     51|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 39, False: 83.6k]
  ------------------
   32|     51|      return 8;
   33|    187|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 187, False: 83.4k]
  ------------------
   34|    187|      return 4;
   35|      2|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 2, False: 83.6k]
  ------------------
   36|      2|      return 8;
   37|     38|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 38, False: 83.6k]
  ------------------
   38|     38|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 83.6k]
  ------------------
   40|      0|      return -1;
   41|  83.6k|  }
   42|  83.6k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    225|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    589|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|    814|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|    814|  bool ok() const { return status_.ok(); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|    785|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|    814|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|     29|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|    225|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|    225|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|    589|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|    589|  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): [Folded - Ignored]
  ------------------
   65|   557k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 64, False: 557k]
  ------------------
   66|     64|      return false;
   67|     64|    }
   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|   557k|  return true;
   77|   557k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   147k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   147k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   147k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 11, False: 147k]
  ------------------
   33|     11|    return false;
   34|     11|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   147k|  uint8_t in;
   39|   147k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 39, False: 147k]
  ------------------
   40|     39|    return false;
   41|     39|  }
   42|   147k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 6.47k, False: 141k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  6.47k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 55, False: 6.42k]
  ------------------
   45|     55|      return false;
   46|     55|    }
   47|       |    // Append decoded info from this byte.
   48|  6.42k|    *out_val <<= 7;
   49|  6.42k|    *out_val |= in & ((1 << 7) - 1);
   50|   141k|  } else {
   51|       |    // Last byte reached
   52|   141k|    *out_val = in;
   53|   141k|  }
   54|   147k|  return true;
   55|   147k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|    146|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    146|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    146|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 146]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    146|  uint8_t in;
   39|    146|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 146]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    146|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 12, False: 134]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     12|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 12]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     12|    *out_val <<= 7;
   49|     12|    *out_val |= in & ((1 << 7) - 1);
   50|    134|  } else {
   51|       |    // Last byte reached
   52|    134|    *out_val = in;
   53|    134|  }
   54|    146|  return true;
   55|    146|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|    275|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|    275|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded - Ignored]
  ------------------
   65|    275|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 275]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|    275|  } 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|    275|  return true;
   77|    275|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|    162|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    162|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    162|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 162]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    162|  uint8_t in;
   39|    162|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 162]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    162|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 0, False: 162]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|      0|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 0]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|      0|    *out_val <<= 7;
   49|      0|    *out_val |= in & ((1 << 7) - 1);
   50|    162|  } else {
   51|       |    // Last byte reached
   52|    162|    *out_val = in;
   53|    162|  }
   54|    162|  return true;
   55|    162|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   411k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   411k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   411k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 411k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   411k|  uint8_t in;
   39|   411k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 8, False: 411k]
  ------------------
   40|      8|    return false;
   41|      8|  }
   42|   411k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.00k, False: 410k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.00k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 20, False: 984]
  ------------------
   45|     20|      return false;
   46|     20|    }
   47|       |    // Append decoded info from this byte.
   48|    984|    *out_val <<= 7;
   49|    984|    *out_val |= in & ((1 << 7) - 1);
   50|   410k|  } else {
   51|       |    // Last byte reached
   52|   410k|    *out_val = in;
   53|   410k|  }
   54|   411k|  return true;
   55|   411k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|      6|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|      6|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded - Ignored]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|      6|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      6|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      6|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 6]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      6|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      6|  }
   76|      6|  return true;
   77|      6|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|      6|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|      6|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|      6|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 6]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|      6|  uint8_t in;
   39|      6|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 6]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|      6|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 0, False: 6]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|      0|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 0]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|      0|    *out_val <<= 7;
   49|      0|    *out_val |= in & ((1 << 7) - 1);
   50|      6|  } else {
   51|       |    // Last byte reached
   52|      6|    *out_val = in;
   53|      6|  }
   54|      6|  return true;
   55|      6|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|    236|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    236|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    236|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 236]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    236|  uint8_t in;
   39|    236|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 236]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    236|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 44, False: 192]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     44|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 44]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     44|    *out_val <<= 7;
   49|     44|    *out_val |= in & ((1 << 7) - 1);
   50|    192|  } else {
   51|       |    // Last byte reached
   52|    192|    *out_val = in;
   53|    192|  }
   54|    236|  return true;
   55|    236|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.89k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.89k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.89k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 3.89k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.89k|  uint8_t in;
   39|  3.89k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 3.89k]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|  3.89k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 124, False: 3.76k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    124|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 124]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    124|    *out_val <<= 7;
   49|    124|    *out_val |= in & ((1 << 7) - 1);
   50|  3.76k|  } else {
   51|       |    // Last byte reached
   52|  3.76k|    *out_val = in;
   53|  3.76k|  }
   54|  3.89k|  return true;
   55|  3.89k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|    363|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    363|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    363|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 363]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    363|  uint8_t in;
   39|    363|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 363]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    363|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 109, False: 254]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    109|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 109]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    109|    *out_val <<= 7;
   49|    109|    *out_val |= in & ((1 << 7) - 1);
   50|    254|  } else {
   51|       |    // Last byte reached
   52|    254|    *out_val = in;
   53|    254|  }
   54|    363|  return true;
   55|    363|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|    305|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    305|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    305|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 305]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    305|  uint8_t in;
   39|    305|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 305]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    305|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 192, False: 113]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    192|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 192]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    192|    *out_val <<= 7;
   49|    192|    *out_val |= in & ((1 << 7) - 1);
   50|    192|  } else {
   51|       |    // Last byte reached
   52|    113|    *out_val = in;
   53|    113|  }
   54|    305|  return true;
   55|    305|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  1.94k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.94k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.94k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 1.94k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.94k|  uint8_t in;
   39|  1.94k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 2, False: 1.94k]
  ------------------
   40|      2|    return false;
   41|      2|  }
   42|  1.94k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 28, False: 1.91k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     28|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 28]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     28|    *out_val <<= 7;
   49|     28|    *out_val |= in & ((1 << 7) - 1);
   50|  1.91k|  } else {
   51|       |    // Last byte reached
   52|  1.91k|    *out_val = in;
   53|  1.91k|  }
   54|  1.94k|  return true;
   55|  1.94k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|  22.3k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|  22.2k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  1.85k|  Self operator-(const Self &o) const {
  138|  1.85k|    Self ret;
  139|  7.41k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 5.56k, False: 1.85k]
  ------------------
  140|  5.56k|      ret[i] = (*this)[i] - o[i];
  141|  5.56k|    }
  142|  1.85k|    return ret;
  143|  1.85k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  4.40k|  VectorD() {
   41|  17.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 13.2k, False: 4.40k]
  ------------------
   42|  13.2k|      (*this)[i] = Scalar(0);
   43|  13.2k|    }
   44|  4.40k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  69.7k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|  61.9k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  4.92k|  Self operator-(const Self &o) const {
  138|  4.92k|    Self ret;
  139|  19.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 14.7k, False: 4.92k]
  ------------------
  140|  14.7k|      ret[i] = (*this)[i] - o[i];
  141|  14.7k|    }
  142|  4.92k|    return ret;
  143|  4.92k|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  2.29k|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  2.29k|  static_assert(std::is_signed<ScalarT>::value,
  321|  2.29k|                "ScalarT must be a signed type. ");
  322|  2.29k|  VectorD<ScalarT, 3> r;
  323|  2.29k|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  2.29k|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  2.29k|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  2.29k|  return r;
  327|  2.29k|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  2.29k|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  2.29k|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|    668|  Scalar AbsSum() const {
  238|    668|    Scalar result(0);
  239|  2.64k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 1.99k, False: 648]
  ------------------
  240|  1.99k|      Scalar next_value = std::abs(v_[i]);
  241|  1.99k|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 20, False: 1.97k]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|     20|        return std::numeric_limits<Scalar>::max();
  244|     20|      }
  245|  1.97k|      result += next_value;
  246|  1.97k|    }
  247|    648|    return result;
  248|    668|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|    526|  Self operator/(const Scalar &o) const {
  183|    526|    Self ret;
  184|  2.10k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 1.57k, False: 526]
  ------------------
  185|  1.57k|      ret[i] = (*this)[i] / o;
  186|  1.57k|    }
  187|    526|    return ret;
  188|    526|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|  74.1k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  3.35k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  2.00k|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|    551|  Self operator-() const {
  121|    551|    Self ret;
  122|  2.20k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 1.65k, False: 551]
  ------------------
  123|  1.65k|      ret[i] = -(*this)[i];
  124|  1.65k|    }
  125|    551|    return ret;
  126|    551|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  1.65k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|     14|  Self operator-(const Self &o) const {
  138|     14|    Self ret;
  139|     42|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 28, False: 14]
  ------------------
  140|     28|      ret[i] = (*this)[i] - o[i];
  141|     28|    }
  142|     14|    return ret;
  143|     14|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|    168|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|    252|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|   178k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|     28|  Self operator+(const Self &o) const {
  130|     28|    Self ret;
  131|     84|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 56, False: 28]
  ------------------
  132|     56|      ret[i] = (*this)[i] + o[i];
  133|     56|    }
  134|     28|    return ret;
  135|     28|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|   121k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  5.37k|  Self operator-(const Self &o) const {
  138|  5.37k|    Self ret;
  139|  16.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 10.7k, False: 5.37k]
  ------------------
  140|  10.7k|      ret[i] = (*this)[i] - o[i];
  141|  10.7k|    }
  142|  5.37k|    return ret;
  143|  5.37k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  5.37k|  Self operator+(const Self &o) const {
  130|  5.37k|    Self ret;
  131|  16.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 10.7k, False: 5.37k]
  ------------------
  132|  10.7k|      ret[i] = (*this)[i] + o[i];
  133|  10.7k|    }
  134|  5.37k|    return ret;
  135|  5.37k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|  4.00k|  bool operator==(const Self &o) const {
  207|  10.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 7.37k, False: 3.31k]
  ------------------
  208|  7.37k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 692, False: 6.67k]
  ------------------
  209|    692|        return false;
  210|    692|      }
  211|  7.37k|    }
  212|  3.31k|    return true;
  213|  4.00k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  48.0k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  1.16k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  1.63k|  Scalar Dot(const Self &o) const {
  251|  1.63k|    Scalar ret(0);
  252|  6.52k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 4.89k, False: 1.63k]
  ------------------
  253|  4.89k|      ret += (*this)[i] * o[i];
  254|  4.89k|    }
  255|  1.63k|    return ret;
  256|  1.63k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    470|  Self operator*(const Scalar &o) const {
  175|    470|    Self ret;
  176|  1.88k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.41k, False: 470]
  ------------------
  177|  1.41k|      ret[i] = (*this)[i] * o;
  178|  1.41k|    }
  179|    470|    return ret;
  180|    470|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|    692|  Self operator-(const Self &o) const {
  138|    692|    Self ret;
  139|  2.07k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.38k, False: 692]
  ------------------
  140|  1.38k|      ret[i] = (*this)[i] - o[i];
  141|  1.38k|    }
  142|    692|    return ret;
  143|    692|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  1.38k|  VectorD() {
   41|  4.15k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 2.76k, False: 1.38k]
  ------------------
   42|  2.76k|      (*this)[i] = Scalar(0);
   43|  2.76k|    }
   44|  1.38k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|  8.70k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  8.70k|    DRACO_DCHECK_EQ(dimension, 2);
   54|  8.70k|    v_[0] = c0;
   55|  8.70k|    v_[1] = c1;
   56|  8.70k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  5.53k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|  3.22k|  bool operator==(const Self &o) const {
  207|  9.44k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 6.34k, False: 3.10k]
  ------------------
  208|  6.34k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 114, False: 6.22k]
  ------------------
  209|    114|        return false;
  210|    114|      }
  211|  6.34k|    }
  212|  3.10k|    return true;
  213|  3.22k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  21.7k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  14.2k|  VectorD() {
   41|  56.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 42.6k, False: 14.2k]
  ------------------
   42|  42.6k|      (*this)[i] = Scalar(0);
   43|  42.6k|    }
   44|  14.2k|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|    222|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|    332|  Scalar Dot(const Self &o) const {
  251|    332|    Scalar ret(0);
  252|  1.32k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 996, False: 332]
  ------------------
  253|    996|      ret += (*this)[i] * o[i];
  254|    996|    }
  255|    332|    return ret;
  256|    332|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|    110|  Self operator-(const Self &o) const {
  138|    110|    Self ret;
  139|    330|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 220, False: 110]
  ------------------
  140|    220|      ret[i] = (*this)[i] - o[i];
  141|    220|    }
  142|    110|    return ret;
  143|    110|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|    324|  Self operator*(const Scalar &o) const {
  175|    324|    Self ret;
  176|    972|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 648, False: 324]
  ------------------
  177|    648|      ret[i] = (*this)[i] * o;
  178|    648|    }
  179|    324|    return ret;
  180|    324|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|    108|  Self operator+(const Self &o) const {
  130|    108|    Self ret;
  131|    324|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 216, False: 108]
  ------------------
  132|    216|      ret[i] = (*this)[i] + o[i];
  133|    216|    }
  134|    108|    return ret;
  135|    108|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|    108|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|    108|  return v * o;
  294|    108|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|    108|  Self operator+(const Self &o) const {
  130|    108|    Self ret;
  131|    432|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 324, False: 108]
  ------------------
  132|    324|      ret[i] = (*this)[i] + o[i];
  133|    324|    }
  134|    108|    return ret;
  135|    108|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|    108|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|    108|  return v * o;
  294|    108|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|    108|  Self operator*(const Scalar &o) const {
  175|    108|    Self ret;
  176|    432|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 324, False: 108]
  ------------------
  177|    324|      ret[i] = (*this)[i] * o;
  178|    324|    }
  179|    108|    return ret;
  180|    108|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|  6.54k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  6.54k|    DRACO_DCHECK_EQ(dimension, 2);
   54|  6.54k|    v_[0] = c0;
   55|  6.54k|    v_[1] = c1;
   56|  6.54k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|    758|  VectorD() {
   41|  2.27k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 1.51k, False: 758]
  ------------------
   42|  1.51k|      (*this)[i] = Scalar(0);
   43|  1.51k|    }
   44|    758|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|    216|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|    648|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 432, False: 216]
  ------------------
  104|    432|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 432, False: 0]
  ------------------
  105|    432|        v_[i] = Scalar(src_vector[i]);
  106|    432|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|    432|    }
  110|    216|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|     75|  Self operator+(const Self &o) const {
  130|     75|    Self ret;
  131|    225|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 150, False: 75]
  ------------------
  132|    150|      ret[i] = (*this)[i] + o[i];
  133|    150|    }
  134|     75|    return ret;
  135|     75|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|    108|  VectorD() {
   41|    324|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 216, False: 108]
  ------------------
   42|    216|      (*this)[i] = Scalar(0);
   43|    216|    }
   44|    108|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|    648|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|    432|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|    108|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|    324|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 216, False: 108]
  ------------------
  104|    216|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 216, False: 0]
  ------------------
  105|    216|        v_[i] = Scalar(src_vector[i]);
  106|    216|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|    216|    }
  110|    108|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|    108|  Self operator/(const Scalar &o) const {
  183|    108|    Self ret;
  184|    324|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 216, False: 108]
  ------------------
  185|    216|      ret[i] = (*this)[i] / o;
  186|    216|    }
  187|    108|    return ret;
  188|    108|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|     33|  Self operator-(const Self &o) const {
  138|     33|    Self ret;
  139|     99|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 66, False: 33]
  ------------------
  140|     66|      ret[i] = (*this)[i] - o[i];
  141|     66|    }
  142|     33|    return ret;
  143|     33|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  3.03k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|    568|  VectorD() {
   41|  2.27k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 1.70k, False: 568]
  ------------------
   42|  1.70k|      (*this)[i] = Scalar(0);
   43|  1.70k|    }
   44|    568|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  31.4k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  31.4k|    DRACO_DCHECK_EQ(dimension, 2);
   54|  31.4k|    v_[0] = c0;
   55|  31.4k|    v_[1] = c1;
   56|  31.4k|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|     84|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|    252|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 168, False: 84]
  ------------------
  104|    168|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 168, False: 0]
  ------------------
  105|    168|        v_[i] = Scalar(src_vector[i]);
  106|    168|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|    168|    }
  110|     84|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|     42|  VectorD() {
   41|    126|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 84, False: 42]
  ------------------
   42|     84|      (*this)[i] = Scalar(0);
   43|     84|    }
   44|     42|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|     42|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|    126|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 84, False: 42]
  ------------------
  104|     84|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 84, False: 0]
  ------------------
  105|     84|        v_[i] = Scalar(src_vector[i]);
  106|     84|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|     84|    }
  110|     42|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  26.0k|  VectorD(const Self &o) {
   89|  78.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 52.0k, False: 26.0k]
  ------------------
   90|  52.0k|      (*this)[i] = o[i];
   91|  52.0k|    }
   92|  26.0k|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  10.7k|  VectorD() {
   41|  32.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 21.4k, False: 10.7k]
  ------------------
   42|  21.4k|      (*this)[i] = Scalar(0);
   43|  21.4k|    }
   44|  10.7k|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|  23.2k|  VectorD(const Self &o) {
   89|  92.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 69.7k, False: 23.2k]
  ------------------
   90|  69.7k|      (*this)[i] = o[i];
   91|  69.7k|    }
   92|  23.2k|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  69.7k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|  11.0k|      : v_({{c0, c1, c2}}) {
   60|  11.0k|    DRACO_DCHECK_EQ(dimension, 3);
   61|  11.0k|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  1.39M|  inline int num_vertices() const {
   74|  1.39M|    return static_cast<int>(vertex_corners_.size());
   75|  1.39M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|   266k|  inline int num_corners() const {
   77|   266k|    return static_cast<int>(corner_to_vertex_map_.size());
   78|   266k|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  5.94k|  inline int num_faces() const {
   80|  5.94k|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  5.94k|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|  8.61M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|  8.61M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 8.61M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|  8.61M|    return opposite_corners_[corner];
   88|  8.61M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|  10.6M|  inline CornerIndex Next(CornerIndex corner) const {
   90|  10.6M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 431k, False: 10.2M]
  ------------------
   91|   431k|      return corner;
   92|   431k|    }
   93|  10.2M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 7.74M, False: 2.47M]
  ------------------
   94|  10.6M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|  8.63M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|  8.63M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 199k, False: 8.43M]
  ------------------
   97|   199k|      return corner;
   98|   199k|    }
   99|  8.43M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 3.59M, False: 4.83M]
  ------------------
  100|  8.63M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  11.9M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|  11.9M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 11.9M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|  11.9M|    return ConfidentVertex(corner);
  106|  11.9M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  11.9M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|  11.9M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|  11.9M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|  11.9M|    return corner_to_vertex_map_[corner];
  111|  11.9M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|   603k|  inline FaceIndex Face(CornerIndex corner) const {
  113|   603k|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 603k]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|   603k|    return FaceIndex(corner.value() / 3);
  117|   603k|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|  18.6M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  1.71M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  1.71M|    return vertex_corners_[v];
  152|  1.71M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  95.0k|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  95.0k|    const CornerIndex corner = LeftMostCorner(vert);
  187|  95.0k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 1.34k, False: 93.6k]
  ------------------
  188|  1.34k|      return true;
  189|  1.34k|    }
  190|  93.6k|    return false;
  191|  95.0k|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  2.18M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  2.18M|    return Previous(Opposite(Previous(corner)));
  202|  2.18M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  1.31M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  1.31M|    return Next(Opposite(Next(corner)));
  207|  1.31M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|   240k|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|   240k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 240k]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|   240k|    return Opposite(Previous(corner_id));
  222|   240k|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|   334k|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|   334k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 334k]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|   334k|    return Opposite(Next(corner_id));
  228|   334k|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|  5.89M|                                CornerIndex opp_corner_id) {
  249|  5.89M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|  5.89M|    opposite_corners_[corner_id] = opp_corner_id;
  251|  5.89M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|  7.40M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|  7.40M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|  7.40M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|  7.40M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  1.51M|  VertexIndex AddNewVertex() {
  271|  1.51M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  1.51M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  1.51M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  1.51M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|  3.50M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|  3.50M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|  3.50M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 3.50M, False: 0]
  ------------------
  295|  3.50M|      vertex_corners_[vert] = corner;
  296|  3.50M|    }
  297|  3.50M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|   192k|  void MakeVertexIsolated(VertexIndex vert) {
  329|   192k|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|   192k|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|   192k|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  231|  5.22k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  25.0k|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  17.4k|  VertexCornersIterator &operator++() {
  268|  17.4k|    Next();
  269|  17.4k|    return *this;
  270|  17.4k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  19.3k|  void Next() {
  248|  19.3k|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 13.3k, False: 6.02k]
  ------------------
  249|  13.3k|      corner_ = corner_table_->SwingLeft(corner_);
  250|  13.3k|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 3.40k, False: 9.96k]
  ------------------
  251|       |        // Open boundary reached.
  252|  3.40k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  3.40k|        left_traversal_ = false;
  254|  9.96k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 2.24k, False: 7.72k]
  ------------------
  255|       |        // End reached.
  256|  2.24k|        corner_ = kInvalidCornerIndex;
  257|  2.24k|      }
  258|  13.3k|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  6.02k|      corner_ = corner_table_->SwingRight(corner_);
  262|  6.02k|    }
  263|  19.3k|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  21.3k|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|    551|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|    618|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|    309|  void Next() {
  248|    309|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 276, False: 33]
  ------------------
  249|    276|      corner_ = corner_table_->SwingLeft(corner_);
  250|    276|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 241, False: 35]
  ------------------
  251|       |        // Open boundary reached.
  252|    241|        corner_ = corner_table_->SwingRight(start_corner_);
  253|    241|        left_traversal_ = false;
  254|    241|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 1, False: 34]
  ------------------
  255|       |        // End reached.
  256|      1|        corner_ = kInvalidCornerIndex;
  257|      1|      }
  258|    276|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|     33|      corner_ = corner_table_->SwingRight(corner_);
  262|     33|    }
  263|    309|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  238|    242|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  238|    426|        left_traversal_(true) {}

_ZN5draco4MeshC2Ev:
   29|    589|Mesh::Mesh() {}

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  1.24M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  1.24M|    return is_edge_on_seam_[corner.value()];
   47|  1.24M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|   249k|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|   249k|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 249k]
  |  Branch (50:42): [True: 247k, False: 2.18k]
  ------------------
   51|   247k|      return kInvalidCornerIndex;
   52|   247k|    }
   53|  2.18k|    return corner_table_->Opposite(corner);
   54|   249k|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|   489k|  inline CornerIndex Next(CornerIndex corner) const {
   57|   489k|    return corner_table_->Next(corner);
   58|   489k|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  14.9k|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  14.9k|    return corner_table_->Previous(corner);
   62|  14.9k|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|   139k|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|   139k|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|   139k|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.68k|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  2.68k|    return Opposite(Previous(corner));
   73|  2.68k|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  2.75k|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  2.75k|    return Opposite(Next(corner));
   76|  2.75k|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  2.32k|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  2.32k|    return Previous(Opposite(Previous(corner)));
   81|  2.32k|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|   239k|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|   239k|    return Next(Opposite(Next(corner)));
   86|   239k|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|    453|  int num_vertices() const {
   89|    453|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|    453|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|    110|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|     68|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  2.09M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  2.09M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  2.09M|    return ConfidentVertex(corner);
   97|  2.09M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  2.09M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  2.09M|    return corner_to_vertex_map_[corner.value()];
  100|  2.09M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  2.46k|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  2.46k|    return vertex_to_left_most_corner_map_[v.value()];
  108|  2.46k|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  2.46k|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  2.46k|    const CornerIndex corner = LeftMostCorner(vert);
  124|  2.46k|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 2.46k]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  2.46k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 2.39k, False: 70]
  ------------------
  128|  2.39k|      return true;
  129|  2.39k|    }
  130|     70|    return false;
  131|  2.46k|  }

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

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

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

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

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

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

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

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

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

