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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  1.81k|      : quantization_bits_(-1),
   54|  1.81k|        max_quantized_value_(-1),
   55|  1.81k|        max_value_(-1),
   56|  1.81k|        dequantization_scale_(1.f),
   57|  1.81k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  1.65k|  bool SetQuantizationBits(int32_t q) {
   60|  1.65k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 577, False: 1.08k]
  |  Branch (60:18): [True: 76, False: 1.00k]
  ------------------
   61|    653|      return false;
   62|    653|    }
   63|  1.00k|    quantization_bits_ = q;
   64|  1.00k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.00k|    max_value_ = max_quantized_value_ - 1;
   66|  1.00k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.00k|    center_value_ = max_value_ / 2;
   68|  1.00k|    return true;
   69|  1.65k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  1.15M|                                           int32_t *out_t) const {
   77|  1.15M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 2.35k, False: 1.14M]
  |  Branch (77:20): [True: 0, False: 2.35k]
  |  Branch (77:32): [True: 2.35k, False: 1.14M]
  |  Branch (77:42): [True: 0, False: 2.35k]
  ------------------
   78|  1.15M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 926k, False: 224k]
  |  Branch (78:29): [True: 8.22k, False: 918k]
  ------------------
   79|  8.22k|      s = max_value_;
   80|  8.22k|      t = max_value_;
   81|  1.14M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 2.35k, False: 1.14M]
  |  Branch (81:26): [True: 648, False: 1.70k]
  ------------------
   82|    648|      t = center_value_ - (t - center_value_);
   83|  1.14M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 918k, False: 223k]
  |  Branch (83:35): [True: 8.22k, False: 910k]
  ------------------
   84|  8.22k|      t = center_value_ + (center_value_ - t);
   85|  1.13M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 912k, False: 221k]
  |  Branch (85:35): [True: 404, False: 912k]
  ------------------
   86|    404|      s = center_value_ + (center_value_ - s);
   87|  1.13M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 3.39k, False: 1.13M]
  |  Branch (87:26): [True: 1.26k, False: 2.13k]
  ------------------
   88|  1.26k|      s = center_value_ - (s - center_value_);
   89|  1.26k|    }
   90|       |
   91|  1.15M|    *out_s = s;
   92|  1.15M|    *out_t = t;
   93|  1.15M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  1.15M|                                                       int32_t *out_t) const {
  100|  1.15M|    DRACO_DCHECK_EQ(
  101|  1.15M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  1.15M|        center_value_);
  103|  1.15M|    int32_t s, t;
  104|  1.15M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 350k, False: 800k]
  ------------------
  105|       |      // Right hemisphere.
  106|   350k|      s = (int_vec[1] + center_value_);
  107|   350k|      t = (int_vec[2] + center_value_);
  108|   800k|    } else {
  109|       |      // Left hemisphere.
  110|   800k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 44.0k, False: 756k]
  ------------------
  111|  44.0k|        s = std::abs(int_vec[2]);
  112|   756k|      } else {
  113|   756k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   756k|      }
  115|   800k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 44.9k, False: 755k]
  ------------------
  116|  44.9k|        t = std::abs(int_vec[1]);
  117|   755k|      } else {
  118|   755k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   755k|      }
  120|   800k|    }
  121|  1.15M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  1.15M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  64.2k|                                                    float *out_vector) const {
  199|  64.2k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  64.2k|                                 in_t * dequantization_scale_ - 1.f,
  201|  64.2k|                                 out_vector);
  202|  64.2k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  1.23M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  1.23M|    DRACO_DCHECK_LE(s, center_value_);
  208|  1.23M|    DRACO_DCHECK_LE(t, center_value_);
  209|  1.23M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  1.23M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  1.23M|    const uint32_t st =
  212|  1.23M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  1.23M|    return st <= center_value_;
  214|  1.23M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  1.49M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  1.49M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  1.49M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  1.49M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  1.49M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  1.49M|    int32_t sign_s = 0;
  223|  1.49M|    int32_t sign_t = 0;
  224|  1.49M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 1.40M, False: 91.2k]
  |  Branch (224:20): [True: 1.35M, False: 51.5k]
  ------------------
  225|  1.35M|      sign_s = 1;
  226|  1.35M|      sign_t = 1;
  227|  1.35M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 92.6k, False: 50.1k]
  |  Branch (227:27): [True: 42.4k, False: 50.2k]
  ------------------
  228|  42.4k|      sign_s = -1;
  229|  42.4k|      sign_t = -1;
  230|   100k|    } else {
  231|   100k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 50.1k, False: 50.2k]
  ------------------
  232|   100k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 50.2k, False: 50.1k]
  ------------------
  233|   100k|    }
  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|  1.49M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  1.49M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  1.49M|    uint32_t us = *s;
  241|  1.49M|    uint32_t ut = *t;
  242|  1.49M|    us = us + us - corner_point_s;
  243|  1.49M|    ut = ut + ut - corner_point_t;
  244|  1.49M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 1.39M, False: 100k]
  ------------------
  245|  1.39M|      uint32_t temp = us;
  246|  1.39M|      us = -ut;
  247|  1.39M|      ut = -temp;
  248|  1.39M|    } else {
  249|   100k|      std::swap(us, ut);
  250|   100k|    }
  251|  1.49M|    us = us + corner_point_s;
  252|  1.49M|    ut = ut + corner_point_t;
  253|       |
  254|  1.49M|    *s = us;
  255|  1.49M|    *t = ut;
  256|  1.49M|    *s /= 2;
  257|  1.49M|    *t /= 2;
  258|  1.49M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  2.46M|  int32_t ModMax(int32_t x) const {
  273|  2.46M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 1.33k, False: 2.45M]
  ------------------
  274|  1.33k|      return x - this->max_quantized_value();
  275|  1.33k|    }
  276|  2.45M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 1.30k, False: 2.45M]
  ------------------
  277|  1.30k|      return x + this->max_quantized_value();
  278|  1.30k|    }
  279|  2.45M|    return x;
  280|  2.45M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.02k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  2.64k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  7.38M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  64.2k|                                           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|  64.2k|    float y = in_s_scaled;
  329|  64.2k|    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|  64.2k|    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|  64.2k|    float x_offset = -x;
  342|  64.2k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 549, False: 63.6k]
  ------------------
  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|  64.2k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 5.49k, False: 58.7k]
  ------------------
  348|  64.2k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 5.46k, False: 58.7k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  64.2k|    const float norm_squared = x * x + y * y + z * z;
  352|  64.2k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 64.2k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  64.2k|    } else {
  357|  64.2k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  64.2k|      out_vector[0] = x * d;
  359|  64.2k|      out_vector[1] = y * d;
  360|  64.2k|      out_vector[2] = z * d;
  361|  64.2k|    }
  362|  64.2k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  1.15M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  1.15M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  1.15M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  1.15M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  1.15M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  1.15M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  1.15M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 921k, False: 229k]
  ------------------
  181|   921k|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|   921k|    } else {
  183|   229k|      vec[0] =
  184|   229k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   229k|          abs_sum;
  186|   229k|      vec[1] =
  187|   229k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   229k|          abs_sum;
  189|   229k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 121k, False: 107k]
  ------------------
  190|   121k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   121k|      } else {
  192|   107k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   107k|      }
  194|   229k|    }
  195|  1.15M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    195|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    195|            attribute, transform, mesh_data),
   52|    195|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    194|                                                                *buffer) {
  194|    194|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    194|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    194|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 7, False: 187]
  ------------------
  196|       |    // Decode prediction mode.
  197|      7|    uint8_t mode;
  198|      7|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 7]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      7|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 2, False: 5]
  ------------------
  203|       |      // Unsupported mode.
  204|      2|      return false;
  205|      2|    }
  206|      7|  }
  207|    192|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    889|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 728, False: 161]
  ------------------
  211|    728|    uint32_t num_flags;
  212|    728|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 7, False: 721]
  ------------------
  213|      7|      return false;
  214|      7|    }
  215|    721|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 14, False: 707]
  ------------------
  216|     14|      return false;
  217|     14|    }
  218|    707|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 332, False: 375]
  ------------------
  219|    332|      is_crease_edge_[i].resize(num_flags);
  220|    332|      RAnsBitDecoder decoder;
  221|    332|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 10, False: 322]
  ------------------
  222|     10|        return false;
  223|     10|      }
  224|   557k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 556k, False: 322]
  ------------------
  225|   556k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   556k|      }
  227|    322|      decoder.EndDecoding();
  228|    322|    }
  229|    707|  }
  230|    161|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    161|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    192|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    154|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    154|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    154|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    770|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 616, False: 154]
  ------------------
   93|    616|    pred_vals[i].resize(num_components, 0);
   94|    616|  }
   95|    154|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    154|                                         out_data);
   97|       |
   98|    154|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    154|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    154|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    154|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    154|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    154|  const int corner_map_size =
  109|    154|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   368k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 368k, False: 101]
  ------------------
  111|   368k|    const CornerIndex start_corner_id =
  112|   368k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   368k|    CornerIndex corner_id(start_corner_id);
  115|   368k|    int num_parallelograms = 0;
  116|   368k|    bool first_pass = true;
  117|   871k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 530k, False: 340k]
  ------------------
  118|   530k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 60.8k, False: 469k]
  ------------------
  119|   530k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   530k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  60.8k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  60.8k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 714, False: 60.1k]
  ------------------
  127|    714|          break;
  128|    714|        }
  129|  60.8k|      }
  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|   529k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 519k, False: 10.0k]
  ------------------
  134|   519k|        corner_id = table->SwingLeft(corner_id);
  135|   519k|      } else {
  136|  10.0k|        corner_id = table->SwingRight(corner_id);
  137|  10.0k|      }
  138|   529k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 26.9k, False: 502k]
  ------------------
  139|  26.9k|        break;
  140|  26.9k|      }
  141|   502k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 345k, False: 157k]
  |  Branch (141:47): [True: 340k, False: 4.67k]
  ------------------
  142|   340k|        first_pass = false;
  143|   340k|        corner_id = table->SwingRight(start_corner_id);
  144|   340k|      }
  145|   502k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   368k|    int num_used_parallelograms = 0;
  150|   368k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 34.4k, False: 334k]
  ------------------
  151|  1.18M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 1.15M, False: 34.4k]
  ------------------
  152|  1.15M|        multi_pred_vals[i] = 0;
  153|  1.15M|      }
  154|       |      // Check which parallelograms are actually used.
  155|  95.2k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 60.8k, False: 34.3k]
  ------------------
  156|  60.8k|        const int context = num_parallelograms - 1;
  157|  60.8k|        const int pos = is_crease_edge_pos[context]++;
  158|  60.8k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 53, False: 60.7k]
  ------------------
  159|     53|          return false;
  160|     53|        }
  161|  60.7k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  60.7k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 6.51k, False: 54.2k]
  ------------------
  163|  6.51k|          ++num_used_parallelograms;
  164|   358k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 351k, False: 6.51k]
  ------------------
  165|   351k|            multi_pred_vals[j] =
  166|   351k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   351k|          }
  168|  6.51k|        }
  169|  60.7k|      }
  170|  34.4k|    }
  171|   368k|    const int dst_offset = p * num_components;
  172|   368k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 365k, False: 3.36k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   365k|      const int src_offset = (p - 1) * num_components;
  176|   365k|      this->transform().ComputeOriginalValue(
  177|   365k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   365k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   195k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 192k, False: 3.36k]
  ------------------
  181|   192k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   192k|      }
  183|  3.36k|      this->transform().ComputeOriginalValue(
  184|  3.36k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  3.36k|    }
  186|   368k|  }
  187|    101|  return true;
  188|    154|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    183|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    183|            attribute, transform, mesh_data),
   52|    183|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    175|                                                                *buffer) {
  194|    175|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    175|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    175|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 0, False: 175]
  ------------------
  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|    175|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    810|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 660, False: 150]
  ------------------
  211|    660|    uint32_t num_flags;
  212|    660|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 0, False: 660]
  ------------------
  213|      0|      return false;
  214|      0|    }
  215|    660|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 17, False: 643]
  ------------------
  216|     17|      return false;
  217|     17|    }
  218|    643|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 309, False: 334]
  ------------------
  219|    309|      is_crease_edge_[i].resize(num_flags);
  220|    309|      RAnsBitDecoder decoder;
  221|    309|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 8, False: 301]
  ------------------
  222|      8|        return false;
  223|      8|      }
  224|   286k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 286k, False: 301]
  ------------------
  225|   286k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   286k|      }
  227|    301|      decoder.EndDecoding();
  228|    301|    }
  229|    643|  }
  230|    150|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    150|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    175|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    139|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    139|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    139|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    695|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 556, False: 139]
  ------------------
   93|    556|    pred_vals[i].resize(num_components, 0);
   94|    556|  }
   95|    139|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    139|                                         out_data);
   97|       |
   98|    139|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    139|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    139|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    139|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    139|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    139|  const int corner_map_size =
  109|    139|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  28.3k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 28.2k, False: 92]
  ------------------
  111|  28.2k|    const CornerIndex start_corner_id =
  112|  28.2k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  28.2k|    CornerIndex corner_id(start_corner_id);
  115|  28.2k|    int num_parallelograms = 0;
  116|  28.2k|    bool first_pass = true;
  117|   160k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 158k, False: 2.32k]
  ------------------
  118|   158k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 50.7k, False: 107k]
  ------------------
  119|   158k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   158k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  50.7k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  50.7k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 281, False: 50.5k]
  ------------------
  127|    281|          break;
  128|    281|        }
  129|  50.7k|      }
  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|   158k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 156k, False: 2.06k]
  ------------------
  134|   156k|        corner_id = table->SwingLeft(corner_id);
  135|   156k|      } else {
  136|  2.06k|        corner_id = table->SwingRight(corner_id);
  137|  2.06k|      }
  138|   158k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 25.6k, False: 132k]
  ------------------
  139|  25.6k|        break;
  140|  25.6k|      }
  141|   132k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 3.23k, False: 129k]
  |  Branch (141:47): [True: 2.33k, False: 899]
  ------------------
  142|  2.33k|        first_pass = false;
  143|  2.33k|        corner_id = table->SwingRight(start_corner_id);
  144|  2.33k|      }
  145|   132k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  28.2k|    int num_used_parallelograms = 0;
  150|  28.2k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 26.0k, False: 2.19k]
  ------------------
  151|  3.33M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 3.30M, False: 26.0k]
  ------------------
  152|  3.30M|        multi_pred_vals[i] = 0;
  153|  3.30M|      }
  154|       |      // Check which parallelograms are actually used.
  155|  76.7k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 50.7k, False: 26.0k]
  ------------------
  156|  50.7k|        const int context = num_parallelograms - 1;
  157|  50.7k|        const int pos = is_crease_edge_pos[context]++;
  158|  50.7k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 47, False: 50.7k]
  ------------------
  159|     47|          return false;
  160|     47|        }
  161|  50.7k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  50.7k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 3.71k, False: 46.9k]
  ------------------
  163|  3.71k|          ++num_used_parallelograms;
  164|   507k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 503k, False: 3.71k]
  ------------------
  165|   503k|            multi_pred_vals[j] =
  166|   503k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   503k|          }
  168|  3.71k|        }
  169|  50.7k|      }
  170|  26.0k|    }
  171|  28.2k|    const int dst_offset = p * num_components;
  172|  28.2k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 26.4k, False: 1.80k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  26.4k|      const int src_offset = (p - 1) * num_components;
  176|  26.4k|      this->transform().ComputeOriginalValue(
  177|  26.4k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  26.4k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   181k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 179k, False: 1.80k]
  ------------------
  181|   179k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   179k|      }
  183|  1.80k|      this->transform().ComputeOriginalValue(
  184|  1.80k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  1.80k|    }
  186|  28.2k|  }
  187|     92|  return true;
  188|    139|}

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

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   419k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  77.7k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   125k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   250k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.03k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.03k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  5.33M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.40k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.40k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  1.82M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    137|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    137|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     87|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     87|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    141|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    141|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    126|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    126|        mesh_data_(mesh_data) {}

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

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    174|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    174|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 32, False: 142]
  ------------------
  105|     32|      this->normal_prediction_mode_ = mode;
  106|     32|      return true;
  107|    142|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 142, False: 0]
  ------------------
  108|    142|      this->normal_prediction_mode_ = mode;
  109|    142|      return true;
  110|    142|    }
  111|      0|    return false;
  112|    174|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   419k|                             DataTypeT *prediction) override {
   42|   419k|    DRACO_DCHECK(this->IsInitialized());
   43|   419k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   419k|    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|   419k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   419k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   419k|    VectorD<int64_t, 3> normal;
   53|   419k|    CornerIndex c_next, c_prev;
   54|   967k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 547k, False: 419k]
  ------------------
   55|       |      // Getting corners.
   56|   547k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 186, False: 547k]
  ------------------
   57|    186|        c_next = corner_table->Next(corner_id);
   58|    186|        c_prev = corner_table->Previous(corner_id);
   59|   547k|      } else {
   60|   547k|        c_next = corner_table->Next(cit.Corner());
   61|   547k|        c_prev = corner_table->Previous(cit.Corner());
   62|   547k|      }
   63|   547k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   547k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   547k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   547k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   547k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   547k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   547k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   547k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   547k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   547k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   547k|      cit.Next();
   81|   547k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   419k|    constexpr int64_t upper_bound = 1 << 29;
   85|   419k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 136, False: 419k]
  ------------------
   86|    136|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    136|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 36, False: 100]
  ------------------
   88|     36|        const int64_t quotient = abs_sum / upper_bound;
   89|     36|        normal = normal / quotient;
   90|     36|      }
   91|   419k|    } else {
   92|   419k|      const int64_t abs_sum = normal.AbsSum();
   93|   419k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.64k, False: 417k]
  ------------------
   94|  1.64k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.64k|        normal = normal / quotient;
   96|  1.64k|      }
   97|   419k|    }
   98|   419k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   419k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   419k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   419k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   419k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    101|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    101|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 13, False: 88]
  ------------------
  105|     13|      this->normal_prediction_mode_ = mode;
  106|     13|      return true;
  107|     88|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 88, False: 0]
  ------------------
  108|     88|      this->normal_prediction_mode_ = mode;
  109|     88|      return true;
  110|     88|    }
  111|      0|    return false;
  112|    101|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  77.7k|                             DataTypeT *prediction) override {
   42|  77.7k|    DRACO_DCHECK(this->IsInitialized());
   43|  77.7k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  77.7k|    const CornerTable *const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|  77.7k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  77.7k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  77.7k|    VectorD<int64_t, 3> normal;
   53|  77.7k|    CornerIndex c_next, c_prev;
   54|   540k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 463k, False: 77.7k]
  ------------------
   55|       |      // Getting corners.
   56|   463k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 72, False: 463k]
  ------------------
   57|     72|        c_next = corner_table->Next(corner_id);
   58|     72|        c_prev = corner_table->Previous(corner_id);
   59|   463k|      } else {
   60|   463k|        c_next = corner_table->Next(cit.Corner());
   61|   463k|        c_prev = corner_table->Previous(cit.Corner());
   62|   463k|      }
   63|   463k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   463k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   463k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   463k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   463k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   463k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   463k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   463k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   463k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   463k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   463k|      cit.Next();
   81|   463k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  77.7k|    constexpr int64_t upper_bound = 1 << 29;
   85|  77.7k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 48, False: 77.6k]
  ------------------
   86|     48|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     48|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 16, False: 32]
  ------------------
   88|     16|        const int64_t quotient = abs_sum / upper_bound;
   89|     16|        normal = normal / quotient;
   90|     16|      }
   91|  77.6k|    } else {
   92|  77.6k|      const int64_t abs_sum = normal.AbsSum();
   93|  77.6k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 48.2k, False: 29.3k]
  ------------------
   94|  48.2k|        const int64_t quotient = abs_sum / upper_bound;
   95|  48.2k|        normal = normal / quotient;
   96|  48.2k|      }
   97|  77.6k|    }
   98|  77.7k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  77.7k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  77.7k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  77.7k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  77.7k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    182|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    182|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 40, False: 142]
  ------------------
  105|     40|      this->normal_prediction_mode_ = mode;
  106|     40|      return true;
  107|    142|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 142, False: 0]
  ------------------
  108|    142|      this->normal_prediction_mode_ = mode;
  109|    142|      return true;
  110|    142|    }
  111|      0|    return false;
  112|    182|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   125k|                             DataTypeT *prediction) override {
   42|   125k|    DRACO_DCHECK(this->IsInitialized());
   43|   125k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   125k|    const CornerTable *const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   125k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   125k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   125k|    VectorD<int64_t, 3> normal;
   53|   125k|    CornerIndex c_next, c_prev;
   54|   301k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 175k, False: 125k]
  ------------------
   55|       |      // Getting corners.
   56|   175k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 234, False: 175k]
  ------------------
   57|    234|        c_next = corner_table->Next(corner_id);
   58|    234|        c_prev = corner_table->Previous(corner_id);
   59|   175k|      } else {
   60|   175k|        c_next = corner_table->Next(cit.Corner());
   61|   175k|        c_prev = corner_table->Previous(cit.Corner());
   62|   175k|      }
   63|   175k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   175k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   175k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   175k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   175k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   175k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   175k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   175k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   175k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   175k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   175k|      cit.Next();
   81|   175k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   125k|    constexpr int64_t upper_bound = 1 << 29;
   85|   125k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 156, False: 125k]
  ------------------
   86|    156|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    156|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 42, False: 114]
  ------------------
   88|     42|        const int64_t quotient = abs_sum / upper_bound;
   89|     42|        normal = normal / quotient;
   90|     42|      }
   91|   125k|    } else {
   92|   125k|      const int64_t abs_sum = normal.AbsSum();
   93|   125k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.50k, False: 123k]
  ------------------
   94|  1.50k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.50k|        normal = normal / quotient;
   96|  1.50k|      }
   97|   125k|    }
   98|   125k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   125k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   125k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   125k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   125k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    152|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    152|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 25, False: 127]
  ------------------
  105|     25|      this->normal_prediction_mode_ = mode;
  106|     25|      return true;
  107|    127|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 127, False: 0]
  ------------------
  108|    127|      this->normal_prediction_mode_ = mode;
  109|    127|      return true;
  110|    127|    }
  111|      0|    return false;
  112|    152|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   250k|                             DataTypeT *prediction) override {
   42|   250k|    DRACO_DCHECK(this->IsInitialized());
   43|   250k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   250k|    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|   250k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   250k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   250k|    VectorD<int64_t, 3> normal;
   53|   250k|    CornerIndex c_next, c_prev;
   54|  1.74M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.49M, False: 250k]
  ------------------
   55|       |      // Getting corners.
   56|  1.49M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 138, False: 1.49M]
  ------------------
   57|    138|        c_next = corner_table->Next(corner_id);
   58|    138|        c_prev = corner_table->Previous(corner_id);
   59|  1.49M|      } else {
   60|  1.49M|        c_next = corner_table->Next(cit.Corner());
   61|  1.49M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.49M|      }
   63|  1.49M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.49M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.49M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.49M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.49M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.49M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.49M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.49M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.49M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.49M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.49M|      cit.Next();
   81|  1.49M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   250k|    constexpr int64_t upper_bound = 1 << 29;
   85|   250k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 92, False: 250k]
  ------------------
   86|     92|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     92|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 35, False: 57]
  ------------------
   88|     35|        const int64_t quotient = abs_sum / upper_bound;
   89|     35|        normal = normal / quotient;
   90|     35|      }
   91|   250k|    } else {
   92|   250k|      const int64_t abs_sum = normal.AbsSum();
   93|   250k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 150k, False: 99.9k]
  ------------------
   94|   150k|        const int64_t quotient = abs_sum / upper_bound;
   95|   150k|        normal = normal / quotient;
   96|   150k|      }
   97|   250k|    }
   98|   250k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   250k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   250k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   250k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   250k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    122|      : Base(md) {
   35|    122|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    122|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    167|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    167|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 42, False: 125]
  ------------------
  105|     42|      this->normal_prediction_mode_ = mode;
  106|     42|      return true;
  107|    125|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 125, False: 0]
  ------------------
  108|    125|      this->normal_prediction_mode_ = mode;
  109|    125|      return true;
  110|    125|    }
  111|      0|    return false;
  112|    167|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  90.9k|                             DataTypeT *prediction) override {
   42|  90.9k|    DRACO_DCHECK(this->IsInitialized());
   43|  90.9k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  90.9k|    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|  90.9k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  90.9k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  90.9k|    VectorD<int64_t, 3> normal;
   53|  90.9k|    CornerIndex c_next, c_prev;
   54|   397k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 306k, False: 90.9k]
  ------------------
   55|       |      // Getting corners.
   56|   306k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 167k, False: 138k]
  ------------------
   57|   167k|        c_next = corner_table->Next(corner_id);
   58|   167k|        c_prev = corner_table->Previous(corner_id);
   59|   167k|      } else {
   60|   138k|        c_next = corner_table->Next(cit.Corner());
   61|   138k|        c_prev = corner_table->Previous(cit.Corner());
   62|   138k|      }
   63|   306k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   306k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   306k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   306k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   306k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   306k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   306k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   306k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   306k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   306k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   306k|      cit.Next();
   81|   306k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  90.9k|    constexpr int64_t upper_bound = 1 << 29;
   85|  90.9k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 28.3k, False: 62.5k]
  ------------------
   86|  28.3k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  28.3k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 84, False: 28.3k]
  ------------------
   88|     84|        const int64_t quotient = abs_sum / upper_bound;
   89|     84|        normal = normal / quotient;
   90|     84|      }
   91|  62.5k|    } else {
   92|  62.5k|      const int64_t abs_sum = normal.AbsSum();
   93|  62.5k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.19k, False: 61.3k]
  ------------------
   94|  1.19k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.19k|        normal = normal / quotient;
   96|  1.19k|      }
   97|  62.5k|    }
   98|  90.9k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  90.9k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  90.9k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  90.9k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  90.9k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    463|      : Base(md) {
   35|    463|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    463|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    548|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    548|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 84, False: 464]
  ------------------
  105|     84|      this->normal_prediction_mode_ = mode;
  106|     84|      return true;
  107|    464|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 464, False: 0]
  ------------------
  108|    464|      this->normal_prediction_mode_ = mode;
  109|    464|      return true;
  110|    464|    }
  111|      0|    return false;
  112|    548|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   187k|                             DataTypeT *prediction) override {
   42|   187k|    DRACO_DCHECK(this->IsInitialized());
   43|   187k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   187k|    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|   187k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   187k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   187k|    VectorD<int64_t, 3> normal;
   53|   187k|    CornerIndex c_next, c_prev;
   54|  1.24M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.05M, False: 187k]
  ------------------
   55|       |      // Getting corners.
   56|  1.05M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 334k, False: 722k]
  ------------------
   57|   334k|        c_next = corner_table->Next(corner_id);
   58|   334k|        c_prev = corner_table->Previous(corner_id);
   59|   722k|      } else {
   60|   722k|        c_next = corner_table->Next(cit.Corner());
   61|   722k|        c_prev = corner_table->Previous(cit.Corner());
   62|   722k|      }
   63|  1.05M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.05M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.05M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.05M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.05M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.05M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.05M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.05M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.05M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.05M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.05M|      cit.Next();
   81|  1.05M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   187k|    constexpr int64_t upper_bound = 1 << 29;
   85|   187k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 57.1k, False: 130k]
  ------------------
   86|  57.1k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  57.1k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 232, False: 56.9k]
  ------------------
   88|    232|        const int64_t quotient = abs_sum / upper_bound;
   89|    232|        normal = normal / quotient;
   90|    232|      }
   91|   130k|    } else {
   92|   130k|      const int64_t abs_sum = normal.AbsSum();
   93|   130k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 12.7k, False: 117k]
  ------------------
   94|  12.7k|        const int64_t quotient = abs_sum / upper_bound;
   95|  12.7k|        normal = normal / quotient;
   96|  12.7k|      }
   97|   130k|    }
   98|   187k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   187k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   187k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   187k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   187k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    137|      : Base(md) {
   35|    137|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    137|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     87|      : Base(md) {
   35|     87|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     87|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    141|      : Base(md) {
   35|    141|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    141|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    126|      : Base(md) {
   35|    126|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    126|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.51M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.51M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.51M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.51M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.51M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.51M|    return GetPositionForDataId(data_id);
   77|  1.51M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.51M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.51M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.51M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.51M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.51M|    VectorD<int64_t, 3> pos;
   68|  1.51M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.51M|    return pos;
   70|  1.51M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    137|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    137|    pos_attribute_ = &position_attribute;
   43|    137|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    124|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    124|    entry_to_point_id_map_ = map;
   46|    124|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.00M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.00M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.00M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.00M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.00M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.00M|    return GetPositionForDataId(data_id);
   77|  1.00M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.00M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.00M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.00M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.00M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.00M|    VectorD<int64_t, 3> pos;
   68|  1.00M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.00M|    return pos;
   70|  1.00M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     87|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     87|    pos_attribute_ = &position_attribute;
   43|     87|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     81|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     81|    entry_to_point_id_map_ = map;
   46|     81|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   476k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   476k|    DRACO_DCHECK(this->IsInitialized());
   73|   476k|    const auto corner_table = mesh_data_.corner_table();
   74|   476k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   476k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   476k|    return GetPositionForDataId(data_id);
   77|   476k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|   476k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   476k|    DRACO_DCHECK(this->IsInitialized());
   65|   476k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   476k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   476k|    VectorD<int64_t, 3> pos;
   68|   476k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   476k|    return pos;
   70|   476k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    138|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    138|    pos_attribute_ = &position_attribute;
   43|    138|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    114|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    114|    entry_to_point_id_map_ = map;
   46|    114|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.23M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.23M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.23M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.23M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.23M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.23M|    return GetPositionForDataId(data_id);
   77|  3.23M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.23M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.23M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.23M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.23M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.23M|    VectorD<int64_t, 3> pos;
   68|  3.23M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.23M|    return pos;
   70|  3.23M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    126|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    126|    pos_attribute_ = &position_attribute;
   43|    126|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    121|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    121|    entry_to_point_id_map_ = map;
   46|    121|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    122|      : pos_attribute_(nullptr),
   36|    122|        entry_to_point_id_map_(nullptr),
   37|    122|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    122|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   703k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   703k|    DRACO_DCHECK(this->IsInitialized());
   73|   703k|    const auto corner_table = mesh_data_.corner_table();
   74|   703k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   703k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   703k|    return GetPositionForDataId(data_id);
   77|   703k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|   703k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   703k|    DRACO_DCHECK(this->IsInitialized());
   65|   703k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   703k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   703k|    VectorD<int64_t, 3> pos;
   68|   703k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   703k|    return pos;
   70|   703k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    121|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    121|    pos_attribute_ = &position_attribute;
   43|    121|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     98|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     98|    entry_to_point_id_map_ = map;
   46|     98|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    463|      : pos_attribute_(nullptr),
   36|    463|        entry_to_point_id_map_(nullptr),
   37|    463|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    463|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.30M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.30M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.30M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.30M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.30M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.30M|    return GetPositionForDataId(data_id);
   77|  2.30M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.30M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.30M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.30M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.30M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.30M|    VectorD<int64_t, 3> pos;
   68|  2.30M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.30M|    return pos;
   70|  2.30M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    463|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    463|    pos_attribute_ = &position_attribute;
   43|    463|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    422|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    422|    entry_to_point_id_map_ = map;
   46|    422|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    137|      : pos_attribute_(nullptr),
   36|    137|        entry_to_point_id_map_(nullptr),
   37|    137|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    137|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|     87|      : pos_attribute_(nullptr),
   36|     87|        entry_to_point_id_map_(nullptr),
   37|     87|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|     87|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    141|      : pos_attribute_(nullptr),
   36|    141|        entry_to_point_id_map_(nullptr),
   37|    141|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    141|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    126|      : pos_attribute_(nullptr),
   36|    126|        entry_to_point_id_map_(nullptr),
   37|    126|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    126|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    139|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    139|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    126|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    126|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    126|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    126|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    126|      new DataTypeT[num_components]());
   70|       |
   71|    126|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    126|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    126|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    126|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    126|  const int corner_map_size =
   78|    126|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  10.6k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 10.5k, False: 126]
  ------------------
   80|  10.5k|    const CornerIndex start_corner_id =
   81|  10.5k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  10.5k|    CornerIndex corner_id(start_corner_id);
   84|  10.5k|    int num_parallelograms = 0;
   85|   724k|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 714k, False: 10.5k]
  ------------------
   86|   714k|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|   714k|    }
   88|  53.2k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 42.7k, False: 10.5k]
  ------------------
   89|  42.7k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 13.2k, False: 29.5k]
  ------------------
   90|  42.7k|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  42.7k|              num_components, parallelogram_pred_vals.get())) {
   92|  1.37M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 1.35M, False: 13.2k]
  ------------------
   93|  1.35M|          pred_vals[c] =
   94|  1.35M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  1.35M|        }
   96|  13.2k|        ++num_parallelograms;
   97|  13.2k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  42.7k|      corner_id = table->SwingRight(corner_id);
  101|  42.7k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 6.52k, False: 36.2k]
  ------------------
  102|  6.52k|        corner_id = kInvalidCornerIndex;
  103|  6.52k|      }
  104|  42.7k|    }
  105|       |
  106|  10.5k|    const int dst_offset = p * num_components;
  107|  10.5k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 3.30k, False: 7.21k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  3.30k|      const int src_offset = (p - 1) * num_components;
  111|  3.30k|      this->transform().ComputeOriginalValue(
  112|  3.30k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  7.21k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|   703k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 696k, False: 7.21k]
  ------------------
  116|   696k|        pred_vals[c] /= num_parallelograms;
  117|   696k|      }
  118|  7.21k|      this->transform().ComputeOriginalValue(
  119|  7.21k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  7.21k|    }
  121|  10.5k|  }
  122|    126|  return true;
  123|    126|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    196|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    196|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    189|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    189|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    189|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    189|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    189|      new DataTypeT[num_components]());
   70|       |
   71|    189|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    189|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    189|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    189|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    189|  const int corner_map_size =
   78|    189|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   341k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 340k, False: 189]
  ------------------
   80|   340k|    const CornerIndex start_corner_id =
   81|   340k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   340k|    CornerIndex corner_id(start_corner_id);
   84|   340k|    int num_parallelograms = 0;
   85|  1.54M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 1.20M, False: 340k]
  ------------------
   86|  1.20M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  1.20M|    }
   88|  2.36M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 2.02M, False: 340k]
  ------------------
   89|  2.02M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 660k, False: 1.36M]
  ------------------
   90|  2.02M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  2.02M|              num_components, parallelogram_pred_vals.get())) {
   92|  2.99M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 2.33M, False: 660k]
  ------------------
   93|  2.33M|          pred_vals[c] =
   94|  2.33M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  2.33M|        }
   96|   660k|        ++num_parallelograms;
   97|   660k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  2.02M|      corner_id = table->SwingRight(corner_id);
  101|  2.02M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 336k, False: 1.68M]
  ------------------
  102|   336k|        corner_id = kInvalidCornerIndex;
  103|   336k|      }
  104|  2.02M|    }
  105|       |
  106|   340k|    const int dst_offset = p * num_components;
  107|   340k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 594, False: 340k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|    594|      const int src_offset = (p - 1) * num_components;
  111|    594|      this->transform().ComputeOriginalValue(
  112|    594|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   340k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  1.54M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 1.20M, False: 340k]
  ------------------
  116|  1.20M|        pred_vals[c] /= num_parallelograms;
  117|  1.20M|      }
  118|   340k|      this->transform().ComputeOriginalValue(
  119|   340k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   340k|    }
  121|   340k|  }
  122|    189|  return true;
  123|    189|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  1.08M|    int num_components, DataTypeT *out_prediction) {
   49|  1.08M|  const CornerIndex oci = table->Opposite(ci);
   50|  1.08M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 775k, False: 310k]
  ------------------
   51|   775k|    return false;
   52|   775k|  }
   53|   310k|  int vert_opp, vert_next, vert_prev;
   54|   310k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   310k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   310k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 193k, False: 117k]
  |  Branch (56:35): [True: 165k, False: 27.5k]
  ------------------
   57|   165k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 160k, False: 5.44k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   160k|    const int v_opp_off = vert_opp * num_components;
   60|   160k|    const int v_next_off = vert_next * num_components;
   61|   160k|    const int v_prev_off = vert_prev * num_components;
   62|  6.54M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 6.38M, False: 160k]
  ------------------
   63|  6.38M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  6.38M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  6.38M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  6.38M|      const int64_t result =
   67|  6.38M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  6.38M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  6.38M|    }
   71|   160k|    return true;
   72|   160k|  }
   73|   150k|  return false;  // Not all data is available for prediction
   74|   310k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   310k|    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|   310k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   310k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   310k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   310k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  2.38M|    int num_components, DataTypeT *out_prediction) {
   49|  2.38M|  const CornerIndex oci = table->Opposite(ci);
   50|  2.38M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 7.33k, False: 2.37M]
  ------------------
   51|  7.33k|    return false;
   52|  7.33k|  }
   53|  2.37M|  int vert_opp, vert_next, vert_prev;
   54|  2.37M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  2.37M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  2.37M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 1.27M, False: 1.10M]
  |  Branch (56:35): [True: 964k, False: 308k]
  ------------------
   57|   964k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 897k, False: 67.3k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   897k|    const int v_opp_off = vert_opp * num_components;
   60|   897k|    const int v_next_off = vert_next * num_components;
   61|   897k|    const int v_prev_off = vert_prev * num_components;
   62|  14.4M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 13.5M, False: 897k]
  ------------------
   63|  13.5M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  13.5M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  13.5M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  13.5M|      const int64_t result =
   67|  13.5M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  13.5M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  13.5M|    }
   71|   897k|    return true;
   72|   897k|  }
   73|  1.47M|  return false;  // Not all data is available for prediction
   74|  2.37M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  2.37M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  2.37M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  2.37M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  2.37M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  2.37M|}

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

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

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

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     28|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    243|  bool AreCorrectionsPositive() override {
   71|    243|    return transform_.AreCorrectionsPositive();
   72|    243|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     19|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     19|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 4, False: 15]
  ------------------
   50|      4|      return false;
   51|      4|    }
   52|     15|    return true;
   53|     19|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   498k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     51|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    309|  bool AreCorrectionsPositive() override {
   71|    309|    return transform_.AreCorrectionsPositive();
   72|    309|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     45|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     45|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 12, False: 33]
  ------------------
   50|     12|      return false;
   51|     12|    }
   52|     33|    return true;
   53|     45|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|   732k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  2.58k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  1.56k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  2.47k|  bool AreCorrectionsPositive() override {
   71|  2.47k|    return transform_.AreCorrectionsPositive();
   72|  2.47k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  1.80k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  1.80k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 92, False: 1.71k]
  ------------------
   50|     92|      return false;
   51|     92|    }
   52|  1.71k|    return true;
   53|  1.80k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  3.39M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    252|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    318|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    252|                                 const PointCloudDecoder *decoder) {
  188|    252|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    252|      method, att_id, decoder, TransformT());
  190|    252|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    252|                                 const TransformT &transform) {
  156|    252|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 252]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    252|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    252|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 251, False: 1]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|    251|    const MeshDecoder *const mesh_decoder =
  167|    251|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    251|    auto ret = CreateMeshPredictionScheme<
  170|    251|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    251|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    251|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    251|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 224, False: 27]
  ------------------
  174|    224|      return ret;
  175|    224|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    251|  }
  178|       |  // Create delta decoder.
  179|     28|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     28|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    252|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    139|      uint16_t bitstream_version) {
  143|    139|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    139|        method, attribute, transform, mesh_data, bitstream_version);
  145|    139|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    139|        uint16_t bitstream_version) {
  127|    139|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 137, False: 2]
  ------------------
  128|    137|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    137|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    137|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    137|                                                  mesh_data));
  132|    137|      }
  133|      2|      return nullptr;
  134|    139|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|     90|      uint16_t bitstream_version) {
  143|     90|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|     90|        method, attribute, transform, mesh_data, bitstream_version);
  145|     90|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|     90|        uint16_t bitstream_version) {
  127|     90|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 87, False: 3]
  ------------------
  128|     87|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|     87|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|     87|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|     87|                                                  mesh_data));
  132|     87|      }
  133|      3|      return nullptr;
  134|     90|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    318|                                 const PointCloudDecoder *decoder) {
  188|    318|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    318|      method, att_id, decoder, TransformT());
  190|    318|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    318|                                 const TransformT &transform) {
  156|    318|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 318]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    318|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    318|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 318, 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|    318|    const MeshDecoder *const mesh_decoder =
  167|    318|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    318|    auto ret = CreateMeshPredictionScheme<
  170|    318|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    318|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    318|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    318|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 267, False: 51]
  ------------------
  174|    267|      return ret;
  175|    267|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    318|  }
  178|       |  // Create delta decoder.
  179|     51|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     51|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    318|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    144|      uint16_t bitstream_version) {
  143|    144|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    144|        method, attribute, transform, mesh_data, bitstream_version);
  145|    144|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    144|        uint16_t bitstream_version) {
  111|    144|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 141, False: 3]
  ------------------
  112|    141|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    141|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    141|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    141|                                                  mesh_data));
  116|    141|      }
  117|      3|      return nullptr;
  118|    144|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    132|      uint16_t bitstream_version) {
  143|    132|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    132|        method, attribute, transform, mesh_data, bitstream_version);
  145|    132|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    132|        uint16_t bitstream_version) {
  111|    132|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 126, False: 6]
  ------------------
  112|    126|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    126|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    126|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    126|                                                  mesh_data));
  116|    126|      }
  117|      6|      return nullptr;
  118|    132|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  2.58k|                                 const PointCloudDecoder *decoder) {
  188|  2.58k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  2.58k|      method, att_id, decoder, TransformT());
  190|  2.58k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  2.58k|                                 const TransformT &transform) {
  156|  2.58k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 2.58k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  2.58k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  2.58k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 2.57k, False: 5]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|  2.57k|    const MeshDecoder *const mesh_decoder =
  167|  2.57k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  2.57k|    auto ret = CreateMeshPredictionScheme<
  170|  2.57k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  2.57k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  2.57k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  2.57k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 2.43k, False: 141]
  ------------------
  174|  2.43k|      return ret;
  175|  2.43k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  2.57k|  }
  178|       |  // Create delta decoder.
  179|    146|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    146|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  2.58k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.03k|      uint16_t bitstream_version) {
  143|  1.03k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.03k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.03k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.03k|        uint16_t bitstream_version) {
   53|  1.03k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 358, False: 679]
  ------------------
   54|    358|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    358|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    358|                                                         MeshDataT>(
   57|    358|                attribute, transform, mesh_data));
   58|    358|      }
   59|    679|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|    679|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 139, False: 540]
  ------------------
   61|    139|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    139|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    139|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    139|                                                  mesh_data));
   65|    139|      }
   66|    540|#endif
   67|    540|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 195, False: 345]
  ------------------
   68|    195|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    195|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    195|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    195|                                                  mesh_data));
   72|    195|      }
   73|    345|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    345|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 101, False: 244]
  ------------------
   75|    101|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    101|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    101|                                                     MeshDataT>(
   78|    101|                attribute, transform, mesh_data, bitstream_version));
   79|    101|      }
   80|    244|#endif
   81|    244|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 122, False: 122]
  ------------------
   82|    122|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    122|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    122|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    122|                                                  mesh_data));
   86|    122|      }
   87|    122|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    122|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 122, False: 0]
  ------------------
   89|    122|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    122|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    122|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    122|                                                  mesh_data));
   93|    122|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.03k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.40k|      uint16_t bitstream_version) {
  143|  1.40k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.40k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.40k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.40k|        uint16_t bitstream_version) {
   53|  1.40k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 348, False: 1.05k]
  ------------------
   54|    348|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    348|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    348|                                                         MeshDataT>(
   57|    348|                attribute, transform, mesh_data));
   58|    348|      }
   59|  1.05k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.05k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 196, False: 857]
  ------------------
   61|    196|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    196|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    196|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    196|                                                  mesh_data));
   65|    196|      }
   66|    857|#endif
   67|    857|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 183, False: 674]
  ------------------
   68|    183|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    183|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    183|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    183|                                                  mesh_data));
   72|    183|      }
   73|    674|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    674|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 91, False: 583]
  ------------------
   75|     91|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|     91|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|     91|                                                     MeshDataT>(
   78|     91|                attribute, transform, mesh_data, bitstream_version));
   79|     91|      }
   80|    583|#endif
   81|    583|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 120, False: 463]
  ------------------
   82|    120|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    120|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    120|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    120|                                                  mesh_data));
   86|    120|      }
   87|    463|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    463|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 463, False: 0]
  ------------------
   89|    463|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    463|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    463|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    463|                                                  mesh_data));
   93|    463|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.40k|    }

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    251|    uint16_t bitstream_version) {
   38|    251|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    251|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 251, False: 0]
  ------------------
   40|    251|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 7, False: 244]
  ------------------
   41|    244|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 2, False: 242]
  ------------------
   42|    242|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 242]
  ------------------
   43|    242|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 2, False: 240]
  ------------------
   44|    240|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 224, False: 16]
  ------------------
   45|    236|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 1, False: 15]
  ------------------
   46|    236|    const CornerTable *const ct = source->GetCornerTable();
   47|    236|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    236|        source->GetAttributeEncodingData(att_id);
   49|    236|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 7, False: 229]
  |  Branch (49:26): [True: 0, False: 229]
  ------------------
   50|       |      // No connectivity data found.
   51|      7|      return nullptr;
   52|      7|    }
   53|       |    // Connectivity data exists.
   54|    229|    const MeshAttributeCornerTable *const att_ct =
   55|    229|        source->GetAttributeCornerTable(att_id);
   56|    229|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 139, False: 90]
  ------------------
   57|    139|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    139|      MeshData md;
   59|    139|      md.Set(source->mesh(), att_ct,
   60|    139|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    139|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    139|      MeshPredictionSchemeFactoryT factory;
   63|    139|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    139|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 137, False: 2]
  ------------------
   65|    137|        return ret;
   66|    137|      }
   67|    139|    } else {
   68|     90|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     90|      MeshData md;
   70|     90|      md.Set(source->mesh(), ct,
   71|     90|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     90|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     90|      MeshPredictionSchemeFactoryT factory;
   74|     90|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     90|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 87, False: 3]
  ------------------
   76|     87|        return ret;
   77|     87|      }
   78|     90|    }
   79|    229|  }
   80|     20|  return nullptr;
   81|    251|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    318|    uint16_t bitstream_version) {
   38|    318|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    318|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 318, False: 0]
  ------------------
   40|    318|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 9, False: 309]
  ------------------
   41|    309|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 10, False: 299]
  ------------------
   42|    299|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 11, False: 288]
  ------------------
   43|    288|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 288]
  ------------------
   44|    288|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 267, False: 21]
  ------------------
   45|    298|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 1, False: 20]
  ------------------
   46|    298|    const CornerTable *const ct = source->GetCornerTable();
   47|    298|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    298|        source->GetAttributeEncodingData(att_id);
   49|    298|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 22, False: 276]
  |  Branch (49:26): [True: 0, False: 276]
  ------------------
   50|       |      // No connectivity data found.
   51|     22|      return nullptr;
   52|     22|    }
   53|       |    // Connectivity data exists.
   54|    276|    const MeshAttributeCornerTable *const att_ct =
   55|    276|        source->GetAttributeCornerTable(att_id);
   56|    276|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 144, False: 132]
  ------------------
   57|    144|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    144|      MeshData md;
   59|    144|      md.Set(source->mesh(), att_ct,
   60|    144|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    144|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    144|      MeshPredictionSchemeFactoryT factory;
   63|    144|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    144|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 141, False: 3]
  ------------------
   65|    141|        return ret;
   66|    141|      }
   67|    144|    } else {
   68|    132|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    132|      MeshData md;
   70|    132|      md.Set(source->mesh(), ct,
   71|    132|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    132|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    132|      MeshPredictionSchemeFactoryT factory;
   74|    132|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    132|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 126, False: 6]
  ------------------
   76|    126|        return ret;
   77|    126|      }
   78|    132|    }
   79|    276|  }
   80|     29|  return nullptr;
   81|    318|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  2.57k|    uint16_t bitstream_version) {
   38|  2.57k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  2.57k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 2.57k, False: 0]
  ------------------
   40|  2.57k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 718, False: 1.86k]
  ------------------
   41|  1.86k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 338, False: 1.52k]
  ------------------
   42|  1.52k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 388, False: 1.13k]
  ------------------
   43|  1.13k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 242, False: 893]
  ------------------
   44|    893|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 585, False: 308]
  ------------------
   45|  2.46k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 195, False: 113]
  ------------------
   46|  2.46k|    const CornerTable *const ct = source->GetCornerTable();
   47|  2.46k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  2.46k|        source->GetAttributeEncodingData(att_id);
   49|  2.46k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 28, False: 2.43k]
  |  Branch (49:26): [True: 0, False: 2.43k]
  ------------------
   50|       |      // No connectivity data found.
   51|     28|      return nullptr;
   52|     28|    }
   53|       |    // Connectivity data exists.
   54|  2.43k|    const MeshAttributeCornerTable *const att_ct =
   55|  2.43k|        source->GetAttributeCornerTable(att_id);
   56|  2.43k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.03k, False: 1.40k]
  ------------------
   57|  1.03k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.03k|      MeshData md;
   59|  1.03k|      md.Set(source->mesh(), att_ct,
   60|  1.03k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.03k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.03k|      MeshPredictionSchemeFactoryT factory;
   63|  1.03k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.03k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.03k, False: 0]
  ------------------
   65|  1.03k|        return ret;
   66|  1.03k|      }
   67|  1.40k|    } else {
   68|  1.40k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  1.40k|      MeshData md;
   70|  1.40k|      md.Set(source->mesh(), ct,
   71|  1.40k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  1.40k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  1.40k|      MeshPredictionSchemeFactoryT factory;
   74|  1.40k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  1.40k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 1.40k, False: 0]
  ------------------
   76|  1.40k|        return ret;
   77|  1.40k|      }
   78|  1.40k|    }
   79|  2.43k|  }
   80|    113|  return nullptr;
   81|  2.57k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|   732k|  bool IsInBottomLeft(const Point2 &p) const {
   93|   732k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 576k, False: 155k]
  |  Branch (93:22): [True: 223k, False: 352k]
  ------------------
   94|   223k|      return true;
   95|   223k|    }
   96|   508k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 75.4k, False: 432k]
  |  Branch (96:25): [True: 37.6k, False: 37.8k]
  ------------------
   97|   732k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|   732k|  int32_t GetRotationCount(Point2 pred) const {
   51|   732k|    const DataType sign_x = pred[0];
   52|   732k|    const DataType sign_y = pred[1];
   53|       |
   54|   732k|    int32_t rotation_count = 0;
   55|   732k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 576k, False: 155k]
  ------------------
   56|   576k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 223k, False: 352k]
  ------------------
   57|   223k|        rotation_count = 0;
   58|   352k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 349k, False: 3.31k]
  ------------------
   59|   349k|        rotation_count = 3;
   60|   349k|      } else {
   61|  3.31k|        rotation_count = 1;
   62|  3.31k|      }
   63|   576k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 80.4k, False: 75.4k]
  ------------------
   64|  80.4k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 42.0k, False: 38.3k]
  ------------------
   65|  42.0k|        rotation_count = 2;
   66|  42.0k|      } else {
   67|  38.3k|        rotation_count = 1;
   68|  38.3k|      }
   69|  80.4k|    } else {
   70|  75.4k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 37.6k, False: 37.8k]
  ------------------
   71|  37.6k|        rotation_count = 0;
   72|  37.8k|      } else {
   73|  37.8k|        rotation_count = 3;
   74|  37.8k|      }
   75|  75.4k|    }
   76|   732k|    return rotation_count;
   77|   732k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   941k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   941k|    switch (rotation_count) {
   81|   428k|      case 1:
  ------------------
  |  Branch (81:7): [True: 428k, False: 512k]
  ------------------
   82|   428k|        return Point2(p[1], -p[0]);
   83|  84.1k|      case 2:
  ------------------
  |  Branch (83:7): [True: 84.1k, False: 857k]
  ------------------
   84|  84.1k|        return Point2(-p[0], -p[1]);
   85|   428k|      case 3:
  ------------------
  |  Branch (85:7): [True: 428k, False: 512k]
  ------------------
   86|   428k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 941k]
  ------------------
   88|      0|        return p;
   89|   941k|    }
   90|   941k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    318|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

_ZN5draco37PredictionSchemeWrapDecodingTransformIiiE19DecodeTransformDataEPNS_13DecoderBufferE:
   66|  2.39k|  bool DecodeTransformData(DecoderBuffer *buffer) {
   67|  2.39k|    DataTypeT min_value, max_value;
   68|  2.39k|    if (!buffer->Decode(&min_value)) {
  ------------------
  |  Branch (68:9): [True: 21, False: 2.36k]
  ------------------
   69|     21|      return false;
   70|     21|    }
   71|  2.36k|    if (!buffer->Decode(&max_value)) {
  ------------------
  |  Branch (71:9): [True: 14, False: 2.35k]
  ------------------
   72|     14|      return false;
   73|     14|    }
   74|  2.35k|    if (min_value > max_value) {
  ------------------
  |  Branch (74:9): [True: 83, False: 2.27k]
  ------------------
   75|     83|      return false;
   76|     83|    }
   77|  2.27k|    this->set_min_value(min_value);
   78|  2.27k|    this->set_max_value(max_value);
   79|  2.27k|    if (!this->InitCorrectionBounds()) {
  ------------------
  |  Branch (79:9): [True: 4, False: 2.26k]
  ------------------
   80|      4|      return false;
   81|      4|    }
   82|  2.26k|    return true;
   83|  2.27k|  }
_ZNK5draco37PredictionSchemeWrapDecodingTransformIiiE20ComputeOriginalValueEPKiS3_Pi:
   38|  3.38M|                                   DataTypeT *out_original_vals) const {
   39|       |    // For now we assume both |DataTypeT| and |CorrTypeT| are equal.
   40|  3.38M|    static_assert(std::is_same<DataTypeT, CorrTypeT>::value,
   41|  3.38M|                  "Predictions and corrections must have the same type.");
   42|       |
   43|       |    // The only valid implementation right now is for int32_t.
   44|  3.38M|    static_assert(std::is_same<DataTypeT, int32_t>::value,
   45|  3.38M|                  "Only int32_t is supported for predicted values.");
   46|       |
   47|  3.38M|    predicted_vals = this->ClampPredictedValue(predicted_vals);
   48|       |
   49|       |    // Perform the wrapping using unsigned coordinates to avoid potential signed
   50|       |    // integer overflows caused by malformed input.
   51|  3.38M|    const uint32_t *const uint_predicted_vals =
   52|  3.38M|        reinterpret_cast<const uint32_t *>(predicted_vals);
   53|  3.38M|    const uint32_t *const uint_corr_vals =
   54|  3.38M|        reinterpret_cast<const uint32_t *>(corr_vals);
   55|  49.8M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (55:21): [True: 46.4M, False: 3.38M]
  ------------------
   56|  46.4M|      out_original_vals[i] =
   57|  46.4M|          static_cast<DataTypeT>(uint_predicted_vals[i] + uint_corr_vals[i]);
   58|  46.4M|      if (out_original_vals[i] > this->max_value()) {
  ------------------
  |  Branch (58:11): [True: 46.9k, False: 46.4M]
  ------------------
   59|  46.9k|        out_original_vals[i] -= this->max_dif();
   60|  46.4M|      } else if (out_original_vals[i] < this->min_value()) {
  ------------------
  |  Branch (60:18): [True: 311k, False: 46.1M]
  ------------------
   61|   311k|        out_original_vals[i] += this->max_dif();
   62|   311k|      }
   63|  46.4M|    }
   64|  3.38M|  }
_ZN5draco37PredictionSchemeWrapDecodingTransformIiiEC2Ev:
   32|  2.58k|  PredictionSchemeWrapDecodingTransform() {}

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  2.47k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  2.27k|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  2.27k|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  2.27k|  bool InitCorrectionBounds() {
   84|  2.27k|    const int64_t dif =
   85|  2.27k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  2.27k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 2.27k]
  |  Branch (86:20): [True: 4, False: 2.26k]
  ------------------
   87|      4|      return false;
   88|      4|    }
   89|  2.26k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  2.26k|    max_correction_ = max_dif_ / 2;
   91|  2.26k|    min_correction_ = -max_correction_;
   92|  2.26k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 1.03k, False: 1.23k]
  ------------------
   93|  1.03k|      max_correction_ -= 1;
   94|  1.03k|    }
   95|  2.26k|    return true;
   96|  2.27k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  1.70k|  void Init(int num_components) {
   56|  1.70k|    num_components_ = num_components;
   57|  1.70k|    clamped_value_.resize(num_components);
   58|  1.70k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  3.38M|      const DataTypeT *predicted_val) const {
   64|  49.8M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 46.4M, False: 3.38M]
  ------------------
   65|  46.4M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 140k, False: 46.3M]
  ------------------
   66|   140k|        clamped_value_[i] = max_value_;
   67|  46.3M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 647k, False: 45.7M]
  ------------------
   68|   647k|        clamped_value_[i] = min_value_;
   69|  45.7M|      } else {
   70|  45.7M|        clamped_value_[i] = predicted_val[i];
   71|  45.7M|      }
   72|  46.4M|    }
   73|  3.38M|    return clamped_value_.data();
   74|  3.38M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|  99.7M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|  46.4M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|   358k|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|  46.4M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    520|  int quantization_bits() const {
   78|    520|    DRACO_DCHECK(false);
   79|    520|    return -1;
   80|    520|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  2.58k|      : num_components_(0),
   45|  2.58k|        min_value_(0),
   46|  2.58k|        max_value_(0),
   47|  2.58k|        max_dif_(0),
   48|  2.58k|        max_correction_(0),
   49|  2.58k|        min_correction_(0) {}

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

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

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  9.19k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  3.77k|    DecoderBuffer *buffer) {
   30|  3.77k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 72, False: 3.70k]
  ------------------
   31|     72|    return false;
   32|     72|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  3.70k|  const int32_t num_attributes = GetNumAttributes();
   35|  3.70k|  sequential_decoders_.resize(num_attributes);
   36|  14.6k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 10.9k, False: 3.69k]
  ------------------
   37|  10.9k|    uint8_t decoder_type;
   38|  10.9k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 5, False: 10.9k]
  ------------------
   39|      5|      return false;
   40|      5|    }
   41|       |    // Create the decoder from the id.
   42|  10.9k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  10.9k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 8, False: 10.9k]
  ------------------
   44|      8|      return false;
   45|      8|    }
   46|  10.9k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 2, False: 10.9k]
  ------------------
   47|      2|      return false;
   48|      2|    }
   49|  10.9k|  }
   50|  3.69k|  return true;
   51|  3.70k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  2.06k|    DecoderBuffer *buffer) {
   55|  2.06k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 2.06k]
  |  Branch (55:22): [True: 0, False: 2.06k]
  ------------------
   56|      0|    return false;
   57|      0|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  2.06k|  const int32_t num_attributes = GetNumAttributes();
   60|  10.9k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 8.93k, False: 2.06k]
  ------------------
   61|  8.93k|    PointAttribute *const pa =
   62|  8.93k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  8.93k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 0, False: 8.93k]
  ------------------
   64|      0|      return false;
   65|      0|    }
   66|  8.93k|  }
   67|  2.06k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  2.06k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  2.06k|    DecoderBuffer *in_buffer) {
   72|  2.06k|  const int32_t num_attributes = GetNumAttributes();
   73|  7.07k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 6.11k, False: 961]
  ------------------
   74|  6.11k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 1.10k, False: 5.01k]
  ------------------
   75|  6.11k|                                                          in_buffer)) {
   76|  1.10k|      return false;
   77|  1.10k|    }
   78|  6.11k|  }
   79|    961|  return true;
   80|  2.06k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|    961|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|    961|  const int32_t num_attributes = GetNumAttributes();
   85|  3.23k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 2.49k, False: 740]
  ------------------
   86|  2.49k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 221, False: 2.27k]
  ------------------
   87|  2.49k|            point_ids_, in_buffer)) {
   88|    221|      return false;
   89|    221|    }
   90|  2.49k|  }
   91|    740|  return true;
   92|    961|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|    740|    TransformAttributesToOriginalFormat() {
   96|    740|  const int32_t num_attributes = GetNumAttributes();
   97|  2.40k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 1.91k, False: 491]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  1.91k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 1.91k, False: 0]
  ------------------
  100|  1.91k|      const PointAttribute *const attribute =
  101|  1.91k|          sequential_decoders_[i]->attribute();
  102|  1.91k|      const PointAttribute *const portable_attribute =
  103|  1.91k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  1.91k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 1.60k, False: 305]
  |  Branch (104:11): [True: 0, False: 1.91k]
  ------------------
  105|  1.60k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 0, False: 1.60k]
  ------------------
  106|  1.60k|              attribute->attribute_type(), "skip_attribute_transform", false)) {
  107|       |        // Attribute transform should not be performed. In this case, we replace
  108|       |        // the output geometry attribute with the portable attribute.
  109|       |        // TODO(ostava): We can potentially avoid this copy by introducing a new
  110|       |        // mechanism that would allow to use the final attributes as portable
  111|       |        // attributes for predictors that may need them.
  112|      0|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|      0|        continue;
  114|      0|      }
  115|  1.91k|    }
  116|  1.91k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 249, False: 1.66k]
  ------------------
  117|  1.91k|            point_ids_)) {
  118|    249|      return false;
  119|    249|    }
  120|  1.91k|  }
  121|    491|  return true;
  122|    740|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  10.9k|    uint8_t decoder_type) {
  127|  10.9k|  switch (decoder_type) {
  128|  1.16k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.16k, False: 9.78k]
  ------------------
  129|  1.16k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.16k|          new SequentialAttributeDecoder());
  131|  8.67k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 8.67k, False: 2.27k]
  ------------------
  132|  8.67k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  8.67k|          new SequentialIntegerAttributeDecoder());
  134|    331|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 331, False: 10.6k]
  ------------------
  135|    331|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    331|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|    771|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 771, False: 10.1k]
  ------------------
  139|    771|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|    771|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|      8|    default:
  ------------------
  |  Branch (142:5): [True: 8, False: 10.9k]
  ------------------
  143|      8|      break;
  144|  10.9k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|      8|  return nullptr;
  147|  10.9k|}

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

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

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  5.93M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  5.93M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  5.93M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  5.93M|    const int remaining = 32 - num_used_bits_;
   54|  5.93M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 5.52M, False: 416k]
  ------------------
   55|  5.52M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 5.10M, False: 413k]
  ------------------
   56|  5.10M|        return false;
   57|  5.10M|      }
   58|   413k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   413k|      num_used_bits_ += nbits;
   60|   413k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 13.8k, False: 400k]
  ------------------
   61|  13.8k|        ++pos_;
   62|  13.8k|        num_used_bits_ = 0;
   63|  13.8k|      }
   64|   416k|    } else {
   65|   416k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 404k, False: 11.2k]
  ------------------
   66|   404k|        return false;
   67|   404k|      }
   68|  11.2k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  11.2k|      num_used_bits_ = nbits - remaining;
   70|  11.2k|      ++pos_;
   71|  11.2k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  11.2k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  11.2k|    }
   74|   425k|    return true;
   75|  5.93M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  6.05M|  bool DecodeNextBit() {
   35|  6.05M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  6.05M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 5.65M, False: 396k]
  ------------------
   37|  5.65M|      return false;
   38|  5.65M|    }
   39|   396k|    const bool bit = *pos_ & selector;
   40|   396k|    ++num_used_bits_;
   41|   396k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 12.2k, False: 384k]
  ------------------
   42|  12.2k|      ++pos_;
   43|  12.2k|      num_used_bits_ = 0;
   44|  12.2k|    }
   45|   396k|    return bit;
   46|  6.05M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    366|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    404|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    333|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  9.53k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 9.25k, False: 272]
  ------------------
   35|  9.25k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 61, False: 9.19k]
  ------------------
   36|     61|        return false;
   37|     61|      }
   38|  9.25k|    }
   39|    272|    return bit_decoder_.StartDecoding(source_buffer);
   40|    333|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  2.83M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  2.83M|    uint32_t result = 0;
   49|  17.7M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 14.9M, False: 2.83M]
  ------------------
   50|  14.9M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  14.9M|      result = (result << 1) + bit;
   52|  14.9M|    }
   53|  2.83M|    *value = result;
   54|  2.83M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     71|  void EndDecoding() {
   57|  2.34k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 2.27k, False: 71]
  ------------------
   58|  2.27k|      folded_number_decoders_[i].EndDecoding();
   59|  2.27k|    }
   60|     71|    bit_decoder_.EndDecoding();
   61|     71|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    404|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  27.8k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  19.5k|                                const uint8_t *const buf, int offset) {
  301|  19.5k|  unsigned x;
  302|  19.5k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 29, False: 19.5k]
  ------------------
  303|     29|    return 1;
  304|     29|  }
  305|  19.5k|  ans->buf = buf;
  306|  19.5k|  x = buf[offset - 1] >> 6;
  307|  19.5k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 17.1k, False: 2.41k]
  ------------------
  308|  17.1k|    ans->buf_offset = offset - 1;
  309|  17.1k|    ans->state = buf[offset - 1] & 0x3F;
  310|  17.1k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.17k, False: 237]
  ------------------
  311|  2.17k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 8, False: 2.16k]
  ------------------
  312|      8|      return 1;
  313|      8|    }
  314|  2.16k|    ans->buf_offset = offset - 2;
  315|  2.16k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.16k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 227, False: 10]
  ------------------
  317|    227|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 5, False: 222]
  ------------------
  318|      5|      return 1;
  319|      5|    }
  320|    222|    ans->buf_offset = offset - 3;
  321|    222|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    222|  } else {
  323|     10|    return 1;
  324|     10|  }
  325|  19.5k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  19.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  19.5k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  19.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  19.5k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 3, False: 19.5k]
  ------------------
  327|      3|    return 1;
  328|      3|  }
  329|  19.5k|  return 0;
  330|  19.5k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.16k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.16k|  uint32_t val;
   69|  2.16k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.16k|  val = mem[1] << 8;
   72|  2.16k|  val |= mem[0];
   73|  2.16k|  return val;
   74|  2.16k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    222|static uint32_t mem_get_le24(const void *vmem) {
   77|    222|  uint32_t val;
   78|    222|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    222|  val = mem[2] << 16;
   81|    222|  val |= mem[1] << 8;
   82|    222|  val |= mem[0];
   83|    222|  return val;
   84|    222|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  9.53G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  9.53G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  9.53G|  unsigned quot, rem, x, xn;
  172|  9.53G|#endif
  173|  9.53G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  9.53G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  9.53G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  19.0G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 9.02G, False: 503M]
  |  Branch (174:40): [True: 73.9k, False: 9.02G]
  ------------------
  175|  73.9k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  73.9k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  73.9k|  }
  177|       |#if DRACO_ANS_IMPL1
  178|       |  val = ans->state % DRACO_ANS_P8_PRECISION < p;
  179|       |  l_s = val ? p : p0;
  180|       |  ans->state = (ans->state / DRACO_ANS_P8_PRECISION) * l_s +
  181|       |               ans->state % DRACO_ANS_P8_PRECISION - (!val * p);
  182|       |#else
  183|  9.53G|  x = ans->state;
  184|  9.53G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  9.53G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  9.53G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  9.53G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  9.53G|  xn = quot * p;
  187|  9.53G|  val = rem < p;
  188|  9.53G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  19.0G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 9.03G, False: 499M]
  |  |  ------------------
  ------------------
  189|  9.03G|    ans->state = xn + rem;
  190|  9.03G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   499M|    ans->state = x - xn - p;
  193|   499M|  }
  194|  9.53G|#endif
  195|  9.53G|  return val;
  196|  9.53G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  44.8k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  44.8k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  44.8k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  44.8k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  1.58k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|    818|                                       uint32_t num_symbols) {
  482|    818|    lut_table_.resize(rans_precision);
  483|    818|    probability_table_.resize(num_symbols);
  484|    818|    uint32_t cum_prob = 0;
  485|    818|    uint32_t act_prob = 0;
  486|  6.58k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 5.85k, False: 729]
  ------------------
  487|  5.85k|      probability_table_[i].prob = token_probs[i];
  488|  5.85k|      probability_table_[i].cum_prob = cum_prob;
  489|  5.85k|      cum_prob += token_probs[i];
  490|  5.85k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 89, False: 5.77k]
  ------------------
  491|     89|        return false;
  492|     89|      }
  493|  2.73M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 2.72M, False: 5.77k]
  ------------------
  494|  2.72M|        lut_table_[j] = i;
  495|  2.72M|      }
  496|  5.77k|      act_prob = cum_prob;
  497|  5.77k|    }
  498|    729|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 86, False: 643]
  ------------------
  499|     86|      return false;
  500|     86|    }
  501|    643|    return true;
  502|    729|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|    583|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    583|    unsigned x;
  423|    583|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 45, False: 538]
  ------------------
  424|     45|      return 1;
  425|     45|    }
  426|    538|    ans_.buf = buf;
  427|    538|    x = buf[offset - 1] >> 6;
  428|    538|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 337, False: 201]
  ------------------
  429|    337|      ans_.buf_offset = offset - 1;
  430|    337|      ans_.state = buf[offset - 1] & 0x3F;
  431|    337|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 67, False: 134]
  ------------------
  432|     67|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 67]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     67|      ans_.buf_offset = offset - 2;
  436|     67|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    134|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 77, False: 57]
  ------------------
  438|     77|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 76]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|     76|      ans_.buf_offset = offset - 3;
  442|     76|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     76|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 57, False: 0]
  ------------------
  444|     57|      ans_.buf_offset = offset - 4;
  445|     57|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     57|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    537|    ans_.state += l_rans_base;
  450|    537|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    537|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 58, False: 479]
  ------------------
  451|     58|      return 1;
  452|     58|    }
  453|    479|    return 0;
  454|    537|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    112|static uint32_t mem_get_le16(const void *vmem) {
   68|    112|  uint32_t val;
   69|    112|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    112|  val = mem[1] << 8;
   72|    112|  val |= mem[0];
   73|    112|  return val;
   74|    112|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    118|static uint32_t mem_get_le24(const void *vmem) {
   77|    118|  uint32_t val;
   78|    118|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    118|  val = mem[2] << 16;
   81|    118|  val |= mem[1] << 8;
   82|    118|  val |= mem[0];
   83|    118|  return val;
   84|    118|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    138|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    138|  uint32_t val;
   88|    138|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    138|  val = mem[3] << 24;
   91|    138|  val |= mem[2] << 16;
   92|    138|  val |= mem[1] << 8;
   93|    138|  val |= mem[0];
   94|    138|  return val;
   95|    138|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  30.8M|  inline int rans_read() {
  463|  30.8M|    unsigned rem;
  464|  30.8M|    unsigned quo;
  465|  30.8M|    struct rans_dec_sym sym;
  466|  30.8M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 24.3M, False: 6.51M]
  |  Branch (466:40): [True: 13.2k, False: 24.3M]
  ------------------
  467|  13.2k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  13.2k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  13.2k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  30.8M|    quo = ans_.state / rans_precision;
  472|  30.8M|    rem = ans_.state % rans_precision;
  473|  30.8M|    fetch_sym(&sym, rem);
  474|  30.8M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  30.8M|    return sym.val;
  476|  30.8M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  30.8M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  30.8M|    uint32_t symbol = lut_table_[rem];
  507|  30.8M|    out->val = symbol;
  508|  30.8M|    out->prob = probability_table_[symbol].prob;
  509|  30.8M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  30.8M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|    449|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    126|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|     72|                                       uint32_t num_symbols) {
  482|     72|    lut_table_.resize(rans_precision);
  483|     72|    probability_table_.resize(num_symbols);
  484|     72|    uint32_t cum_prob = 0;
  485|     72|    uint32_t act_prob = 0;
  486|  10.6k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 10.5k, False: 63]
  ------------------
  487|  10.5k|      probability_table_[i].prob = token_probs[i];
  488|  10.5k|      probability_table_[i].cum_prob = cum_prob;
  489|  10.5k|      cum_prob += token_probs[i];
  490|  10.5k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 9, False: 10.5k]
  ------------------
  491|      9|        return false;
  492|      9|      }
  493|   537k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 527k, False: 10.5k]
  ------------------
  494|   527k|        lut_table_[j] = i;
  495|   527k|      }
  496|  10.5k|      act_prob = cum_prob;
  497|  10.5k|    }
  498|     63|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 4, False: 59]
  ------------------
  499|      4|      return false;
  500|      4|    }
  501|     59|    return true;
  502|     63|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     46|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     46|    unsigned x;
  423|     46|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 5, False: 41]
  ------------------
  424|      5|      return 1;
  425|      5|    }
  426|     41|    ans_.buf = buf;
  427|     41|    x = buf[offset - 1] >> 6;
  428|     41|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 22, False: 19]
  ------------------
  429|     22|      ans_.buf_offset = offset - 1;
  430|     22|      ans_.state = buf[offset - 1] & 0x3F;
  431|     22|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 2, False: 17]
  ------------------
  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|     17|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 5, False: 12]
  ------------------
  438|      5|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 5]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      5|      ans_.buf_offset = offset - 3;
  442|      5|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     12|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 12, False: 0]
  ------------------
  444|     12|      ans_.buf_offset = offset - 4;
  445|     12|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     12|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     41|    ans_.state += l_rans_base;
  450|     41|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     41|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 12, False: 29]
  ------------------
  451|     12|      return 1;
  452|     12|    }
  453|     29|    return 0;
  454|     41|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  94.9k|  inline int rans_read() {
  463|  94.9k|    unsigned rem;
  464|  94.9k|    unsigned quo;
  465|  94.9k|    struct rans_dec_sym sym;
  466|  96.1k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 91.5k, False: 4.55k]
  |  Branch (466:40): [True: 1.20k, False: 90.3k]
  ------------------
  467|  1.20k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.20k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.20k|    }
  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|  94.9k|    quo = ans_.state / rans_precision;
  472|  94.9k|    rem = ans_.state % rans_precision;
  473|  94.9k|    fetch_sym(&sym, rem);
  474|  94.9k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  94.9k|    return sym.val;
  476|  94.9k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  94.9k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  94.9k|    uint32_t symbol = lut_table_[rem];
  507|  94.9k|    out->val = symbol;
  508|  94.9k|    out->prob = probability_table_[symbol].prob;
  509|  94.9k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  94.9k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     29|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|     93|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|     56|                                       uint32_t num_symbols) {
  482|     56|    lut_table_.resize(rans_precision);
  483|     56|    probability_table_.resize(num_symbols);
  484|     56|    uint32_t cum_prob = 0;
  485|     56|    uint32_t act_prob = 0;
  486|  5.44k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 5.39k, False: 52]
  ------------------
  487|  5.39k|      probability_table_[i].prob = token_probs[i];
  488|  5.39k|      probability_table_[i].cum_prob = cum_prob;
  489|  5.39k|      cum_prob += token_probs[i];
  490|  5.39k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 4, False: 5.38k]
  ------------------
  491|      4|        return false;
  492|      4|      }
  493|  1.56M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.56M, False: 5.38k]
  ------------------
  494|  1.56M|        lut_table_[j] = i;
  495|  1.56M|      }
  496|  5.38k|      act_prob = cum_prob;
  497|  5.38k|    }
  498|     52|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 9, False: 43]
  ------------------
  499|      9|      return false;
  500|      9|    }
  501|     43|    return true;
  502|     52|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     23|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     23|    unsigned x;
  423|     23|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 23]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     23|    ans_.buf = buf;
  427|     23|    x = buf[offset - 1] >> 6;
  428|     23|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 4, False: 19]
  ------------------
  429|      4|      ans_.buf_offset = offset - 1;
  430|      4|      ans_.state = buf[offset - 1] & 0x3F;
  431|     19|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 10, False: 9]
  ------------------
  432|     10|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 10]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     10|      ans_.buf_offset = offset - 2;
  436|     10|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     10|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 3, False: 6]
  ------------------
  438|      3|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 3]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      3|      ans_.buf_offset = offset - 3;
  442|      3|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      6|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 6, False: 0]
  ------------------
  444|      6|      ans_.buf_offset = offset - 4;
  445|      6|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      6|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     23|    ans_.state += l_rans_base;
  450|     23|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     23|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 6, False: 17]
  ------------------
  451|      6|      return 1;
  452|      6|    }
  453|     17|    return 0;
  454|     23|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   104k|  inline int rans_read() {
  463|   104k|    unsigned rem;
  464|   104k|    unsigned quo;
  465|   104k|    struct rans_dec_sym sym;
  466|   108k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 64.7k, False: 43.4k]
  |  Branch (466:40): [True: 3.97k, False: 60.7k]
  ------------------
  467|  3.97k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  3.97k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  3.97k|    }
  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|   104k|    quo = ans_.state / rans_precision;
  472|   104k|    rem = ans_.state % rans_precision;
  473|   104k|    fetch_sym(&sym, rem);
  474|   104k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   104k|    return sym.val;
  476|   104k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   104k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   104k|    uint32_t symbol = lut_table_[rem];
  507|   104k|    out->val = symbol;
  508|   104k|    out->prob = probability_table_[symbol].prob;
  509|   104k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   104k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     17|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|     74|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|     23|                                       uint32_t num_symbols) {
  482|     23|    lut_table_.resize(rans_precision);
  483|     23|    probability_table_.resize(num_symbols);
  484|     23|    uint32_t cum_prob = 0;
  485|     23|    uint32_t act_prob = 0;
  486|  6.79k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.78k, False: 13]
  ------------------
  487|  6.78k|      probability_table_[i].prob = token_probs[i];
  488|  6.78k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.78k|      cum_prob += token_probs[i];
  490|  6.78k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 10, False: 6.77k]
  ------------------
  491|     10|        return false;
  492|     10|      }
  493|  1.06M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.05M, False: 6.77k]
  ------------------
  494|  1.05M|        lut_table_[j] = i;
  495|  1.05M|      }
  496|  6.77k|      act_prob = cum_prob;
  497|  6.77k|    }
  498|     13|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 4, False: 9]
  ------------------
  499|      4|      return false;
  500|      4|    }
  501|      9|    return true;
  502|     13|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|      6|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      6|    unsigned x;
  423|      6|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 6]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      6|    ans_.buf = buf;
  427|      6|    x = buf[offset - 1] >> 6;
  428|      6|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 5, False: 1]
  ------------------
  429|      5|      ans_.buf_offset = offset - 1;
  430|      5|      ans_.state = buf[offset - 1] & 0x3F;
  431|      5|    } 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|      6|    ans_.state += l_rans_base;
  450|      6|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      6|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 6]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      6|    return 0;
  454|      6|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|  35.4k|  inline int rans_read() {
  463|  35.4k|    unsigned rem;
  464|  35.4k|    unsigned quo;
  465|  35.4k|    struct rans_dec_sym sym;
  466|  35.8k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 19.8k, False: 15.9k]
  |  Branch (466:40): [True: 364, False: 19.5k]
  ------------------
  467|    364|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    364|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    364|    }
  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|  35.4k|    quo = ans_.state / rans_precision;
  472|  35.4k|    rem = ans_.state % rans_precision;
  473|  35.4k|    fetch_sym(&sym, rem);
  474|  35.4k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  35.4k|    return sym.val;
  476|  35.4k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|  35.4k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  35.4k|    uint32_t symbol = lut_table_[rem];
  507|  35.4k|    out->val = symbol;
  508|  35.4k|    out->prob = probability_table_[symbol].prob;
  509|  35.4k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  35.4k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|      6|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|     83|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|     38|                                       uint32_t num_symbols) {
  482|     38|    lut_table_.resize(rans_precision);
  483|     38|    probability_table_.resize(num_symbols);
  484|     38|    uint32_t cum_prob = 0;
  485|     38|    uint32_t act_prob = 0;
  486|  3.52k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.48k, False: 37]
  ------------------
  487|  3.48k|      probability_table_[i].prob = token_probs[i];
  488|  3.48k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.48k|      cum_prob += token_probs[i];
  490|  3.48k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 1, False: 3.48k]
  ------------------
  491|      1|        return false;
  492|      1|      }
  493|  9.08M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 9.08M, False: 3.48k]
  ------------------
  494|  9.08M|        lut_table_[j] = i;
  495|  9.08M|      }
  496|  3.48k|      act_prob = cum_prob;
  497|  3.48k|    }
  498|     37|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 4, False: 33]
  ------------------
  499|      4|      return false;
  500|      4|    }
  501|     33|    return true;
  502|     37|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     10|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     10|    unsigned x;
  423|     10|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 10]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     10|    ans_.buf = buf;
  427|     10|    x = buf[offset - 1] >> 6;
  428|     10|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1, False: 9]
  ------------------
  429|      1|      ans_.buf_offset = offset - 1;
  430|      1|      ans_.state = buf[offset - 1] & 0x3F;
  431|      9|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 5, False: 4]
  ------------------
  432|      5|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 5]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      5|      ans_.buf_offset = offset - 2;
  436|      5|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      5|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 4, False: 0]
  ------------------
  438|      4|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 4]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      4|      ans_.buf_offset = offset - 3;
  442|      4|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      4|    } 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|     10|    ans_.state += l_rans_base;
  450|     10|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     10|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 10]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|     10|    return 0;
  454|     10|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  12.1k|  inline int rans_read() {
  463|  12.1k|    unsigned rem;
  464|  12.1k|    unsigned quo;
  465|  12.1k|    struct rans_dec_sym sym;
  466|  12.1k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 11.3k, False: 760]
  |  Branch (466:40): [True: 17, False: 11.3k]
  ------------------
  467|     17|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|     17|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|     17|    }
  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|  12.1k|    quo = ans_.state / rans_precision;
  472|  12.1k|    rem = ans_.state % rans_precision;
  473|  12.1k|    fetch_sym(&sym, rem);
  474|  12.1k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  12.1k|    return sym.val;
  476|  12.1k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  12.1k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  12.1k|    uint32_t symbol = lut_table_[rem];
  507|  12.1k|    out->val = symbol;
  508|  12.1k|    out->prob = probability_table_[symbol].prob;
  509|  12.1k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  12.1k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     10|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    109|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|     63|                                       uint32_t num_symbols) {
  482|     63|    lut_table_.resize(rans_precision);
  483|     63|    probability_table_.resize(num_symbols);
  484|     63|    uint32_t cum_prob = 0;
  485|     63|    uint32_t act_prob = 0;
  486|  2.93k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.88k, False: 49]
  ------------------
  487|  2.88k|      probability_table_[i].prob = token_probs[i];
  488|  2.88k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.88k|      cum_prob += token_probs[i];
  490|  2.88k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 14, False: 2.86k]
  ------------------
  491|     14|        return false;
  492|     14|      }
  493|  23.9M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 23.9M, False: 2.86k]
  ------------------
  494|  23.9M|        lut_table_[j] = i;
  495|  23.9M|      }
  496|  2.86k|      act_prob = cum_prob;
  497|  2.86k|    }
  498|     49|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 7, False: 42]
  ------------------
  499|      7|      return false;
  500|      7|    }
  501|     42|    return true;
  502|     49|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     39|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     39|    unsigned x;
  423|     39|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 39]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     39|    ans_.buf = buf;
  427|     39|    x = buf[offset - 1] >> 6;
  428|     39|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 11, False: 28]
  ------------------
  429|     11|      ans_.buf_offset = offset - 1;
  430|     11|      ans_.state = buf[offset - 1] & 0x3F;
  431|     28|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 8, False: 20]
  ------------------
  432|      8|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 7]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      7|      ans_.buf_offset = offset - 2;
  436|      7|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     20|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 9, False: 11]
  ------------------
  438|      9|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 8]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|      8|      ans_.buf_offset = offset - 3;
  442|      8|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     11|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 11, False: 0]
  ------------------
  444|     11|      ans_.buf_offset = offset - 4;
  445|     11|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     11|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     37|    ans_.state += l_rans_base;
  450|     37|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     37|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 10, False: 27]
  ------------------
  451|     10|      return 1;
  452|     10|    }
  453|     27|    return 0;
  454|     37|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   123k|  inline int rans_read() {
  463|   123k|    unsigned rem;
  464|   123k|    unsigned quo;
  465|   123k|    struct rans_dec_sym sym;
  466|   123k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 49.6k, False: 73.8k]
  |  Branch (466:40): [True: 241, False: 49.3k]
  ------------------
  467|    241|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    241|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    241|    }
  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|   123k|    quo = ans_.state / rans_precision;
  472|   123k|    rem = ans_.state % rans_precision;
  473|   123k|    fetch_sym(&sym, rem);
  474|   123k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   123k|    return sym.val;
  476|   123k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   123k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   123k|    uint32_t symbol = lut_table_[rem];
  507|   123k|    out->val = symbol;
  508|   123k|    out->prob = probability_table_[symbol].prob;
  509|   123k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   123k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     27|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|    558|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    316|                                       uint32_t num_symbols) {
  482|    316|    lut_table_.resize(rans_precision);
  483|    316|    probability_table_.resize(num_symbols);
  484|    316|    uint32_t cum_prob = 0;
  485|    316|    uint32_t act_prob = 0;
  486|  7.87k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 7.58k, False: 291]
  ------------------
  487|  7.58k|      probability_table_[i].prob = token_probs[i];
  488|  7.58k|      probability_table_[i].cum_prob = cum_prob;
  489|  7.58k|      cum_prob += token_probs[i];
  490|  7.58k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 25, False: 7.55k]
  ------------------
  491|     25|        return false;
  492|     25|      }
  493|   293M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 293M, False: 7.55k]
  ------------------
  494|   293M|        lut_table_[j] = i;
  495|   293M|      }
  496|  7.55k|      act_prob = cum_prob;
  497|  7.55k|    }
  498|    291|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 19, False: 272]
  ------------------
  499|     19|      return false;
  500|     19|    }
  501|    272|    return true;
  502|    291|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    149|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    149|    unsigned x;
  423|    149|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 149]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|    149|    ans_.buf = buf;
  427|    149|    x = buf[offset - 1] >> 6;
  428|    149|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 53, False: 96]
  ------------------
  429|     53|      ans_.buf_offset = offset - 1;
  430|     53|      ans_.state = buf[offset - 1] & 0x3F;
  431|     96|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 21, False: 75]
  ------------------
  432|     21|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 20]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|     20|      ans_.buf_offset = offset - 2;
  436|     20|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     75|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 23, False: 52]
  ------------------
  438|     23|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 22]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|     22|      ans_.buf_offset = offset - 3;
  442|     22|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     52|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 52, False: 0]
  ------------------
  444|     52|      ans_.buf_offset = offset - 4;
  445|     52|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     52|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    147|    ans_.state += l_rans_base;
  450|    147|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    147|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 32, False: 115]
  ------------------
  451|     32|      return 1;
  452|     32|    }
  453|    115|    return 0;
  454|    147|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  19.2M|  inline int rans_read() {
  463|  19.2M|    unsigned rem;
  464|  19.2M|    unsigned quo;
  465|  19.2M|    struct rans_dec_sym sym;
  466|  19.2M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 12.9M, False: 6.25M]
  |  Branch (466:40): [True: 5.38k, False: 12.9M]
  ------------------
  467|  5.38k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  5.38k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  5.38k|    }
  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|  19.2M|    quo = ans_.state / rans_precision;
  472|  19.2M|    rem = ans_.state % rans_precision;
  473|  19.2M|    fetch_sym(&sym, rem);
  474|  19.2M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  19.2M|    return sym.val;
  476|  19.2M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  19.2M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  19.2M|    uint32_t symbol = lut_table_[rem];
  507|  19.2M|    out->val = symbol;
  508|  19.2M|    out->prob = probability_table_[symbol].prob;
  509|  19.2M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  19.2M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    115|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    498|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    498|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    498|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 498]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    498|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    498|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    498|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 34, False: 464]
  ------------------
   67|     34|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 33]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     34|  } else
   72|    464|#endif
   73|    464|  {
   74|    464|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 459]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    464|  }
   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|    492|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 31, False: 461]
  ------------------
   83|     31|    return false;
   84|     31|  }
   85|    461|  probability_table_.resize(num_symbols_);
   86|    461|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 182, False: 279]
  ------------------
   87|    182|    return true;
   88|    182|  }
   89|       |  // Decode the table.
   90|  15.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 15.1k, False: 137]
  ------------------
   91|  15.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  15.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 18, False: 15.1k]
  ------------------
   95|     18|      return false;
   96|     18|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  15.1k|    const int token = prob_data & 3;
  102|  15.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.12k, False: 10.0k]
  ------------------
  103|  5.12k|      const uint32_t offset = prob_data >> 2;
  104|  5.12k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 110, False: 5.01k]
  ------------------
  105|    110|        return false;
  106|    110|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   209k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 204k, False: 5.01k]
  ------------------
  109|   204k|        probability_table_[i + j] = 0;
  110|   204k|      }
  111|  5.01k|      i += offset;
  112|  10.0k|    } else {
  113|  10.0k|      const int extra_bytes = token;
  114|  10.0k|      uint32_t prob = prob_data >> 2;
  115|  17.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 7.29k, False: 10.0k]
  ------------------
  116|  7.29k|        uint8_t eb;
  117|  7.29k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 7.27k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  7.27k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  7.27k|      }
  124|  10.0k|      probability_table_[i] = prob;
  125|  10.0k|    }
  126|  15.1k|  }
  127|    137|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 73, False: 64]
  ------------------
  128|     73|    return false;
  129|     73|  }
  130|     64|  return true;
  131|    137|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    174|    DecoderBuffer *buffer) {
  136|    174|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    174|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    174|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    174|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 158]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 15]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     16|  } else
  145|    158|#endif
  146|    158|  {
  147|    158|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 157]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    158|  }
  151|    172|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 32, False: 140]
  ------------------
  152|     32|    return false;
  153|     32|  }
  154|    140|  const uint8_t *const data_head =
  155|    140|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    140|  buffer->Advance(bytes_encoded);
  158|    140|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 46, False: 94]
  ------------------
  159|     46|    return false;
  160|     46|  }
  161|     94|  return true;
  162|    140|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    166|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  5.06M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|     64|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     64|  ans_.read_end();
  167|     64|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    241|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    241|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    241|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 241]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    241|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    241|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    241|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 31, False: 210]
  ------------------
   67|     31|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 31]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     31|  } else
   72|    210|#endif
   73|    210|  {
   74|    210|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 208]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    210|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    239|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 218]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    218|  probability_table_.resize(num_symbols_);
   86|    218|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 214]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|   141k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 141k, False: 150]
  ------------------
   91|   141k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   141k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 13, False: 141k]
  ------------------
   95|     13|      return false;
   96|     13|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   141k|    const int token = prob_data & 3;
  102|   141k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 14.4k, False: 126k]
  ------------------
  103|  14.4k|      const uint32_t offset = prob_data >> 2;
  104|  14.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 14.3k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   660k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 645k, False: 14.3k]
  ------------------
  109|   645k|        probability_table_[i + j] = 0;
  110|   645k|      }
  111|  14.3k|      i += offset;
  112|   126k|    } else {
  113|   126k|      const int extra_bytes = token;
  114|   126k|      uint32_t prob = prob_data >> 2;
  115|   159k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 32.4k, False: 126k]
  ------------------
  116|  32.4k|        uint8_t eb;
  117|  32.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 32.4k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  32.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  32.4k|      }
  124|   126k|      probability_table_[i] = prob;
  125|   126k|    }
  126|   141k|  }
  127|    150|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 62, False: 88]
  ------------------
  128|     62|    return false;
  129|     62|  }
  130|     88|  return true;
  131|    150|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|     92|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|     88|    DecoderBuffer *buffer) {
  136|     88|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     88|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     88|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     88|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 87]
  ------------------
  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|     87|#endif
  146|     87|  {
  147|     87|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 87]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     87|  }
  151|     88|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 2, False: 86]
  ------------------
  152|      2|    return false;
  153|      2|  }
  154|     86|  const uint8_t *const data_head =
  155|     86|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     86|  buffer->Advance(bytes_encoded);
  158|     86|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 7, False: 79]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|     79|  return true;
  162|     86|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  1.68M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|     79|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     79|  ans_.read_end();
  167|     79|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    181|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    181|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    181|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 181]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    181|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    181|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    181|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 50, False: 131]
  ------------------
   67|     50|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 50]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     50|  } else
   72|    131|#endif
   73|    131|  {
   74|    131|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 131]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    131|  }
   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|    181|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 172]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    172|  probability_table_.resize(num_symbols_);
   86|    172|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 171]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   296k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 296k, False: 108]
  ------------------
   91|   296k|    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|   296k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 34, False: 296k]
  ------------------
   95|     34|      return false;
   96|     34|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   296k|    const int token = prob_data & 3;
  102|   296k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 38.9k, False: 257k]
  ------------------
  103|  38.9k|      const uint32_t offset = prob_data >> 2;
  104|  38.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 38.9k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   775k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 736k, False: 38.9k]
  ------------------
  109|   736k|        probability_table_[i + j] = 0;
  110|   736k|      }
  111|  38.9k|      i += offset;
  112|   257k|    } else {
  113|   257k|      const int extra_bytes = token;
  114|   257k|      uint32_t prob = prob_data >> 2;
  115|   483k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 225k, False: 257k]
  ------------------
  116|   225k|        uint8_t eb;
  117|   225k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 4, False: 225k]
  ------------------
  118|      4|          return false;
  119|      4|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   225k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   225k|      }
  124|   257k|      probability_table_[i] = prob;
  125|   257k|    }
  126|   296k|  }
  127|    108|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 17, False: 91]
  ------------------
  128|     17|    return false;
  129|     17|  }
  130|     91|  return true;
  131|    108|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|     92|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|     91|    DecoderBuffer *buffer) {
  136|     91|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     91|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     91|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     91|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 25, False: 66]
  ------------------
  140|     25|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 25]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     25|  } else
  145|     66|#endif
  146|     66|  {
  147|     66|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 66]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     66|  }
  151|     91|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 27, False: 64]
  ------------------
  152|     27|    return false;
  153|     27|  }
  154|     64|  const uint8_t *const data_head =
  155|     64|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     64|  buffer->Advance(bytes_encoded);
  158|     64|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 16, False: 48]
  ------------------
  159|     16|    return false;
  160|     16|  }
  161|     48|  return true;
  162|     64|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|   394k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|     48|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     48|  ans_.read_end();
  167|     48|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    166|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    166|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    166|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 166]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    166|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    166|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    166|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 31, False: 135]
  ------------------
   67|     31|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 31]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     31|  } else
   72|    135|#endif
   73|    135|  {
   74|    135|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 135]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    135|  }
   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|    166|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 163]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    163|  probability_table_.resize(num_symbols_);
   86|    163|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 163]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  5.42k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 5.29k, False: 136]
  ------------------
   91|  5.29k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  5.29k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 13, False: 5.27k]
  ------------------
   95|     13|      return false;
   96|     13|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  5.27k|    const int token = prob_data & 3;
  102|  5.27k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.96k, False: 2.31k]
  ------------------
  103|  2.96k|      const uint32_t offset = prob_data >> 2;
  104|  2.96k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 2.95k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   117k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 114k, False: 2.95k]
  ------------------
  109|   114k|        probability_table_[i + j] = 0;
  110|   114k|      }
  111|  2.95k|      i += offset;
  112|  2.95k|    } else {
  113|  2.31k|      const int extra_bytes = token;
  114|  2.31k|      uint32_t prob = prob_data >> 2;
  115|  3.74k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.43k, False: 2.30k]
  ------------------
  116|  1.43k|        uint8_t eb;
  117|  1.43k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 1.42k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.42k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.42k|      }
  124|  2.30k|      probability_table_[i] = prob;
  125|  2.30k|    }
  126|  5.27k|  }
  127|    136|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 132]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|    132|  return true;
  131|    136|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    132|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    132|    DecoderBuffer *buffer) {
  136|    132|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    132|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    132|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    132|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 105]
  ------------------
  140|     27|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 26]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     27|  } else
  145|    105|#endif
  146|    105|  {
  147|    105|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 105]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    105|  }
  151|    131|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 34, False: 97]
  ------------------
  152|     34|    return false;
  153|     34|  }
  154|     97|  const uint8_t *const data_head =
  155|     97|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     97|  buffer->Advance(bytes_encoded);
  158|     97|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 11, False: 86]
  ------------------
  159|     11|    return false;
  160|     11|  }
  161|     86|  return true;
  162|     97|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  16.0M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|     86|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     86|  ans_.read_end();
  167|     86|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    110|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    110|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    110|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 110]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    110|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    110|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    110|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 100]
  ------------------
   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|    100|#endif
   73|    100|  {
   74|    100|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 100]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    100|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    110|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 98]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|     98|  probability_table_.resize(num_symbols_);
   86|     98|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 98]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  20.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 20.8k, False: 71]
  ------------------
   91|  20.8k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  20.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 15, False: 20.8k]
  ------------------
   95|     15|      return false;
   96|     15|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  20.8k|    const int token = prob_data & 3;
  102|  20.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.55k, False: 14.3k]
  ------------------
  103|  6.55k|      const uint32_t offset = prob_data >> 2;
  104|  6.55k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 5, False: 6.54k]
  ------------------
  105|      5|        return false;
  106|      5|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   287k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 281k, False: 6.54k]
  ------------------
  109|   281k|        probability_table_[i + j] = 0;
  110|   281k|      }
  111|  6.54k|      i += offset;
  112|  14.3k|    } else {
  113|  14.3k|      const int extra_bytes = token;
  114|  14.3k|      uint32_t prob = prob_data >> 2;
  115|  22.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.60k, False: 14.3k]
  ------------------
  116|  8.60k|        uint8_t eb;
  117|  8.60k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 8.59k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.59k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.59k|      }
  124|  14.3k|      probability_table_[i] = prob;
  125|  14.3k|    }
  126|  20.8k|  }
  127|     71|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 68]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|     68|  return true;
  131|     71|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|     68|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|     68|    DecoderBuffer *buffer) {
  136|     68|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     68|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     68|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     68|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 68]
  ------------------
  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|     68|#endif
  146|     68|  {
  147|     68|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 68]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     68|  }
  151|     68|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 68]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|     68|  const uint8_t *const data_head =
  155|     68|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     68|  buffer->Advance(bytes_encoded);
  158|     68|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 3, False: 65]
  ------------------
  159|      3|    return false;
  160|      3|  }
  161|     65|  return true;
  162|     68|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|   594k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     65|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     65|  ans_.read_end();
  167|     65|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|     86|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|     86|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     86|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 86]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     86|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     86|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     86|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 20, False: 66]
  ------------------
   67|     20|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 20]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     20|  } else
   72|     66|#endif
   73|     66|  {
   74|     66|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 60]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|     66|  }
   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|     80|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 70]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|     70|  probability_table_.resize(num_symbols_);
   86|     70|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 69]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  9.79k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 9.76k, False: 35]
  ------------------
   91|  9.76k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  9.76k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 9.74k]
  ------------------
   95|     16|      return false;
   96|     16|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  9.74k|    const int token = prob_data & 3;
  102|  9.74k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.44k, False: 6.30k]
  ------------------
  103|  3.44k|      const uint32_t offset = prob_data >> 2;
  104|  3.44k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 3.43k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   118k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 114k, False: 3.43k]
  ------------------
  109|   114k|        probability_table_[i + j] = 0;
  110|   114k|      }
  111|  3.43k|      i += offset;
  112|  6.30k|    } else {
  113|  6.30k|      const int extra_bytes = token;
  114|  6.30k|      uint32_t prob = prob_data >> 2;
  115|  9.66k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.36k, False: 6.29k]
  ------------------
  116|  3.36k|        uint8_t eb;
  117|  3.36k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 5, False: 3.36k]
  ------------------
  118|      5|          return false;
  119|      5|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.36k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.36k|      }
  124|  6.29k|      probability_table_[i] = prob;
  125|  6.29k|    }
  126|  9.74k|  }
  127|     35|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 31]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|     31|  return true;
  131|     35|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|     32|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|     31|    DecoderBuffer *buffer) {
  136|     31|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     31|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     31|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     31|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 11, False: 20]
  ------------------
  140|     11|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 11]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     11|  } else
  145|     20|#endif
  146|     20|  {
  147|     20|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 20]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     20|  }
  151|     31|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 14, False: 17]
  ------------------
  152|     14|    return false;
  153|     14|  }
  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: 7, False: 10]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|     10|  return true;
  162|     17|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  3.30M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|     10|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     10|  ans_.read_end();
  167|     10|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    171|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    171|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    171|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 171]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    171|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    171|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    171|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 30, False: 141]
  ------------------
   67|     30|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 30]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     30|  } else
   72|    141|#endif
   73|    141|  {
   74|    141|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 141]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    141|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    171|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 169]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    169|  probability_table_.resize(num_symbols_);
   86|    169|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 169]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   438k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 438k, False: 100]
  ------------------
   91|   438k|    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|   438k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 28, False: 438k]
  ------------------
   95|     28|      return false;
   96|     28|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   438k|    const int token = prob_data & 3;
  102|   438k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 217k, False: 220k]
  ------------------
  103|   217k|      const uint32_t offset = prob_data >> 2;
  104|   217k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 31, False: 217k]
  ------------------
  105|     31|        return false;
  106|     31|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  9.13M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.92M, False: 217k]
  ------------------
  109|  8.92M|        probability_table_[i + j] = 0;
  110|  8.92M|      }
  111|   217k|      i += offset;
  112|   220k|    } else {
  113|   220k|      const int extra_bytes = token;
  114|   220k|      uint32_t prob = prob_data >> 2;
  115|   415k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 194k, False: 220k]
  ------------------
  116|   194k|        uint8_t eb;
  117|   194k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 194k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   194k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   194k|      }
  124|   220k|      probability_table_[i] = prob;
  125|   220k|    }
  126|   438k|  }
  127|    100|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 8, False: 92]
  ------------------
  128|      8|    return false;
  129|      8|  }
  130|     92|  return true;
  131|    100|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|     92|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|     92|    DecoderBuffer *buffer) {
  136|     92|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     92|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     92|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     92|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 13, False: 79]
  ------------------
  140|     13|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 12]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     13|  } else
  145|     79|#endif
  146|     79|  {
  147|     79|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 78]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     79|  }
  151|     90|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 14, False: 76]
  ------------------
  152|     14|    return false;
  153|     14|  }
  154|     76|  const uint8_t *const data_head =
  155|     76|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     76|  buffer->Advance(bytes_encoded);
  158|     76|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 4, False: 72]
  ------------------
  159|      4|    return false;
  160|      4|  }
  161|     72|  return true;
  162|     76|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  1.95M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     72|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     72|  ans_.read_end();
  167|     72|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    135|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    135|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    135|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 135]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    135|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    135|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    135|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 93]
  ------------------
   67|     42|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 42]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     42|  } else
   72|     93|#endif
   73|     93|  {
   74|     93|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 93]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     93|  }
   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|    135|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 130]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    130|  probability_table_.resize(num_symbols_);
   86|    130|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 130]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   105k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 105k, False: 81]
  ------------------
   91|   105k|    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|   105k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 18, False: 105k]
  ------------------
   95|     18|      return false;
   96|     18|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   105k|    const int token = prob_data & 3;
  102|   105k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 15.4k, False: 90.2k]
  ------------------
  103|  15.4k|      const uint32_t offset = prob_data >> 2;
  104|  15.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 15.4k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   533k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 517k, False: 15.4k]
  ------------------
  109|   517k|        probability_table_[i + j] = 0;
  110|   517k|      }
  111|  15.4k|      i += offset;
  112|  90.2k|    } else {
  113|  90.2k|      const int extra_bytes = token;
  114|  90.2k|      uint32_t prob = prob_data >> 2;
  115|   166k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 76.4k, False: 90.2k]
  ------------------
  116|  76.4k|        uint8_t eb;
  117|  76.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 76.4k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  76.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  76.4k|      }
  124|  90.2k|      probability_table_[i] = prob;
  125|  90.2k|    }
  126|   105k|  }
  127|     81|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 77]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|     77|  return true;
  131|     81|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|     77|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|     77|    DecoderBuffer *buffer) {
  136|     77|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     77|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     77|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     77|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 38, False: 39]
  ------------------
  140|     38|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 37]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     38|  } else
  145|     39|#endif
  146|     39|  {
  147|     39|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 39]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     39|  }
  151|     76|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 41, False: 35]
  ------------------
  152|     41|    return false;
  153|     41|  }
  154|     35|  const uint8_t *const data_head =
  155|     35|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     35|  buffer->Advance(bytes_encoded);
  158|     35|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 10, False: 25]
  ------------------
  159|     10|    return false;
  160|     10|  }
  161|     25|  return true;
  162|     35|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  1.78M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     25|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     25|  ans_.read_end();
  167|     25|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    126|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    126|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    126|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 126]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    126|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    126|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    126|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 19, False: 107]
  ------------------
   67|     19|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 19]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     19|  } else
   72|    107|#endif
   73|    107|  {
   74|    107|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 107]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    107|  }
   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|    126|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 124]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    124|  probability_table_.resize(num_symbols_);
   86|    124|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 124]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  55.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 55.6k, False: 72]
  ------------------
   91|  55.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|  55.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 18, False: 55.5k]
  ------------------
   95|     18|      return false;
   96|     18|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  55.5k|    const int token = prob_data & 3;
  102|  55.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.4k, False: 45.1k]
  ------------------
  103|  10.4k|      const uint32_t offset = prob_data >> 2;
  104|  10.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 10.3k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   371k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 360k, False: 10.3k]
  ------------------
  109|   360k|        probability_table_[i + j] = 0;
  110|   360k|      }
  111|  10.3k|      i += offset;
  112|  45.1k|    } else {
  113|  45.1k|      const int extra_bytes = token;
  114|  45.1k|      uint32_t prob = prob_data >> 2;
  115|  86.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 41.3k, False: 45.1k]
  ------------------
  116|  41.3k|        uint8_t eb;
  117|  41.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 5, False: 41.3k]
  ------------------
  118|      5|          return false;
  119|      5|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  41.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  41.3k|      }
  124|  45.1k|      probability_table_[i] = prob;
  125|  45.1k|    }
  126|  55.5k|  }
  127|     72|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 59]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|     59|  return true;
  131|     72|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|     59|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|     59|    DecoderBuffer *buffer) {
  136|     59|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     59|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     59|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     59|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 56]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 3]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      3|  } else
  145|     56|#endif
  146|     56|  {
  147|     56|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 56]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     56|  }
  151|     59|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 13, False: 46]
  ------------------
  152|     13|    return false;
  153|     13|  }
  154|     46|  const uint8_t *const data_head =
  155|     46|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     46|  buffer->Advance(bytes_encoded);
  158|     46|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 17, False: 29]
  ------------------
  159|     17|    return false;
  160|     17|  }
  161|     29|  return true;
  162|     46|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  94.9k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     29|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     29|  ans_.read_end();
  167|     29|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|     93|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|     93|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     93|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 93]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     93|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     93|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     93|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 26, False: 67]
  ------------------
   67|     26|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 23]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     26|  } else
   72|     67|#endif
   73|     67|  {
   74|     67|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 67]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     67|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     90|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 90]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     90|  probability_table_.resize(num_symbols_);
   86|     90|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 90]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  81.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 80.9k, False: 56]
  ------------------
   91|  80.9k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  80.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 19, False: 80.9k]
  ------------------
   95|     19|      return false;
   96|     19|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  80.9k|    const int token = prob_data & 3;
  102|  80.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 12.4k, False: 68.4k]
  ------------------
  103|  12.4k|      const uint32_t offset = prob_data >> 2;
  104|  12.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 11, False: 12.4k]
  ------------------
  105|     11|        return false;
  106|     11|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   313k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 301k, False: 12.4k]
  ------------------
  109|   301k|        probability_table_[i + j] = 0;
  110|   301k|      }
  111|  12.4k|      i += offset;
  112|  68.4k|    } else {
  113|  68.4k|      const int extra_bytes = token;
  114|  68.4k|      uint32_t prob = prob_data >> 2;
  115|   127k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 59.0k, False: 68.4k]
  ------------------
  116|  59.0k|        uint8_t eb;
  117|  59.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 4, False: 59.0k]
  ------------------
  118|      4|          return false;
  119|      4|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  59.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  59.0k|      }
  124|  68.4k|      probability_table_[i] = prob;
  125|  68.4k|    }
  126|  80.9k|  }
  127|     56|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 43]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|     43|  return true;
  131|     56|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|     43|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|     43|    DecoderBuffer *buffer) {
  136|     43|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     43|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     43|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     43|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 27]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 16]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     16|  } else
  145|     27|#endif
  146|     27|  {
  147|     27|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 27]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     27|  }
  151|     43|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 20, False: 23]
  ------------------
  152|     20|    return false;
  153|     20|  }
  154|     23|  const uint8_t *const data_head =
  155|     23|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     23|  buffer->Advance(bytes_encoded);
  158|     23|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 6, False: 17]
  ------------------
  159|      6|    return false;
  160|      6|  }
  161|     17|  return true;
  162|     23|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   104k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     17|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     17|  ans_.read_end();
  167|     17|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|     74|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|     74|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     74|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 74]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     74|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     74|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     74|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 59]
  ------------------
   67|     15|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 15]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     15|  } else
   72|     59|#endif
   73|     59|  {
   74|     59|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 59]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     59|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     74|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 68]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|     68|  probability_table_.resize(num_symbols_);
   86|     68|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 65]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|  20.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 20.6k, False: 23]
  ------------------
   91|  20.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|  20.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 20.6k]
  ------------------
   95|     16|      return false;
   96|     16|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  20.6k|    const int token = prob_data & 3;
  102|  20.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.92k, False: 16.6k]
  ------------------
  103|  3.92k|      const uint32_t offset = prob_data >> 2;
  104|  3.92k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 3.91k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   150k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 146k, False: 3.91k]
  ------------------
  109|   146k|        probability_table_[i + j] = 0;
  110|   146k|      }
  111|  3.91k|      i += offset;
  112|  16.6k|    } else {
  113|  16.6k|      const int extra_bytes = token;
  114|  16.6k|      uint32_t prob = prob_data >> 2;
  115|  31.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 15.1k, False: 16.6k]
  ------------------
  116|  15.1k|        uint8_t eb;
  117|  15.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 15.0k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  15.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  15.0k|      }
  124|  16.6k|      probability_table_[i] = prob;
  125|  16.6k|    }
  126|  20.6k|  }
  127|     23|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 9]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|      9|  return true;
  131|     23|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|     12|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|      9|    DecoderBuffer *buffer) {
  136|      9|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      9|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      9|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      9|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 9]
  ------------------
  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|      9|#endif
  146|      9|  {
  147|      9|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 9]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      9|  }
  151|      9|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 3, False: 6]
  ------------------
  152|      3|    return false;
  153|      3|  }
  154|      6|  const uint8_t *const data_head =
  155|      6|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      6|  buffer->Advance(bytes_encoded);
  158|      6|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 6]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      6|  return true;
  162|      6|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  35.4k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|      6|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      6|  ans_.read_end();
  167|      6|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|     83|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|     83|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     83|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 83]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     83|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     83|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     83|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 12, False: 71]
  ------------------
   67|     12|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 12]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     12|  } else
   72|     71|#endif
   73|     71|  {
   74|     71|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 71]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     71|  }
   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|     83|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 83]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     83|  probability_table_.resize(num_symbols_);
   86|     83|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 82]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   143k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 143k, False: 38]
  ------------------
   91|   143k|    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|   143k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 19, False: 143k]
  ------------------
   95|     19|      return false;
   96|     19|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   143k|    const int token = prob_data & 3;
  102|   143k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 19.0k, False: 124k]
  ------------------
  103|  19.0k|      const uint32_t offset = prob_data >> 2;
  104|  19.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 19.0k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   549k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 530k, False: 19.0k]
  ------------------
  109|   530k|        probability_table_[i + j] = 0;
  110|   530k|      }
  111|  19.0k|      i += offset;
  112|   124k|    } else {
  113|   124k|      const int extra_bytes = token;
  114|   124k|      uint32_t prob = prob_data >> 2;
  115|   267k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 142k, False: 124k]
  ------------------
  116|   142k|        uint8_t eb;
  117|   142k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 142k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   142k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   142k|      }
  124|   124k|      probability_table_[i] = prob;
  125|   124k|    }
  126|   143k|  }
  127|     38|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 33]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|     33|  return true;
  131|     38|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|     34|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|     33|    DecoderBuffer *buffer) {
  136|     33|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     33|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     33|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     33|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 12, False: 21]
  ------------------
  140|     12|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 12]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     12|  } else
  145|     21|#endif
  146|     21|  {
  147|     21|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 21]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     21|  }
  151|     33|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 23, False: 10]
  ------------------
  152|     23|    return false;
  153|     23|  }
  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|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  12.1k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     10|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     10|  ans_.read_end();
  167|     10|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    109|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    109|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    109|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 109]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    109|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    109|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    109|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 3, False: 106]
  ------------------
   67|      3|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 3]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      3|  } else
   72|    106|#endif
   73|    106|  {
   74|    106|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 106]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    106|  }
   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|    109|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 105]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|    105|  probability_table_.resize(num_symbols_);
   86|    105|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 104]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   544k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 544k, False: 63]
  ------------------
   91|   544k|    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|   544k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 544k]
  ------------------
   95|     16|      return false;
   96|     16|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   544k|    const int token = prob_data & 3;
  102|   544k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 311k, False: 232k]
  ------------------
  103|   311k|      const uint32_t offset = prob_data >> 2;
  104|   311k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 311k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  10.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 10.2M, False: 311k]
  ------------------
  109|  10.2M|        probability_table_[i + j] = 0;
  110|  10.2M|      }
  111|   311k|      i += offset;
  112|   311k|    } else {
  113|   232k|      const int extra_bytes = token;
  114|   232k|      uint32_t prob = prob_data >> 2;
  115|   391k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 158k, False: 232k]
  ------------------
  116|   158k|        uint8_t eb;
  117|   158k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 158k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   158k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   158k|      }
  124|   232k|      probability_table_[i] = prob;
  125|   232k|    }
  126|   544k|  }
  127|     63|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 42]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|     42|  return true;
  131|     63|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|     43|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|     42|    DecoderBuffer *buffer) {
  136|     42|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     42|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     42|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     42|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 42]
  ------------------
  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|     42|#endif
  146|     42|  {
  147|     42|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 42]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     42|  }
  151|     42|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 3, False: 39]
  ------------------
  152|      3|    return false;
  153|      3|  }
  154|     39|  const uint8_t *const data_head =
  155|     39|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     39|  buffer->Advance(bytes_encoded);
  158|     39|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 12, False: 27]
  ------------------
  159|     12|    return false;
  160|     12|  }
  161|     27|  return true;
  162|     39|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   123k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     27|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     27|  ans_.read_end();
  167|     27|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    122|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    122|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    122|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 122]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    122|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    122|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    122|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 26, False: 96]
  ------------------
   67|     26|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 26]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     26|  } else
   72|     96|#endif
   73|     96|  {
   74|     96|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 96]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     96|  }
   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|    122|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 118]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|    118|  probability_table_.resize(num_symbols_);
   86|    118|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 118]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   104k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 104k, False: 67]
  ------------------
   91|   104k|    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|   104k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 22, False: 104k]
  ------------------
   95|     22|      return false;
   96|     22|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   104k|    const int token = prob_data & 3;
  102|   104k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 38.6k, False: 65.6k]
  ------------------
  103|  38.6k|      const uint32_t offset = prob_data >> 2;
  104|  38.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 38.6k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.93M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.89M, False: 38.6k]
  ------------------
  109|  1.89M|        probability_table_[i + j] = 0;
  110|  1.89M|      }
  111|  38.6k|      i += offset;
  112|  65.6k|    } else {
  113|  65.6k|      const int extra_bytes = token;
  114|  65.6k|      uint32_t prob = prob_data >> 2;
  115|   140k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 75.2k, False: 65.6k]
  ------------------
  116|  75.2k|        uint8_t eb;
  117|  75.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 75.2k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  75.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  75.2k|      }
  124|  65.6k|      probability_table_[i] = prob;
  125|  65.6k|    }
  126|   104k|  }
  127|     67|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 11, False: 56]
  ------------------
  128|     11|    return false;
  129|     11|  }
  130|     56|  return true;
  131|     67|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|     56|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|     56|    DecoderBuffer *buffer) {
  136|     56|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     56|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     56|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     56|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 5, False: 51]
  ------------------
  140|      5|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 5]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      5|  } else
  145|     51|#endif
  146|     51|  {
  147|     51|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 51]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     51|  }
  151|     56|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 22, False: 34]
  ------------------
  152|     22|    return false;
  153|     22|  }
  154|     34|  const uint8_t *const data_head =
  155|     34|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     34|  buffer->Advance(bytes_encoded);
  158|     34|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 8, False: 26]
  ------------------
  159|      8|    return false;
  160|      8|  }
  161|     26|  return true;
  162|     34|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|   113k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     26|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     26|  ans_.read_end();
  167|     26|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|     88|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|     88|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     88|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 88]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     88|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     88|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     88|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 32, False: 56]
  ------------------
   67|     32|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 32]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     32|  } else
   72|     56|#endif
   73|     56|  {
   74|     56|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 56]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     56|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     88|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 87]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|     87|  probability_table_.resize(num_symbols_);
   86|     87|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 87]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  67.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 66.9k, False: 41]
  ------------------
   91|  66.9k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  66.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 22, False: 66.9k]
  ------------------
   95|     22|      return false;
   96|     22|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  66.9k|    const int token = prob_data & 3;
  102|  66.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 22.8k, False: 44.0k]
  ------------------
  103|  22.8k|      const uint32_t offset = prob_data >> 2;
  104|  22.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 12, False: 22.8k]
  ------------------
  105|     12|        return false;
  106|     12|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   984k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 961k, False: 22.8k]
  ------------------
  109|   961k|        probability_table_[i + j] = 0;
  110|   961k|      }
  111|  22.8k|      i += offset;
  112|  44.0k|    } else {
  113|  44.0k|      const int extra_bytes = token;
  114|  44.0k|      uint32_t prob = prob_data >> 2;
  115|   100k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 56.9k, False: 44.0k]
  ------------------
  116|  56.9k|        uint8_t eb;
  117|  56.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 56.9k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  56.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  56.9k|      }
  124|  44.0k|      probability_table_[i] = prob;
  125|  44.0k|    }
  126|  66.9k|  }
  127|     41|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 36]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|     36|  return true;
  131|     41|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|     36|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|     36|    DecoderBuffer *buffer) {
  136|     36|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     36|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     36|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     36|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 15, False: 21]
  ------------------
  140|     15|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 15]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     15|  } else
  145|     21|#endif
  146|     21|  {
  147|     21|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 21]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     21|  }
  151|     36|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 19, False: 17]
  ------------------
  152|     19|    return false;
  153|     19|  }
  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: 11, False: 6]
  ------------------
  159|     11|    return false;
  160|     11|  }
  161|      6|  return true;
  162|     17|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  1.58M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|      6|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      6|  ans_.read_end();
  167|      6|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|     79|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|     79|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     79|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 79]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     79|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     79|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     79|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 9, False: 70]
  ------------------
   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|     70|#endif
   73|     70|  {
   74|     70|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 70]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     70|  }
   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|     79|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 77]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|     77|  probability_table_.resize(num_symbols_);
   86|     77|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 77]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  9.41k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 9.37k, False: 39]
  ------------------
   91|  9.37k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  9.37k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 13, False: 9.36k]
  ------------------
   95|     13|      return false;
   96|     13|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  9.36k|    const int token = prob_data & 3;
  102|  9.36k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.05k, False: 5.30k]
  ------------------
  103|  4.05k|      const uint32_t offset = prob_data >> 2;
  104|  4.05k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 19, False: 4.03k]
  ------------------
  105|     19|        return false;
  106|     19|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   160k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 156k, False: 4.03k]
  ------------------
  109|   156k|        probability_table_[i + j] = 0;
  110|   156k|      }
  111|  4.03k|      i += offset;
  112|  5.30k|    } else {
  113|  5.30k|      const int extra_bytes = token;
  114|  5.30k|      uint32_t prob = prob_data >> 2;
  115|  9.17k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.87k, False: 5.30k]
  ------------------
  116|  3.87k|        uint8_t eb;
  117|  3.87k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 3.87k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.87k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.87k|      }
  124|  5.30k|      probability_table_[i] = prob;
  125|  5.30k|    }
  126|  9.36k|  }
  127|     39|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 34]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|     34|  return true;
  131|     39|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|     34|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|     34|    DecoderBuffer *buffer) {
  136|     34|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     34|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     34|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     34|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 34]
  ------------------
  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|     34|#endif
  146|     34|  {
  147|     34|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 34]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     34|  }
  151|     34|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 10, False: 24]
  ------------------
  152|     10|    return false;
  153|     10|  }
  154|     24|  const uint8_t *const data_head =
  155|     24|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     24|  buffer->Advance(bytes_encoded);
  158|     24|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 2, False: 22]
  ------------------
  159|      2|    return false;
  160|      2|  }
  161|     22|  return true;
  162|     24|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  11.0M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     22|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     22|  ans_.read_end();
  167|     22|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    125|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    125|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    125|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 125]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    125|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    125|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    125|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 12, False: 113]
  ------------------
   67|     12|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 12]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     12|  } else
   72|    113|#endif
   73|    113|  {
   74|    113|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 111]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    113|  }
   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|    123|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 116]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    116|  probability_table_.resize(num_symbols_);
   86|    116|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 116]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   122k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 122k, False: 72]
  ------------------
   91|   122k|    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|   122k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 121k]
  ------------------
   95|     14|      return false;
   96|     14|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   121k|    const int token = prob_data & 3;
  102|   121k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 94.8k, False: 27.1k]
  ------------------
  103|  94.8k|      const uint32_t offset = prob_data >> 2;
  104|  94.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 94.8k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.63M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.53M, False: 94.8k]
  ------------------
  109|  4.53M|        probability_table_[i + j] = 0;
  110|  4.53M|      }
  111|  94.8k|      i += offset;
  112|  94.8k|    } else {
  113|  27.1k|      const int extra_bytes = token;
  114|  27.1k|      uint32_t prob = prob_data >> 2;
  115|  38.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 11.2k, False: 27.0k]
  ------------------
  116|  11.2k|        uint8_t eb;
  117|  11.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 9, False: 11.2k]
  ------------------
  118|      9|          return false;
  119|      9|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  11.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  11.2k|      }
  124|  27.0k|      probability_table_[i] = prob;
  125|  27.0k|    }
  126|   121k|  }
  127|     72|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 69]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|     69|  return true;
  131|     72|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|     69|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|     69|    DecoderBuffer *buffer) {
  136|     69|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     69|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     69|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     69|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 5, False: 64]
  ------------------
  140|      5|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 5]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      5|  } else
  145|     64|#endif
  146|     64|  {
  147|     64|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 59]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|     64|  }
  151|     64|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 21, False: 43]
  ------------------
  152|     21|    return false;
  153|     21|  }
  154|     43|  const uint8_t *const data_head =
  155|     43|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     43|  buffer->Advance(bytes_encoded);
  158|     43|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 6, False: 37]
  ------------------
  159|      6|    return false;
  160|      6|  }
  161|     37|  return true;
  162|     43|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  6.42M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     37|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     37|  ans_.read_end();
  167|     37|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    144|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    144|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    144|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 144]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    144|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    144|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    144|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 27, False: 117]
  ------------------
   67|     27|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 27]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     27|  } else
   72|    117|#endif
   73|    117|  {
   74|    117|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 117]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    117|  }
   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|    144|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 143]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|    143|  probability_table_.resize(num_symbols_);
   86|    143|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 143]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  20.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 20.4k, False: 97]
  ------------------
   91|  20.4k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  20.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 20, False: 20.4k]
  ------------------
   95|     20|      return false;
   96|     20|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  20.4k|    const int token = prob_data & 3;
  102|  20.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.83k, False: 15.6k]
  ------------------
  103|  4.83k|      const uint32_t offset = prob_data >> 2;
  104|  4.83k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 11, False: 4.82k]
  ------------------
  105|     11|        return false;
  106|     11|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   177k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 172k, False: 4.82k]
  ------------------
  109|   172k|        probability_table_[i + j] = 0;
  110|   172k|      }
  111|  4.82k|      i += offset;
  112|  15.6k|    } else {
  113|  15.6k|      const int extra_bytes = token;
  114|  15.6k|      uint32_t prob = prob_data >> 2;
  115|  30.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 15.0k, False: 15.6k]
  ------------------
  116|  15.0k|        uint8_t eb;
  117|  15.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 15.0k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  15.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  15.0k|      }
  124|  15.6k|      probability_table_[i] = prob;
  125|  15.6k|    }
  126|  20.4k|  }
  127|     97|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 77]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|     77|  return true;
  131|     97|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|     77|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|     77|    DecoderBuffer *buffer) {
  136|     77|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     77|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     77|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     77|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 18, False: 59]
  ------------------
  140|     18|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 17]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     18|  } else
  145|     59|#endif
  146|     59|  {
  147|     59|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 53]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|     59|  }
  151|     70|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 39, False: 31]
  ------------------
  152|     39|    return false;
  153|     39|  }
  154|     31|  const uint8_t *const data_head =
  155|     31|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     31|  buffer->Advance(bytes_encoded);
  158|     31|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 7, False: 24]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|     24|  return true;
  162|     31|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  62.9k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     24|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     24|  ans_.read_end();
  167|     24|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  3.92k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  3.92k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 0, False: 3.92k]
  ------------------
   35|      0|    return true;
   36|      0|  }
   37|       |  // Decode which scheme to use.
   38|  3.92k|  uint8_t scheme;
   39|  3.92k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 15, False: 3.90k]
  ------------------
   40|     15|    return false;
   41|     15|  }
   42|  3.90k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 402, False: 3.50k]
  ------------------
   43|    402|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    402|                                                  src_buffer, out_values);
   45|  3.50k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 2.36k, False: 1.14k]
  ------------------
   46|  2.36k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  2.36k|                                               out_values);
   48|  2.36k|  }
   49|  1.14k|  return false;
   50|  3.90k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    402|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    402|  SymbolDecoderT<5> tag_decoder;
   57|    402|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 244, False: 158]
  ------------------
   58|    244|    return false;
   59|    244|  }
   60|       |
   61|    158|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 80, False: 78]
  ------------------
   62|     80|    return false;
   63|     80|  }
   64|       |
   65|     78|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 78, False: 0]
  |  Branch (65:25): [True: 30, False: 48]
  ------------------
   66|     30|    return false;  // Wrong number of symbols.
   67|     30|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|     48|  src_buffer->StartBitDecoding(false, nullptr);
   72|     48|  int value_id = 0;
   73|   129k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 129k, False: 48]
  ------------------
   74|       |    // Decode the tag.
   75|   129k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|   267k|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 137k, False: 129k]
  ------------------
   78|   137k|      uint32_t val;
   79|   137k|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 137k]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|   137k|      out_values[value_id++] = val;
   83|   137k|    }
   84|   129k|  }
   85|     48|  tag_decoder.EndDecoding();
   86|     48|  src_buffer->EndBitDecoding();
   87|     48|  return true;
   88|     48|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  2.36k|                      uint32_t *out_values) {
  117|  2.36k|  uint8_t max_bit_length;
  118|  2.36k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 3, False: 2.35k]
  ------------------
  119|      3|    return false;
  120|      3|  }
  121|  2.35k|  switch (max_bit_length) {
  122|    241|    case 1:
  ------------------
  |  Branch (122:5): [True: 241, False: 2.11k]
  ------------------
  123|    241|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    241|                                                         out_values);
  125|    181|    case 2:
  ------------------
  |  Branch (125:5): [True: 181, False: 2.17k]
  ------------------
  126|    181|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    181|                                                         out_values);
  128|    166|    case 3:
  ------------------
  |  Branch (128:5): [True: 166, False: 2.19k]
  ------------------
  129|    166|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    166|                                                         out_values);
  131|    110|    case 4:
  ------------------
  |  Branch (131:5): [True: 110, False: 2.24k]
  ------------------
  132|    110|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    110|                                                         out_values);
  134|     96|    case 5:
  ------------------
  |  Branch (134:5): [True: 96, False: 2.26k]
  ------------------
  135|     96|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|     96|                                                         out_values);
  137|     86|    case 6:
  ------------------
  |  Branch (137:5): [True: 86, False: 2.27k]
  ------------------
  138|     86|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|     86|                                                         out_values);
  140|    171|    case 7:
  ------------------
  |  Branch (140:5): [True: 171, False: 2.18k]
  ------------------
  141|    171|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    171|                                                         out_values);
  143|    135|    case 8:
  ------------------
  |  Branch (143:5): [True: 135, False: 2.22k]
  ------------------
  144|    135|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    135|                                                         out_values);
  146|    126|    case 9:
  ------------------
  |  Branch (146:5): [True: 126, False: 2.23k]
  ------------------
  147|    126|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    126|                                                         out_values);
  149|     93|    case 10:
  ------------------
  |  Branch (149:5): [True: 93, False: 2.26k]
  ------------------
  150|     93|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|     93|          num_values, src_buffer, out_values);
  152|     74|    case 11:
  ------------------
  |  Branch (152:5): [True: 74, False: 2.28k]
  ------------------
  153|     74|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|     74|          num_values, src_buffer, out_values);
  155|     83|    case 12:
  ------------------
  |  Branch (155:5): [True: 83, False: 2.27k]
  ------------------
  156|     83|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|     83|          num_values, src_buffer, out_values);
  158|    109|    case 13:
  ------------------
  |  Branch (158:5): [True: 109, False: 2.24k]
  ------------------
  159|    109|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    109|          num_values, src_buffer, out_values);
  161|    122|    case 14:
  ------------------
  |  Branch (161:5): [True: 122, False: 2.23k]
  ------------------
  162|    122|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    122|          num_values, src_buffer, out_values);
  164|     88|    case 15:
  ------------------
  |  Branch (164:5): [True: 88, False: 2.26k]
  ------------------
  165|     88|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|     88|          num_values, src_buffer, out_values);
  167|     79|    case 16:
  ------------------
  |  Branch (167:5): [True: 79, False: 2.27k]
  ------------------
  168|     79|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|     79|          num_values, src_buffer, out_values);
  170|    125|    case 17:
  ------------------
  |  Branch (170:5): [True: 125, False: 2.23k]
  ------------------
  171|    125|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    125|          num_values, src_buffer, out_values);
  173|    144|    case 18:
  ------------------
  |  Branch (173:5): [True: 144, False: 2.21k]
  ------------------
  174|    144|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    144|          num_values, src_buffer, out_values);
  176|    128|    default:
  ------------------
  |  Branch (176:5): [True: 128, False: 2.22k]
  ------------------
  177|    128|      return false;
  178|  2.35k|  }
  179|  2.35k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    241|                              uint32_t *out_values) {
   93|    241|  SymbolDecoderT decoder;
   94|    241|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 149, False: 92]
  ------------------
   95|    149|    return false;
   96|    149|  }
   97|       |
   98|     92|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 92, False: 0]
  |  Branch (98:25): [True: 4, False: 88]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|     88|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 9, False: 79]
  ------------------
  103|      9|    return false;
  104|      9|  }
  105|  1.68M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.68M, False: 79]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.68M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.68M|    out_values[i] = value;
  109|  1.68M|  }
  110|     79|  decoder.EndDecoding();
  111|     79|  return true;
  112|     88|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    181|                              uint32_t *out_values) {
   93|    181|  SymbolDecoderT decoder;
   94|    181|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 89, False: 92]
  ------------------
   95|     89|    return false;
   96|     89|  }
   97|       |
   98|     92|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 92, False: 0]
  |  Branch (98:25): [True: 1, False: 91]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     91|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 43, False: 48]
  ------------------
  103|     43|    return false;
  104|     43|  }
  105|   394k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 394k, False: 48]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   394k|    const uint32_t value = decoder.DecodeSymbol();
  108|   394k|    out_values[i] = value;
  109|   394k|  }
  110|     48|  decoder.EndDecoding();
  111|     48|  return true;
  112|     91|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    166|                              uint32_t *out_values) {
   93|    166|  SymbolDecoderT decoder;
   94|    166|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 34, False: 132]
  ------------------
   95|     34|    return false;
   96|     34|  }
   97|       |
   98|    132|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 132, False: 0]
  |  Branch (98:25): [True: 0, False: 132]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    132|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 46, False: 86]
  ------------------
  103|     46|    return false;
  104|     46|  }
  105|  16.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 16.0M, False: 86]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  16.0M|    const uint32_t value = decoder.DecodeSymbol();
  108|  16.0M|    out_values[i] = value;
  109|  16.0M|  }
  110|     86|  decoder.EndDecoding();
  111|     86|  return true;
  112|    132|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    110|                              uint32_t *out_values) {
   93|    110|  SymbolDecoderT decoder;
   94|    110|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 42, False: 68]
  ------------------
   95|     42|    return false;
   96|     42|  }
   97|       |
   98|     68|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 68, False: 0]
  |  Branch (98:25): [True: 0, False: 68]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     68|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 3, False: 65]
  ------------------
  103|      3|    return false;
  104|      3|  }
  105|   594k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 594k, False: 65]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   594k|    const uint32_t value = decoder.DecodeSymbol();
  108|   594k|    out_values[i] = value;
  109|   594k|  }
  110|     65|  decoder.EndDecoding();
  111|     65|  return true;
  112|     68|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|     96|                              uint32_t *out_values) {
   93|     96|  SymbolDecoderT decoder;
   94|     96|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 8, False: 88]
  ------------------
   95|      8|    return false;
   96|      8|  }
   97|       |
   98|     88|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 88, False: 0]
  |  Branch (98:25): [True: 72, False: 16]
  ------------------
   99|     72|    return false;  // Wrong number of symbols.
  100|     72|  }
  101|       |
  102|     16|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 16]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  4.93M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.93M, False: 16]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.93M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.93M|    out_values[i] = value;
  109|  4.93M|  }
  110|     16|  decoder.EndDecoding();
  111|     16|  return true;
  112|     16|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|     86|                              uint32_t *out_values) {
   93|     86|  SymbolDecoderT decoder;
   94|     86|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 54, False: 32]
  ------------------
   95|     54|    return false;
   96|     54|  }
   97|       |
   98|     32|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 32, False: 0]
  |  Branch (98:25): [True: 1, False: 31]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     31|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 21, False: 10]
  ------------------
  103|     21|    return false;
  104|     21|  }
  105|  3.30M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.30M, False: 10]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.30M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.30M|    out_values[i] = value;
  109|  3.30M|  }
  110|     10|  decoder.EndDecoding();
  111|     10|  return true;
  112|     31|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    171|                              uint32_t *out_values) {
   93|    171|  SymbolDecoderT decoder;
   94|    171|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 79, False: 92]
  ------------------
   95|     79|    return false;
   96|     79|  }
   97|       |
   98|     92|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 92, False: 0]
  |  Branch (98:25): [True: 0, False: 92]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     92|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 20, False: 72]
  ------------------
  103|     20|    return false;
  104|     20|  }
  105|  1.95M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.95M, False: 72]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.95M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.95M|    out_values[i] = value;
  109|  1.95M|  }
  110|     72|  decoder.EndDecoding();
  111|     72|  return true;
  112|     92|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    135|                              uint32_t *out_values) {
   93|    135|  SymbolDecoderT decoder;
   94|    135|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 58, False: 77]
  ------------------
   95|     58|    return false;
   96|     58|  }
   97|       |
   98|     77|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 77, False: 0]
  |  Branch (98:25): [True: 0, False: 77]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     77|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 52, False: 25]
  ------------------
  103|     52|    return false;
  104|     52|  }
  105|  1.78M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.78M, False: 25]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.78M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.78M|    out_values[i] = value;
  109|  1.78M|  }
  110|     25|  decoder.EndDecoding();
  111|     25|  return true;
  112|     77|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    126|                              uint32_t *out_values) {
   93|    126|  SymbolDecoderT decoder;
   94|    126|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 67, False: 59]
  ------------------
   95|     67|    return false;
   96|     67|  }
   97|       |
   98|     59|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 59, False: 0]
  |  Branch (98:25): [True: 0, False: 59]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     59|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 30, False: 29]
  ------------------
  103|     30|    return false;
  104|     30|  }
  105|  94.9k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 94.9k, False: 29]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  94.9k|    const uint32_t value = decoder.DecodeSymbol();
  108|  94.9k|    out_values[i] = value;
  109|  94.9k|  }
  110|     29|  decoder.EndDecoding();
  111|     29|  return true;
  112|     59|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|     93|                              uint32_t *out_values) {
   93|     93|  SymbolDecoderT decoder;
   94|     93|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 50, False: 43]
  ------------------
   95|     50|    return false;
   96|     50|  }
   97|       |
   98|     43|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 43, False: 0]
  |  Branch (98:25): [True: 0, False: 43]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     43|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 26, False: 17]
  ------------------
  103|     26|    return false;
  104|     26|  }
  105|   104k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 104k, False: 17]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   104k|    const uint32_t value = decoder.DecodeSymbol();
  108|   104k|    out_values[i] = value;
  109|   104k|  }
  110|     17|  decoder.EndDecoding();
  111|     17|  return true;
  112|     43|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|     74|                              uint32_t *out_values) {
   93|     74|  SymbolDecoderT decoder;
   94|     74|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 62, False: 12]
  ------------------
   95|     62|    return false;
   96|     62|  }
   97|       |
   98|     12|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 12, False: 0]
  |  Branch (98:25): [True: 3, False: 9]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|      9|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 3, False: 6]
  ------------------
  103|      3|    return false;
  104|      3|  }
  105|  35.5k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 35.4k, False: 6]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  35.4k|    const uint32_t value = decoder.DecodeSymbol();
  108|  35.4k|    out_values[i] = value;
  109|  35.4k|  }
  110|      6|  decoder.EndDecoding();
  111|      6|  return true;
  112|      9|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|     83|                              uint32_t *out_values) {
   93|     83|  SymbolDecoderT decoder;
   94|     83|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 49, False: 34]
  ------------------
   95|     49|    return false;
   96|     49|  }
   97|       |
   98|     34|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 34, False: 0]
  |  Branch (98:25): [True: 1, False: 33]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     33|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 23, False: 10]
  ------------------
  103|     23|    return false;
  104|     23|  }
  105|  12.1k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.1k, False: 10]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.1k|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.1k|    out_values[i] = value;
  109|  12.1k|  }
  110|     10|  decoder.EndDecoding();
  111|     10|  return true;
  112|     33|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    109|                              uint32_t *out_values) {
   93|    109|  SymbolDecoderT decoder;
   94|    109|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 66, False: 43]
  ------------------
   95|     66|    return false;
   96|     66|  }
   97|       |
   98|     43|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 43, False: 0]
  |  Branch (98:25): [True: 1, False: 42]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     42|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 15, False: 27]
  ------------------
  103|     15|    return false;
  104|     15|  }
  105|   123k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 123k, False: 27]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   123k|    const uint32_t value = decoder.DecodeSymbol();
  108|   123k|    out_values[i] = value;
  109|   123k|  }
  110|     27|  decoder.EndDecoding();
  111|     27|  return true;
  112|     42|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    122|                              uint32_t *out_values) {
   93|    122|  SymbolDecoderT decoder;
   94|    122|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 66, False: 56]
  ------------------
   95|     66|    return false;
   96|     66|  }
   97|       |
   98|     56|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 56, False: 0]
  |  Branch (98:25): [True: 0, False: 56]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     56|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 30, False: 26]
  ------------------
  103|     30|    return false;
  104|     30|  }
  105|   113k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 113k, False: 26]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   113k|    const uint32_t value = decoder.DecodeSymbol();
  108|   113k|    out_values[i] = value;
  109|   113k|  }
  110|     26|  decoder.EndDecoding();
  111|     26|  return true;
  112|     56|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|     88|                              uint32_t *out_values) {
   93|     88|  SymbolDecoderT decoder;
   94|     88|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 52, False: 36]
  ------------------
   95|     52|    return false;
   96|     52|  }
   97|       |
   98|     36|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 36, False: 0]
  |  Branch (98:25): [True: 0, False: 36]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     36|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 30, False: 6]
  ------------------
  103|     30|    return false;
  104|     30|  }
  105|  1.58M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.58M, False: 6]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.58M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.58M|    out_values[i] = value;
  109|  1.58M|  }
  110|      6|  decoder.EndDecoding();
  111|      6|  return true;
  112|     36|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|     79|                              uint32_t *out_values) {
   93|     79|  SymbolDecoderT decoder;
   94|     79|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 45, False: 34]
  ------------------
   95|     45|    return false;
   96|     45|  }
   97|       |
   98|     34|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 34, False: 0]
  |  Branch (98:25): [True: 0, False: 34]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     34|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 12, False: 22]
  ------------------
  103|     12|    return false;
  104|     12|  }
  105|  11.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 11.0M, False: 22]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  11.0M|    const uint32_t value = decoder.DecodeSymbol();
  108|  11.0M|    out_values[i] = value;
  109|  11.0M|  }
  110|     22|  decoder.EndDecoding();
  111|     22|  return true;
  112|     34|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    125|                              uint32_t *out_values) {
   93|    125|  SymbolDecoderT decoder;
   94|    125|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 56, False: 69]
  ------------------
   95|     56|    return false;
   96|     56|  }
   97|       |
   98|     69|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 69, False: 0]
  |  Branch (98:25): [True: 0, False: 69]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     69|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 32, False: 37]
  ------------------
  103|     32|    return false;
  104|     32|  }
  105|  6.42M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.42M, False: 37]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.42M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.42M|    out_values[i] = value;
  109|  6.42M|  }
  110|     37|  decoder.EndDecoding();
  111|     37|  return true;
  112|     69|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    144|                              uint32_t *out_values) {
   93|    144|  SymbolDecoderT decoder;
   94|    144|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 67, False: 77]
  ------------------
   95|     67|    return false;
   96|     67|  }
   97|       |
   98|     77|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 77, False: 0]
  |  Branch (98:25): [True: 0, False: 77]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     77|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 53, False: 24]
  ------------------
  103|     53|    return false;
  104|     53|  }
  105|  62.9k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 62.9k, False: 24]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  62.9k|    const uint32_t value = decoder.DecodeSymbol();
  108|  62.9k|    out_values[i] = value;
  109|  62.9k|  }
  110|     24|  decoder.EndDecoding();
  111|     24|  return true;
  112|     77|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  3.55k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  1.48k|  const CornerTable *GetCornerTable() const override {
   67|  1.48k|    return corner_table_.get();
   68|  1.48k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  2.36M|                       int *out_encoder_split_symbol_id) {
   87|  2.36M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 2.11M, False: 256k]
  ------------------
   88|  2.11M|      return false;
   89|  2.11M|    }
   90|   256k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 5, False: 256k]
  ------------------
   91|   256k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|      5|      *out_encoder_split_symbol_id = -1;
   98|      5|      return true;
   99|      5|    }
  100|   256k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 255k, False: 762]
  ------------------
  101|   255k|      return false;
  102|   255k|    }
  103|    762|    *out_face_edge =
  104|    762|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    762|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    762|    topology_split_data_.pop_back();
  108|    762|    return true;
  109|   256k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  9.51M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  9.51M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  9.51M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  9.51M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  5.90k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  2.57k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  2.11k|  const CornerTable *GetCornerTable() const override {
   67|  2.11k|    return corner_table_.get();
   68|  2.11k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  12.8M|                       int *out_encoder_split_symbol_id) {
   87|  12.8M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 12.6M, False: 226k]
  ------------------
   88|  12.6M|      return false;
   89|  12.6M|    }
   90|   226k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 23, False: 226k]
  ------------------
   91|   226k|        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|     23|      *out_encoder_split_symbol_id = -1;
   98|     23|      return true;
   99|     23|    }
  100|   226k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 225k, False: 934]
  ------------------
  101|   225k|      return false;
  102|   225k|    }
  103|    934|    *out_face_edge =
  104|    934|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    934|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    934|    topology_split_data_.pop_back();
  108|    934|    return true;
  109|   226k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  38.2M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  38.2M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  38.2M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  38.2M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  3.15k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  4.42k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|    993|  const CornerTable *GetCornerTable() const override {
   67|    993|    return corner_table_.get();
   68|    993|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  22.6M|                       int *out_encoder_split_symbol_id) {
   87|  22.6M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 22.3M, False: 319k]
  ------------------
   88|  22.3M|      return false;
   89|  22.3M|    }
   90|   319k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 12, False: 319k]
  ------------------
   91|   319k|        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|     12|      *out_encoder_split_symbol_id = -1;
   98|     12|      return true;
   99|     12|    }
  100|   319k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 318k, False: 773]
  ------------------
  101|   318k|      return false;
  102|   318k|    }
  103|    773|    *out_face_edge =
  104|    773|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    773|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    773|    topology_split_data_.pop_back();
  108|    773|    return true;
  109|   319k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  26.7M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  26.7M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  26.7M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  26.7M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  2.18k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

_ZN5draco13HoleEventDataC2Ev:
  118|  1.22M|  HoleEventData() : symbol_id(0) {}

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  3.04k|      : attribute_connectivity_decoders_(nullptr),
   34|  3.04k|        num_attribute_data_(0),
   35|  3.04k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  2.82k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  2.82k|    decoder_impl_ = decoder;
   38|  2.82k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  2.82k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  2.82k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  2.82k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  2.06k|  uint16_t BitstreamVersion() const {
   45|  2.06k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  2.06k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  1.18k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  2.82k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  2.04k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  2.04k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 17, False: 2.02k]
  ------------------
   63|     17|      return false;
   64|     17|    }
   65|       |
   66|  2.02k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 32, False: 1.99k]
  ------------------
   67|     32|      return false;
   68|     32|    }
   69|       |
   70|  1.99k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 10, False: 1.98k]
  ------------------
   71|     10|      return false;
   72|     10|    }
   73|  1.98k|    *out_buffer = buffer_;
   74|  1.98k|    return true;
   75|  1.99k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  2.94M|  inline bool DecodeStartFaceConfiguration() {
   79|  2.94M|    uint32_t face_configuration;
   80|  2.94M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  2.94M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.94M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 447, False: 2.94M]
  ------------------
   82|    447|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    447|    } else
   85|  2.94M|#endif
   86|  2.94M|    {
   87|  2.94M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  2.94M|    }
   89|  2.94M|    return face_configuration;
   90|  2.94M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  6.54M|  inline uint32_t DecodeSymbol() {
   94|  6.54M|    uint32_t symbol;
   95|  6.54M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  6.54M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 3.19M, False: 3.35M]
  ------------------
   97|  3.19M|      return symbol;
   98|  3.19M|    }
   99|       |    // Else decode two additional bits.
  100|  3.35M|    uint32_t symbol_suffix;
  101|  3.35M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  3.35M|    symbol |= (symbol_suffix << 1);
  103|  3.35M|    return symbol;
  104|  6.54M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  6.48M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|   954k|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  9.66M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  9.66M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  9.66M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  1.93k|  void Done() {
  123|  1.93k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 1.79k, False: 141]
  ------------------
  124|  1.79k|      symbol_buffer_.EndBitDecoding();
  125|  1.79k|    }
  126|  1.93k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  1.93k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.93k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 308, False: 1.62k]
  ------------------
  128|    308|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    308|    } else
  131|  1.62k|#endif
  132|  1.62k|    {
  133|  1.62k|      start_face_decoder_.EndDecoding();
  134|  1.62k|    }
  135|  1.93k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|    749|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  2.14k|  bool DecodeTraversalSymbols() {
  141|  2.14k|    uint64_t traversal_size;
  142|  2.14k|    symbol_buffer_ = buffer_;
  143|  2.14k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 3, False: 2.14k]
  ------------------
  144|      3|      return false;
  145|      3|    }
  146|  2.14k|    buffer_ = symbol_buffer_;
  147|  2.14k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 35, False: 2.10k]
  ------------------
  148|     35|      return false;
  149|     35|    }
  150|  2.10k|    buffer_.Advance(traversal_size);
  151|  2.10k|    return true;
  152|  2.14k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  2.79k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  2.79k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  2.79k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.79k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 430, False: 2.36k]
  ------------------
  158|    430|      start_face_buffer_ = buffer_;
  159|    430|      uint64_t traversal_size;
  160|    430|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 0, False: 430]
  ------------------
  161|      0|        return false;
  162|      0|      }
  163|    430|      buffer_ = start_face_buffer_;
  164|    430|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 43, False: 387]
  ------------------
  165|     43|        return false;
  166|     43|      }
  167|    387|      buffer_.Advance(traversal_size);
  168|    387|      return true;
  169|    430|    }
  170|  2.36k|#endif
  171|  2.36k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  2.79k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  2.74k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  2.74k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 1.95k, False: 788]
  ------------------
  177|  1.95k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  1.95k|          new BinaryDecoder[num_attribute_data_]);
  179|  6.71k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 4.77k, False: 1.94k]
  ------------------
  180|  4.77k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 12, False: 4.76k]
  ------------------
  181|     12|          return false;
  182|     12|        }
  183|  4.77k|      }
  184|  1.95k|    }
  185|  2.73k|    return true;
  186|  2.74k|  }

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    660|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.20M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.20M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.19M, False: 8.19k]
  ------------------
   61|  1.19M|      return true;  // Already traversed.
   62|  1.19M|    }
   63|       |
   64|  8.19k|    corner_traversal_stack_.clear();
   65|  8.19k|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  8.19k|    const VertexIndex next_vert =
   69|  8.19k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  8.19k|    const VertexIndex prev_vert =
   71|  8.19k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  8.19k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 8.19k]
  |  Branch (72:45): [True: 0, False: 8.19k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  8.19k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 8.09k, False: 100]
  ------------------
   76|  8.09k|      this->MarkVertexVisited(next_vert);
   77|  8.09k|      this->traversal_observer().OnNewVertexVisited(
   78|  8.09k|          next_vert, this->corner_table()->Next(corner_id));
   79|  8.09k|    }
   80|  8.19k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.25k, False: 5.94k]
  ------------------
   81|  2.25k|      this->MarkVertexVisited(prev_vert);
   82|  2.25k|      this->traversal_observer().OnNewVertexVisited(
   83|  2.25k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.25k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  26.4k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 18.2k, False: 8.19k]
  ------------------
   88|       |      // Currently processed corner.
   89|  18.2k|      corner_id = corner_traversal_stack_.back();
   90|  18.2k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  18.2k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 18.2k]
  |  Branch (92:47): [True: 519, False: 17.7k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    519|        corner_traversal_stack_.pop_back();
   95|    519|        continue;
   96|    519|      }
   97|  1.20M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.20M, Folded]
  ------------------
   98|  1.20M|        this->MarkFaceVisited(face_id);
   99|  1.20M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.20M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.20M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.20M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.20M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 607k, False: 597k]
  ------------------
  105|   607k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   607k|          this->MarkVertexVisited(vert_id);
  107|   607k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   607k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 589k, False: 17.3k]
  ------------------
  109|   589k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   589k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   589k|            continue;
  112|   589k|          }
  113|   607k|        }
  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|   614k|        const CornerIndex right_corner_id =
  118|   614k|            this->corner_table()->GetRightCorner(corner_id);
  119|   614k|        const CornerIndex left_corner_id =
  120|   614k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   614k|        const FaceIndex right_face_id(
  122|   614k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 12.2k, False: 602k]
  ------------------
  123|   614k|                 ? kInvalidFaceIndex
  124|   614k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   614k|        const FaceIndex left_face_id(
  126|   614k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 12.6k, False: 602k]
  ------------------
  127|   614k|                 ? kInvalidFaceIndex
  128|   614k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   614k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 593k, False: 21.5k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   593k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 12.6k, False: 580k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  12.6k|            corner_traversal_stack_.pop_back();
  134|  12.6k|            break;  // Break from the while (true) loop.
  135|   580k|          } else {
  136|       |            // Go to the left face.
  137|   580k|            corner_id = left_corner_id;
  138|   580k|            face_id = left_face_id;
  139|   580k|          }
  140|   593k|        } else {
  141|       |          // Right face was not visited.
  142|  21.5k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 16.5k, False: 5.01k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  16.5k|            corner_id = right_corner_id;
  145|  16.5k|            face_id = right_face_id;
  146|  16.5k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  5.01k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  5.01k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  5.01k|            break;
  159|  5.01k|          }
  160|  21.5k|        }
  161|   614k|      }
  162|  17.7k|    }
  163|  8.19k|    return true;
  164|  8.19k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    660|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  1.35k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    916|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.64M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.64M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 691k, False: 957k]
  ------------------
   61|   691k|      return true;  // Already traversed.
   62|   691k|    }
   63|       |
   64|   957k|    corner_traversal_stack_.clear();
   65|   957k|    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|   957k|    const VertexIndex next_vert =
   69|   957k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|   957k|    const VertexIndex prev_vert =
   71|   957k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|   957k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 957k]
  |  Branch (72:45): [True: 0, False: 957k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|   957k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 956k, False: 697]
  ------------------
   76|   956k|      this->MarkVertexVisited(next_vert);
   77|   956k|      this->traversal_observer().OnNewVertexVisited(
   78|   956k|          next_vert, this->corner_table()->Next(corner_id));
   79|   956k|    }
   80|   957k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 940k, False: 16.8k]
  ------------------
   81|   940k|      this->MarkVertexVisited(prev_vert);
   82|   940k|      this->traversal_observer().OnNewVertexVisited(
   83|   940k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|   940k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  1.95M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 996k, False: 957k]
  ------------------
   88|       |      // Currently processed corner.
   89|   996k|      corner_id = corner_traversal_stack_.back();
   90|   996k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|   996k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 996k]
  |  Branch (92:47): [True: 3.03k, False: 993k]
  ------------------
   93|       |        // This face has been already traversed.
   94|  3.03k|        corner_traversal_stack_.pop_back();
   95|  3.03k|        continue;
   96|  3.03k|      }
   97|  1.64M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.64M, Folded]
  ------------------
   98|  1.64M|        this->MarkFaceVisited(face_id);
   99|  1.64M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.64M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.64M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.64M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.64M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.29M, False: 349k]
  ------------------
  105|  1.29M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.29M|          this->MarkVertexVisited(vert_id);
  107|  1.29M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.29M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 325k, False: 974k]
  ------------------
  109|   325k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   325k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   325k|            continue;
  112|   325k|          }
  113|  1.29M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  1.32M|        const CornerIndex right_corner_id =
  118|  1.32M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.32M|        const CornerIndex left_corner_id =
  120|  1.32M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.32M|        const FaceIndex right_face_id(
  122|  1.32M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 959k, False: 363k]
  ------------------
  123|  1.32M|                 ? kInvalidFaceIndex
  124|  1.32M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.32M|        const FaceIndex left_face_id(
  126|  1.32M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 971k, False: 352k]
  ------------------
  127|  1.32M|                 ? kInvalidFaceIndex
  128|  1.32M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.32M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.27M, False: 44.5k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.27M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 973k, False: 305k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|   973k|            corner_traversal_stack_.pop_back();
  134|   973k|            break;  // Break from the while (true) loop.
  135|   973k|          } else {
  136|       |            // Go to the left face.
  137|   305k|            corner_id = left_corner_id;
  138|   305k|            face_id = left_face_id;
  139|   305k|          }
  140|  1.27M|        } else {
  141|       |          // Right face was not visited.
  142|  44.5k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 25.0k, False: 19.5k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  25.0k|            corner_id = right_corner_id;
  145|  25.0k|            face_id = right_face_id;
  146|  25.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|  19.5k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  19.5k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  19.5k|            break;
  159|  19.5k|          }
  160|  44.5k|        }
  161|  1.32M|      }
  162|   993k|    }
  163|   957k|    return true;
  164|   957k|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    916|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  1.85k|  DepthFirstTraverser() {}

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

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

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

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  1.85k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  12.4M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  6.23M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  6.23M|    return is_vertex_visited_[vert_id.value()];
   65|  6.23M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  1.11M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  1.11M|    is_vertex_visited_[vert_id.value()] = true;
   68|  1.11M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  3.23M|  inline TraversalObserverT &traversal_observer() {
   75|  3.23M|    return traversal_observer_;
   76|  3.23M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  4.87M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  4.87M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 77.6k, False: 4.79M]
  ------------------
   47|  77.6k|      return true;  // Invalid faces are always considered as visited.
   48|  77.6k|    }
   49|  4.79M|    return is_face_visited_[face_id.value()];
   50|  4.87M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.12M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.12M|    is_face_visited_[face_id.value()] = true;
   62|  2.12M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  1.74k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  1.74k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    870|                    TraversalObserver traversal_observer) {
   37|    870|    corner_table_ = corner_table;
   38|    870|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    870|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    870|    traversal_observer_ = traversal_observer;
   41|    870|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.20M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.20M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.20M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.20M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.20M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  11.6M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.64M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.64M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.64M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.64M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.64M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  3.56M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  3.56M|    return is_vertex_visited_[vert_id.value()];
   65|  3.56M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  3.19M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  3.19M|    is_vertex_visited_[vert_id.value()] = true;
   68|  3.19M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  4.84M|  inline TraversalObserverT &traversal_observer() {
   75|  4.84M|    return traversal_observer_;
   76|  4.84M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  3.64M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  3.64M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 1.93M, False: 1.71M]
  ------------------
   47|  1.93M|      return true;  // Invalid faces are always considered as visited.
   48|  1.93M|    }
   49|  1.71M|    return is_face_visited_[face_id.value()];
   50|  3.64M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  1.64M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  1.64M|    is_face_visited_[face_id.value()] = true;
   62|  1.64M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  1.85k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    925|                    TraversalObserver traversal_observer) {
   37|    925|    corner_table_ = corner_table;
   38|    925|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    925|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    925|    traversal_observer_ = traversal_observer;
   41|    925|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    106|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    106|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 103]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    103|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 9, False: 94]
  ------------------
  190|      9|    return false;
  191|      9|  }
  192|     94|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 92]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|     92|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 39, False: 53]
  ------------------
  196|     39|    return true;
  197|     39|  }
  198|     53|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 3, False: 50]
  ------------------
  199|      3|    return false;
  200|      3|  }
  201|     50|  num_decoded_points_ = 0;
  202|       |
  203|     50|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 9, False: 41]
  ------------------
  204|      9|    return false;
  205|      9|  }
  206|     41|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 6, False: 35]
  ------------------
  207|      6|    return false;
  208|      6|  }
  209|     35|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 35]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     35|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 35]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     35|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 26, False: 9]
  ------------------
  217|     26|    return false;
  218|     26|  }
  219|       |
  220|      9|  numbers_decoder_.EndDecoding();
  221|      9|  remaining_bits_decoder_.EndDecoding();
  222|      9|  axis_decoder_.EndDecoding();
  223|      9|  half_decoder_.EndDecoding();
  224|       |
  225|      9|  return true;
  226|     35|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     35|    uint32_t num_points, OutputIteratorT &oit) {
  254|     35|  typedef DecodingStatus Status;
  255|     35|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     35|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     35|  DecodingStatus init_status(num_points, 0, 0);
  258|     35|  std::stack<Status> status_stack;
  259|     35|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   142k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 142k, False: 9]
  ------------------
  263|   142k|    const DecodingStatus status = status_stack.top();
  264|   142k|    status_stack.pop();
  265|       |
  266|   142k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   142k|    const uint32_t last_axis = status.last_axis;
  268|   142k|    const uint32_t stack_pos = status.stack_pos;
  269|   142k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   142k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   142k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 142k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   142k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   142k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 142k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   142k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   142k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 66.6k, False: 76.2k]
  ------------------
  285|  11.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 11.1M, False: 66.6k]
  ------------------
  286|  11.1M|        *oit = old_base;
  287|  11.1M|        ++oit;
  288|  11.1M|        ++num_decoded_points_;
  289|  11.1M|      }
  290|  66.6k|      continue;
  291|  66.6k|    }
  292|       |
  293|  76.2k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  76.2k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 4.35k, False: 71.8k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  4.35k|      axes_[0] = axis;
  300|  13.8k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 9.50k, False: 4.35k]
  ------------------
  301|  9.50k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  9.50k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.72k, False: 6.77k]
  |  |  ------------------
  ------------------
  302|  9.50k|      }
  303|  11.5k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 7.22k, False: 4.34k]
  ------------------
  304|  29.7k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 22.5k, False: 7.21k]
  ------------------
  305|  22.5k|          p_[axes_[j]] = 0;
  306|  22.5k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  22.5k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 19.3k, False: 3.18k]
  ------------------
  308|  19.3k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 10, False: 19.3k]
  ------------------
  309|  19.3k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     10|              return false;
  311|     10|            }
  312|  19.3k|          }
  313|  22.5k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  22.5k|        }
  315|  7.21k|        *oit = p_;
  316|  7.21k|        ++oit;
  317|  7.21k|        ++num_decoded_points_;
  318|  7.21k|      }
  319|  4.34k|      continue;
  320|  4.35k|    }
  321|       |
  322|  71.8k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 71.8k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  71.8k|    const int num_remaining_bits = bit_length_ - level;
  327|  71.8k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  71.8k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  71.8k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  71.8k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  71.8k|    uint32_t number = 0;
  334|  71.8k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  71.8k|    uint32_t first_half = num_remaining_points / 2;
  337|  71.8k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 16, False: 71.8k]
  ------------------
  338|       |      // Invalid |number|.
  339|     16|      return false;
  340|     16|    }
  341|  71.8k|    first_half -= number;
  342|  71.8k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  71.8k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 42.4k, False: 29.4k]
  ------------------
  345|  42.4k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 39.7k, False: 2.65k]
  ------------------
  346|  39.7k|        std::swap(first_half, second_half);
  347|  39.7k|      }
  348|  42.4k|    }
  349|       |
  350|  71.8k|    levels_stack_[stack_pos][axis] += 1;
  351|  71.8k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  71.8k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 71.7k, False: 83]
  ------------------
  353|  71.7k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  71.7k|    }
  355|  71.8k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 71.4k, False: 380]
  ------------------
  356|  71.4k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  71.4k|    }
  358|  71.8k|  }
  359|      9|  return true;
  360|     35|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  1.73M|        : num_remaining_points(num_remaining_points_),
  135|  1.73M|          last_axis(last_axis_),
  136|  1.73M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|   868k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   868k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   868k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     39|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    161|      : bit_length_(0),
   87|    161|        num_points_(0),
   88|    161|        num_decoded_points_(0),
   89|    161|        dimension_(dimension),
   90|    161|        p_(dimension, 0),
   91|    161|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    161|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    161|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     36|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     36|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 33]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|     33|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 32]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     32|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 32]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     32|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 4, False: 28]
  ------------------
  196|      4|    return true;
  197|      4|  }
  198|     28|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 28]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     28|  num_decoded_points_ = 0;
  202|       |
  203|     28|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 27]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|     27|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 24]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     24|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 24]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     24|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 23]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     23|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 19, False: 4]
  ------------------
  217|     19|    return false;
  218|     19|  }
  219|       |
  220|      4|  numbers_decoder_.EndDecoding();
  221|      4|  remaining_bits_decoder_.EndDecoding();
  222|      4|  axis_decoder_.EndDecoding();
  223|      4|  half_decoder_.EndDecoding();
  224|       |
  225|      4|  return true;
  226|     23|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     23|    uint32_t num_points, OutputIteratorT &oit) {
  254|     23|  typedef DecodingStatus Status;
  255|     23|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     23|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     23|  DecodingStatus init_status(num_points, 0, 0);
  258|     23|  std::stack<Status> status_stack;
  259|     23|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.89M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.89M, False: 4]
  ------------------
  263|  2.89M|    const DecodingStatus status = status_stack.top();
  264|  2.89M|    status_stack.pop();
  265|       |
  266|  2.89M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.89M|    const uint32_t last_axis = status.last_axis;
  268|  2.89M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.89M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.89M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.89M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.89M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.89M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.89M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.89M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.89M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.89M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.44M, False: 1.44M]
  ------------------
  285|  13.5M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 12.1M, False: 1.44M]
  ------------------
  286|  12.1M|        *oit = old_base;
  287|  12.1M|        ++oit;
  288|  12.1M|        ++num_decoded_points_;
  289|  12.1M|      }
  290|  1.44M|      continue;
  291|  1.44M|    }
  292|       |
  293|  1.44M|    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.44M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.17k, False: 1.44M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.17k|      axes_[0] = axis;
  300|  8.68k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 7.51k, False: 1.17k]
  ------------------
  301|  7.51k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  7.51k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 345, False: 7.16k]
  |  |  ------------------
  ------------------
  302|  7.51k|      }
  303|  3.24k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.07k, False: 1.16k]
  ------------------
  304|  17.0k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 14.9k, False: 2.07k]
  ------------------
  305|  14.9k|          p_[axes_[j]] = 0;
  306|  14.9k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  14.9k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 6.55k, False: 8.40k]
  ------------------
  308|  6.55k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 8, False: 6.54k]
  ------------------
  309|  6.55k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      8|              return false;
  311|      8|            }
  312|  6.55k|          }
  313|  14.9k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  14.9k|        }
  315|  2.07k|        *oit = p_;
  316|  2.07k|        ++oit;
  317|  2.07k|        ++num_decoded_points_;
  318|  2.07k|      }
  319|  1.16k|      continue;
  320|  1.17k|    }
  321|       |
  322|  1.44M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.44M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.44M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.44M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.44M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.44M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.44M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.44M|    uint32_t number = 0;
  334|  1.44M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.44M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.44M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 11, False: 1.44M]
  ------------------
  338|       |      // Invalid |number|.
  339|     11|      return false;
  340|     11|    }
  341|  1.44M|    first_half -= number;
  342|  1.44M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.44M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 801k, False: 644k]
  ------------------
  345|   801k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 796k, False: 4.96k]
  ------------------
  346|   796k|        std::swap(first_half, second_half);
  347|   796k|      }
  348|   801k|    }
  349|       |
  350|  1.44M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.44M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.44M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.44M, False: 96]
  ------------------
  353|  1.44M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.44M|    }
  355|  1.44M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.44M, False: 128]
  ------------------
  356|  1.44M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.44M|    }
  358|  1.44M|  }
  359|      4|  return true;
  360|     23|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  9.30M|        : num_remaining_points(num_remaining_points_),
  135|  9.30M|          last_axis(last_axis_),
  136|  9.30M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  9.30M|    uint32_t last_axis) {
  232|  9.30M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 9.30M, Folded]
  ------------------
  233|  9.30M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  9.30M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 4.52M, False: 4.78M]
  |  |  ------------------
  ------------------
  234|  9.30M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  9.30M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  4.65M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  4.65M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  4.65M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|      4|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     35|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     35|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 35]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     35|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 33]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|     33|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 33]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     33|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 6, False: 27]
  ------------------
  196|      6|    return true;
  197|      6|  }
  198|     27|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 7, False: 20]
  ------------------
  199|      7|    return false;
  200|      7|  }
  201|     20|  num_decoded_points_ = 0;
  202|       |
  203|     20|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 18]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     18|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 17]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     17|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 4, False: 13]
  ------------------
  210|      4|    return false;
  211|      4|  }
  212|     13|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 13]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     13|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 13, False: 0]
  ------------------
  217|     13|    return false;
  218|     13|  }
  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|     13|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     13|    uint32_t num_points, OutputIteratorT &oit) {
  254|     13|  typedef DecodingStatus Status;
  255|     13|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     13|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     13|  DecodingStatus init_status(num_points, 0, 0);
  258|     13|  std::stack<Status> status_stack;
  259|     13|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  16.9k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 16.9k, False: 0]
  ------------------
  263|  16.9k|    const DecodingStatus status = status_stack.top();
  264|  16.9k|    status_stack.pop();
  265|       |
  266|  16.9k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  16.9k|    const uint32_t last_axis = status.last_axis;
  268|  16.9k|    const uint32_t stack_pos = status.stack_pos;
  269|  16.9k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  16.9k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  16.9k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 16.9k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  16.9k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  16.9k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 16.9k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  16.9k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  16.9k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.08k, False: 14.9k]
  ------------------
  285|  7.75k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 5.67k, False: 2.08k]
  ------------------
  286|  5.67k|        *oit = old_base;
  287|  5.67k|        ++oit;
  288|  5.67k|        ++num_decoded_points_;
  289|  5.67k|      }
  290|  2.08k|      continue;
  291|  2.08k|    }
  292|       |
  293|  14.9k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  14.9k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 82, False: 14.8k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     82|      axes_[0] = axis;
  300|    345|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 263, False: 82]
  ------------------
  301|    263|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    263|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 35, False: 228]
  |  |  ------------------
  ------------------
  302|    263|      }
  303|    219|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 141, False: 78]
  ------------------
  304|    713|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 576, False: 137]
  ------------------
  305|    576|          p_[axes_[j]] = 0;
  306|    576|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|    576|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 487, False: 89]
  ------------------
  308|    487|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 4, False: 483]
  ------------------
  309|    487|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      4|              return false;
  311|      4|            }
  312|    487|          }
  313|    572|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|    572|        }
  315|    137|        *oit = p_;
  316|    137|        ++oit;
  317|    137|        ++num_decoded_points_;
  318|    137|      }
  319|     78|      continue;
  320|     82|    }
  321|       |
  322|  14.8k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 14.8k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  14.8k|    const int num_remaining_bits = bit_length_ - level;
  327|  14.8k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  14.8k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  14.8k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  14.8k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  14.8k|    uint32_t number = 0;
  334|  14.8k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  14.8k|    uint32_t first_half = num_remaining_points / 2;
  337|  14.8k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 9, False: 14.8k]
  ------------------
  338|       |      // Invalid |number|.
  339|      9|      return false;
  340|      9|    }
  341|  14.8k|    first_half -= number;
  342|  14.8k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  14.8k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 13.7k, False: 1.11k]
  ------------------
  345|  13.7k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 11.6k, False: 2.09k]
  ------------------
  346|  11.6k|        std::swap(first_half, second_half);
  347|  11.6k|      }
  348|  13.7k|    }
  349|       |
  350|  14.8k|    levels_stack_[stack_pos][axis] += 1;
  351|  14.8k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  14.8k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 12.8k, False: 1.94k]
  ------------------
  353|  12.8k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  12.8k|    }
  355|  14.8k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 4.21k, False: 10.6k]
  ------------------
  356|  4.21k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  4.21k|    }
  358|  14.8k|  }
  359|      0|  return true;
  360|     13|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|   118k|        : num_remaining_points(num_remaining_points_),
  135|   118k|          last_axis(last_axis_),
  136|   118k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  65.7k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  65.7k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  65.7k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|      6|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|     88|      : bit_length_(0),
   87|     88|        num_points_(0),
   88|     88|        num_decoded_points_(0),
   89|     88|        dimension_(dimension),
   90|     88|        p_(dimension, 0),
   91|     88|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     88|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     88|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     25|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     25|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 25]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     25|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 24]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     24|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 24]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     24|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 7, False: 17]
  ------------------
  196|      7|    return true;
  197|      7|  }
  198|     17|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 15]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|     15|  num_decoded_points_ = 0;
  202|       |
  203|     15|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 14]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|     14|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 13]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     13|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 12]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     12|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 12]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     12|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 12, False: 0]
  ------------------
  217|     12|    return false;
  218|     12|  }
  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|     12|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     12|    uint32_t num_points, OutputIteratorT &oit) {
  254|     12|  typedef DecodingStatus Status;
  255|     12|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     12|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     12|  DecodingStatus init_status(num_points, 0, 0);
  258|     12|  std::stack<Status> status_stack;
  259|     12|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  14.7k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 14.7k, False: 0]
  ------------------
  263|  14.7k|    const DecodingStatus status = status_stack.top();
  264|  14.7k|    status_stack.pop();
  265|       |
  266|  14.7k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  14.7k|    const uint32_t last_axis = status.last_axis;
  268|  14.7k|    const uint32_t stack_pos = status.stack_pos;
  269|  14.7k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  14.7k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  14.7k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 14.7k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  14.7k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  14.7k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 14.7k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  14.7k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  14.7k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 9, False: 14.7k]
  ------------------
  285|  3.08k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 3.07k, False: 9]
  ------------------
  286|  3.07k|        *oit = old_base;
  287|  3.07k|        ++oit;
  288|  3.07k|        ++num_decoded_points_;
  289|  3.07k|      }
  290|      9|      continue;
  291|      9|    }
  292|       |
  293|  14.7k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  14.7k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.06k, False: 13.7k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.06k|      axes_[0] = axis;
  300|  2.20k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.13k, False: 1.06k]
  ------------------
  301|  1.13k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.13k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 545, False: 590]
  |  |  ------------------
  ------------------
  302|  1.13k|      }
  303|  2.76k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.70k, False: 1.06k]
  ------------------
  304|  5.20k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.50k, False: 1.69k]
  ------------------
  305|  3.50k|          p_[axes_[j]] = 0;
  306|  3.50k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.50k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.47k, False: 33]
  ------------------
  308|  3.47k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 1, False: 3.47k]
  ------------------
  309|  3.47k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      1|              return false;
  311|      1|            }
  312|  3.47k|          }
  313|  3.50k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  3.50k|        }
  315|  1.69k|        *oit = p_;
  316|  1.69k|        ++oit;
  317|  1.69k|        ++num_decoded_points_;
  318|  1.69k|      }
  319|  1.06k|      continue;
  320|  1.06k|    }
  321|       |
  322|  13.7k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 13.7k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  13.7k|    const int num_remaining_bits = bit_length_ - level;
  327|  13.7k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  13.7k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  13.7k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  13.7k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  13.7k|    uint32_t number = 0;
  334|  13.7k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  13.7k|    uint32_t first_half = num_remaining_points / 2;
  337|  13.7k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 11, False: 13.6k]
  ------------------
  338|       |      // Invalid |number|.
  339|     11|      return false;
  340|     11|    }
  341|  13.6k|    first_half -= number;
  342|  13.6k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  13.6k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 13.3k, False: 363]
  ------------------
  345|  13.3k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 11.3k, False: 2.01k]
  ------------------
  346|  11.3k|        std::swap(first_half, second_half);
  347|  11.3k|      }
  348|  13.3k|    }
  349|       |
  350|  13.6k|    levels_stack_[stack_pos][axis] += 1;
  351|  13.6k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  13.6k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 11.7k, False: 1.97k]
  ------------------
  353|  11.7k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  11.7k|    }
  355|  13.6k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 3.20k, False: 10.4k]
  ------------------
  356|  3.20k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  3.20k|    }
  358|  13.6k|  }
  359|      0|  return true;
  360|     12|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  71.4k|        : num_remaining_points(num_remaining_points_),
  135|  71.4k|          last_axis(last_axis_),
  136|  71.4k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  70.3k|    uint32_t last_axis) {
  232|  70.3k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 70.3k, Folded]
  ------------------
  233|  70.3k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  70.3k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 17.6k, False: 52.7k]
  |  |  ------------------
  ------------------
  234|  70.3k|  }
  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|  70.3k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  42.0k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  42.0k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  42.0k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|      7|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    120|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    120|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 119]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    119|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 118]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|    118|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 118]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    118|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 26, False: 92]
  ------------------
  196|     26|    return true;
  197|     26|  }
  198|     92|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 8, False: 84]
  ------------------
  199|      8|    return false;
  200|      8|  }
  201|     84|  num_decoded_points_ = 0;
  202|       |
  203|     84|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 83]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|     83|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 81]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     81|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 4, False: 77]
  ------------------
  210|      4|    return false;
  211|      4|  }
  212|     77|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 76]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     76|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 60, False: 16]
  ------------------
  217|     60|    return false;
  218|     60|  }
  219|       |
  220|     16|  numbers_decoder_.EndDecoding();
  221|     16|  remaining_bits_decoder_.EndDecoding();
  222|     16|  axis_decoder_.EndDecoding();
  223|     16|  half_decoder_.EndDecoding();
  224|       |
  225|     16|  return true;
  226|     76|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     76|    uint32_t num_points, OutputIteratorT &oit) {
  254|     76|  typedef DecodingStatus Status;
  255|     76|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     76|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     76|  DecodingStatus init_status(num_points, 0, 0);
  258|     76|  std::stack<Status> status_stack;
  259|     76|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.79M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.79M, False: 16]
  ------------------
  263|  2.79M|    const DecodingStatus status = status_stack.top();
  264|  2.79M|    status_stack.pop();
  265|       |
  266|  2.79M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.79M|    const uint32_t last_axis = status.last_axis;
  268|  2.79M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.79M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.79M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.79M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.79M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.79M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.79M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.79M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.79M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.79M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.30M, False: 1.48M]
  ------------------
  285|  65.3M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 63.9M, False: 1.30M]
  ------------------
  286|  63.9M|        *oit = old_base;
  287|  63.9M|        ++oit;
  288|  63.9M|        ++num_decoded_points_;
  289|  63.9M|      }
  290|  1.30M|      continue;
  291|  1.30M|    }
  292|       |
  293|  1.48M|    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.48M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 79.8k, False: 1.40M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  79.8k|      axes_[0] = axis;
  300|   130k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 50.2k, False: 79.8k]
  ------------------
  301|  50.2k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  50.2k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 18.4k, False: 31.8k]
  |  |  ------------------
  ------------------
  302|  50.2k|      }
  303|   201k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 121k, False: 79.7k]
  ------------------
  304|   312k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 190k, False: 121k]
  ------------------
  305|   190k|          p_[axes_[j]] = 0;
  306|   190k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   190k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 168k, False: 22.0k]
  ------------------
  308|   168k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 55, False: 168k]
  ------------------
  309|   168k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     55|              return false;
  311|     55|            }
  312|   168k|          }
  313|   190k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   190k|        }
  315|   121k|        *oit = p_;
  316|   121k|        ++oit;
  317|   121k|        ++num_decoded_points_;
  318|   121k|      }
  319|  79.7k|      continue;
  320|  79.8k|    }
  321|       |
  322|  1.40M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.40M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.40M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.40M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.40M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.40M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.40M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.40M|    uint32_t number = 0;
  334|  1.40M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.40M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.40M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 5, False: 1.40M]
  ------------------
  338|       |      // Invalid |number|.
  339|      5|      return false;
  340|      5|    }
  341|  1.40M|    first_half -= number;
  342|  1.40M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.40M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.35M, False: 48.6k]
  ------------------
  345|  1.35M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.32M, False: 29.9k]
  ------------------
  346|  1.32M|        std::swap(first_half, second_half);
  347|  1.32M|      }
  348|  1.35M|    }
  349|       |
  350|  1.40M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.40M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.40M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.39M, False: 8.95k]
  ------------------
  353|  1.39M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.39M|    }
  355|  1.40M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.39M, False: 12.7k]
  ------------------
  356|  1.39M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.39M|    }
  358|  1.40M|  }
  359|     16|  return true;
  360|     76|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  2.79M|        : num_remaining_points(num_remaining_points_),
  135|  2.79M|          last_axis(last_axis_),
  136|  2.79M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  1.40M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.40M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.40M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     42|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    142|      : bit_length_(0),
   87|    142|        num_points_(0),
   88|    142|        num_decoded_points_(0),
   89|    142|        dimension_(dimension),
   90|    142|        p_(dimension, 0),
   91|    142|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    142|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    142|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    134|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    134|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 134]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    134|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 133]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|    133|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 133]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    133|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 5, False: 128]
  ------------------
  196|      5|    return true;
  197|      5|  }
  198|    128|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 9, False: 119]
  ------------------
  199|      9|    return false;
  200|      9|  }
  201|    119|  num_decoded_points_ = 0;
  202|       |
  203|    119|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 20, False: 99]
  ------------------
  204|     20|    return false;
  205|     20|  }
  206|     99|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 5, False: 94]
  ------------------
  207|      5|    return false;
  208|      5|  }
  209|     94|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 9, False: 85]
  ------------------
  210|      9|    return false;
  211|      9|  }
  212|     85|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 82]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     82|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 40, False: 42]
  ------------------
  217|     40|    return false;
  218|     40|  }
  219|       |
  220|     42|  numbers_decoder_.EndDecoding();
  221|     42|  remaining_bits_decoder_.EndDecoding();
  222|     42|  axis_decoder_.EndDecoding();
  223|     42|  half_decoder_.EndDecoding();
  224|       |
  225|     42|  return true;
  226|     82|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     82|    uint32_t num_points, OutputIteratorT &oit) {
  254|     82|  typedef DecodingStatus Status;
  255|     82|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     82|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     82|  DecodingStatus init_status(num_points, 0, 0);
  258|     82|  std::stack<Status> status_stack;
  259|     82|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.48M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.48M, False: 42]
  ------------------
  263|  2.48M|    const DecodingStatus status = status_stack.top();
  264|  2.48M|    status_stack.pop();
  265|       |
  266|  2.48M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.48M|    const uint32_t last_axis = status.last_axis;
  268|  2.48M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.48M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.48M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.48M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.48M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.48M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.48M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.48M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.48M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.48M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.16M, False: 1.32M]
  ------------------
  285|  98.9M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 97.8M, False: 1.16M]
  ------------------
  286|  97.8M|        *oit = old_base;
  287|  97.8M|        ++oit;
  288|  97.8M|        ++num_decoded_points_;
  289|  97.8M|      }
  290|  1.16M|      continue;
  291|  1.16M|    }
  292|       |
  293|  1.32M|    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.32M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 66.2k, False: 1.26M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  66.2k|      axes_[0] = axis;
  300|   200k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 134k, False: 66.2k]
  ------------------
  301|   134k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   134k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 17.7k, False: 116k]
  |  |  ------------------
  ------------------
  302|   134k|      }
  303|   166k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 100k, False: 66.2k]
  ------------------
  304|   419k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 319k, False: 100k]
  ------------------
  305|   319k|          p_[axes_[j]] = 0;
  306|   319k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   319k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 148k, False: 170k]
  ------------------
  308|   148k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 39, False: 148k]
  ------------------
  309|   148k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     39|              return false;
  311|     39|            }
  312|   148k|          }
  313|   319k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   319k|        }
  315|   100k|        *oit = p_;
  316|   100k|        ++oit;
  317|   100k|        ++num_decoded_points_;
  318|   100k|      }
  319|  66.2k|      continue;
  320|  66.2k|    }
  321|       |
  322|  1.26M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.26M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.26M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.26M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.26M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.26M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.26M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.26M|    uint32_t number = 0;
  334|  1.26M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.26M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.26M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 1.26M]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|  1.26M|    first_half -= number;
  342|  1.26M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.26M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.21M, False: 40.4k]
  ------------------
  345|  1.21M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.17M, False: 39.6k]
  ------------------
  346|  1.17M|        std::swap(first_half, second_half);
  347|  1.17M|      }
  348|  1.21M|    }
  349|       |
  350|  1.26M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.26M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.26M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.24M, False: 13.0k]
  ------------------
  353|  1.24M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.24M|    }
  355|  1.26M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.24M, False: 19.0k]
  ------------------
  356|  1.24M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.24M|    }
  358|  1.26M|  }
  359|     42|  return true;
  360|     82|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  2.48M|        : num_remaining_points(num_remaining_points_),
  135|  2.48M|          last_axis(last_axis_),
  136|  2.48M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.48M|    uint32_t last_axis) {
  232|  2.48M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.48M, Folded]
  ------------------
  233|  2.48M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.48M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.26M, False: 1.21M]
  |  |  ------------------
  ------------------
  234|  2.48M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  2.48M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.26M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.26M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.26M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     47|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    114|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    114|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 113]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    113|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 111]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|    111|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 111]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    111|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 10, False: 101]
  ------------------
  196|     10|    return true;
  197|     10|  }
  198|    101|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 4, False: 97]
  ------------------
  199|      4|    return false;
  200|      4|  }
  201|     97|  num_decoded_points_ = 0;
  202|       |
  203|     97|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 8, False: 89]
  ------------------
  204|      8|    return false;
  205|      8|  }
  206|     89|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 85]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     85|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 84]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     84|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 83]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     83|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 70, False: 13]
  ------------------
  217|     70|    return false;
  218|     70|  }
  219|       |
  220|     13|  numbers_decoder_.EndDecoding();
  221|     13|  remaining_bits_decoder_.EndDecoding();
  222|     13|  axis_decoder_.EndDecoding();
  223|     13|  half_decoder_.EndDecoding();
  224|       |
  225|     13|  return true;
  226|     83|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     83|    uint32_t num_points, OutputIteratorT &oit) {
  254|     83|  typedef DecodingStatus Status;
  255|     83|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     83|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     83|  DecodingStatus init_status(num_points, 0, 0);
  258|     83|  std::stack<Status> status_stack;
  259|     83|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   173k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 173k, False: 13]
  ------------------
  263|   173k|    const DecodingStatus status = status_stack.top();
  264|   173k|    status_stack.pop();
  265|       |
  266|   173k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   173k|    const uint32_t last_axis = status.last_axis;
  268|   173k|    const uint32_t stack_pos = status.stack_pos;
  269|   173k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   173k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   173k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 173k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   173k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   173k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 7, False: 173k]
  ------------------
  278|      7|      return false;
  279|      7|    }
  280|       |
  281|   173k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   173k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 482, False: 173k]
  ------------------
  285|  55.6k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 55.1k, False: 482]
  ------------------
  286|  55.1k|        *oit = old_base;
  287|  55.1k|        ++oit;
  288|  55.1k|        ++num_decoded_points_;
  289|  55.1k|      }
  290|    482|      continue;
  291|    482|    }
  292|       |
  293|   173k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   173k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 672, False: 172k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    672|      axes_[0] = axis;
  300|  42.3k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 41.7k, False: 672]
  ------------------
  301|  41.7k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  41.7k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 657, False: 41.0k]
  |  |  ------------------
  ------------------
  302|  41.7k|      }
  303|  1.53k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 903, False: 636]
  ------------------
  304|  54.9k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 54.0k, False: 867]
  ------------------
  305|  54.0k|          p_[axes_[j]] = 0;
  306|  54.0k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  54.0k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 53.8k, False: 236]
  ------------------
  308|  53.8k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 36, False: 53.7k]
  ------------------
  309|  53.8k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     36|              return false;
  311|     36|            }
  312|  53.8k|          }
  313|  54.0k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  54.0k|        }
  315|    867|        *oit = p_;
  316|    867|        ++oit;
  317|    867|        ++num_decoded_points_;
  318|    867|      }
  319|    636|      continue;
  320|    672|    }
  321|       |
  322|   172k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 172k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   172k|    const int num_remaining_bits = bit_length_ - level;
  327|   172k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   172k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   172k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   172k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   172k|    uint32_t number = 0;
  334|   172k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   172k|    uint32_t first_half = num_remaining_points / 2;
  337|   172k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 27, False: 172k]
  ------------------
  338|       |      // Invalid |number|.
  339|     27|      return false;
  340|     27|    }
  341|   172k|    first_half -= number;
  342|   172k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   172k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 172k, False: 83]
  ------------------
  345|   172k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 130k, False: 42.2k]
  ------------------
  346|   130k|        std::swap(first_half, second_half);
  347|   130k|      }
  348|   172k|    }
  349|       |
  350|   172k|    levels_stack_[stack_pos][axis] += 1;
  351|   172k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   172k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 130k, False: 41.8k]
  ------------------
  353|   130k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   130k|    }
  355|   172k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 43.1k, False: 129k]
  ------------------
  356|  43.1k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  43.1k|    }
  358|   172k|  }
  359|     13|  return true;
  360|     83|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   173k|        : num_remaining_points(num_remaining_points_),
  135|   173k|          last_axis(last_axis_),
  136|   173k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   172k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   172k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   172k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     23|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    122|      : bit_length_(0),
   87|    122|        num_points_(0),
   88|    122|        num_decoded_points_(0),
   89|    122|        dimension_(dimension),
   90|    122|        p_(dimension, 0),
   91|    122|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    122|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    122|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     49|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     49|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     49|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|     69|      : bit_length_(0),
   87|     69|        num_points_(0),
   88|     69|        num_decoded_points_(0),
   89|     69|        dimension_(dimension),
   90|     69|        p_(dimension, 0),
   91|     69|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     69|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     69|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     29|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     29|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     29|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|     85|      : bit_length_(0),
   87|     85|        num_points_(0),
   88|     85|        num_decoded_points_(0),
   89|     85|        dimension_(dimension),
   90|     85|        p_(dimension, 0),
   91|     85|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     85|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     85|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      7|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      7|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      7|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    140|      : bit_length_(0),
   87|    140|        num_points_(0),
   88|    140|        num_decoded_points_(0),
   89|    140|        dimension_(dimension),
   90|    140|        p_(dimension, 0),
   91|    140|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    140|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    140|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.73M|    uint32_t last_axis) {
  232|  1.73M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.73M, Folded]
  ------------------
  233|  1.73M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.73M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 497k, False: 1.23M]
  |  |  ------------------
  ------------------
  234|  1.73M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  1.73M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   117k|    uint32_t last_axis) {
  232|   117k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 117k, Folded]
  ------------------
  233|   117k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|   117k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 30.5k, False: 87.1k]
  |  |  ------------------
  ------------------
  234|   117k|  }
  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|   117k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.79M|    uint32_t last_axis) {
  232|  2.79M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.79M, Folded]
  ------------------
  233|  2.79M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.79M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.66M, False: 125k]
  |  |  ------------------
  ------------------
  234|  2.79M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  2.79M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   173k|    uint32_t last_axis) {
  232|   173k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 173k]
  ------------------
  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|   173k|  uint32_t best_axis = 0;
  237|   173k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 173k, False: 676]
  ------------------
  238|  19.2M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 19.0M, False: 173k]
  ------------------
  239|  19.0M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 205k, False: 18.8M]
  ------------------
  240|   205k|        best_axis = axis;
  241|   205k|      }
  242|  19.0M|    }
  243|   173k|  } else {
  244|    676|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|    676|  }
  246|       |
  247|   173k|  return best_axis;
  248|   173k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     55|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     55|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     55|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_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: 1, False: 54]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     54|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 54]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     54|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 53]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     53|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 53]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     53|  num_decoded_points_ = 0;
  202|       |
  203|     53|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 48]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     48|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 5, False: 43]
  ------------------
  207|      5|    return false;
  208|      5|  }
  209|     43|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 43]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     43|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 43]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     43|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 31, False: 12]
  ------------------
  217|     31|    return false;
  218|     31|  }
  219|       |
  220|     12|  numbers_decoder_.EndDecoding();
  221|     12|  remaining_bits_decoder_.EndDecoding();
  222|     12|  axis_decoder_.EndDecoding();
  223|     12|  half_decoder_.EndDecoding();
  224|       |
  225|     12|  return true;
  226|     43|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  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|  1.59M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.59M, False: 12]
  ------------------
  263|  1.59M|    const DecodingStatus status = status_stack.top();
  264|  1.59M|    status_stack.pop();
  265|       |
  266|  1.59M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.59M|    const uint32_t last_axis = status.last_axis;
  268|  1.59M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.59M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.59M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.59M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.59M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.59M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.59M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.59M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.59M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.59M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 794k, False: 797k]
  ------------------
  285|  93.5M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 92.7M, False: 794k]
  ------------------
  286|  92.7M|        *oit = old_base;
  287|  92.7M|        ++oit;
  288|  92.7M|        ++num_decoded_points_;
  289|  92.7M|      }
  290|   794k|      continue;
  291|   794k|    }
  292|       |
  293|   797k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   797k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.05k, False: 796k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.05k|      axes_[0] = axis;
  300|  3.16k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.10k, False: 1.05k]
  ------------------
  301|  2.10k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.10k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 277, False: 1.83k]
  |  |  ------------------
  ------------------
  302|  2.10k|      }
  303|  2.88k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.85k, False: 1.03k]
  ------------------
  304|  7.36k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 5.52k, False: 1.83k]
  ------------------
  305|  5.52k|          p_[axes_[j]] = 0;
  306|  5.52k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  5.52k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.69k, False: 2.83k]
  ------------------
  308|  2.69k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 17, False: 2.67k]
  ------------------
  309|  2.69k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     17|              return false;
  311|     17|            }
  312|  2.69k|          }
  313|  5.51k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  5.51k|        }
  315|  1.83k|        *oit = p_;
  316|  1.83k|        ++oit;
  317|  1.83k|        ++num_decoded_points_;
  318|  1.83k|      }
  319|  1.03k|      continue;
  320|  1.05k|    }
  321|       |
  322|   796k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 796k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   796k|    const int num_remaining_bits = bit_length_ - level;
  327|   796k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   796k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   796k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   796k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   796k|    uint32_t number = 0;
  334|   796k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   796k|    uint32_t first_half = num_remaining_points / 2;
  337|   796k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 14, False: 796k]
  ------------------
  338|       |      // Invalid |number|.
  339|     14|      return false;
  340|     14|    }
  341|   796k|    first_half -= number;
  342|   796k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   796k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 373k, False: 422k]
  ------------------
  345|   373k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 350k, False: 23.7k]
  ------------------
  346|   350k|        std::swap(first_half, second_half);
  347|   350k|      }
  348|   373k|    }
  349|       |
  350|   796k|    levels_stack_[stack_pos][axis] += 1;
  351|   796k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   796k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 796k, False: 93]
  ------------------
  353|   796k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   796k|    }
  355|   796k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 796k, False: 117]
  ------------------
  356|   796k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   796k|    }
  358|   796k|  }
  359|     12|  return true;
  360|     43|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     33|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     33|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     33|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     33|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     33|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 33]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     33|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 30]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     30|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 30]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     30|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 30]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     30|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 30]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     30|  num_decoded_points_ = 0;
  202|       |
  203|     30|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 26]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|     26|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 26]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     26|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 25]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     25|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 25]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     25|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 17, False: 8]
  ------------------
  217|     17|    return false;
  218|     17|  }
  219|       |
  220|      8|  numbers_decoder_.EndDecoding();
  221|      8|  remaining_bits_decoder_.EndDecoding();
  222|      8|  axis_decoder_.EndDecoding();
  223|      8|  half_decoder_.EndDecoding();
  224|       |
  225|      8|  return true;
  226|     25|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     25|    uint32_t num_points, OutputIteratorT &oit) {
  254|     25|  typedef DecodingStatus Status;
  255|     25|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     25|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     25|  DecodingStatus init_status(num_points, 0, 0);
  258|     25|  std::stack<Status> status_stack;
  259|     25|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  6.41M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 6.41M, False: 8]
  ------------------
  263|  6.41M|    const DecodingStatus status = status_stack.top();
  264|  6.41M|    status_stack.pop();
  265|       |
  266|  6.41M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  6.41M|    const uint32_t last_axis = status.last_axis;
  268|  6.41M|    const uint32_t stack_pos = status.stack_pos;
  269|  6.41M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  6.41M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  6.41M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 6.41M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  6.41M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  6.41M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 6.41M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  6.41M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  6.41M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 3.20M, False: 3.20M]
  ------------------
  285|  59.6M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 56.4M, False: 3.20M]
  ------------------
  286|  56.4M|        *oit = old_base;
  287|  56.4M|        ++oit;
  288|  56.4M|        ++num_decoded_points_;
  289|  56.4M|      }
  290|  3.20M|      continue;
  291|  3.20M|    }
  292|       |
  293|  3.20M|    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.20M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.00k, False: 3.20M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.00k|      axes_[0] = axis;
  300|  3.02k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.01k, False: 1.00k]
  ------------------
  301|  2.01k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.01k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 333, False: 1.68k]
  |  |  ------------------
  ------------------
  302|  2.01k|      }
  303|  2.71k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.72k, False: 994]
  ------------------
  304|  6.86k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 5.15k, False: 1.71k]
  ------------------
  305|  5.15k|          p_[axes_[j]] = 0;
  306|  5.15k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  5.15k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.63k, False: 2.51k]
  ------------------
  308|  2.63k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 13, False: 2.62k]
  ------------------
  309|  2.63k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     13|              return false;
  311|     13|            }
  312|  2.63k|          }
  313|  5.13k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  5.13k|        }
  315|  1.71k|        *oit = p_;
  316|  1.71k|        ++oit;
  317|  1.71k|        ++num_decoded_points_;
  318|  1.71k|      }
  319|    994|      continue;
  320|  1.00k|    }
  321|       |
  322|  3.20M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 3.20M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  3.20M|    const int num_remaining_bits = bit_length_ - level;
  327|  3.20M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  3.20M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  3.20M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  3.20M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  3.20M|    uint32_t number = 0;
  334|  3.20M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  3.20M|    uint32_t first_half = num_remaining_points / 2;
  337|  3.20M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 4, False: 3.20M]
  ------------------
  338|       |      // Invalid |number|.
  339|      4|      return false;
  340|      4|    }
  341|  3.20M|    first_half -= number;
  342|  3.20M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  3.20M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 2.03M, False: 1.17M]
  ------------------
  345|  2.03M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 2.02M, False: 2.13k]
  ------------------
  346|  2.02M|        std::swap(first_half, second_half);
  347|  2.02M|      }
  348|  2.03M|    }
  349|       |
  350|  3.20M|    levels_stack_[stack_pos][axis] += 1;
  351|  3.20M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  3.20M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 3.20M, False: 92]
  ------------------
  353|  3.20M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  3.20M|    }
  355|  3.20M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 3.20M, False: 36]
  ------------------
  356|  3.20M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  3.20M|    }
  358|  3.20M|  }
  359|      8|  return true;
  360|     25|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     53|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     53|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     53|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     53|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     53|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 53]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     53|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 53]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     53|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 53]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     53|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 53]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     53|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 53]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     53|  num_decoded_points_ = 0;
  202|       |
  203|     53|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 48]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     48|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 46]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     46|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 46]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     46|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 46]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     46|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 41, False: 5]
  ------------------
  217|     41|    return false;
  218|     41|  }
  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|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     46|    uint32_t num_points, OutputIteratorT &oit) {
  254|     46|  typedef DecodingStatus Status;
  255|     46|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     46|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     46|  DecodingStatus init_status(num_points, 0, 0);
  258|     46|  std::stack<Status> status_stack;
  259|     46|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   100k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 100k, False: 5]
  ------------------
  263|   100k|    const DecodingStatus status = status_stack.top();
  264|   100k|    status_stack.pop();
  265|       |
  266|   100k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   100k|    const uint32_t last_axis = status.last_axis;
  268|   100k|    const uint32_t stack_pos = status.stack_pos;
  269|   100k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   100k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   100k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 100k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   100k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   100k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 100k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   100k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   100k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 48.9k, False: 51.7k]
  ------------------
  285|  11.4M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 11.4M, False: 48.9k]
  ------------------
  286|  11.4M|        *oit = old_base;
  287|  11.4M|        ++oit;
  288|  11.4M|        ++num_decoded_points_;
  289|  11.4M|      }
  290|  48.9k|      continue;
  291|  48.9k|    }
  292|       |
  293|  51.7k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  51.7k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 869, False: 50.9k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    869|      axes_[0] = axis;
  300|  2.60k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.73k, False: 869]
  ------------------
  301|  1.73k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.73k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 180, False: 1.55k]
  |  |  ------------------
  ------------------
  302|  1.73k|      }
  303|  2.34k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.48k, False: 862]
  ------------------
  304|  5.93k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.45k, False: 1.48k]
  ------------------
  305|  4.45k|          p_[axes_[j]] = 0;
  306|  4.45k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.45k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.17k, False: 2.27k]
  ------------------
  308|  2.17k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 7, False: 2.17k]
  ------------------
  309|  2.17k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      7|              return false;
  311|      7|            }
  312|  2.17k|          }
  313|  4.44k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.44k|        }
  315|  1.48k|        *oit = p_;
  316|  1.48k|        ++oit;
  317|  1.48k|        ++num_decoded_points_;
  318|  1.48k|      }
  319|    862|      continue;
  320|    869|    }
  321|       |
  322|  50.9k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 50.9k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  50.9k|    const int num_remaining_bits = bit_length_ - level;
  327|  50.9k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  50.9k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  50.9k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  50.9k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  50.9k|    uint32_t number = 0;
  334|  50.9k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  50.9k|    uint32_t first_half = num_remaining_points / 2;
  337|  50.9k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 34, False: 50.8k]
  ------------------
  338|       |      // Invalid |number|.
  339|     34|      return false;
  340|     34|    }
  341|  50.8k|    first_half -= number;
  342|  50.8k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  50.8k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 10.6k, False: 40.2k]
  ------------------
  345|  10.6k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 6.51k, False: 4.12k]
  ------------------
  346|  6.51k|        std::swap(first_half, second_half);
  347|  6.51k|      }
  348|  10.6k|    }
  349|       |
  350|  50.8k|    levels_stack_[stack_pos][axis] += 1;
  351|  50.8k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  50.8k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 50.7k, False: 93]
  ------------------
  353|  50.7k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  50.7k|    }
  355|  50.8k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 50.7k, False: 142]
  ------------------
  356|  50.7k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  50.7k|    }
  358|  50.8k|  }
  359|      5|  return true;
  360|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     60|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     60|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     60|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     60|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     60|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 60]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     60|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 59]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     59|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 59]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     59|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 59]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     59|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 59]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     59|  num_decoded_points_ = 0;
  202|       |
  203|     59|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 55]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|     55|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 53]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     53|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 52]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     52|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 50]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     50|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 48, False: 2]
  ------------------
  217|     48|    return false;
  218|     48|  }
  219|       |
  220|      2|  numbers_decoder_.EndDecoding();
  221|      2|  remaining_bits_decoder_.EndDecoding();
  222|      2|  axis_decoder_.EndDecoding();
  223|      2|  half_decoder_.EndDecoding();
  224|       |
  225|      2|  return true;
  226|     50|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     50|    uint32_t num_points, OutputIteratorT &oit) {
  254|     50|  typedef DecodingStatus Status;
  255|     50|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     50|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     50|  DecodingStatus init_status(num_points, 0, 0);
  258|     50|  std::stack<Status> status_stack;
  259|     50|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  55.6k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 55.5k, False: 2]
  ------------------
  263|  55.5k|    const DecodingStatus status = status_stack.top();
  264|  55.5k|    status_stack.pop();
  265|       |
  266|  55.5k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  55.5k|    const uint32_t last_axis = status.last_axis;
  268|  55.5k|    const uint32_t stack_pos = status.stack_pos;
  269|  55.5k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  55.5k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  55.5k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 55.5k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  55.5k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  55.5k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 55.5k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  55.5k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  55.5k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 25.3k, False: 30.2k]
  ------------------
  285|  9.07M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 9.05M, False: 25.3k]
  ------------------
  286|  9.05M|        *oit = old_base;
  287|  9.05M|        ++oit;
  288|  9.05M|        ++num_decoded_points_;
  289|  9.05M|      }
  290|  25.3k|      continue;
  291|  25.3k|    }
  292|       |
  293|  30.2k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  30.2k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.88k, False: 28.3k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.88k|      axes_[0] = axis;
  300|  5.64k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 3.76k, False: 1.88k]
  ------------------
  301|  3.76k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  3.76k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 677, False: 3.08k]
  |  |  ------------------
  ------------------
  302|  3.76k|      }
  303|  5.19k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.32k, False: 1.86k]
  ------------------
  304|  13.2k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 9.95k, False: 3.31k]
  ------------------
  305|  9.95k|          p_[axes_[j]] = 0;
  306|  9.95k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  9.95k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 6.38k, False: 3.57k]
  ------------------
  308|  6.38k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 13, False: 6.37k]
  ------------------
  309|  6.38k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     13|              return false;
  311|     13|            }
  312|  6.38k|          }
  313|  9.94k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  9.94k|        }
  315|  3.31k|        *oit = p_;
  316|  3.31k|        ++oit;
  317|  3.31k|        ++num_decoded_points_;
  318|  3.31k|      }
  319|  1.86k|      continue;
  320|  1.88k|    }
  321|       |
  322|  28.3k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 28.3k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  28.3k|    const int num_remaining_bits = bit_length_ - level;
  327|  28.3k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  28.3k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  28.3k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  28.3k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  28.3k|    uint32_t number = 0;
  334|  28.3k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  28.3k|    uint32_t first_half = num_remaining_points / 2;
  337|  28.3k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 35, False: 28.3k]
  ------------------
  338|       |      // Invalid |number|.
  339|     35|      return false;
  340|     35|    }
  341|  28.3k|    first_half -= number;
  342|  28.3k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  28.3k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 17.3k, False: 10.9k]
  ------------------
  345|  17.3k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 11.3k, False: 5.99k]
  ------------------
  346|  11.3k|        std::swap(first_half, second_half);
  347|  11.3k|      }
  348|  17.3k|    }
  349|       |
  350|  28.3k|    levels_stack_[stack_pos][axis] += 1;
  351|  28.3k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  28.3k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 28.2k, False: 74]
  ------------------
  353|  28.2k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  28.2k|    }
  355|  28.3k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 28.2k, False: 135]
  ------------------
  356|  28.2k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  28.2k|    }
  358|  28.3k|  }
  359|      2|  return true;
  360|     50|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     22|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     22|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     22|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     22|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     22|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 22]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     22|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 20]
  ------------------
  190|      2|    return false;
  191|      2|  }
  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: 20, False: 0]
  ------------------
  204|     20|    return false;
  205|     20|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      6|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      6|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      6|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_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: 6, False: 0]
  ------------------
  204|      6|    return false;
  205|      6|  }
  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: 1, False: 7]
  ------------------
  190|      1|    return false;
  191|      1|  }
  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: 0, False: 7]
  ------------------
  196|      0|    return true;
  197|      0|  }
  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: 7, False: 0]
  ------------------
  204|      7|    return false;
  205|      7|  }
  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|    251|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    251|  qinfo_.quantization_bits = 0;
   67|    251|  qinfo_.range = 0;
   68|    251|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    244|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    244|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 244]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|    244|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 1, False: 243]
  ------------------
   76|      1|    return false;
   77|      1|  }
   78|    243|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 243]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|    243|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 243]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|    243|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 11, False: 232]
  |  Branch (84:38): [True: 4, False: 7]
  ------------------
   85|      4|    return false;
   86|      4|  }
   87|    239|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 239]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    239|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 2, False: 237]
  ------------------
   93|      2|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      2|#define DRACO_LOGE printf
  ------------------
   94|      2|               compression_level_);
   95|      2|    return false;
   96|      2|  }
   97|       |
   98|    237|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    237|      std::back_inserter(*qpoints);
  100|    237|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    237|                           Converter>
  102|    237|      oit(oit_qpoints);
  103|    237|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 237, False: 0]
  ------------------
  104|    237|    qpoints->reserve(num_points_);
  105|    237|    switch (compression_level_) {
  106|     55|      case 0: {
  ------------------
  |  Branch (106:7): [True: 55, False: 182]
  ------------------
  107|     55|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|     55|        qpoints_decoder.DecodePoints(buffer, oit);
  109|     55|        break;
  110|      0|      }
  111|     33|      case 1: {
  ------------------
  |  Branch (111:7): [True: 33, False: 204]
  ------------------
  112|     33|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     33|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     33|        break;
  115|      0|      }
  116|     53|      case 2: {
  ------------------
  |  Branch (116:7): [True: 53, False: 184]
  ------------------
  117|     53|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     53|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     53|        break;
  120|      0|      }
  121|     60|      case 3: {
  ------------------
  |  Branch (121:7): [True: 60, False: 177]
  ------------------
  122|     60|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|     60|        qpoints_decoder.DecodePoints(buffer, oit);
  124|     60|        break;
  125|      0|      }
  126|     22|      case 4: {
  ------------------
  |  Branch (126:7): [True: 22, False: 215]
  ------------------
  127|     22|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     22|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     22|        break;
  130|      0|      }
  131|      6|      case 5: {
  ------------------
  |  Branch (131:7): [True: 6, False: 231]
  ------------------
  132|      6|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|      6|        qpoints_decoder.DecodePoints(buffer, oit);
  134|      6|        break;
  135|      0|      }
  136|      8|      case 6: {
  ------------------
  |  Branch (136:7): [True: 8, False: 229]
  ------------------
  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: 237]
  ------------------
  142|      0|        return false;
  143|    237|    }
  144|    237|  }
  145|       |
  146|    237|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 234, False: 3]
  ------------------
  147|    234|    return false;
  148|    234|  }
  149|      3|  return true;
  150|    237|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    237|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   169M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   169M|  const Self &operator=(const SourceType &source) {
   56|   169M|    *oit_ = Converter()(source);
   57|   169M|    return *this;
   58|   169M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   169M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   169M|    return Point3ui(v[0], v[1], v[2]);
   31|   169M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   169M|  const Self &operator++() {
   46|   169M|    ++oit_;
   47|   169M|    return *this;
   48|   169M|  }

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  10.0M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  10.0M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 10.0M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  10.0M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  10.0M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   273M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   273M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 252, False: 273M]
  ------------------
   78|    252|      return false;  // Buffer overflow.
   79|    252|    }
   80|   273M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   273M|    pos_ += size_to_decode;
   82|   273M|    return true;
   83|   273M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  23.1k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  5.20k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  29.5k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   239k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  2.82k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  10.0M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  2.98M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  3.69k|    inline void reset(const void *b, size_t s) {
  131|  3.69k|      bit_offset_ = 0;
  132|  3.69k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  3.69k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  3.69k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  3.22k|    inline uint64_t BitsDecoded() const {
  138|  3.22k|      return static_cast<uint64_t>(bit_offset_);
  139|  3.22k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  10.0M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  10.0M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 10.0M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  10.0M|      uint32_t value = 0;
  165|  23.6M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 13.6M, False: 10.0M]
  ------------------
  166|  13.6M|        value |= GetBit() << bit;
  167|  13.6M|      }
  168|  10.0M|      *x = value;
  169|  10.0M|      return true;
  170|  10.0M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  13.6M|    inline int GetBit() {
  176|  13.6M|      const size_t off = bit_offset_;
  177|  13.6M|      const size_t byte_offset = off >> 3;
  178|  13.6M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  13.6M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 13.1M, False: 426k]
  ------------------
  180|  13.1M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  13.1M|        bit_offset_ = off + 1;
  182|  13.1M|        return bit;
  183|  13.1M|      }
  184|   426k|      return 0;
  185|  13.6M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  4.32M|  bool Decode(T *out_val) {
   69|  4.32M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 1.14k, False: 4.32M]
  ------------------
   70|  1.14k|      return false;
   71|  1.14k|    }
   72|  4.32M|    pos_ += sizeof(T);
   73|  4.32M|    return true;
   74|  4.32M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  4.32M|  bool Peek(T *out_val) {
   88|  4.32M|    const size_t size_to_decode = sizeof(T);
   89|  4.32M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 1.14k, False: 4.32M]
  ------------------
   90|  1.14k|      return false;  // Buffer overflow.
   91|  1.14k|    }
   92|  4.32M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  4.32M|    return true;
   94|  4.32M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  7.59k|  bool Decode(T *out_val) {
   69|  7.59k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 41, False: 7.55k]
  ------------------
   70|     41|      return false;
   71|     41|    }
   72|  7.55k|    pos_ += sizeof(T);
   73|  7.55k|    return true;
   74|  7.59k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  7.59k|  bool Peek(T *out_val) {
   88|  7.59k|    const size_t size_to_decode = sizeof(T);
   89|  7.59k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 41, False: 7.55k]
  ------------------
   90|     41|      return false;  // Buffer overflow.
   91|     41|    }
   92|  7.55k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  7.55k|    return true;
   94|  7.59k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   303k|  bool Decode(T *out_val) {
   69|   303k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 74, False: 303k]
  ------------------
   70|     74|      return false;
   71|     74|    }
   72|   303k|    pos_ += sizeof(T);
   73|   303k|    return true;
   74|   303k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   303k|  bool Peek(T *out_val) {
   88|   303k|    const size_t size_to_decode = sizeof(T);
   89|   303k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 74, False: 303k]
  ------------------
   90|     74|      return false;  // Buffer overflow.
   91|     74|    }
   92|   303k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   303k|    return true;
   94|   303k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  12.8k|  bool Decode(T *out_val) {
   69|  12.8k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 123, False: 12.7k]
  ------------------
   70|    123|      return false;
   71|    123|    }
   72|  12.7k|    pos_ += sizeof(T);
   73|  12.7k|    return true;
   74|  12.8k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  12.8k|  bool Peek(T *out_val) {
   88|  12.8k|    const size_t size_to_decode = sizeof(T);
   89|  12.8k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 123, False: 12.7k]
  ------------------
   90|    123|      return false;  // Buffer overflow.
   91|    123|    }
   92|  12.7k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  12.7k|    return true;
   94|  12.8k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|  1.17M|  bool Decode(T *out_val) {
   69|  1.17M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 71, False: 1.17M]
  ------------------
   70|     71|      return false;
   71|     71|    }
   72|  1.17M|    pos_ += sizeof(T);
   73|  1.17M|    return true;
   74|  1.17M|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|  1.17M|  bool Peek(T *out_val) {
   88|  1.17M|    const size_t size_to_decode = sizeof(T);
   89|  1.17M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 71, False: 1.17M]
  ------------------
   90|     71|      return false;  // Buffer overflow.
   91|     71|    }
   92|  1.17M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.17M|    return true;
   94|  1.17M|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  18.6k|  bool Decode(T *out_val) {
   69|  18.6k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 7, False: 18.5k]
  ------------------
   70|      7|      return false;
   71|      7|    }
   72|  18.5k|    pos_ += sizeof(T);
   73|  18.5k|    return true;
   74|  18.6k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  18.6k|  bool Peek(T *out_val) {
   88|  18.6k|    const size_t size_to_decode = sizeof(T);
   89|  18.6k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 7, False: 18.5k]
  ------------------
   90|      7|      return false;  // Buffer overflow.
   91|      7|    }
   92|  18.5k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  18.5k|    return true;
   94|  18.6k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.09k|  bool Decode(T *out_val) {
   69|  1.09k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 5, False: 1.09k]
  ------------------
   70|      5|      return false;
   71|      5|    }
   72|  1.09k|    pos_ += sizeof(T);
   73|  1.09k|    return true;
   74|  1.09k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.09k|  bool Peek(T *out_val) {
   88|  1.09k|    const size_t size_to_decode = sizeof(T);
   89|  1.09k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 5, False: 1.09k]
  ------------------
   90|      5|      return false;  // Buffer overflow.
   91|      5|    }
   92|  1.09k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.09k|    return true;
   94|  1.09k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    378|  bool Decode(T *out_val) {
   69|    378|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 4, False: 374]
  ------------------
   70|      4|      return false;
   71|      4|    }
   72|    374|    pos_ += sizeof(T);
   73|    374|    return true;
   74|    378|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    378|  bool Peek(T *out_val) {
   88|    378|    const size_t size_to_decode = sizeof(T);
   89|    378|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 4, False: 374]
  ------------------
   90|      4|      return false;  // Buffer overflow.
   91|      4|    }
   92|    374|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    374|    return true;
   94|    378|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   276M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   283M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  4.71M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  4.71M|    return value_ >= val;
  100|  4.71M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   122M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  1.47G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  12.7M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  48.1M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  48.1M|    value_ = i.value_;
  153|  48.1M|    return *this;
  154|  48.1M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   468M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   468M|    value_ = i.value_;
  153|   468M|    return *this;
  154|   468M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  12.7M|  inline ThisIndexType &operator++() {
  103|  12.7M|    ++value_;
  104|  12.7M|    return *this;
  105|  12.7M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  1.09G|  constexpr bool operator==(const IndexType &i) const {
   76|  1.09G|    return value_ == i.value_;
   77|  1.09G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   432M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  6.45k|  constexpr bool operator<(const IndexType &i) const {
   88|  6.45k|    return value_ < i.value_;
   89|  6.45k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|  60.7M|  constexpr bool operator==(const IndexType &i) const {
   76|  60.7M|    return value_ == i.value_;
   77|  60.7M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|  88.0M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|  88.0M|    return ThisIndexType(value_ - val);
  133|  88.0M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   332M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   332M|    return ThisIndexType(value_ + val);
  127|   332M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  8.51M|  constexpr bool operator==(const IndexType &i) const {
   76|  8.51M|    return value_ == i.value_;
   77|  8.51M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   112M|  constexpr bool operator!=(const IndexType &i) const {
   82|   112M|    return value_ != i.value_;
   83|   112M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   161M|  constexpr bool operator!=(const IndexType &i) const {
   82|   161M|    return value_ != i.value_;
   83|   161M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   239M|  inline ThisIndexType &operator++() {
  103|   239M|    ++value_;
  104|   239M|    return *this;
  105|   239M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   195M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   195M|    value_ = i.value_;
  153|   195M|    return *this;
  154|   195M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   473M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   473M|    value_ = i.value_;
  153|   473M|    return *this;
  154|   473M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  24.0M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  24.0M|    return value_ >= val;
  100|  24.0M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  4.37M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   513M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  7.69G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|  86.1M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  5.45G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   103M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  10.5M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  10.5M|    return ThisIndexType(value_ + val);
  127|  10.5M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|  80.3M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  11.9M|  constexpr bool operator<(const IndexType &i) const {
   88|  11.9M|    return value_ < i.value_;
   89|  11.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   343M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   468M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  30.8M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   264M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   381M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  2.76M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  2.76M|    value_ = i.value_;
  153|  2.76M|    return *this;
  154|  2.76M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  4.37M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  4.37M|    value_ += val;
  141|  4.37M|    return *this;
  142|  4.37M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  14.1M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  14.1M|    value_ = val;
  157|  14.1M|    return *this;
  158|  14.1M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   454M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  3.50M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  3.49M|  inline ThisIndexType &operator++() {
  103|  3.49M|    ++value_;
  104|  3.49M|    return *this;
  105|  3.49M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  12.5M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|    235|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   197M|  inline ThisIndexType &operator++() {
  103|   197M|    ++value_;
  104|   197M|    return *this;
  105|   197M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|    139|  inline ThisIndexType &operator++() {
  103|    139|    ++value_;
  104|    139|    return *this;
  105|    139|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   224M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   224M|    return value_ >= val;
  100|   224M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  21.8M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  21.8M|    return vector_[index.value()];
   75|  21.8M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  12.5M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  7.60k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  10.4k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  36.5M|  inline reference operator[](const IndexTypeT &index) {
   71|  36.5M|    return vector_[index.value()];
   72|  36.5M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  4.53k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  9.43M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  1.93k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   70|  4.71M|  inline reference operator[](const IndexTypeT &index) {
   71|  4.71M|    return vector_[index.value()];
   72|  4.71M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  12.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  12.3M|    return vector_[index.value()];
   75|  12.3M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|  92.0M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  7.08M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   147M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   147M|    return vector_[index.value()];
   75|   147M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   380M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   380M|    return vector_[index.value()];
   75|   380M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   176M|  inline reference operator[](const IndexTypeT &index) {
   71|   176M|    return vector_[index.value()];
   72|   176M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  28.7M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  28.7M|    return vector_[index.value()];
   75|  28.7M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   148M|  inline reference operator[](const IndexTypeT &index) {
   71|   148M|    return vector_[index.value()];
   72|   148M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  48.3M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|  99.8M|  inline reference operator[](const IndexTypeT &index) {
   71|  99.8M|    return vector_[index.value()];
   72|  99.8M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|    937|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|  91.7M|  inline reference operator[](const IndexTypeT &index) {
   71|  91.7M|    return vector_[index.value()];
   72|  91.7M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  22.6k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|   922k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  21.3k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  3.01k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  3.01k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  3.01k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  3.01k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  7.12k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  7.12k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  7.12k|    vector_.swap(arg.vector_);
   57|  7.12k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  7.12k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  7.12k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  7.12k|    vector_.swap(arg.vector_);
   57|  7.12k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  3.01k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  3.01k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  3.01k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  4.27k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  26.3k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  45.8k|int32_t DataTypeLength(DataType dt) {
   20|  45.8k|  switch (dt) {
   21|  12.9k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 12.9k, False: 32.8k]
  ------------------
   22|  16.1k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.19k, False: 42.6k]
  ------------------
   23|  16.1k|      return 1;
   24|  2.04k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 2.04k, False: 43.7k]
  ------------------
   25|  8.68k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 6.64k, False: 39.1k]
  ------------------
   26|  8.68k|      return 2;
   27|  16.4k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 16.4k, False: 29.4k]
  ------------------
   28|  17.2k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 841, False: 44.9k]
  ------------------
   29|  17.2k|      return 4;
   30|    430|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 430, False: 45.3k]
  ------------------
   31|    740|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 310, False: 45.5k]
  ------------------
   32|    740|      return 8;
   33|  2.67k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 2.67k, False: 43.1k]
  ------------------
   34|  2.67k|      return 4;
   35|     58|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 58, False: 45.7k]
  ------------------
   36|     58|      return 8;
   37|    295|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 295, False: 45.5k]
  ------------------
   38|    295|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 45.8k]
  ------------------
   40|      0|      return -1;
   41|  45.8k|  }
   42|  45.8k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    927|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  4.27k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|      1|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  5.20k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  5.20k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|      1|  const Status &status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  4.85k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  5.20k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    350|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|    927|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|    927|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  4.27k|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  4.27k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   418k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   418k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 418k, Folded]
  ------------------
   65|   418k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 390, False: 417k]
  ------------------
   66|    390|      return false;
   67|    390|    }
   68|   418k|  } 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|   417k|  return true;
   77|   418k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  92.1k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  92.1k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  92.1k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 80, False: 92.0k]
  ------------------
   33|     80|    return false;
   34|     80|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  92.0k|  uint8_t in;
   39|  92.0k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 204, False: 91.8k]
  ------------------
   40|    204|    return false;
   41|    204|  }
   42|  91.8k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 11.5k, False: 80.2k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  11.5k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 420, False: 11.1k]
  ------------------
   45|    420|      return false;
   46|    420|    }
   47|       |    // Append decoded info from this byte.
   48|  11.1k|    *out_val <<= 7;
   49|  11.1k|    *out_val |= in & ((1 << 7) - 1);
   50|  80.2k|  } else {
   51|       |    // Last byte reached
   52|  80.2k|    *out_val = in;
   53|  80.2k|  }
   54|  91.4k|  return true;
   55|  91.8k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  1.96k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.96k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.96k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 1.96k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.96k|  uint8_t in;
   39|  1.96k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 2, False: 1.96k]
  ------------------
   40|      2|    return false;
   41|      2|  }
   42|  1.96k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 166, False: 1.80k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    166|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 166]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    166|    *out_val <<= 7;
   49|    166|    *out_val |= in & ((1 << 7) - 1);
   50|  1.80k|  } else {
   51|       |    // Last byte reached
   52|  1.80k|    *out_val = in;
   53|  1.80k|  }
   54|  1.96k|  return true;
   55|  1.96k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  2.68k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.68k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 2.68k, Folded]
  ------------------
   65|  2.68k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 16, False: 2.67k]
  ------------------
   66|     16|      return false;
   67|     16|    }
   68|  2.68k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  2.67k|  return true;
   77|  2.68k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  1.69k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.69k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.69k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 1.69k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.69k|  uint8_t in;
   39|  1.69k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 3, False: 1.69k]
  ------------------
   40|      3|    return false;
   41|      3|  }
   42|  1.69k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 15, False: 1.67k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     15|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 15]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     15|    *out_val <<= 7;
   49|     15|    *out_val |= in & ((1 << 7) - 1);
   50|  1.67k|  } else {
   51|       |    // Last byte reached
   52|  1.67k|    *out_val = in;
   53|  1.67k|  }
   54|  1.69k|  return true;
   55|  1.69k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   286k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   286k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   286k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 10, False: 286k]
  ------------------
   33|     10|    return false;
   34|     10|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   286k|  uint8_t in;
   39|   286k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 46, False: 286k]
  ------------------
   40|     46|    return false;
   41|     46|  }
   42|   286k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 907, False: 285k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    907|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 65, False: 842]
  ------------------
   45|     65|      return false;
   46|     65|    }
   47|       |    // Append decoded info from this byte.
   48|    842|    *out_val <<= 7;
   49|    842|    *out_val |= in & ((1 << 7) - 1);
   50|   285k|  } else {
   51|       |    // Last byte reached
   52|   285k|    *out_val = in;
   53|   285k|  }
   54|   286k|  return true;
   55|   286k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  2.73k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.73k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 2.73k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  2.73k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  2.73k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  2.73k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 14, False: 2.71k]
  ------------------
   72|     14|      return false;
   73|     14|    }
   74|  2.71k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  2.71k|  }
   76|  2.71k|  return true;
   77|  2.73k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.25k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.25k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.25k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 3.25k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.25k|  uint8_t in;
   39|  3.25k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 11, False: 3.23k]
  ------------------
   40|     11|    return false;
   41|     11|  }
   42|  3.23k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 522, False: 2.71k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    522|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 27, False: 495]
  ------------------
   45|     27|      return false;
   46|     27|    }
   47|       |    // Append decoded info from this byte.
   48|    495|    *out_val <<= 7;
   49|    495|    *out_val |= in & ((1 << 7) - 1);
   50|  2.71k|  } else {
   51|       |    // Last byte reached
   52|  2.71k|    *out_val = in;
   53|  2.71k|  }
   54|  3.21k|  return true;
   55|  3.23k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  1.89k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.89k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.89k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 1.89k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.89k|  uint8_t in;
   39|  1.89k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 7, False: 1.88k]
  ------------------
   40|      7|    return false;
   41|      7|  }
   42|  1.88k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 325, False: 1.56k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    325|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 4, False: 321]
  ------------------
   45|      4|      return false;
   46|      4|    }
   47|       |    // Append decoded info from this byte.
   48|    321|    *out_val <<= 7;
   49|    321|    *out_val |= in & ((1 << 7) - 1);
   50|  1.56k|  } else {
   51|       |    // Last byte reached
   52|  1.56k|    *out_val = in;
   53|  1.56k|  }
   54|  1.88k|  return true;
   55|  1.88k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  19.2k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  19.2k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  19.2k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 19.2k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  19.2k|  uint8_t in;
   39|  19.2k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 3, False: 19.2k]
  ------------------
   40|      3|    return false;
   41|      3|  }
   42|  19.2k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 500, False: 18.7k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    500|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 20, False: 480]
  ------------------
   45|     20|      return false;
   46|     20|    }
   47|       |    // Append decoded info from this byte.
   48|    480|    *out_val <<= 7;
   49|    480|    *out_val |= in & ((1 << 7) - 1);
   50|  18.7k|  } else {
   51|       |    // Last byte reached
   52|  18.7k|    *out_val = in;
   53|  18.7k|  }
   54|  19.2k|  return true;
   55|  19.2k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.04k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.04k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.04k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 8, False: 3.03k]
  ------------------
   33|      8|    return false;
   34|      8|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.03k|  uint8_t in;
   39|  3.03k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 7, False: 3.02k]
  ------------------
   40|      7|    return false;
   41|      7|  }
   42|  3.02k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 839, False: 2.18k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    839|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 46, False: 793]
  ------------------
   45|     46|      return false;
   46|     46|    }
   47|       |    // Append decoded info from this byte.
   48|    793|    *out_val <<= 7;
   49|    793|    *out_val |= in & ((1 << 7) - 1);
   50|  2.18k|  } else {
   51|       |    // Last byte reached
   52|  2.18k|    *out_val = in;
   53|  2.18k|  }
   54|  2.98k|  return true;
   55|  3.02k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  1.99k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.99k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.99k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 12, False: 1.97k]
  ------------------
   33|     12|    return false;
   34|     12|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.97k|  uint8_t in;
   39|  1.97k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 1, False: 1.97k]
  ------------------
   40|      1|    return false;
   41|      1|  }
   42|  1.97k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 984, False: 993]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    984|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 120, False: 864]
  ------------------
   45|    120|      return false;
   46|    120|    }
   47|       |    // Append decoded info from this byte.
   48|    864|    *out_val <<= 7;
   49|    864|    *out_val |= in & ((1 << 7) - 1);
   50|    993|  } else {
   51|       |    // Last byte reached
   52|    993|    *out_val = in;
   53|    993|  }
   54|  1.85k|  return true;
   55|  1.97k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  29.8k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  29.8k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  29.8k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 7, False: 29.8k]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  29.8k|  uint8_t in;
   39|  29.8k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 12, False: 29.8k]
  ------------------
   40|     12|    return false;
   41|     12|  }
   42|  29.8k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.27k, False: 27.5k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.27k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 41, False: 2.23k]
  ------------------
   45|     41|      return false;
   46|     41|    }
   47|       |    // Append decoded info from this byte.
   48|  2.23k|    *out_val <<= 7;
   49|  2.23k|    *out_val |= in & ((1 << 7) - 1);
   50|  27.5k|  } else {
   51|       |    // Last byte reached
   52|  27.5k|    *out_val = in;
   53|  27.5k|  }
   54|  29.8k|  return true;
   55|  29.8k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|  61.6k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|  73.6k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  6.14k|  Self operator-(const Self &o) const {
  138|  6.14k|    Self ret;
  139|  24.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 18.4k, False: 6.14k]
  ------------------
  140|  18.4k|      ret[i] = (*this)[i] - o[i];
  141|  18.4k|    }
  142|  6.14k|    return ret;
  143|  6.14k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  15.0k|  VectorD() {
   41|  60.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 45.2k, False: 15.0k]
  ------------------
   42|  45.2k|      (*this)[i] = Scalar(0);
   43|  45.2k|    }
   44|  15.0k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  1.16G|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|      7|      : v_({{c0, c1, c2}}) {
   60|      7|    DRACO_DCHECK_EQ(dimension, 3);
   61|      7|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|  97.9M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  8.10M|  Self operator-(const Self &o) const {
  138|  8.10M|    Self ret;
  139|  32.4M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 24.3M, False: 8.10M]
  ------------------
  140|  24.3M|      ret[i] = (*this)[i] - o[i];
  141|  24.3M|    }
  142|  8.10M|    return ret;
  143|  8.10M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  4.04M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  4.04M|  static_assert(std::is_signed<ScalarT>::value,
  321|  4.04M|                "ScalarT must be a signed type. ");
  322|  4.04M|  VectorD<ScalarT, 3> r;
  323|  4.04M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  4.04M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  4.04M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  4.04M|  return r;
  327|  4.04M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  4.04M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  4.04M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  1.15M|  Scalar AbsSum() const {
  238|  1.15M|    Scalar result(0);
  239|  4.59M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 3.45M, False: 1.14M]
  ------------------
  240|  3.45M|      Scalar next_value = std::abs(v_[i]);
  241|  3.45M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 9.73k, False: 3.44M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  9.73k|        return std::numeric_limits<Scalar>::max();
  244|  9.73k|      }
  245|  3.44M|      result += next_value;
  246|  3.44M|    }
  247|  1.14M|    return result;
  248|  1.15M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   218k|  Self operator/(const Scalar &o) const {
  183|   218k|    Self ret;
  184|   875k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 656k, False: 218k]
  ------------------
  185|   656k|      ret[i] = (*this)[i] / o;
  186|   656k|    }
  187|   218k|    return ret;
  188|   218k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   118M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  6.44M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  3.45M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.07M|  Self operator-() const {
  121|  1.07M|    Self ret;
  122|  4.29M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 3.22M, False: 1.07M]
  ------------------
  123|  3.22M|      ret[i] = -(*this)[i];
  124|  3.22M|    }
  125|  1.07M|    return ret;
  126|  1.07M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  3.22M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   498k|  Self operator-(const Self &o) const {
  138|   498k|    Self ret;
  139|  1.49M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 996k, False: 498k]
  ------------------
  140|   996k|      ret[i] = (*this)[i] - o[i];
  141|   996k|    }
  142|   498k|    return ret;
  143|   498k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  5.97M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  8.96M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  26.8M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|   996k|  Self operator+(const Self &o) const {
  130|   996k|    Self ret;
  131|  2.98M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.99M, False: 996k]
  ------------------
  132|  1.99M|      ret[i] = (*this)[i] + o[i];
  133|  1.99M|    }
  134|   996k|    return ret;
  135|   996k|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  23.4M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|   732k|  Self operator-(const Self &o) const {
  138|   732k|    Self ret;
  139|  2.19M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.46M, False: 732k]
  ------------------
  140|  1.46M|      ret[i] = (*this)[i] - o[i];
  141|  1.46M|    }
  142|   732k|    return ret;
  143|   732k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|   732k|  Self operator+(const Self &o) const {
  130|   732k|    Self ret;
  131|  2.19M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.46M, False: 732k]
  ------------------
  132|  1.46M|      ret[i] = (*this)[i] + o[i];
  133|  1.46M|    }
  134|   732k|    return ret;
  135|   732k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   338k|  bool operator==(const Self &o) const {
  207|  1.00M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 674k, False: 335k]
  ------------------
  208|   674k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 2.80k, False: 671k]
  ------------------
  209|  2.80k|        return false;
  210|  2.80k|      }
  211|   674k|    }
  212|   335k|    return true;
  213|   338k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  4.06M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  3.33k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  3.86k|  Scalar Dot(const Self &o) const {
  251|  3.86k|    Scalar ret(0);
  252|  15.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 11.5k, False: 3.86k]
  ------------------
  253|  11.5k|      ret += (*this)[i] * o[i];
  254|  11.5k|    }
  255|  3.86k|    return ret;
  256|  3.86k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    529|  Self operator*(const Scalar &o) const {
  175|    529|    Self ret;
  176|  2.11k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.58k, False: 529]
  ------------------
  177|  1.58k|      ret[i] = (*this)[i] * o;
  178|  1.58k|    }
  179|    529|    return ret;
  180|    529|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  2.80k|  Self operator-(const Self &o) const {
  138|  2.80k|    Self ret;
  139|  8.41k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 5.61k, False: 2.80k]
  ------------------
  140|  5.61k|      ret[i] = (*this)[i] - o[i];
  141|  5.61k|    }
  142|  2.80k|    return ret;
  143|  2.80k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  5.61k|  VectorD() {
   41|  16.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 11.2k, False: 5.61k]
  ------------------
   42|  11.2k|      (*this)[i] = Scalar(0);
   43|  11.2k|    }
   44|  5.61k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   679k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   679k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   679k|    v_[0] = c0;
   55|   679k|    v_[1] = c1;
   56|   679k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  22.4k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   300k|  bool operator==(const Self &o) const {
  207|   868k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 584k, False: 283k]
  ------------------
  208|   584k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 17.1k, False: 567k]
  ------------------
  209|  17.1k|        return false;
  210|  17.1k|      }
  211|   584k|    }
  212|   283k|    return true;
  213|   300k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.80M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  22.8M|  VectorD() {
   41|  91.2M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 68.4M, False: 22.8M]
  ------------------
   42|  68.4M|      (*this)[i] = Scalar(0);
   43|  68.4M|    }
   44|  22.8M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  19.8k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  22.6k|  Scalar Dot(const Self &o) const {
  251|  22.6k|    Scalar ret(0);
  252|  90.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 67.9k, False: 22.6k]
  ------------------
  253|  67.9k|      ret += (*this)[i] * o[i];
  254|  67.9k|    }
  255|  22.6k|    return ret;
  256|  22.6k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  2.77k|  Self operator-(const Self &o) const {
  138|  2.77k|    Self ret;
  139|  8.32k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 5.54k, False: 2.77k]
  ------------------
  140|  5.54k|      ret[i] = (*this)[i] - o[i];
  141|  5.54k|    }
  142|  2.77k|    return ret;
  143|  2.77k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  8.22k|  Self operator*(const Scalar &o) const {
  175|  8.22k|    Self ret;
  176|  24.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 16.4k, False: 8.22k]
  ------------------
  177|  16.4k|      ret[i] = (*this)[i] * o;
  178|  16.4k|    }
  179|  8.22k|    return ret;
  180|  8.22k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  2.74k|  Self operator+(const Self &o) const {
  130|  2.74k|    Self ret;
  131|  8.22k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 5.48k, False: 2.74k]
  ------------------
  132|  5.48k|      ret[i] = (*this)[i] + o[i];
  133|  5.48k|    }
  134|  2.74k|    return ret;
  135|  2.74k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.74k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.74k|  return v * o;
  294|  2.74k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  2.73k|  Self operator+(const Self &o) const {
  130|  2.73k|    Self ret;
  131|  10.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 8.21k, False: 2.73k]
  ------------------
  132|  8.21k|      ret[i] = (*this)[i] + o[i];
  133|  8.21k|    }
  134|  2.73k|    return ret;
  135|  2.73k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.73k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.73k|  return v * o;
  294|  2.73k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  2.73k|  Self operator*(const Scalar &o) const {
  175|  2.73k|    Self ret;
  176|  10.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 8.21k, False: 2.73k]
  ------------------
  177|  8.21k|      ret[i] = (*this)[i] * o;
  178|  8.21k|    }
  179|  2.73k|    return ret;
  180|  2.73k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   603k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   603k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   603k|    v_[0] = c0;
   55|   603k|    v_[1] = c1;
   56|   603k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  19.1k|  VectorD() {
   41|  57.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 38.3k, False: 19.1k]
  ------------------
   42|  38.3k|      (*this)[i] = Scalar(0);
   43|  38.3k|    }
   44|  19.1k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  5.42k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  16.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 10.8k, False: 5.42k]
  ------------------
  104|  10.8k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 10.8k, False: 0]
  ------------------
  105|  10.8k|        v_[i] = Scalar(src_vector[i]);
  106|  10.8k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  10.8k|    }
  110|  5.42k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|  1.64k|  Self operator+(const Self &o) const {
  130|  1.64k|    Self ret;
  131|  4.94k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 3.29k, False: 1.64k]
  ------------------
  132|  3.29k|      ret[i] = (*this)[i] + o[i];
  133|  3.29k|    }
  134|  1.64k|    return ret;
  135|  1.64k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  2.71k|  VectorD() {
   41|  8.13k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.42k, False: 2.71k]
  ------------------
   42|  5.42k|      (*this)[i] = Scalar(0);
   43|  5.42k|    }
   44|  2.71k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  16.2k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  10.8k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  2.71k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  8.13k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 5.42k, False: 2.71k]
  ------------------
  104|  5.42k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 5.42k, False: 0]
  ------------------
  105|  5.42k|        v_[i] = Scalar(src_vector[i]);
  106|  5.42k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  5.42k|    }
  110|  2.71k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  2.71k|  Self operator/(const Scalar &o) const {
  183|  2.71k|    Self ret;
  184|  8.13k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 5.42k, False: 2.71k]
  ------------------
  185|  5.42k|      ret[i] = (*this)[i] / o;
  186|  5.42k|    }
  187|  2.71k|    return ret;
  188|  2.71k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.06k|  Self operator-(const Self &o) const {
  138|  1.06k|    Self ret;
  139|  3.18k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.12k, False: 1.06k]
  ------------------
  140|  2.12k|      ret[i] = (*this)[i] - o[i];
  141|  2.12k|    }
  142|  1.06k|    return ret;
  143|  1.06k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  76.7k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.07M|  VectorD() {
   41|  4.29M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.22M, False: 1.07M]
  ------------------
   42|  3.22M|      (*this)[i] = Scalar(0);
   43|  3.22M|    }
   44|  1.07M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  5.36M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  5.36M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  5.36M|    v_[0] = c0;
   55|  5.36M|    v_[1] = c1;
   56|  5.36M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  2.98M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  8.96M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 5.97M, False: 2.98M]
  ------------------
  104|  5.97M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 5.97M, False: 0]
  ------------------
  105|  5.97M|        v_[i] = Scalar(src_vector[i]);
  106|  5.97M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  5.97M|    }
  110|  2.98M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  1.49M|  VectorD() {
   41|  4.48M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 2.98M, False: 1.49M]
  ------------------
   42|  2.98M|      (*this)[i] = Scalar(0);
   43|  2.98M|    }
   44|  1.49M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  1.49M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  4.48M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 2.98M, False: 1.49M]
  ------------------
  104|  2.98M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 2.98M, False: 0]
  ------------------
  105|  2.98M|        v_[i] = Scalar(src_vector[i]);
  106|  2.98M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  2.98M|    }
  110|  1.49M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  3.63M|  VectorD(const Self &o) {
   89|  10.9M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 7.27M, False: 3.63M]
  ------------------
   90|  7.27M|      (*this)[i] = o[i];
   91|  7.27M|    }
   92|  3.63M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  1.46M|  VectorD() {
   41|  4.39M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 2.92M, False: 1.46M]
  ------------------
   42|  2.92M|      (*this)[i] = Scalar(0);
   43|  2.92M|    }
   44|  1.46M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   387M|  VectorD(const Self &o) {
   89|  1.54G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 1.16G, False: 387M]
  ------------------
   90|  1.16G|      (*this)[i] = o[i];
   91|  1.16G|    }
   92|   387M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  1.16G|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   169M|      : v_({{c0, c1, c2}}) {
   60|   169M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   169M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  43.7M|  inline int num_vertices() const {
   74|  43.7M|    return static_cast<int>(vertex_corners_.size());
   75|  43.7M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  4.38M|  inline int num_corners() const {
   77|  4.38M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  4.38M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  2.69M|  inline int num_faces() const {
   80|  2.69M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  2.69M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   147M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   147M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 147M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   147M|    return opposite_corners_[corner];
   88|   147M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   245M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   245M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 5.64M, False: 239M]
  ------------------
   91|  5.64M|      return corner;
   92|  5.64M|    }
   93|   239M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 213M, False: 25.8M]
  ------------------
   94|   245M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   205M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   205M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 1.66M, False: 203M]
  ------------------
   97|  1.66M|      return corner;
   98|  1.66M|    }
   99|   203M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 62.1M, False: 141M]
  ------------------
  100|   205M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   380M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   380M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 380M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   380M|    return ConfidentVertex(corner);
  106|   380M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   380M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   380M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   380M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   380M|    return corner_to_vertex_map_[corner];
  111|   380M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  16.0M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  16.0M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 16.0M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  16.0M|    return FaceIndex(corner.value() / 3);
  117|  16.0M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   442M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  28.7M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  28.7M|    return vertex_corners_[v];
  152|  28.7M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|   607k|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|   607k|    const CornerIndex corner = LeftMostCorner(vert);
  187|   607k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 17.3k, False: 589k]
  ------------------
  188|  17.3k|      return true;
  189|  17.3k|    }
  190|   589k|    return false;
  191|   607k|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  36.0M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  36.0M|    return Previous(Opposite(Previous(corner)));
  202|  36.0M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  7.64M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  7.64M|    return Next(Opposite(Next(corner)));
  207|  7.64M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  1.53M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  1.53M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 1.53M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  1.53M|    return Opposite(Previous(corner_id));
  222|  1.53M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  2.12M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  2.12M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 2.12M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  2.12M|    return Opposite(Next(corner_id));
  228|  2.12M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   148M|                                CornerIndex opp_corner_id) {
  249|   148M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   148M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   148M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   176M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   176M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   176M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   176M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  48.3M|  VertexIndex AddNewVertex() {
  271|  48.3M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  48.3M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  48.3M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  48.3M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|  98.8M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|  98.8M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|  98.8M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 98.8M, False: 0]
  ------------------
  295|  98.8M|      vertex_corners_[vert] = corner;
  296|  98.8M|    }
  297|  98.8M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|   973k|  void MakeVertexIsolated(VertexIndex vert) {
  329|   973k|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|   973k|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|   973k|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  6.14k|      : corner_table_(table),
  229|  6.14k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  6.14k|        corner_(start_corner_),
  231|  6.14k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  3.55M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  19.6k|  VertexCornersIterator &operator++() {
  268|  19.6k|    Next();
  269|  19.6k|    return *this;
  270|  19.6k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.03M|  void Next() {
  248|  3.03M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.00M, False: 28.7k]
  ------------------
  249|  3.00M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.00M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 24.8k, False: 2.97M]
  ------------------
  251|       |        // Open boundary reached.
  252|  24.8k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  24.8k|        left_traversal_ = false;
  254|  2.97M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 496k, False: 2.48M]
  ------------------
  255|       |        // End reached.
  256|   496k|        corner_ = kInvalidCornerIndex;
  257|   496k|      }
  258|  3.00M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  28.7k|      corner_ = corner_table_->SwingRight(corner_);
  262|  28.7k|    }
  263|  3.03M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  5.37M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  1.66M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  1.72M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  1.02M|  void Next() {
  248|  1.02M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 1.01M, False: 13.4k]
  ------------------
  249|  1.01M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  1.01M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 560k, False: 455k]
  ------------------
  251|       |        // Open boundary reached.
  252|   560k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|   560k|        left_traversal_ = false;
  254|   560k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 74.8k, False: 380k]
  ------------------
  255|       |        // End reached.
  256|  74.8k|        corner_ = kInvalidCornerIndex;
  257|  74.8k|      }
  258|  1.01M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  13.4k|      corner_ = corner_table_->SwingRight(corner_);
  262|  13.4k|    }
  263|  1.02M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   635k|      : corner_table_(table),
  236|   635k|        start_corner_(corner_id),
  237|   635k|        corner_(start_corner_),
  238|   635k|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   515k|      : corner_table_(table),
  236|   515k|        start_corner_(corner_id),
  237|   515k|        corner_(start_corner_),
  238|   515k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  26.3M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  26.3M|    return is_edge_on_seam_[corner.value()];
   47|  26.3M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  10.6M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  10.6M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 10.6M]
  |  Branch (50:42): [True: 8.24M, False: 2.45M]
  ------------------
   51|  8.24M|      return kInvalidCornerIndex;
   52|  8.24M|    }
   53|  2.45M|    return corner_table_->Opposite(corner);
   54|  10.6M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  17.1M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  17.1M|    return corner_table_->Next(corner);
   58|  17.1M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  7.40M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  7.40M|    return corner_table_->Previous(corner);
   62|  7.40M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  2.24M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  2.24M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  2.24M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.32M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  1.32M|    return Opposite(Previous(corner));
   73|  1.32M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  1.64M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  1.64M|    return Opposite(Next(corner));
   76|  1.64M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|   968k|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|   968k|    return Previous(Opposite(Previous(corner)));
   81|   968k|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  5.67M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  5.67M|    return Next(Opposite(Next(corner)));
   86|  5.67M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  5.95k|  int num_vertices() const {
   89|  5.95k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  5.95k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  1.84k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|    820|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  44.9M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  44.9M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  44.9M|    return ConfidentVertex(corner);
   97|  44.9M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  44.9M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  44.9M|    return corner_to_vertex_map_[corner.value()];
  100|  44.9M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  1.29M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  1.29M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  1.29M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  1.29M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  1.29M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  1.29M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 1.29M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  1.29M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 974k, False: 325k]
  ------------------
  128|   974k|      return true;
  129|   974k|    }
  130|   325k|    return false;
  131|  1.29M|  }

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

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

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

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

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

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

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

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

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

