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

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

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

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

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

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

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

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

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

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

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

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

_ZNK5draco17AttributesDecoder14GetAttributeIdEi:
   44|  54.0k|  int32_t GetAttributeId(int i) const override {
   45|  54.0k|    return point_attribute_ids_[i];
   46|  54.0k|  }
_ZNK5draco17AttributesDecoder16GetNumAttributesEv:
   47|  31.0k|  int32_t GetNumAttributes() const override {
   48|  31.0k|    return static_cast<int32_t>(point_attribute_ids_.size());
   49|  31.0k|  }
_ZNK5draco17AttributesDecoder10GetDecoderEv:
   50|  31.9k|  PointCloudDecoder *GetDecoder() const override {
   51|  31.9k|    return point_cloud_decoder_;
   52|  31.9k|  }
_ZN5draco17AttributesDecoder16DecodeAttributesEPNS_13DecoderBufferE:
   55|  3.21k|  bool DecodeAttributes(DecoderBuffer *in_buffer) override {
   56|  3.21k|    if (!DecodePortableAttributes(in_buffer)) {
  ------------------
  |  Branch (56:9): [True: 1.61k, False: 1.59k]
  ------------------
   57|  1.61k|      return false;
   58|  1.61k|    }
   59|  1.59k|    if (!DecodeDataNeededByPortableTransforms(in_buffer)) {
  ------------------
  |  Branch (59:9): [True: 641, False: 958]
  ------------------
   60|    641|      return false;
   61|    641|    }
   62|    958|    if (!TransformAttributesToOriginalFormat()) {
  ------------------
  |  Branch (62:9): [True: 294, False: 664]
  ------------------
   63|    294|      return false;
   64|    294|    }
   65|    664|    return true;
   66|    958|  }
_ZNK5draco17AttributesDecoder27GetLocalIdForPointAttributeEi:
   69|  1.53k|  int32_t GetLocalIdForPointAttribute(int32_t point_attribute_id) const {
   70|  1.53k|    const int id_map_size =
   71|  1.53k|        static_cast<int>(point_attribute_to_local_id_map_.size());
   72|  1.53k|    if (point_attribute_id >= id_map_size) {
  ------------------
  |  Branch (72:9): [True: 0, False: 1.53k]
  ------------------
   73|      0|      return -1;
   74|      0|    }
   75|  1.53k|    return point_attribute_to_local_id_map_[point_attribute_id];
   76|  1.53k|  }
_ZN5draco17AttributesDecoderD2Ev:
   35|  17.7k|  virtual ~AttributesDecoder() = default;

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  1.78k|      : quantization_bits_(-1),
   54|  1.78k|        max_quantized_value_(-1),
   55|  1.78k|        max_value_(-1),
   56|  1.78k|        dequantization_scale_(1.f),
   57|  1.78k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  1.63k|  bool SetQuantizationBits(int32_t q) {
   60|  1.63k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 574, False: 1.05k]
  |  Branch (60:18): [True: 67, False: 991]
  ------------------
   61|    641|      return false;
   62|    641|    }
   63|    991|    quantization_bits_ = q;
   64|    991|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|    991|    max_value_ = max_quantized_value_ - 1;
   66|    991|    dequantization_scale_ = 2.f / max_value_;
   67|    991|    center_value_ = max_value_ / 2;
   68|    991|    return true;
   69|  1.63k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  1.47M|                                           int32_t *out_t) const {
   77|  1.47M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 2.83k, False: 1.47M]
  |  Branch (77:20): [True: 0, False: 2.83k]
  |  Branch (77:32): [True: 2.83k, False: 1.47M]
  |  Branch (77:42): [True: 0, False: 2.83k]
  ------------------
   78|  1.47M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.22M, False: 254k]
  |  Branch (78:29): [True: 6.97k, False: 1.21M]
  ------------------
   79|  6.97k|      s = max_value_;
   80|  6.97k|      t = max_value_;
   81|  1.47M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 2.83k, False: 1.46M]
  |  Branch (81:26): [True: 701, False: 2.13k]
  ------------------
   82|    701|      t = center_value_ - (t - center_value_);
   83|  1.46M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.21M, False: 253k]
  |  Branch (83:35): [True: 6.95k, False: 1.20M]
  ------------------
   84|  6.95k|      t = center_value_ + (center_value_ - t);
   85|  1.46M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.20M, False: 252k]
  |  Branch (85:35): [True: 282, False: 1.20M]
  ------------------
   86|    282|      s = center_value_ + (center_value_ - s);
   87|  1.46M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 3.27k, False: 1.45M]
  |  Branch (87:26): [True: 1.26k, False: 2.01k]
  ------------------
   88|  1.26k|      s = center_value_ - (s - center_value_);
   89|  1.26k|    }
   90|       |
   91|  1.47M|    *out_s = s;
   92|  1.47M|    *out_t = t;
   93|  1.47M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  1.47M|                                                       int32_t *out_t) const {
  100|  1.47M|    DRACO_DCHECK_EQ(
  101|  1.47M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  1.47M|        center_value_);
  103|  1.47M|    int32_t s, t;
  104|  1.47M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 392k, False: 1.08M]
  ------------------
  105|       |      // Right hemisphere.
  106|   392k|      s = (int_vec[1] + center_value_);
  107|   392k|      t = (int_vec[2] + center_value_);
  108|  1.08M|    } else {
  109|       |      // Left hemisphere.
  110|  1.08M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 46.1k, False: 1.03M]
  ------------------
  111|  46.1k|        s = std::abs(int_vec[2]);
  112|  1.03M|      } else {
  113|  1.03M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.03M|      }
  115|  1.08M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 48.0k, False: 1.03M]
  ------------------
  116|  48.0k|        t = std::abs(int_vec[1]);
  117|  1.03M|      } else {
  118|  1.03M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.03M|      }
  120|  1.08M|    }
  121|  1.47M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  1.47M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   522k|                                                    float *out_vector) const {
  199|   522k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   522k|                                 in_t * dequantization_scale_ - 1.f,
  201|   522k|                                 out_vector);
  202|   522k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  2.32M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  2.32M|    DRACO_DCHECK_LE(s, center_value_);
  208|  2.32M|    DRACO_DCHECK_LE(t, center_value_);
  209|  2.32M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  2.32M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  2.32M|    const uint32_t st =
  212|  2.32M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  2.32M|    return st <= center_value_;
  214|  2.32M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  4.32M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  4.32M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  4.32M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  4.32M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  4.32M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  4.32M|    int32_t sign_s = 0;
  223|  4.32M|    int32_t sign_t = 0;
  224|  4.32M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 2.77M, False: 1.54M]
  |  Branch (224:20): [True: 2.72M, False: 57.1k]
  ------------------
  225|  2.72M|      sign_s = 1;
  226|  2.72M|      sign_t = 1;
  227|  2.72M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 1.54M, False: 55.6k]
  |  Branch (227:27): [True: 775k, False: 769k]
  ------------------
  228|   775k|      sign_s = -1;
  229|   775k|      sign_t = -1;
  230|   825k|    } else {
  231|   825k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 55.6k, False: 769k]
  ------------------
  232|   825k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 769k, False: 55.6k]
  ------------------
  233|   825k|    }
  234|       |
  235|       |    // Perform the addition and subtraction using unsigned integers to avoid
  236|       |    // signed integer overflows for bad data. Note that the result will be
  237|       |    // unchanged for non-overflowing cases.
  238|  4.32M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  4.32M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  4.32M|    uint32_t us = *s;
  241|  4.32M|    uint32_t ut = *t;
  242|  4.32M|    us = us + us - corner_point_s;
  243|  4.32M|    ut = ut + ut - corner_point_t;
  244|  4.32M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 3.49M, False: 825k]
  ------------------
  245|  3.49M|      uint32_t temp = us;
  246|  3.49M|      us = -ut;
  247|  3.49M|      ut = -temp;
  248|  3.49M|    } else {
  249|   825k|      std::swap(us, ut);
  250|   825k|    }
  251|  4.32M|    us = us + corner_point_s;
  252|  4.32M|    ut = ut + corner_point_t;
  253|       |
  254|  4.32M|    *s = us;
  255|  4.32M|    *t = ut;
  256|  4.32M|    *s /= 2;
  257|  4.32M|    *t /= 2;
  258|  4.32M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  4.64M|  int32_t ModMax(int32_t x) const {
  273|  4.64M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 534, False: 4.64M]
  ------------------
  274|    534|      return x - this->max_quantized_value();
  275|    534|    }
  276|  4.64M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 738, False: 4.64M]
  ------------------
  277|    738|      return x + this->max_quantized_value();
  278|    738|    }
  279|  4.64M|    return x;
  280|  4.64M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|    980|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  1.27k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  13.9M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   522k|                                           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|   522k|    float y = in_s_scaled;
  329|   522k|    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|   522k|    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|   522k|    float x_offset = -x;
  342|   522k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 366k, False: 156k]
  ------------------
  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|   522k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 436k, False: 85.6k]
  ------------------
  348|   522k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 78.1k, False: 444k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   522k|    const float norm_squared = x * x + y * y + z * z;
  352|   522k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 522k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   522k|    } else {
  357|   522k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   522k|      out_vector[0] = x * d;
  359|   522k|      out_vector[1] = y * d;
  360|   522k|      out_vector[2] = z * d;
  361|   522k|    }
  362|   522k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  1.47M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  1.47M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  1.47M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  1.47M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  1.47M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  1.47M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  1.47M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 1.24M, False: 233k]
  ------------------
  181|  1.24M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.24M|    } else {
  183|   233k|      vec[0] =
  184|   233k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   233k|          abs_sum;
  186|   233k|      vec[1] =
  187|   233k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   233k|          abs_sum;
  189|   233k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 123k, False: 109k]
  ------------------
  190|   123k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   123k|      } else {
  192|   109k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   109k|      }
  194|   233k|    }
  195|  1.47M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    240|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    240|            attribute, transform, mesh_data),
   52|    240|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    232|                                                                *buffer) {
  194|    232|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    232|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    232|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 7, False: 225]
  ------------------
  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: 6, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      6|      return false;
  205|      6|    }
  206|      7|  }
  207|    226|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.04k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 859, False: 186]
  ------------------
  211|    859|    uint32_t num_flags;
  212|    859|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 5, False: 854]
  ------------------
  213|      5|      return false;
  214|      5|    }
  215|    854|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 23, False: 831]
  ------------------
  216|     23|      return false;
  217|     23|    }
  218|    831|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 456, False: 375]
  ------------------
  219|    456|      is_crease_edge_[i].resize(num_flags);
  220|    456|      RAnsBitDecoder decoder;
  221|    456|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 12, False: 444]
  ------------------
  222|     12|        return false;
  223|     12|      }
  224|  1.38M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.38M, False: 444]
  ------------------
  225|  1.38M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.38M|      }
  227|    444|      decoder.EndDecoding();
  228|    444|    }
  229|    831|  }
  230|    186|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    186|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    226|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    173|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    173|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    173|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    865|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 692, False: 173]
  ------------------
   93|    692|    pred_vals[i].resize(num_components, 0);
   94|    692|  }
   95|    173|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    173|                                         out_data);
   97|       |
   98|    173|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    173|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    173|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    173|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    173|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    173|  const int corner_map_size =
  109|    173|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   777k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 777k, False: 128]
  ------------------
  111|   777k|    const CornerIndex start_corner_id =
  112|   777k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   777k|    CornerIndex corner_id(start_corner_id);
  115|   777k|    int num_parallelograms = 0;
  116|   777k|    bool first_pass = true;
  117|  1.77M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 1.04M, False: 730k]
  ------------------
  118|  1.04M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 100k, False: 946k]
  ------------------
  119|  1.04M|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  1.04M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   100k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   100k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 1.08k, False: 99.5k]
  ------------------
  127|  1.08k|          break;
  128|  1.08k|        }
  129|   100k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|  1.04M|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 1.03M, False: 12.8k]
  ------------------
  134|  1.03M|        corner_id = table->SwingLeft(corner_id);
  135|  1.03M|      } else {
  136|  12.8k|        corner_id = table->SwingRight(corner_id);
  137|  12.8k|      }
  138|  1.04M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 45.3k, False: 1.00M]
  ------------------
  139|  45.3k|        break;
  140|  45.3k|      }
  141|  1.00M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 737k, False: 263k]
  |  Branch (141:47): [True: 730k, False: 6.01k]
  ------------------
  142|   730k|        first_pass = false;
  143|   730k|        corner_id = table->SwingRight(start_corner_id);
  144|   730k|      }
  145|  1.00M|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   777k|    int num_used_parallelograms = 0;
  150|   777k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 55.1k, False: 722k]
  ------------------
  151|  4.29M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 4.23M, False: 55.1k]
  ------------------
  152|  4.23M|        multi_pred_vals[i] = 0;
  153|  4.23M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   155k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 100k, False: 55.0k]
  ------------------
  156|   100k|        const int context = num_parallelograms - 1;
  157|   100k|        const int pos = is_crease_edge_pos[context]++;
  158|   100k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 45, False: 100k]
  ------------------
  159|     45|          return false;
  160|     45|        }
  161|   100k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   100k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 11.9k, False: 88.6k]
  ------------------
  163|  11.9k|          ++num_used_parallelograms;
  164|  1.20M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.18M, False: 11.9k]
  ------------------
  165|  1.18M|            multi_pred_vals[j] =
  166|  1.18M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.18M|          }
  168|  11.9k|        }
  169|   100k|      }
  170|  55.1k|    }
  171|   777k|    const int dst_offset = p * num_components;
  172|   777k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 772k, False: 4.68k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   772k|      const int src_offset = (p - 1) * num_components;
  176|   772k|      this->transform().ComputeOriginalValue(
  177|   772k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   772k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   449k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 445k, False: 4.68k]
  ------------------
  181|   445k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   445k|      }
  183|  4.68k|      this->transform().ComputeOriginalValue(
  184|  4.68k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  4.68k|    }
  186|   777k|  }
  187|    128|  return true;
  188|    173|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    237|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    237|            attribute, transform, mesh_data),
   52|    237|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    233|                                                                *buffer) {
  194|    233|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    233|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    233|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 0, False: 233]
  ------------------
  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|    233|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.09k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 893, False: 205]
  ------------------
  211|    893|    uint32_t num_flags;
  212|    893|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 1, False: 892]
  ------------------
  213|      1|      return false;
  214|      1|    }
  215|    892|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 20, False: 872]
  ------------------
  216|     20|      return false;
  217|     20|    }
  218|    872|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 423, False: 449]
  ------------------
  219|    423|      is_crease_edge_[i].resize(num_flags);
  220|    423|      RAnsBitDecoder decoder;
  221|    423|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 7, False: 416]
  ------------------
  222|      7|        return false;
  223|      7|      }
  224|   796k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 795k, False: 416]
  ------------------
  225|   795k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   795k|      }
  227|    416|      decoder.EndDecoding();
  228|    416|    }
  229|    872|  }
  230|    205|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    205|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    233|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    188|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    188|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    188|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    940|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 752, False: 188]
  ------------------
   93|    752|    pred_vals[i].resize(num_components, 0);
   94|    752|  }
   95|    188|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    188|                                         out_data);
   97|       |
   98|    188|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    188|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    188|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    188|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    188|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    188|  const int corner_map_size =
  109|    188|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  73.9k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 73.8k, False: 120]
  ------------------
  111|  73.8k|    const CornerIndex start_corner_id =
  112|  73.8k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  73.8k|    CornerIndex corner_id(start_corner_id);
  115|  73.8k|    int num_parallelograms = 0;
  116|  73.8k|    bool first_pass = true;
  117|   490k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 476k, False: 13.4k]
  ------------------
  118|   476k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 130k, False: 346k]
  ------------------
  119|   476k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   476k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   130k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   130k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 530, False: 130k]
  ------------------
  127|    530|          break;
  128|    530|        }
  129|   130k|      }
  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|   476k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 459k, False: 17.2k]
  ------------------
  134|   459k|        corner_id = table->SwingLeft(corner_id);
  135|   459k|      } else {
  136|  17.2k|        corner_id = table->SwingRight(corner_id);
  137|  17.2k|      }
  138|   476k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 59.8k, False: 416k]
  ------------------
  139|  59.8k|        break;
  140|  59.8k|      }
  141|   416k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 25.2k, False: 391k]
  |  Branch (141:47): [True: 13.4k, False: 11.7k]
  ------------------
  142|  13.4k|        first_pass = false;
  143|  13.4k|        corner_id = table->SwingRight(start_corner_id);
  144|  13.4k|      }
  145|   416k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  73.8k|    int num_used_parallelograms = 0;
  150|  73.8k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 71.6k, False: 2.18k]
  ------------------
  151|  10.7M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 10.7M, False: 71.6k]
  ------------------
  152|  10.7M|        multi_pred_vals[i] = 0;
  153|  10.7M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   202k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 130k, False: 71.5k]
  ------------------
  156|   130k|        const int context = num_parallelograms - 1;
  157|   130k|        const int pos = is_crease_edge_pos[context]++;
  158|   130k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 68, False: 130k]
  ------------------
  159|     68|          return false;
  160|     68|        }
  161|   130k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   130k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 10.0k, False: 120k]
  ------------------
  163|  10.0k|          ++num_used_parallelograms;
  164|  1.51M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.50M, False: 10.0k]
  ------------------
  165|  1.50M|            multi_pred_vals[j] =
  166|  1.50M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.50M|          }
  168|  10.0k|        }
  169|   130k|      }
  170|  71.6k|    }
  171|  73.7k|    const int dst_offset = p * num_components;
  172|  73.7k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 69.2k, False: 4.56k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  69.2k|      const int src_offset = (p - 1) * num_components;
  176|  69.2k|      this->transform().ComputeOriginalValue(
  177|  69.2k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  69.2k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   537k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 532k, False: 4.56k]
  ------------------
  181|   532k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   532k|      }
  183|  4.56k|      this->transform().ComputeOriginalValue(
  184|  4.56k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  4.56k|    }
  186|  73.7k|  }
  187|    120|  return true;
  188|    188|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.42k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.42k|    mesh_ = mesh;
   39|  1.42k|    corner_table_ = table;
   40|  1.42k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.42k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.42k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  9.86M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  6.44M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  6.44M|    return vertex_to_data_map_;
   48|  6.44M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  3.60M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  3.60M|    return data_to_corner_map_;
   51|  3.60M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.65k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.65k|    mesh_ = mesh;
   39|  1.65k|    corner_table_ = table;
   40|  1.65k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.65k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.65k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  8.53M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  7.39M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  7.39M|    return vertex_to_data_map_;
   48|  7.39M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  1.56M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  1.56M|    return data_to_corner_map_;
   51|  1.56M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  1.42k|      : mesh_(nullptr),
   31|  1.42k|        corner_table_(nullptr),
   32|  1.42k|        vertex_to_data_map_(nullptr),
   33|  1.42k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  1.65k|      : mesh_(nullptr),
   31|  1.65k|        corner_table_(nullptr),
   32|  1.65k|        vertex_to_data_map_(nullptr),
   33|  1.65k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   574k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  84.5k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   282k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   237k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.12k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.12k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  8.47M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.44k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.44k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  1.78M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    154|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    154|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     92|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     92|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    137|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    137|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    112|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    112|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    307|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    154|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    154|    DRACO_DCHECK_EQ(i, 0);
   70|    154|    (void)i;
   71|    154|    return GeometryAttribute::POSITION;
   72|    154|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    154|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    154|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 154]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    154|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 153]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    153|    predictor_.SetPositionAttribute(*att);
   82|    153|    return true;
   83|    154|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    152|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    152|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 4, False: 148]
  ------------------
  145|      4|    return false;
  146|      4|  }
  147|       |
  148|    148|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    148|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    148|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 51, False: 97]
  ------------------
  150|     51|    uint8_t prediction_mode;
  151|     51|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 50]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     50|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 49]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     49|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 49]
  ------------------
  160|     49|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     49|  }
  164|    146|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    146|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 143]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|    143|  return true;
  172|    146|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    143|                                      const PointIndex *entry_to_point_id_map) {
  103|    143|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    143|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    143|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    143|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    143|  const int corner_map_size =
  111|    143|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    143|  VectorD<int32_t, 3> pred_normal_3d;
  114|    143|  int32_t pred_normal_oct[2];
  115|       |
  116|   574k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 574k, False: 143]
  ------------------
  117|   574k|    const CornerIndex corner_id =
  118|   574k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   574k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   574k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   574k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   574k|                    octahedron_tool_box_.center_value());
  125|   574k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 541k, False: 32.8k]
  ------------------
  126|   541k|      pred_normal_3d = -pred_normal_3d;
  127|   541k|    }
  128|   574k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   574k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   574k|    const int data_offset = data_id * 2;
  132|   574k|    this->transform().ComputeOriginalValue(
  133|   574k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   574k|  }
  135|    143|  flip_normal_bit_decoder_.EndDecoding();
  136|    143|  return true;
  137|    143|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    143|  void SetQuantizationBits(int q) {
   85|    143|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    143|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    184|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|     92|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|     92|    DRACO_DCHECK_EQ(i, 0);
   70|     92|    (void)i;
   71|     92|    return GeometryAttribute::POSITION;
   72|     92|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|     92|  bool SetParentAttribute(const PointAttribute *att) override {
   75|     92|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 92]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|     92|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 92]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|     92|    predictor_.SetPositionAttribute(*att);
   82|     92|    return true;
   83|     92|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|     92|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|     92|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 2, False: 90]
  ------------------
  145|      2|    return false;
  146|      2|  }
  147|       |
  148|     90|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|     90|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     90|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 21, False: 69]
  ------------------
  150|     21|    uint8_t prediction_mode;
  151|     21|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 21]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     21|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 20]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     20|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 20]
  ------------------
  160|     20|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     20|  }
  164|     89|#endif
  165|       |
  166|       |  // Init normal flips.
  167|     89|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 2, False: 87]
  ------------------
  168|      2|    return false;
  169|      2|  }
  170|       |
  171|     87|  return true;
  172|     89|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     87|                                      const PointIndex *entry_to_point_id_map) {
  103|     87|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     87|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     87|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     87|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     87|  const int corner_map_size =
  111|     87|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     87|  VectorD<int32_t, 3> pred_normal_3d;
  114|     87|  int32_t pred_normal_oct[2];
  115|       |
  116|  84.5k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 84.4k, False: 87]
  ------------------
  117|  84.4k|    const CornerIndex corner_id =
  118|  84.4k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|  84.4k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|  84.4k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|  84.4k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|  84.4k|                    octahedron_tool_box_.center_value());
  125|  84.4k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 84.1k, False: 324]
  ------------------
  126|  84.1k|      pred_normal_3d = -pred_normal_3d;
  127|  84.1k|    }
  128|  84.4k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|  84.4k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|  84.4k|    const int data_offset = data_id * 2;
  132|  84.4k|    this->transform().ComputeOriginalValue(
  133|  84.4k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|  84.4k|  }
  135|     87|  flip_normal_bit_decoder_.EndDecoding();
  136|     87|  return true;
  137|     87|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     87|  void SetQuantizationBits(int q) {
   85|     87|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     87|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    269|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_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_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_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: 5, False: 132]
  ------------------
   79|      5|      return false;  // Currently works only for 3 component positions.
   80|      5|    }
   81|    132|    predictor_.SetPositionAttribute(*att);
   82|    132|    return true;
   83|    137|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    132|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    132|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 4, False: 128]
  ------------------
  145|      4|    return false;
  146|      4|  }
  147|       |
  148|    128|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    128|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    128|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 51, False: 77]
  ------------------
  150|     51|    uint8_t prediction_mode;
  151|     51|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 51]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     51|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 11, False: 40]
  ------------------
  155|       |      // Invalid prediction mode.
  156|     11|      return false;
  157|     11|    }
  158|       |
  159|     40|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 40]
  ------------------
  160|     40|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     40|  }
  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|   282k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 282k, False: 114]
  ------------------
  117|   282k|    const CornerIndex corner_id =
  118|   282k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   282k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   282k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   282k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   282k|                    octahedron_tool_box_.center_value());
  125|   282k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 280k, False: 2.05k]
  ------------------
  126|   280k|      pred_normal_3d = -pred_normal_3d;
  127|   280k|    }
  128|   282k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   282k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   282k|    const int data_offset = data_id * 2;
  132|   282k|    this->transform().ComputeOriginalValue(
  133|   282k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   282k|  }
  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|    223|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    112|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    112|    DRACO_DCHECK_EQ(i, 0);
   70|    112|    (void)i;
   71|    112|    return GeometryAttribute::POSITION;
   72|    112|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    112|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    112|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 112]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    112|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 111]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    111|    predictor_.SetPositionAttribute(*att);
   82|    111|    return true;
   83|    112|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    111|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    111|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 1, False: 110]
  ------------------
  145|      1|    return false;
  146|      1|  }
  147|       |
  148|    110|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    110|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    110|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 16, False: 94]
  ------------------
  150|     16|    uint8_t prediction_mode;
  151|     16|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 16]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     16|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 15]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     15|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 15]
  ------------------
  160|     15|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     15|  }
  164|    109|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    109|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 106]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|    106|  return true;
  172|    109|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    106|                                      const PointIndex *entry_to_point_id_map) {
  103|    106|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    106|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    106|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    106|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    106|  const int corner_map_size =
  111|    106|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    106|  VectorD<int32_t, 3> pred_normal_3d;
  114|    106|  int32_t pred_normal_oct[2];
  115|       |
  116|   237k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 237k, False: 106]
  ------------------
  117|   237k|    const CornerIndex corner_id =
  118|   237k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   237k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   237k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   237k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   237k|                    octahedron_tool_box_.center_value());
  125|   237k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 229k, False: 7.76k]
  ------------------
  126|   229k|      pred_normal_3d = -pred_normal_3d;
  127|   229k|    }
  128|   237k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   237k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   237k|    const int data_offset = data_id * 2;
  132|   237k|    this->transform().ComputeOriginalValue(
  133|   237k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   237k|  }
  135|    106|  flip_normal_bit_decoder_.EndDecoding();
  136|    106|  return true;
  137|    106|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    106|  void SetQuantizationBits(int q) {
   85|    106|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    106|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    143|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    143|            attribute, transform, mesh_data),
   37|    143|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    285|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    143|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    143|    DRACO_DCHECK_EQ(i, 0);
   70|    143|    (void)i;
   71|    143|    return GeometryAttribute::POSITION;
   72|    143|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    143|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    143|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 143]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    143|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 142]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    142|    predictor_.SetPositionAttribute(*att);
   82|    142|    return true;
   83|    143|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    141|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    141|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 16, False: 125]
  ------------------
  145|     16|    return false;
  146|     16|  }
  147|       |
  148|    125|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    125|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    125|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 47, False: 78]
  ------------------
  150|     47|    uint8_t prediction_mode;
  151|     47|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 46]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     46|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 44]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|     44|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 44]
  ------------------
  160|     44|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     44|  }
  164|    122|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    122|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 119]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|    119|  return true;
  172|    122|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    119|                                      const PointIndex *entry_to_point_id_map) {
  103|    119|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    119|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    119|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    119|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    119|  const int corner_map_size =
  111|    119|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    119|  VectorD<int32_t, 3> pred_normal_3d;
  114|    119|  int32_t pred_normal_oct[2];
  115|       |
  116|  86.0k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 85.9k, False: 119]
  ------------------
  117|  85.9k|    const CornerIndex corner_id =
  118|  85.9k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|  85.9k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|  85.9k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|  85.9k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|  85.9k|                    octahedron_tool_box_.center_value());
  125|  85.9k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 46.0k, False: 39.8k]
  ------------------
  126|  46.0k|      pred_normal_3d = -pred_normal_3d;
  127|  46.0k|    }
  128|  85.9k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|  85.9k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|  85.9k|    const int data_offset = data_id * 2;
  132|  85.9k|    this->transform().ComputeOriginalValue(
  133|  85.9k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|  85.9k|  }
  135|    119|  flip_normal_bit_decoder_.EndDecoding();
  136|    119|  return true;
  137|    119|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    119|  void SetQuantizationBits(int q) {
   85|    119|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    119|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    416|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    416|            attribute, transform, mesh_data),
   37|    416|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    832|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    416|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    416|    DRACO_DCHECK_EQ(i, 0);
   70|    416|    (void)i;
   71|    416|    return GeometryAttribute::POSITION;
   72|    416|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    416|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    416|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 416]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    416|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 416]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|    416|    predictor_.SetPositionAttribute(*att);
   82|    416|    return true;
   83|    416|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    411|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    411|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 26, False: 385]
  ------------------
  145|     26|    return false;
  146|     26|  }
  147|       |
  148|    385|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    385|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    385|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 114, False: 271]
  ------------------
  150|    114|    uint8_t prediction_mode;
  151|    114|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 113]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    113|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 112]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|    112|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 112]
  ------------------
  160|    112|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    112|  }
  164|    383|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    383|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 11, False: 372]
  ------------------
  168|     11|    return false;
  169|     11|  }
  170|       |
  171|    372|  return true;
  172|    383|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    372|                                      const PointIndex *entry_to_point_id_map) {
  103|    372|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    372|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    372|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    372|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    372|  const int corner_map_size =
  111|    372|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    372|  VectorD<int32_t, 3> pred_normal_3d;
  114|    372|  int32_t pred_normal_oct[2];
  115|       |
  116|   212k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 212k, False: 372]
  ------------------
  117|   212k|    const CornerIndex corner_id =
  118|   212k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   212k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   212k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   212k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   212k|                    octahedron_tool_box_.center_value());
  125|   212k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 189k, False: 23.3k]
  ------------------
  126|   189k|      pred_normal_3d = -pred_normal_3d;
  127|   189k|    }
  128|   212k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   212k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   212k|    const int data_offset = data_id * 2;
  132|   212k|    this->transform().ComputeOriginalValue(
  133|   212k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   212k|  }
  135|    372|  flip_normal_bit_decoder_.EndDecoding();
  136|    372|  return true;
  137|    372|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    372|  void SetQuantizationBits(int q) {
   85|    372|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    372|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    154|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    154|            attribute, transform, mesh_data),
   37|    154|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     92|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|     92|            attribute, transform, mesh_data),
   37|     92|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    137|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    137|            attribute, transform, mesh_data),
   37|    137|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    112|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    112|            attribute, transform, mesh_data),
   37|    112|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    203|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    203|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 47, False: 156]
  ------------------
  105|     47|      this->normal_prediction_mode_ = mode;
  106|     47|      return true;
  107|    156|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 156, False: 0]
  ------------------
  108|    156|      this->normal_prediction_mode_ = mode;
  109|    156|      return true;
  110|    156|    }
  111|      0|    return false;
  112|    203|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   574k|                             DataTypeT *prediction) override {
   42|   574k|    DRACO_DCHECK(this->IsInitialized());
   43|   574k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   574k|    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|   574k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   574k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   574k|    VectorD<int64_t, 3> normal;
   53|   574k|    CornerIndex c_next, c_prev;
   54|  1.32M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 755k, False: 574k]
  ------------------
   55|       |      // Getting corners.
   56|   755k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 282, False: 755k]
  ------------------
   57|    282|        c_next = corner_table->Next(corner_id);
   58|    282|        c_prev = corner_table->Previous(corner_id);
   59|   755k|      } else {
   60|   755k|        c_next = corner_table->Next(cit.Corner());
   61|   755k|        c_prev = corner_table->Previous(cit.Corner());
   62|   755k|      }
   63|   755k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   755k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   755k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   755k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   755k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   755k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   755k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   755k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   755k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   755k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   755k|      cit.Next();
   81|   755k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   574k|    constexpr int64_t upper_bound = 1 << 29;
   85|   574k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 218, False: 574k]
  ------------------
   86|    218|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    218|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 58, False: 160]
  ------------------
   88|     58|        const int64_t quotient = abs_sum / upper_bound;
   89|     58|        normal = normal / quotient;
   90|     58|      }
   91|   574k|    } else {
   92|   574k|      const int64_t abs_sum = normal.AbsSum();
   93|   574k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.29k, False: 571k]
  ------------------
   94|  2.29k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.29k|        normal = normal / quotient;
   96|  2.29k|      }
   97|   574k|    }
   98|   574k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   574k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   574k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   574k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   574k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    112|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    112|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 18, False: 94]
  ------------------
  105|     18|      this->normal_prediction_mode_ = mode;
  106|     18|      return true;
  107|     94|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 94, False: 0]
  ------------------
  108|     94|      this->normal_prediction_mode_ = mode;
  109|     94|      return true;
  110|     94|    }
  111|      0|    return false;
  112|    112|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  84.4k|                             DataTypeT *prediction) override {
   42|  84.4k|    DRACO_DCHECK(this->IsInitialized());
   43|  84.4k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  84.4k|    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|  84.4k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  84.4k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  84.4k|    VectorD<int64_t, 3> normal;
   53|  84.4k|    CornerIndex c_next, c_prev;
   54|   589k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 504k, False: 84.4k]
  ------------------
   55|       |      // Getting corners.
   56|   504k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 102, False: 504k]
  ------------------
   57|    102|        c_next = corner_table->Next(corner_id);
   58|    102|        c_prev = corner_table->Previous(corner_id);
   59|   504k|      } else {
   60|   504k|        c_next = corner_table->Next(cit.Corner());
   61|   504k|        c_prev = corner_table->Previous(cit.Corner());
   62|   504k|      }
   63|   504k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   504k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   504k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   504k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   504k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   504k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   504k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   504k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   504k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   504k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   504k|      cit.Next();
   81|   504k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  84.4k|    constexpr int64_t upper_bound = 1 << 29;
   85|  84.4k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 68, False: 84.4k]
  ------------------
   86|     68|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     68|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 24, False: 44]
  ------------------
   88|     24|        const int64_t quotient = abs_sum / upper_bound;
   89|     24|        normal = normal / quotient;
   90|     24|      }
   91|  84.4k|    } else {
   92|  84.4k|      const int64_t abs_sum = normal.AbsSum();
   93|  84.4k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 74.4k, False: 9.92k]
  ------------------
   94|  74.4k|        const int64_t quotient = abs_sum / upper_bound;
   95|  74.4k|        normal = normal / quotient;
   96|  74.4k|      }
   97|  84.4k|    }
   98|  84.4k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  84.4k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  84.4k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  84.4k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  84.4k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    177|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    177|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 38, False: 139]
  ------------------
  105|     38|      this->normal_prediction_mode_ = mode;
  106|     38|      return true;
  107|    139|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 139, False: 0]
  ------------------
  108|    139|      this->normal_prediction_mode_ = mode;
  109|    139|      return true;
  110|    139|    }
  111|      0|    return false;
  112|    177|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   282k|                             DataTypeT *prediction) override {
   42|   282k|    DRACO_DCHECK(this->IsInitialized());
   43|   282k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   282k|    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|   282k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   282k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   282k|    VectorD<int64_t, 3> normal;
   53|   282k|    CornerIndex c_next, c_prev;
   54|   664k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 381k, False: 282k]
  ------------------
   55|       |      // Getting corners.
   56|   381k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 228, False: 381k]
  ------------------
   57|    228|        c_next = corner_table->Next(corner_id);
   58|    228|        c_prev = corner_table->Previous(corner_id);
   59|   381k|      } else {
   60|   381k|        c_next = corner_table->Next(cit.Corner());
   61|   381k|        c_prev = corner_table->Previous(cit.Corner());
   62|   381k|      }
   63|   381k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   381k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   381k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   381k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   381k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   381k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   381k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   381k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   381k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   381k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   381k|      cit.Next();
   81|   381k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   282k|    constexpr int64_t upper_bound = 1 << 29;
   85|   282k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 152, False: 282k]
  ------------------
   86|    152|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    152|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 54, False: 98]
  ------------------
   88|     54|        const int64_t quotient = abs_sum / upper_bound;
   89|     54|        normal = normal / quotient;
   90|     54|      }
   91|   282k|    } else {
   92|   282k|      const int64_t abs_sum = normal.AbsSum();
   93|   282k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.64k, False: 280k]
  ------------------
   94|  1.64k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.64k|        normal = normal / quotient;
   96|  1.64k|      }
   97|   282k|    }
   98|   282k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   282k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   282k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   282k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   282k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    127|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    127|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 14, False: 113]
  ------------------
  105|     14|      this->normal_prediction_mode_ = mode;
  106|     14|      return true;
  107|    113|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 113, False: 0]
  ------------------
  108|    113|      this->normal_prediction_mode_ = mode;
  109|    113|      return true;
  110|    113|    }
  111|      0|    return false;
  112|    127|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   237k|                             DataTypeT *prediction) override {
   42|   237k|    DRACO_DCHECK(this->IsInitialized());
   43|   237k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   237k|    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|   237k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   237k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   237k|    VectorD<int64_t, 3> normal;
   53|   237k|    CornerIndex c_next, c_prev;
   54|  1.64M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.41M, False: 237k]
  ------------------
   55|       |      // Getting corners.
   56|  1.41M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 78, False: 1.41M]
  ------------------
   57|     78|        c_next = corner_table->Next(corner_id);
   58|     78|        c_prev = corner_table->Previous(corner_id);
   59|  1.41M|      } else {
   60|  1.41M|        c_next = corner_table->Next(cit.Corner());
   61|  1.41M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.41M|      }
   63|  1.41M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.41M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.41M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.41M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.41M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.41M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.41M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.41M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.41M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.41M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.41M|      cit.Next();
   81|  1.41M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   237k|    constexpr int64_t upper_bound = 1 << 29;
   85|   237k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 52, False: 237k]
  ------------------
   86|     52|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     52|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 29, False: 23]
  ------------------
   88|     29|        const int64_t quotient = abs_sum / upper_bound;
   89|     29|        normal = normal / quotient;
   90|     29|      }
   91|   237k|    } else {
   92|   237k|      const int64_t abs_sum = normal.AbsSum();
   93|   237k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 131k, False: 105k]
  ------------------
   94|   131k|        const int64_t quotient = abs_sum / upper_bound;
   95|   131k|        normal = normal / quotient;
   96|   131k|      }
   97|   237k|    }
   98|   237k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   237k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   237k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   237k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   237k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    143|      : Base(md) {
   35|    143|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    143|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    187|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    187|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 41, False: 146]
  ------------------
  105|     41|      this->normal_prediction_mode_ = mode;
  106|     41|      return true;
  107|    146|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 146, False: 0]
  ------------------
  108|    146|      this->normal_prediction_mode_ = mode;
  109|    146|      return true;
  110|    146|    }
  111|      0|    return false;
  112|    187|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  85.9k|                             DataTypeT *prediction) override {
   42|  85.9k|    DRACO_DCHECK(this->IsInitialized());
   43|  85.9k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  85.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|  85.9k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  85.9k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  85.9k|    VectorD<int64_t, 3> normal;
   53|  85.9k|    CornerIndex c_next, c_prev;
   54|   456k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 370k, False: 85.9k]
  ------------------
   55|       |      // Getting corners.
   56|   370k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 222k, False: 148k]
  ------------------
   57|   222k|        c_next = corner_table->Next(corner_id);
   58|   222k|        c_prev = corner_table->Previous(corner_id);
   59|   222k|      } else {
   60|   148k|        c_next = corner_table->Next(cit.Corner());
   61|   148k|        c_prev = corner_table->Previous(cit.Corner());
   62|   148k|      }
   63|   370k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   370k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   370k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   370k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   370k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   370k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   370k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   370k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   370k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   370k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   370k|      cit.Next();
   81|   370k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  85.9k|    constexpr int64_t upper_bound = 1 << 29;
   85|  85.9k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 37.5k, False: 48.3k]
  ------------------
   86|  37.5k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  37.5k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 88, False: 37.5k]
  ------------------
   88|     88|        const int64_t quotient = abs_sum / upper_bound;
   89|     88|        normal = normal / quotient;
   90|     88|      }
   91|  48.3k|    } else {
   92|  48.3k|      const int64_t abs_sum = normal.AbsSum();
   93|  48.3k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.00k, False: 47.3k]
  ------------------
   94|  1.00k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.00k|        normal = normal / quotient;
   96|  1.00k|      }
   97|  48.3k|    }
   98|  85.9k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  85.9k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  85.9k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  85.9k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  85.9k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    416|      : Base(md) {
   35|    416|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    416|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    528|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    528|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 110, False: 418]
  ------------------
  105|    110|      this->normal_prediction_mode_ = mode;
  106|    110|      return true;
  107|    418|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 418, False: 0]
  ------------------
  108|    418|      this->normal_prediction_mode_ = mode;
  109|    418|      return true;
  110|    418|    }
  111|      0|    return false;
  112|    528|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   212k|                             DataTypeT *prediction) override {
   42|   212k|    DRACO_DCHECK(this->IsInitialized());
   43|   212k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   212k|    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|   212k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   212k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   212k|    VectorD<int64_t, 3> normal;
   53|   212k|    CornerIndex c_next, c_prev;
   54|  1.41M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.20M, False: 212k]
  ------------------
   55|       |      // Getting corners.
   56|  1.20M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 500k, False: 706k]
  ------------------
   57|   500k|        c_next = corner_table->Next(corner_id);
   58|   500k|        c_prev = corner_table->Previous(corner_id);
   59|   706k|      } else {
   60|   706k|        c_next = corner_table->Next(cit.Corner());
   61|   706k|        c_prev = corner_table->Previous(cit.Corner());
   62|   706k|      }
   63|  1.20M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.20M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.20M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.20M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.20M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.20M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.20M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.20M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.20M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.20M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.20M|      cit.Next();
   81|  1.20M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   212k|    constexpr int64_t upper_bound = 1 << 29;
   85|   212k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 85.9k, False: 126k]
  ------------------
   86|  85.9k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  85.9k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 316, False: 85.6k]
  ------------------
   88|    316|        const int64_t quotient = abs_sum / upper_bound;
   89|    316|        normal = normal / quotient;
   90|    316|      }
   91|   126k|    } else {
   92|   126k|      const int64_t abs_sum = normal.AbsSum();
   93|   126k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 9.52k, False: 117k]
  ------------------
   94|  9.52k|        const int64_t quotient = abs_sum / upper_bound;
   95|  9.52k|        normal = normal / quotient;
   96|  9.52k|      }
   97|   126k|    }
   98|   212k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   212k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   212k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   212k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   212k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    154|      : Base(md) {
   35|    154|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    154|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     92|      : Base(md) {
   35|     92|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     92|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    137|      : Base(md) {
   35|    137|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    137|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    112|      : Base(md) {
   35|    112|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    112|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.08M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.08M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.08M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.08M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.08M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.08M|    return GetPositionForDataId(data_id);
   77|  2.08M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.08M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.08M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.08M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.08M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.08M|    VectorD<int64_t, 3> pos;
   68|  2.08M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.08M|    return pos;
   70|  2.08M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    153|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    153|    pos_attribute_ = &position_attribute;
   43|    153|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    143|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    143|    entry_to_point_id_map_ = map;
   46|    143|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.09M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.09M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.09M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.09M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.09M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.09M|    return GetPositionForDataId(data_id);
   77|  1.09M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.09M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.09M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.09M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.09M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.09M|    VectorD<int64_t, 3> pos;
   68|  1.09M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.09M|    return pos;
   70|  1.09M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     92|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     92|    pos_attribute_ = &position_attribute;
   43|     92|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     87|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     87|    entry_to_point_id_map_ = map;
   46|     87|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.04M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.04M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.04M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.04M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.04M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.04M|    return GetPositionForDataId(data_id);
   77|  1.04M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.04M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.04M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.04M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.04M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.04M|    VectorD<int64_t, 3> pos;
   68|  1.04M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.04M|    return pos;
   70|  1.04M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    132|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    132|    pos_attribute_ = &position_attribute;
   43|    132|  }
_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.06M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.06M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.06M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.06M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.06M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.06M|    return GetPositionForDataId(data_id);
   77|  3.06M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.06M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.06M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.06M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.06M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.06M|    VectorD<int64_t, 3> pos;
   68|  3.06M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.06M|    return pos;
   70|  3.06M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    111|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    111|    pos_attribute_ = &position_attribute;
   43|    111|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    106|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    106|    entry_to_point_id_map_ = map;
   46|    106|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    143|      : pos_attribute_(nullptr),
   36|    143|        entry_to_point_id_map_(nullptr),
   37|    143|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    143|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   827k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   827k|    DRACO_DCHECK(this->IsInitialized());
   73|   827k|    const auto corner_table = mesh_data_.corner_table();
   74|   827k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   827k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   827k|    return GetPositionForDataId(data_id);
   77|   827k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|   827k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   827k|    DRACO_DCHECK(this->IsInitialized());
   65|   827k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   827k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   827k|    VectorD<int64_t, 3> pos;
   68|   827k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   827k|    return pos;
   70|   827k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    142|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    142|    pos_attribute_ = &position_attribute;
   43|    142|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    119|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    119|    entry_to_point_id_map_ = map;
   46|    119|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    416|      : pos_attribute_(nullptr),
   36|    416|        entry_to_point_id_map_(nullptr),
   37|    416|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    416|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.62M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.62M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.62M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.62M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.62M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.62M|    return GetPositionForDataId(data_id);
   77|  2.62M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.62M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.62M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.62M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.62M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.62M|    VectorD<int64_t, 3> pos;
   68|  2.62M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.62M|    return pos;
   70|  2.62M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    416|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    416|    pos_attribute_ = &position_attribute;
   43|    416|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    372|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    372|    entry_to_point_id_map_ = map;
   46|    372|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    154|      : pos_attribute_(nullptr),
   36|    154|        entry_to_point_id_map_(nullptr),
   37|    154|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    154|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|     92|      : pos_attribute_(nullptr),
   36|     92|        entry_to_point_id_map_(nullptr),
   37|     92|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|     92|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    137|      : pos_attribute_(nullptr),
   36|    137|        entry_to_point_id_map_(nullptr),
   37|    137|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    137|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    112|      : pos_attribute_(nullptr),
   36|    112|        entry_to_point_id_map_(nullptr),
   37|    112|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    112|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    157|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    157|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    153|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    153|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    153|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    153|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    153|      new DataTypeT[num_components]());
   70|       |
   71|    153|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    153|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    153|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    153|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    153|  const int corner_map_size =
   78|    153|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  94.9k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 94.8k, False: 153]
  ------------------
   80|  94.8k|    const CornerIndex start_corner_id =
   81|  94.8k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  94.8k|    CornerIndex corner_id(start_corner_id);
   84|  94.8k|    int num_parallelograms = 0;
   85|  3.47M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 3.38M, False: 94.8k]
  ------------------
   86|  3.38M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  3.38M|    }
   88|   290k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 195k, False: 94.8k]
  ------------------
   89|   195k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 46.0k, False: 149k]
  ------------------
   90|   195k|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|   195k|              num_components, parallelogram_pred_vals.get())) {
   92|  2.61M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 2.56M, False: 46.0k]
  ------------------
   93|  2.56M|          pred_vals[c] =
   94|  2.56M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  2.56M|        }
   96|  46.0k|        ++num_parallelograms;
   97|  46.0k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|   195k|      corner_id = table->SwingRight(corner_id);
  101|   195k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 19.5k, False: 176k]
  ------------------
  102|  19.5k|        corner_id = kInvalidCornerIndex;
  103|  19.5k|      }
  104|   195k|    }
  105|       |
  106|  94.8k|    const int dst_offset = p * num_components;
  107|  94.8k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 67.6k, False: 27.2k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  67.6k|      const int src_offset = (p - 1) * num_components;
  111|  67.6k|      this->transform().ComputeOriginalValue(
  112|  67.6k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  67.6k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  1.78M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 1.75M, False: 27.2k]
  ------------------
  116|  1.75M|        pred_vals[c] /= num_parallelograms;
  117|  1.75M|      }
  118|  27.2k|      this->transform().ComputeOriginalValue(
  119|  27.2k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  27.2k|    }
  121|  94.8k|  }
  122|    153|  return true;
  123|    153|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    227|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    227|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    220|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    220|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    220|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    220|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    220|      new DataTypeT[num_components]());
   70|       |
   71|    220|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    220|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    220|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    220|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    220|  const int corner_map_size =
   78|    220|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   389k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 388k, False: 220]
  ------------------
   80|   388k|    const CornerIndex start_corner_id =
   81|   388k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   388k|    CornerIndex corner_id(start_corner_id);
   84|   388k|    int num_parallelograms = 0;
   85|  5.49M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 5.10M, False: 388k]
  ------------------
   86|  5.10M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  5.10M|    }
   88|  2.69M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 2.31M, False: 388k]
  ------------------
   89|  2.31M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 752k, False: 1.55M]
  ------------------
   90|  2.31M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  2.31M|              num_components, parallelogram_pred_vals.get())) {
   92|  10.7M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 9.96M, False: 752k]
  ------------------
   93|  9.96M|          pred_vals[c] =
   94|  9.96M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  9.96M|        }
   96|   752k|        ++num_parallelograms;
   97|   752k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  2.31M|      corner_id = table->SwingRight(corner_id);
  101|  2.31M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 383k, False: 1.92M]
  ------------------
  102|   383k|        corner_id = kInvalidCornerIndex;
  103|   383k|      }
  104|  2.31M|    }
  105|       |
  106|   388k|    const int dst_offset = p * num_components;
  107|   388k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 707, False: 388k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|    707|      const int src_offset = (p - 1) * num_components;
  111|    707|      this->transform().ComputeOriginalValue(
  112|    707|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   388k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  5.48M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 5.09M, False: 388k]
  ------------------
  116|  5.09M|        pred_vals[c] /= num_parallelograms;
  117|  5.09M|      }
  118|   388k|      this->transform().ComputeOriginalValue(
  119|   388k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   388k|    }
  121|   388k|  }
  122|    220|  return true;
  123|    220|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  1.79M|    int num_components, DataTypeT *out_prediction) {
   49|  1.79M|  const CornerIndex oci = table->Opposite(ci);
   50|  1.79M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 1.30M, False: 485k]
  ------------------
   51|  1.30M|    return false;
   52|  1.30M|  }
   53|   485k|  int vert_opp, vert_next, vert_prev;
   54|   485k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   485k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   485k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 264k, False: 221k]
  |  Branch (56:35): [True: 208k, False: 55.6k]
  ------------------
   57|   208k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 199k, False: 9.44k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   199k|    const int v_opp_off = vert_opp * num_components;
   60|   199k|    const int v_next_off = vert_next * num_components;
   61|   199k|    const int v_prev_off = vert_prev * num_components;
   62|  10.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 10.6M, False: 199k]
  ------------------
   63|  10.6M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  10.6M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  10.6M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  10.6M|      const int64_t result =
   67|  10.6M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  10.6M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  10.6M|    }
   71|   199k|    return true;
   72|   199k|  }
   73|   286k|  return false;  // Not all data is available for prediction
   74|   485k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   485k|    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|   485k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   485k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   485k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   485k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  3.04M|    int num_components, DataTypeT *out_prediction) {
   49|  3.04M|  const CornerIndex oci = table->Opposite(ci);
   50|  3.04M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 63.0k, False: 2.98M]
  ------------------
   51|  63.0k|    return false;
   52|  63.0k|  }
   53|  2.98M|  int vert_opp, vert_next, vert_prev;
   54|  2.98M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  2.98M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  2.98M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 1.60M, False: 1.38M]
  |  Branch (56:35): [True: 1.21M, False: 391k]
  ------------------
   57|  1.21M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 1.14M, False: 70.1k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  1.14M|    const int v_opp_off = vert_opp * num_components;
   60|  1.14M|    const int v_next_off = vert_next * num_components;
   61|  1.14M|    const int v_prev_off = vert_prev * num_components;
   62|  37.3M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 36.2M, False: 1.14M]
  ------------------
   63|  36.2M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  36.2M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  36.2M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  36.2M|      const int64_t result =
   67|  36.2M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  36.2M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  36.2M|    }
   71|  1.14M|    return true;
   72|  1.14M|  }
   73|  1.84M|  return false;  // Not all data is available for prediction
   74|  2.98M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  2.98M|    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.98M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  2.98M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  2.98M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  2.98M|}

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

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    134|      : pos_attribute_(nullptr),
   39|    134|        entry_to_point_id_map_(nullptr),
   40|    134|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    134|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    134|    pos_attribute_ = &position_attribute;
   43|    134|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    130|  void ResizeOrientations(int num_orientations) {
   74|    130|    orientations_.resize(num_orientations);
   75|    130|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  4.63G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    115|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    115|    entry_to_point_id_map_ = map;
   46|    115|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   286k|                                                 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|   286k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   286k|  const CornerIndex prev_corner_id =
   99|   286k|      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|   286k|  int next_data_id, prev_data_id;
  103|       |
  104|   286k|  int next_vert_id, prev_vert_id;
  105|   286k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   286k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   286k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   286k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   286k|  typedef VectorD<int64_t, 2> Vec2;
  112|   286k|  typedef VectorD<int64_t, 3> Vec3;
  113|   286k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   286k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 205k, False: 81.1k]
  |  Branch (115:33): [True: 124k, False: 81.1k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   124k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   124k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   124k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 121k, False: 3.36k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   121k|      predicted_value_[0] = p_uv[0];
  122|   121k|      predicted_value_[1] = p_uv[1];
  123|   121k|      return true;
  124|   121k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  3.36k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  3.36k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  3.36k|    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|  3.36k|    const Vec3 pn = prev_pos - next_pos;
  146|  3.36k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  3.36k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 2.12k, False: 1.24k]
  ------------------
  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|  2.12k|      const Vec3 cn = tip_pos - next_pos;
  153|  2.12k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  2.12k|      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|  2.12k|      const int64_t n_uv_absmax_element =
  164|  2.12k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  2.12k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 12, False: 2.10k]
  ------------------
  166|  2.12k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     12|        return false;
  169|     12|      }
  170|  2.10k|      const int64_t pn_uv_absmax_element =
  171|  2.10k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  2.10k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 6, False: 2.10k]
  ------------------
  173|  2.10k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      6|        return false;
  176|      6|      }
  177|  2.10k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  2.10k|      const int64_t pn_absmax_element =
  179|  2.10k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  2.10k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 4, False: 2.09k]
  ------------------
  181|  2.10k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      4|        return false;
  184|      4|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  2.09k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  2.09k|      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|  2.09k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  2.09k|      const uint64_t norm_squared =
  207|  2.09k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  2.09k|      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|  2.09k|      Vec2 predicted_uv;
  214|  2.09k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 2.09k]
  ------------------
  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|  2.09k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  2.09k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 6, False: 2.09k]
  ------------------
  233|      6|          return false;
  234|      6|        }
  235|  2.09k|        const bool orientation = orientations_.back();
  236|  2.09k|        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|  2.09k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 734, False: 1.35k]
  ------------------
  240|    734|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|  1.35k|        } else {
  242|  1.35k|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|  1.35k|        }
  244|  2.09k|      }
  245|  2.09k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  2.09k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  2.09k|      return true;
  248|  2.09k|    }
  249|  3.36k|  }
  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|   163k|  int data_offset = 0;
  254|   163k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 82.4k, False: 81.1k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  82.4k|    data_offset = prev_data_id * kNumComponents;
  257|  82.4k|  }
  258|   163k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 1.25k, False: 162k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  1.25k|    data_offset = next_data_id * kNumComponents;
  261|   162k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   162k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 162k, False: 115]
  ------------------
  265|   162k|      data_offset = (data_id - 1) * kNumComponents;
  266|   162k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    345|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 230, False: 115]
  ------------------
  269|    230|        predicted_value_[i] = 0;
  270|    230|      }
  271|    115|      return true;
  272|    115|    }
  273|   162k|  }
  274|   490k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 326k, False: 163k]
  ------------------
  275|   326k|    predicted_value_[i] = data[data_offset + i];
  276|   326k|  }
  277|   163k|  return true;
  278|   163k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   249k|                                            const DataTypeT *data) const {
   59|   249k|    const int data_offset = entry_id * kNumComponents;
   60|   249k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   249k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  10.0k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  10.0k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  10.0k|    VectorD<int64_t, 3> pos;
   52|  10.0k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  10.0k|                                 &pos[0]);
   54|  10.0k|    return pos;
   55|  10.0k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   286k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    135|      : pos_attribute_(nullptr),
   39|    135|        entry_to_point_id_map_(nullptr),
   40|    135|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    132|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    132|    pos_attribute_ = &position_attribute;
   43|    132|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    129|  void ResizeOrientations(int num_orientations) {
   74|    129|    orientations_.resize(num_orientations);
   75|    129|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  5.67G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    117|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    117|    entry_to_point_id_map_ = map;
   46|    117|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   213k|                                                 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|   213k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   213k|  const CornerIndex prev_corner_id =
   99|   213k|      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|   213k|  int next_data_id, prev_data_id;
  103|       |
  104|   213k|  int next_vert_id, prev_vert_id;
  105|   213k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   213k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   213k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   213k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   213k|  typedef VectorD<int64_t, 2> Vec2;
  112|   213k|  typedef VectorD<int64_t, 3> Vec3;
  113|   213k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   213k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 213k, False: 190]
  |  Branch (115:33): [True: 213k, False: 182]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   213k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   213k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   213k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 198k, False: 14.8k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   198k|      predicted_value_[0] = p_uv[0];
  122|   198k|      predicted_value_[1] = p_uv[1];
  123|   198k|      return true;
  124|   198k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  14.8k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  14.8k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  14.8k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  14.8k|    const Vec3 pn = prev_pos - next_pos;
  146|  14.8k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  14.8k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.77k, False: 13.0k]
  ------------------
  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.77k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.77k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.77k|      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.77k|      const int64_t n_uv_absmax_element =
  164|  1.77k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.77k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 9, False: 1.76k]
  ------------------
  166|  1.77k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|      9|        return false;
  169|      9|      }
  170|  1.76k|      const int64_t pn_uv_absmax_element =
  171|  1.76k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.76k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 5, False: 1.75k]
  ------------------
  173|  1.76k|          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.75k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.75k|      const int64_t pn_absmax_element =
  179|  1.75k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.75k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 3, False: 1.75k]
  ------------------
  181|  1.75k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      3|        return false;
  184|      3|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.75k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.75k|      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.75k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.75k|      const uint64_t norm_squared =
  207|  1.75k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.75k|      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.75k|      Vec2 predicted_uv;
  214|  1.75k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.75k]
  ------------------
  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.75k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.75k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 9, False: 1.74k]
  ------------------
  233|      9|          return false;
  234|      9|        }
  235|  1.74k|        const bool orientation = orientations_.back();
  236|  1.74k|        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.74k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 746, False: 1.00k]
  ------------------
  240|    746|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|  1.00k|        } else {
  242|  1.00k|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|  1.00k|        }
  244|  1.74k|      }
  245|  1.74k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.74k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.74k|      return true;
  248|  1.75k|    }
  249|  14.8k|  }
  250|       |  // Else we don't have available textures on both corners or the position data
  251|       |  // is invalid. For such cases we can't use positions for predicting the uv
  252|       |  // value and we resort to delta coding.
  253|  13.4k|  int data_offset = 0;
  254|  13.4k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 13.2k, False: 190]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  13.2k|    data_offset = prev_data_id * kNumComponents;
  257|  13.2k|  }
  258|  13.4k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 13.0k, False: 357]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  13.0k|    data_offset = next_data_id * kNumComponents;
  261|  13.0k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    357|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 240, False: 117]
  ------------------
  265|    240|      data_offset = (data_id - 1) * kNumComponents;
  266|    240|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    351|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 234, False: 117]
  ------------------
  269|    234|        predicted_value_[i] = 0;
  270|    234|      }
  271|    117|      return true;
  272|    117|    }
  273|    357|  }
  274|  39.8k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 26.5k, False: 13.2k]
  ------------------
  275|  26.5k|    predicted_value_[i] = data[data_offset + i];
  276|  26.5k|  }
  277|  13.2k|  return true;
  278|  13.4k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   427k|                                            const DataTypeT *data) const {
   59|   427k|    const int data_offset = entry_id * kNumComponents;
   60|   427k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   427k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  44.4k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  44.4k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  44.4k|    VectorD<int64_t, 3> pos;
   52|  44.4k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  44.4k|                                 &pos[0]);
   54|  44.4k|    return pos;
   55|  44.4k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   213k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     19|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    257|  bool AreCorrectionsPositive() override {
   71|    257|    return transform_.AreCorrectionsPositive();
   72|    257|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     13|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     13|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 3, False: 10]
  ------------------
   50|      3|      return false;
   51|      3|    }
   52|     10|    return true;
   53|     13|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   700k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     48|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    284|  bool AreCorrectionsPositive() override {
   71|    284|    return transform_.AreCorrectionsPositive();
   72|    284|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     41|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     41|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 14, False: 27]
  ------------------
   50|     14|      return false;
   51|     14|    }
   52|     27|    return true;
   53|     41|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  1.62M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  2.75k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  1.72k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  2.65k|  bool AreCorrectionsPositive() override {
   71|  2.65k|    return transform_.AreCorrectionsPositive();
   72|  2.65k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  1.99k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  1.99k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 99, False: 1.89k]
  ------------------
   50|     99|      return false;
   51|     99|    }
   52|  1.89k|    return true;
   53|  1.99k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  4.73M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    265|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    297|      : attribute_(attribute), transform_(transform) {}

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

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    265|    uint16_t bitstream_version) {
   38|    265|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    265|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 265, False: 0]
  ------------------
   40|    265|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 5, False: 260]
  ------------------
   41|    260|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1, False: 259]
  ------------------
   42|    259|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 259]
  ------------------
   43|    259|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 3, False: 256]
  ------------------
   44|    256|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 246, False: 10]
  ------------------
   45|    256|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 1, False: 9]
  ------------------
   46|    256|    const CornerTable *const ct = source->GetCornerTable();
   47|    256|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    256|        source->GetAttributeEncodingData(att_id);
   49|    256|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 4, False: 252]
  |  Branch (49:26): [True: 0, False: 252]
  ------------------
   50|       |      // No connectivity data found.
   51|      4|      return nullptr;
   52|      4|    }
   53|       |    // Connectivity data exists.
   54|    252|    const MeshAttributeCornerTable *const att_ct =
   55|    252|        source->GetAttributeCornerTable(att_id);
   56|    252|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 157, False: 95]
  ------------------
   57|    157|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    157|      MeshData md;
   59|    157|      md.Set(source->mesh(), att_ct,
   60|    157|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    157|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    157|      MeshPredictionSchemeFactoryT factory;
   63|    157|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    157|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 154, False: 3]
  ------------------
   65|    154|        return ret;
   66|    154|      }
   67|    157|    } else {
   68|     95|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     95|      MeshData md;
   70|     95|      md.Set(source->mesh(), ct,
   71|     95|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     95|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     95|      MeshPredictionSchemeFactoryT factory;
   74|     95|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     95|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 92, False: 3]
  ------------------
   76|     92|        return ret;
   77|     92|      }
   78|     95|    }
   79|    252|  }
   80|     15|  return nullptr;
   81|    265|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    297|    uint16_t bitstream_version) {
   38|    297|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    297|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 297, False: 0]
  ------------------
   40|    297|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 11, False: 286]
  ------------------
   41|    286|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 4, False: 282]
  ------------------
   42|    282|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 282]
  ------------------
   43|    282|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 281]
  ------------------
   44|    281|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 249, False: 32]
  ------------------
   45|    267|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 2, False: 30]
  ------------------
   46|    267|    const CornerTable *const ct = source->GetCornerTable();
   47|    267|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    267|        source->GetAttributeEncodingData(att_id);
   49|    267|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 10, False: 257]
  |  Branch (49:26): [True: 0, False: 257]
  ------------------
   50|       |      // No connectivity data found.
   51|     10|      return nullptr;
   52|     10|    }
   53|       |    // Connectivity data exists.
   54|    257|    const MeshAttributeCornerTable *const att_ct =
   55|    257|        source->GetAttributeCornerTable(att_id);
   56|    257|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 141, False: 116]
  ------------------
   57|    141|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    141|      MeshData md;
   59|    141|      md.Set(source->mesh(), att_ct,
   60|    141|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    141|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    141|      MeshPredictionSchemeFactoryT factory;
   63|    141|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    141|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 137, False: 4]
  ------------------
   65|    137|        return ret;
   66|    137|      }
   67|    141|    } else {
   68|    116|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    116|      MeshData md;
   70|    116|      md.Set(source->mesh(), ct,
   71|    116|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    116|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    116|      MeshPredictionSchemeFactoryT factory;
   74|    116|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    116|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 112, False: 4]
  ------------------
   76|    112|        return ret;
   77|    112|      }
   78|    116|    }
   79|    257|  }
   80|     38|  return nullptr;
   81|    297|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  2.75k|    uint16_t bitstream_version) {
   38|  2.75k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  2.75k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 2.75k, False: 0]
  ------------------
   40|  2.75k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 693, False: 2.05k]
  ------------------
   41|  2.05k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 396, False: 1.66k]
  ------------------
   42|  1.66k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 482, False: 1.18k]
  ------------------
   43|  1.18k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 276, False: 905]
  ------------------
   44|    905|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 559, False: 346]
  ------------------
   45|  2.61k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 207, False: 139]
  ------------------
   46|  2.61k|    const CornerTable *const ct = source->GetCornerTable();
   47|  2.61k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  2.61k|        source->GetAttributeEncodingData(att_id);
   49|  2.61k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 42, False: 2.57k]
  |  Branch (49:26): [True: 0, False: 2.57k]
  ------------------
   50|       |      // No connectivity data found.
   51|     42|      return nullptr;
   52|     42|    }
   53|       |    // Connectivity data exists.
   54|  2.57k|    const MeshAttributeCornerTable *const att_ct =
   55|  2.57k|        source->GetAttributeCornerTable(att_id);
   56|  2.57k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.12k, False: 1.44k]
  ------------------
   57|  1.12k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.12k|      MeshData md;
   59|  1.12k|      md.Set(source->mesh(), att_ct,
   60|  1.12k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.12k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.12k|      MeshPredictionSchemeFactoryT factory;
   63|  1.12k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.12k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.12k, False: 0]
  ------------------
   65|  1.12k|        return ret;
   66|  1.12k|      }
   67|  1.44k|    } else {
   68|  1.44k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  1.44k|      MeshData md;
   70|  1.44k|      md.Set(source->mesh(), ct,
   71|  1.44k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  1.44k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  1.44k|      MeshPredictionSchemeFactoryT factory;
   74|  1.44k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  1.44k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 1.44k, False: 0]
  ------------------
   76|  1.44k|        return ret;
   77|  1.44k|      }
   78|  1.44k|    }
   79|  2.57k|  }
   80|    139|  return nullptr;
   81|  2.75k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  1.62M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  1.62M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 762k, False: 862k]
  |  Branch (93:22): [True: 392k, False: 369k]
  ------------------
   94|   392k|      return true;
   95|   392k|    }
   96|  1.23M|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 790k, False: 441k]
  |  Branch (96:25): [True: 398k, False: 392k]
  ------------------
   97|  1.62M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  1.62M|  int32_t GetRotationCount(Point2 pred) const {
   51|  1.62M|    const DataType sign_x = pred[0];
   52|  1.62M|    const DataType sign_y = pred[1];
   53|       |
   54|  1.62M|    int32_t rotation_count = 0;
   55|  1.62M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 762k, False: 862k]
  ------------------
   56|   762k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 392k, False: 369k]
  ------------------
   57|   392k|        rotation_count = 0;
   58|   392k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 367k, False: 2.49k]
  ------------------
   59|   367k|        rotation_count = 3;
   60|   367k|      } else {
   61|  2.49k|        rotation_count = 1;
   62|  2.49k|      }
   63|   862k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 71.1k, False: 790k]
  ------------------
   64|  71.1k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 35.7k, False: 35.4k]
  ------------------
   65|  35.7k|        rotation_count = 2;
   66|  35.7k|      } else {
   67|  35.4k|        rotation_count = 1;
   68|  35.4k|      }
   69|   790k|    } else {
   70|   790k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 398k, False: 392k]
  ------------------
   71|   398k|        rotation_count = 0;
   72|   398k|      } else {
   73|   392k|        rotation_count = 3;
   74|   392k|      }
   75|   790k|    }
   76|  1.62M|    return rotation_count;
   77|  1.62M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|  1.66M|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|  1.66M|    switch (rotation_count) {
   81|   797k|      case 1:
  ------------------
  |  Branch (81:7): [True: 797k, False: 869k]
  ------------------
   82|   797k|        return Point2(p[1], -p[0]);
   83|  71.4k|      case 2:
  ------------------
  |  Branch (83:7): [True: 71.4k, False: 1.59M]
  ------------------
   84|  71.4k|        return Point2(-p[0], -p[1]);
   85|   797k|      case 3:
  ------------------
  |  Branch (85:7): [True: 797k, False: 869k]
  ------------------
   86|   797k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 1.66M]
  ------------------
   88|      0|        return p;
   89|  1.66M|    }
   90|  1.66M|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    297|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  2.65k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  2.41k|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  2.41k|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  2.41k|  bool InitCorrectionBounds() {
   84|  2.41k|    const int64_t dif =
   85|  2.41k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  2.41k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 2.41k]
  |  Branch (86:20): [True: 7, False: 2.40k]
  ------------------
   87|      7|      return false;
   88|      7|    }
   89|  2.40k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  2.40k|    max_correction_ = max_dif_ / 2;
   91|  2.40k|    min_correction_ = -max_correction_;
   92|  2.40k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 1.08k, False: 1.32k]
  ------------------
   93|  1.08k|      max_correction_ -= 1;
   94|  1.08k|    }
   95|  2.40k|    return true;
   96|  2.41k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  1.88k|  void Init(int num_components) {
   56|  1.88k|    num_components_ = num_components;
   57|  1.88k|    clamped_value_.resize(num_components);
   58|  1.88k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  4.73M|      const DataTypeT *predicted_val) const {
   64|  98.6M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 93.8M, False: 4.73M]
  ------------------
   65|  93.8M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 1.02M, False: 92.8M]
  ------------------
   66|  1.02M|        clamped_value_[i] = max_value_;
   67|  92.8M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 2.78M, False: 90.0M]
  ------------------
   68|  2.78M|        clamped_value_[i] = min_value_;
   69|  90.0M|      } else {
   70|  90.0M|        clamped_value_[i] = predicted_val[i];
   71|  90.0M|      }
   72|  93.8M|    }
   73|  4.73M|    return clamped_value_.data();
   74|  4.73M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|   197M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|  93.8M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|  2.22M|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|  93.7M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    491|  int quantization_bits() const {
   78|    491|    DRACO_DCHECK(false);
   79|    491|    return -1;
   80|    491|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  2.75k|      : num_components_(0),
   45|  2.75k|        min_value_(0),
   46|  2.75k|        max_value_(0),
   47|  2.75k|        max_dif_(0),
   48|  2.75k|        max_correction_(0),
   49|  2.75k|        min_correction_(0) {}

_ZN5draco26SequentialAttributeDecoderC2Ev:
   20|  13.0k|    : decoder_(nullptr), attribute_(nullptr), attribute_id_(-1) {}
_ZN5draco26SequentialAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   23|  13.0k|                                      int attribute_id) {
   24|  13.0k|  decoder_ = decoder;
   25|  13.0k|  attribute_ = decoder->point_cloud()->attribute(attribute_id);
   26|  13.0k|  attribute_id_ = attribute_id;
   27|  13.0k|  return true;
   28|  13.0k|}
_ZN5draco26SequentialAttributeDecoder23DecodePortableAttributeERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   38|  7.36k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   39|  7.36k|  if (attribute_->num_components() <= 0 ||
  ------------------
  |  Branch (39:7): [True: 0, False: 7.36k]
  ------------------
   40|  7.36k|      !attribute_->Reset(point_ids.size())) {
  ------------------
  |  Branch (40:7): [True: 0, False: 7.36k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  7.36k|  if (!DecodeValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (43:7): [True: 1.20k, False: 6.16k]
  ------------------
   44|  1.20k|    return false;
   45|  1.20k|  }
   46|  6.16k|  return true;
   47|  7.36k|}
_ZN5draco26SequentialAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   50|  2.67k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   51|       |  // Default implementation does not apply any transform.
   52|  2.67k|  return true;
   53|  2.67k|}
_ZN5draco26SequentialAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   56|    638|    const std::vector<PointIndex> &point_ids) {
   57|       |  // Default implementation does not apply any transform.
   58|    638|  return true;
   59|    638|}
_ZN5draco26SequentialAttributeDecoder20GetPortableAttributeEv:
   61|  4.73k|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.73k|  if (!attribute_->is_mapping_identity() && portable_attribute_ &&
  ------------------
  |  Branch (64:7): [True: 4.05k, False: 672]
  |  Branch (64:45): [True: 3.42k, False: 634]
  ------------------
   65|  3.42k|      portable_attribute_->is_mapping_identity()) {
  ------------------
  |  Branch (65:7): [True: 2.47k, False: 946]
  ------------------
   66|  2.47k|    portable_attribute_->SetExplicitMapping(attribute_->indices_map_size());
   67|  2.47k|    for (PointIndex i(0);
   68|  16.5M|         i < static_cast<uint32_t>(attribute_->indices_map_size()); ++i) {
  ------------------
  |  Branch (68:10): [True: 16.5M, False: 2.47k]
  ------------------
   69|  16.5M|      portable_attribute_->SetPointMapEntry(i, attribute_->mapped_index(i));
   70|  16.5M|    }
   71|  2.47k|  }
   72|  4.73k|  return portable_attribute_.get();
   73|  4.73k|}
_ZN5draco26SequentialAttributeDecoder20InitPredictionSchemeEPNS_25PredictionSchemeInterfaceE:
   76|  3.31k|    PredictionSchemeInterface *ps) {
   77|  4.83k|  for (int i = 0; i < ps->GetNumParentAttributes(); ++i) {
  ------------------
  |  Branch (77:19): [True: 1.53k, False: 3.30k]
  ------------------
   78|  1.53k|    const int att_id = decoder_->point_cloud()->GetNamedAttributeId(
   79|  1.53k|        ps->GetParentAttributeType(i));
   80|  1.53k|    if (att_id == -1) {
  ------------------
  |  Branch (80:9): [True: 0, False: 1.53k]
  ------------------
   81|      0|      return false;  // Requested attribute does not exist.
   82|      0|    }
   83|  1.53k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   84|  1.53k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.53k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:9): [True: 0, False: 1.53k]
  ------------------
   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.53k|#endif
   90|  1.53k|    {
   91|  1.53k|      const PointAttribute *const pa = decoder_->GetPortableAttribute(att_id);
   92|  1.53k|      if (pa == nullptr || !ps->SetParentAttribute(pa)) {
  ------------------
  |  Branch (92:11): [True: 2, False: 1.52k]
  |  Branch (92:28): [True: 10, False: 1.51k]
  ------------------
   93|     12|        return false;
   94|     12|      }
   95|  1.53k|    }
   96|  1.53k|  }
   97|  3.30k|  return true;
   98|  3.31k|}
_ZN5draco26SequentialAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  101|  1.13k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  102|  1.13k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
  103|  1.13k|  const int entry_size = static_cast<int>(attribute_->byte_stride());
  104|  1.13k|  std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
  105|  1.13k|  uint8_t *const value_data = value_data_ptr.get();
  106|  1.13k|  int out_byte_pos = 0;
  107|       |  // Decode raw attribute values in their original format.
  108|  21.8k|  for (int i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (108:19): [True: 20.8k, False: 1.00k]
  ------------------
  109|  20.8k|    if (!in_buffer->Decode(value_data, entry_size)) {
  ------------------
  |  Branch (109:9): [True: 132, False: 20.7k]
  ------------------
  110|    132|      return false;
  111|    132|    }
  112|  20.7k|    attribute_->buffer()->Write(out_byte_pos, value_data, entry_size);
  113|  20.7k|    out_byte_pos += entry_size;
  114|  20.7k|  }
  115|  1.00k|  return true;
  116|  1.13k|}

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

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

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  10.9k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  10.9k|                                             int attribute_id) {
   27|  10.9k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 10.9k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  10.9k|  return true;
   31|  10.9k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  1.92k|    const std::vector<PointIndex> &point_ids) {
   35|  1.92k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  1.92k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 1.92k, False: 0]
  ------------------
   37|  1.92k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.92k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 0, False: 1.92k]
  ------------------
   38|      0|    return true;  // Don't revert the transform here for older files.
   39|      0|  }
   40|  1.92k|#endif
   41|  1.92k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  1.92k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  6.23k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  6.23k|  int8_t prediction_scheme_method;
   48|  6.23k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 87, False: 6.14k]
  ------------------
   49|     87|    return false;
   50|     87|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  6.14k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 43, False: 6.10k]
  ------------------
   53|  6.10k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 130, False: 5.97k]
  ------------------
   54|    173|    return false;
   55|    173|  }
   56|  5.97k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 5.88k, False: 83]
  ------------------
   57|  5.88k|    int8_t prediction_transform_type;
   58|  5.88k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 24, False: 5.86k]
  ------------------
   59|     24|      return false;
   60|     24|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  5.86k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 15, False: 5.85k]
  ------------------
   63|  5.85k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 30, False: 5.82k]
  ------------------
   64|     45|      return false;
   65|     45|    }
   66|  5.82k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  5.82k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  5.82k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  5.82k|  }
   70|       |
   71|  5.90k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 3.31k, False: 2.58k]
  ------------------
   72|  3.31k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 12, False: 3.30k]
  ------------------
   73|     12|      return false;
   74|     12|    }
   75|  3.31k|  }
   76|       |
   77|  5.89k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 727, False: 5.16k]
  ------------------
   78|    727|    return false;
   79|    727|  }
   80|       |
   81|  5.16k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  5.16k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  5.16k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 5.16k, False: 0]
  ------------------
   84|  5.16k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  5.16k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 0, False: 5.16k]
  ------------------
   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|  5.16k|#endif
   91|  5.16k|  return true;
   92|  5.16k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  5.21k|    PredictionSchemeTransformType transform_type) {
   98|  5.21k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 2.45k, False: 2.75k]
  ------------------
   99|  2.45k|    return nullptr;  // For now we support only wrap transform.
  100|  2.45k|  }
  101|  2.75k|  return CreatePredictionSchemeForDecoder<
  102|  2.75k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  2.75k|      method, attribute_id(), decoder());
  104|  5.21k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  5.89k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  5.89k|  const int num_components = GetNumValueComponents();
  109|  5.89k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 5.89k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  5.89k|  const size_t num_entries = point_ids.size();
  113|  5.89k|  const size_t num_values = num_entries * num_components;
  114|  5.89k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  5.89k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  5.89k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 1, False: 5.88k]
  ------------------
  117|      1|    return false;
  118|      1|  }
  119|  5.88k|  uint8_t compressed;
  120|  5.88k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 2, False: 5.88k]
  ------------------
  121|      2|    return false;
  122|      2|  }
  123|  5.88k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 362, False: 5.52k]
  ------------------
  124|       |    // Decode compressed values.
  125|    362|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 156, False: 206]
  ------------------
  126|    362|                       in_buffer,
  127|    362|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    156|      return false;
  129|    156|    }
  130|  5.52k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  5.52k|    uint8_t num_bytes;
  134|  5.52k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 1, False: 5.52k]
  ------------------
  135|      1|      return false;
  136|      1|    }
  137|  5.52k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 199, False: 5.32k]
  ------------------
  138|    199|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 199]
  ------------------
  139|    199|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    199|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 0, False: 199]
  ------------------
  143|    199|                             sizeof(int32_t) * num_values)) {
  144|      0|        return false;
  145|      0|      }
  146|  5.32k|    } else {
  147|  5.32k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 19, False: 5.30k]
  ------------------
  148|  5.32k|          num_bytes * num_values) {
  149|     19|        return false;
  150|     19|      }
  151|  5.30k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 17, False: 5.28k]
  ------------------
  152|  5.30k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     17|        return false;
  154|     17|      }
  155|   246M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 246M, False: 5.28k]
  ------------------
  156|   246M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 246M]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|   246M|      }
  160|  5.28k|    }
  161|  5.52k|  }
  162|       |
  163|  5.69k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 5.69k, False: 0]
  |  Branch (163:26): [True: 2.49k, False: 3.19k]
  ------------------
  164|  5.15k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 2.65k, False: 541]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  5.15k|    ConvertSymbolsToSignedInts(
  167|  5.15k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  5.15k|        static_cast<int>(num_values), portable_attribute_data);
  169|  5.15k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  5.69k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 3.19k, False: 2.49k]
  ------------------
  173|  3.19k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 323, False: 2.87k]
  ------------------
  174|    323|      return false;
  175|    323|    }
  176|       |
  177|  2.87k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 2.87k, False: 0]
  ------------------
  178|  2.87k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 207, False: 2.66k]
  ------------------
  179|  2.87k|              portable_attribute_data, portable_attribute_data,
  180|  2.87k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    207|        return false;
  182|    207|      }
  183|  2.87k|    }
  184|  2.87k|  }
  185|  5.16k|  return true;
  186|  5.69k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  1.72k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  1.72k|  switch (attribute()->data_type()) {
  190|    203|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 203, False: 1.52k]
  ------------------
  191|    203|      StoreTypedValues<uint8_t>(num_values);
  192|    203|      break;
  193|    926|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 926, False: 800]
  ------------------
  194|    926|      StoreTypedValues<int8_t>(num_values);
  195|    926|      break;
  196|     96|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 96, False: 1.63k]
  ------------------
  197|     96|      StoreTypedValues<uint16_t>(num_values);
  198|     96|      break;
  199|    189|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 189, False: 1.53k]
  ------------------
  200|    189|      StoreTypedValues<int16_t>(num_values);
  201|    189|      break;
  202|    125|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 125, False: 1.60k]
  ------------------
  203|    125|      StoreTypedValues<uint32_t>(num_values);
  204|    125|      break;
  205|     34|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 34, False: 1.69k]
  ------------------
  206|     34|      StoreTypedValues<int32_t>(num_values);
  207|     34|      break;
  208|    153|    default:
  ------------------
  |  Branch (208:5): [True: 153, False: 1.57k]
  ------------------
  209|    153|      return false;
  210|  1.72k|  }
  211|  1.57k|  return true;
  212|  1.72k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  5.89k|    int num_entries, int num_components) {
  237|  5.89k|  GeometryAttribute ga;
  238|  5.89k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  5.89k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  5.89k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  5.89k|  port_att->SetIdentityMapping();
  242|  5.89k|  port_att->Reset(num_entries);
  243|  5.89k|  port_att->set_unique_id(attribute()->unique_id());
  244|  5.89k|  SetPortableAttribute(std::move(port_att));
  245|  5.89k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    203|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    203|  const int num_components = attribute()->num_components();
  217|    203|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    203|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    203|      new AttributeTypeT[num_components]);
  220|    203|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    203|  int val_id = 0;
  222|    203|  int out_byte_pos = 0;
  223|   254k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 254k, False: 203]
  ------------------
  224|  2.17M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 1.91M, False: 254k]
  ------------------
  225|  1.91M|      const AttributeTypeT value =
  226|  1.91M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  1.91M|      att_val[c] = value;
  228|  1.91M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   254k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   254k|    out_byte_pos += entry_size;
  232|   254k|  }
  233|    203|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|    926|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    926|  const int num_components = attribute()->num_components();
  217|    926|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    926|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    926|      new AttributeTypeT[num_components]);
  220|    926|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    926|  int val_id = 0;
  222|    926|  int out_byte_pos = 0;
  223|  4.70M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 4.70M, False: 926]
  ------------------
  224|  48.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 44.0M, False: 4.70M]
  ------------------
  225|  44.0M|      const AttributeTypeT value =
  226|  44.0M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  44.0M|      att_val[c] = value;
  228|  44.0M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  4.70M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  4.70M|    out_byte_pos += entry_size;
  232|  4.70M|  }
  233|    926|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|     96|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     96|  const int num_components = attribute()->num_components();
  217|     96|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     96|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     96|      new AttributeTypeT[num_components]);
  220|     96|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     96|  int val_id = 0;
  222|     96|  int out_byte_pos = 0;
  223|   126k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 126k, False: 96]
  ------------------
  224|  3.59M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 3.46M, False: 126k]
  ------------------
  225|  3.46M|      const AttributeTypeT value =
  226|  3.46M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  3.46M|      att_val[c] = value;
  228|  3.46M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   126k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   126k|    out_byte_pos += entry_size;
  232|   126k|  }
  233|     96|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    189|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    189|  const int num_components = attribute()->num_components();
  217|    189|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    189|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    189|      new AttributeTypeT[num_components]);
  220|    189|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    189|  int val_id = 0;
  222|    189|  int out_byte_pos = 0;
  223|  1.21M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.21M, False: 189]
  ------------------
  224|  8.59M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 7.38M, False: 1.21M]
  ------------------
  225|  7.38M|      const AttributeTypeT value =
  226|  7.38M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  7.38M|      att_val[c] = value;
  228|  7.38M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.21M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.21M|    out_byte_pos += entry_size;
  232|  1.21M|  }
  233|    189|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    125|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    125|  const int num_components = attribute()->num_components();
  217|    125|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    125|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    125|      new AttributeTypeT[num_components]);
  220|    125|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    125|  int val_id = 0;
  222|    125|  int out_byte_pos = 0;
  223|  1.66M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.66M, False: 125]
  ------------------
  224|  92.2M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 90.6M, False: 1.66M]
  ------------------
  225|  90.6M|      const AttributeTypeT value =
  226|  90.6M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  90.6M|      att_val[c] = value;
  228|  90.6M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.66M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.66M|    out_byte_pos += entry_size;
  232|  1.66M|  }
  233|    125|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|     34|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     34|  const int num_components = attribute()->num_components();
  217|     34|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     34|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     34|      new AttributeTypeT[num_components]);
  220|     34|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     34|  int val_id = 0;
  222|     34|  int out_byte_pos = 0;
  223|  1.10k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.07k, False: 34]
  ------------------
  224|  82.7k|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 81.6k, False: 1.07k]
  ------------------
  225|  81.6k|      const AttributeTypeT value =
  226|  81.6k|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  81.6k|      att_val[c] = value;
  228|  81.6k|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.07k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.07k|    out_byte_pos += entry_size;
  232|  1.07k|  }
  233|     34|}

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  4.20M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  4.20M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  4.20M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  4.20M|    const int remaining = 32 - num_used_bits_;
   54|  4.20M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 3.99M, False: 203k]
  ------------------
   55|  3.99M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 3.56M, False: 437k]
  ------------------
   56|  3.56M|        return false;
   57|  3.56M|      }
   58|   437k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   437k|      num_used_bits_ += nbits;
   60|   437k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 14.8k, False: 422k]
  ------------------
   61|  14.8k|        ++pos_;
   62|  14.8k|        num_used_bits_ = 0;
   63|  14.8k|      }
   64|   437k|    } else {
   65|   203k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 191k, False: 12.2k]
  ------------------
   66|   191k|        return false;
   67|   191k|      }
   68|  12.2k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  12.2k|      num_used_bits_ = nbits - remaining;
   70|  12.2k|      ++pos_;
   71|  12.2k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  12.2k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  12.2k|    }
   74|   449k|    return true;
   75|  4.20M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  5.15M|  bool DecodeNextBit() {
   35|  5.15M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  5.15M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 4.67M, False: 480k]
  ------------------
   37|  4.67M|      return false;
   38|  4.67M|    }
   39|   480k|    const bool bit = *pos_ & selector;
   40|   480k|    ++num_used_bits_;
   41|   480k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 14.8k, False: 465k]
  ------------------
   42|  14.8k|      ++pos_;
   43|  14.8k|      num_used_bits_ = 0;
   44|  14.8k|    }
   45|   480k|    return bit;
   46|  5.15M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    455|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    415|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    347|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  10.2k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 9.92k, False: 297]
  ------------------
   35|  9.92k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 50, False: 9.87k]
  ------------------
   36|     50|        return false;
   37|     50|      }
   38|  9.92k|    }
   39|    297|    return bit_decoder_.StartDecoding(source_buffer);
   40|    347|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  3.09M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  3.09M|    uint32_t result = 0;
   49|  19.7M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 16.6M, False: 3.09M]
  ------------------
   50|  16.6M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  16.6M|      result = (result << 1) + bit;
   52|  16.6M|    }
   53|  3.09M|    *value = result;
   54|  3.09M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     94|  void EndDecoding() {
   57|  3.10k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 3.00k, False: 94]
  ------------------
   58|  3.00k|      folded_number_decoders_[i].EndDecoding();
   59|  3.00k|    }
   60|     94|    bit_decoder_.EndDecoding();
   61|     94|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    415|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  29.8k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  21.9k|                                const uint8_t *const buf, int offset) {
  301|  21.9k|  unsigned x;
  302|  21.9k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 24, False: 21.9k]
  ------------------
  303|     24|    return 1;
  304|     24|  }
  305|  21.9k|  ans->buf = buf;
  306|  21.9k|  x = buf[offset - 1] >> 6;
  307|  21.9k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 19.6k, False: 2.31k]
  ------------------
  308|  19.6k|    ans->buf_offset = offset - 1;
  309|  19.6k|    ans->state = buf[offset - 1] & 0x3F;
  310|  19.6k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.10k, False: 208]
  ------------------
  311|  2.10k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 0, False: 2.10k]
  ------------------
  312|      0|      return 1;
  313|      0|    }
  314|  2.10k|    ans->buf_offset = offset - 2;
  315|  2.10k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.10k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 201, False: 7]
  ------------------
  317|    201|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 2, False: 199]
  ------------------
  318|      2|      return 1;
  319|      2|    }
  320|    199|    ans->buf_offset = offset - 3;
  321|    199|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    199|  } else {
  323|      7|    return 1;
  324|      7|  }
  325|  21.9k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  21.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  21.9k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  21.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  21.9k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 8, False: 21.9k]
  ------------------
  327|      8|    return 1;
  328|      8|  }
  329|  21.9k|  return 0;
  330|  21.9k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.10k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.10k|  uint32_t val;
   69|  2.10k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.10k|  val = mem[1] << 8;
   72|  2.10k|  val |= mem[0];
   73|  2.10k|  return val;
   74|  2.10k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    199|static uint32_t mem_get_le24(const void *vmem) {
   77|    199|  uint32_t val;
   78|    199|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    199|  val = mem[2] << 16;
   81|    199|  val |= mem[1] << 8;
   82|    199|  val |= mem[0];
   83|    199|  return val;
   84|    199|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  10.3G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  10.3G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  10.3G|  unsigned quot, rem, x, xn;
  172|  10.3G|#endif
  173|  10.3G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  10.3G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  10.3G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  20.7G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 9.58G, False: 788M]
  |  Branch (174:40): [True: 84.4k, False: 9.58G]
  ------------------
  175|  84.4k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  84.4k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  84.4k|  }
  177|       |#if DRACO_ANS_IMPL1
  178|       |  val = ans->state % DRACO_ANS_P8_PRECISION < p;
  179|       |  l_s = val ? p : p0;
  180|       |  ans->state = (ans->state / DRACO_ANS_P8_PRECISION) * l_s +
  181|       |               ans->state % DRACO_ANS_P8_PRECISION - (!val * p);
  182|       |#else
  183|  10.3G|  x = ans->state;
  184|  10.3G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  10.3G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  10.3G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  10.3G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  10.3G|  xn = quot * p;
  187|  10.3G|  val = rem < p;
  188|  10.3G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  20.7G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 9.59G, False: 784M]
  |  |  ------------------
  ------------------
  189|  9.59G|    ans->state = xn + rem;
  190|  9.59G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   784M|    ans->state = x - xn - p;
  193|   784M|  }
  194|  10.3G|#endif
  195|  10.3G|  return val;
  196|  10.3G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  49.2k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  49.2k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  49.2k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  49.2k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  1.69k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|    945|                                       uint32_t num_symbols) {
  482|    945|    lut_table_.resize(rans_precision);
  483|    945|    probability_table_.resize(num_symbols);
  484|    945|    uint32_t cum_prob = 0;
  485|    945|    uint32_t act_prob = 0;
  486|  8.96k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 8.12k, False: 841]
  ------------------
  487|  8.12k|      probability_table_[i].prob = token_probs[i];
  488|  8.12k|      probability_table_[i].cum_prob = cum_prob;
  489|  8.12k|      cum_prob += token_probs[i];
  490|  8.12k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 104, False: 8.02k]
  ------------------
  491|    104|        return false;
  492|    104|      }
  493|  3.09M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 3.08M, False: 8.02k]
  ------------------
  494|  3.08M|        lut_table_[j] = i;
  495|  3.08M|      }
  496|  8.02k|      act_prob = cum_prob;
  497|  8.02k|    }
  498|    841|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 108, False: 733]
  ------------------
  499|    108|      return false;
  500|    108|    }
  501|    733|    return true;
  502|    841|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|    677|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    677|    unsigned x;
  423|    677|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 46, False: 631]
  ------------------
  424|     46|      return 1;
  425|     46|    }
  426|    631|    ans_.buf = buf;
  427|    631|    x = buf[offset - 1] >> 6;
  428|    631|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 393, False: 238]
  ------------------
  429|    393|      ans_.buf_offset = offset - 1;
  430|    393|      ans_.state = buf[offset - 1] & 0x3F;
  431|    393|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 66, False: 172]
  ------------------
  432|     66|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 66]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     66|      ans_.buf_offset = offset - 2;
  436|     66|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    172|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 106, False: 66]
  ------------------
  438|    106|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 7, False: 99]
  ------------------
  439|      7|        return 1;
  440|      7|      }
  441|     99|      ans_.buf_offset = offset - 3;
  442|     99|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     99|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 66, False: 0]
  ------------------
  444|     66|      ans_.buf_offset = offset - 4;
  445|     66|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     66|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    624|    ans_.state += l_rans_base;
  450|    624|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    624|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 66, False: 558]
  ------------------
  451|     66|      return 1;
  452|     66|    }
  453|    558|    return 0;
  454|    624|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    116|static uint32_t mem_get_le16(const void *vmem) {
   68|    116|  uint32_t val;
   69|    116|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    116|  val = mem[1] << 8;
   72|    116|  val |= mem[0];
   73|    116|  return val;
   74|    116|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    157|static uint32_t mem_get_le24(const void *vmem) {
   77|    157|  uint32_t val;
   78|    157|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    157|  val = mem[2] << 16;
   81|    157|  val |= mem[1] << 8;
   82|    157|  val |= mem[0];
   83|    157|  return val;
   84|    157|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    154|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    154|  uint32_t val;
   88|    154|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    154|  val = mem[3] << 24;
   91|    154|  val |= mem[2] << 16;
   92|    154|  val |= mem[1] << 8;
   93|    154|  val |= mem[0];
   94|    154|  return val;
   95|    154|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  42.6M|  inline int rans_read() {
  463|  42.6M|    unsigned rem;
  464|  42.6M|    unsigned quo;
  465|  42.6M|    struct rans_dec_sym sym;
  466|  42.6M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 32.1M, False: 10.5M]
  |  Branch (466:40): [True: 18.2k, False: 32.0M]
  ------------------
  467|  18.2k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  18.2k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  18.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|  42.6M|    quo = ans_.state / rans_precision;
  472|  42.6M|    rem = ans_.state % rans_precision;
  473|  42.6M|    fetch_sym(&sym, rem);
  474|  42.6M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  42.6M|    return sym.val;
  476|  42.6M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  42.6M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  42.6M|    uint32_t symbol = lut_table_[rem];
  507|  42.6M|    out->val = symbol;
  508|  42.6M|    out->prob = probability_table_[symbol].prob;
  509|  42.6M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  42.6M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|    535|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    123|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|     80|                                       uint32_t num_symbols) {
  482|     80|    lut_table_.resize(rans_precision);
  483|     80|    probability_table_.resize(num_symbols);
  484|     80|    uint32_t cum_prob = 0;
  485|     80|    uint32_t act_prob = 0;
  486|  2.78k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.71k, False: 70]
  ------------------
  487|  2.71k|      probability_table_[i].prob = token_probs[i];
  488|  2.71k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.71k|      cum_prob += token_probs[i];
  490|  2.71k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 10, False: 2.70k]
  ------------------
  491|     10|        return false;
  492|     10|      }
  493|   590k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 587k, False: 2.70k]
  ------------------
  494|   587k|        lut_table_[j] = i;
  495|   587k|      }
  496|  2.70k|      act_prob = cum_prob;
  497|  2.70k|    }
  498|     70|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 3, False: 67]
  ------------------
  499|      3|      return false;
  500|      3|    }
  501|     67|    return true;
  502|     70|  }
_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: 3, False: 43]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|     43|    ans_.buf = buf;
  427|     43|    x = buf[offset - 1] >> 6;
  428|     43|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 29, False: 14]
  ------------------
  429|     29|      ans_.buf_offset = offset - 1;
  430|     29|      ans_.state = buf[offset - 1] & 0x3F;
  431|     29|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 2, False: 12]
  ------------------
  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|     12|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 4, False: 8]
  ------------------
  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|      8|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 8, False: 0]
  ------------------
  444|      8|      ans_.buf_offset = offset - 4;
  445|      8|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      8|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     43|    ans_.state += l_rans_base;
  450|     43|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     43|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 7, False: 36]
  ------------------
  451|      7|      return 1;
  452|      7|    }
  453|     36|    return 0;
  454|     43|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  7.32M|  inline int rans_read() {
  463|  7.32M|    unsigned rem;
  464|  7.32M|    unsigned quo;
  465|  7.32M|    struct rans_dec_sym sym;
  466|  7.33M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 7.31M, False: 20.3k]
  |  Branch (466:40): [True: 2.41k, False: 7.30M]
  ------------------
  467|  2.41k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.41k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.41k|    }
  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|  7.32M|    quo = ans_.state / rans_precision;
  472|  7.32M|    rem = ans_.state % rans_precision;
  473|  7.32M|    fetch_sym(&sym, rem);
  474|  7.32M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  7.32M|    return sym.val;
  476|  7.32M|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  7.32M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  7.32M|    uint32_t symbol = lut_table_[rem];
  507|  7.32M|    out->val = symbol;
  508|  7.32M|    out->prob = probability_table_[symbol].prob;
  509|  7.32M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  7.32M|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     36|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    121|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|     85|                                       uint32_t num_symbols) {
  482|     85|    lut_table_.resize(rans_precision);
  483|     85|    probability_table_.resize(num_symbols);
  484|     85|    uint32_t cum_prob = 0;
  485|     85|    uint32_t act_prob = 0;
  486|  1.84k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.76k, False: 82]
  ------------------
  487|  1.76k|      probability_table_[i].prob = token_probs[i];
  488|  1.76k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.76k|      cum_prob += token_probs[i];
  490|  1.76k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 3, False: 1.76k]
  ------------------
  491|      3|        return false;
  492|      3|      }
  493|  2.39M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 2.39M, False: 1.76k]
  ------------------
  494|  2.39M|        lut_table_[j] = i;
  495|  2.39M|      }
  496|  1.76k|      act_prob = cum_prob;
  497|  1.76k|    }
  498|     82|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 11, False: 71]
  ------------------
  499|     11|      return false;
  500|     11|    }
  501|     71|    return true;
  502|     82|  }
_ZN5draco11RAnsDecoderILi15EE9read_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: 0, False: 46]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     46|    ans_.buf = buf;
  427|     46|    x = buf[offset - 1] >> 6;
  428|     46|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 11, False: 35]
  ------------------
  429|     11|      ans_.buf_offset = offset - 1;
  430|     11|      ans_.state = buf[offset - 1] & 0x3F;
  431|     35|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 13, False: 22]
  ------------------
  432|     13|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 13]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     13|      ans_.buf_offset = offset - 2;
  436|     13|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     22|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 7, False: 15]
  ------------------
  438|      7|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 7]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      7|      ans_.buf_offset = offset - 3;
  442|      7|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     15|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 15, False: 0]
  ------------------
  444|     15|      ans_.buf_offset = offset - 4;
  445|     15|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     15|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     46|    ans_.state += l_rans_base;
  450|     46|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     46|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 14, False: 32]
  ------------------
  451|     14|      return 1;
  452|     14|    }
  453|     32|    return 0;
  454|     46|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   245k|  inline int rans_read() {
  463|   245k|    unsigned rem;
  464|   245k|    unsigned quo;
  465|   245k|    struct rans_dec_sym sym;
  466|   249k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 210k, False: 39.0k]
  |  Branch (466:40): [True: 3.47k, False: 206k]
  ------------------
  467|  3.47k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  3.47k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  3.47k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   245k|    quo = ans_.state / rans_precision;
  472|   245k|    rem = ans_.state % rans_precision;
  473|   245k|    fetch_sym(&sym, rem);
  474|   245k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   245k|    return sym.val;
  476|   245k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   245k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   245k|    uint32_t symbol = lut_table_[rem];
  507|   245k|    out->val = symbol;
  508|   245k|    out->prob = probability_table_[symbol].prob;
  509|   245k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   245k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     32|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|     69|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|     22|                                       uint32_t num_symbols) {
  482|     22|    lut_table_.resize(rans_precision);
  483|     22|    probability_table_.resize(num_symbols);
  484|     22|    uint32_t cum_prob = 0;
  485|     22|    uint32_t act_prob = 0;
  486|  4.47k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.46k, False: 13]
  ------------------
  487|  4.46k|      probability_table_[i].prob = token_probs[i];
  488|  4.46k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.46k|      cum_prob += token_probs[i];
  490|  4.46k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 9, False: 4.45k]
  ------------------
  491|      9|        return false;
  492|      9|      }
  493|   810k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 806k, False: 4.45k]
  ------------------
  494|   806k|        lut_table_[j] = i;
  495|   806k|      }
  496|  4.45k|      act_prob = cum_prob;
  497|  4.45k|    }
  498|     13|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 5, False: 8]
  ------------------
  499|      5|      return false;
  500|      5|    }
  501|      8|    return true;
  502|     13|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|      4|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      4|    unsigned x;
  423|      4|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 4]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      4|    ans_.buf = buf;
  427|      4|    x = buf[offset - 1] >> 6;
  428|      4|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 3, False: 1]
  ------------------
  429|      3|      ans_.buf_offset = offset - 1;
  430|      3|      ans_.state = buf[offset - 1] & 0x3F;
  431|      3|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 1]
  ------------------
  432|      0|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      0|      ans_.buf_offset = offset - 2;
  436|      0|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      1|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 1, False: 0]
  ------------------
  438|      1|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 1]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      1|      ans_.buf_offset = offset - 3;
  442|      1|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      1|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      4|    ans_.state += l_rans_base;
  450|      4|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      4|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 4]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      4|    return 0;
  454|      4|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|  10.4k|  inline int rans_read() {
  463|  10.4k|    unsigned rem;
  464|  10.4k|    unsigned quo;
  465|  10.4k|    struct rans_dec_sym sym;
  466|  10.6k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 215, False: 10.4k]
  |  Branch (466:40): [True: 198, False: 17]
  ------------------
  467|    198|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    198|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    198|    }
  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|  10.4k|    quo = ans_.state / rans_precision;
  472|  10.4k|    rem = ans_.state % rans_precision;
  473|  10.4k|    fetch_sym(&sym, rem);
  474|  10.4k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  10.4k|    return sym.val;
  476|  10.4k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|  10.4k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  10.4k|    uint32_t symbol = lut_table_[rem];
  507|  10.4k|    out->val = symbol;
  508|  10.4k|    out->prob = probability_table_[symbol].prob;
  509|  10.4k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  10.4k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|      4|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|     85|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|     41|                                       uint32_t num_symbols) {
  482|     41|    lut_table_.resize(rans_precision);
  483|     41|    probability_table_.resize(num_symbols);
  484|     41|    uint32_t cum_prob = 0;
  485|     41|    uint32_t act_prob = 0;
  486|  6.04k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.00k, False: 39]
  ------------------
  487|  6.00k|      probability_table_[i].prob = token_probs[i];
  488|  6.00k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.00k|      cum_prob += token_probs[i];
  490|  6.00k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 2, False: 6.00k]
  ------------------
  491|      2|        return false;
  492|      2|      }
  493|  9.02M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 9.01M, False: 6.00k]
  ------------------
  494|  9.01M|        lut_table_[j] = i;
  495|  9.01M|      }
  496|  6.00k|      act_prob = cum_prob;
  497|  6.00k|    }
  498|     39|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 11, False: 28]
  ------------------
  499|     11|      return false;
  500|     11|    }
  501|     28|    return true;
  502|     39|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|      9|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      9|    unsigned x;
  423|      9|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 8]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|      8|    ans_.buf = buf;
  427|      8|    x = buf[offset - 1] >> 6;
  428|      8|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 2, False: 6]
  ------------------
  429|      2|      ans_.buf_offset = offset - 1;
  430|      2|      ans_.state = buf[offset - 1] & 0x3F;
  431|      6|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 2, False: 4]
  ------------------
  432|      2|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 2]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      2|      ans_.buf_offset = offset - 2;
  436|      2|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      4|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 3, False: 1]
  ------------------
  438|      3|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 3]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      3|      ans_.buf_offset = offset - 3;
  442|      3|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      3|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 1, False: 0]
  ------------------
  444|      1|      ans_.buf_offset = offset - 4;
  445|      1|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      1|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      8|    ans_.state += l_rans_base;
  450|      8|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      8|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 1, False: 7]
  ------------------
  451|      1|      return 1;
  452|      1|    }
  453|      7|    return 0;
  454|      8|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  23.5k|  inline int rans_read() {
  463|  23.5k|    unsigned rem;
  464|  23.5k|    unsigned quo;
  465|  23.5k|    struct rans_dec_sym sym;
  466|  23.5k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 22.5k, False: 1.07k]
  |  Branch (466:40): [True: 34, False: 22.4k]
  ------------------
  467|     34|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|     34|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|     34|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  23.5k|    quo = ans_.state / rans_precision;
  472|  23.5k|    rem = ans_.state % rans_precision;
  473|  23.5k|    fetch_sym(&sym, rem);
  474|  23.5k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  23.5k|    return sym.val;
  476|  23.5k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  23.5k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  23.5k|    uint32_t symbol = lut_table_[rem];
  507|  23.5k|    out->val = symbol;
  508|  23.5k|    out->prob = probability_table_[symbol].prob;
  509|  23.5k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  23.5k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|      7|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    100|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_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|  1.85k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.80k, False: 49]
  ------------------
  487|  1.80k|      probability_table_[i].prob = token_probs[i];
  488|  1.80k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.80k|      cum_prob += token_probs[i];
  490|  1.80k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 7, False: 1.80k]
  ------------------
  491|      7|        return false;
  492|      7|      }
  493|  22.7M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 22.7M, False: 1.80k]
  ------------------
  494|  22.7M|        lut_table_[j] = i;
  495|  22.7M|      }
  496|  1.80k|      act_prob = cum_prob;
  497|  1.80k|    }
  498|     49|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 11, False: 38]
  ------------------
  499|     11|      return false;
  500|     11|    }
  501|     38|    return true;
  502|     49|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     37|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     37|    unsigned x;
  423|     37|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 37]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     37|    ans_.buf = buf;
  427|     37|    x = buf[offset - 1] >> 6;
  428|     37|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 9, False: 28]
  ------------------
  429|      9|      ans_.buf_offset = offset - 1;
  430|      9|      ans_.state = buf[offset - 1] & 0x3F;
  431|     28|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 7, False: 21]
  ------------------
  432|      7|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 7]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      7|      ans_.buf_offset = offset - 2;
  436|      7|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     21|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 14, False: 7]
  ------------------
  438|     14|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 2, False: 12]
  ------------------
  439|      2|        return 1;
  440|      2|      }
  441|     12|      ans_.buf_offset = offset - 3;
  442|     12|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     12|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 7, False: 0]
  ------------------
  444|      7|      ans_.buf_offset = offset - 4;
  445|      7|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      7|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     35|    ans_.state += l_rans_base;
  450|     35|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     35|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 2, False: 33]
  ------------------
  451|      2|      return 1;
  452|      2|    }
  453|     33|    return 0;
  454|     35|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|  74.8k|  inline int rans_read() {
  463|  74.8k|    unsigned rem;
  464|  74.8k|    unsigned quo;
  465|  74.8k|    struct rans_dec_sym sym;
  466|  75.0k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 39.2k, False: 35.7k]
  |  Branch (466:40): [True: 164, False: 39.0k]
  ------------------
  467|    164|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    164|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    164|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  74.8k|    quo = ans_.state / rans_precision;
  472|  74.8k|    rem = ans_.state % rans_precision;
  473|  74.8k|    fetch_sym(&sym, rem);
  474|  74.8k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  74.8k|    return sym.val;
  476|  74.8k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|  74.8k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  74.8k|    uint32_t symbol = lut_table_[rem];
  507|  74.8k|    out->val = symbol;
  508|  74.8k|    out->prob = probability_table_[symbol].prob;
  509|  74.8k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  74.8k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     33|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|    518|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    321|                                       uint32_t num_symbols) {
  482|    321|    lut_table_.resize(rans_precision);
  483|    321|    probability_table_.resize(num_symbols);
  484|    321|    uint32_t cum_prob = 0;
  485|    321|    uint32_t act_prob = 0;
  486|  8.95k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 8.66k, False: 293]
  ------------------
  487|  8.66k|      probability_table_[i].prob = token_probs[i];
  488|  8.66k|      probability_table_[i].cum_prob = cum_prob;
  489|  8.66k|      cum_prob += token_probs[i];
  490|  8.66k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 28, False: 8.63k]
  ------------------
  491|     28|        return false;
  492|     28|      }
  493|   305M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 305M, False: 8.63k]
  ------------------
  494|   305M|        lut_table_[j] = i;
  495|   305M|      }
  496|  8.63k|      act_prob = cum_prob;
  497|  8.63k|    }
  498|    293|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 15, False: 278]
  ------------------
  499|     15|      return false;
  500|     15|    }
  501|    278|    return true;
  502|    293|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    160|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    160|    unsigned x;
  423|    160|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 159]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|    159|    ans_.buf = buf;
  427|    159|    x = buf[offset - 1] >> 6;
  428|    159|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 44, False: 115]
  ------------------
  429|     44|      ans_.buf_offset = offset - 1;
  430|     44|      ans_.state = buf[offset - 1] & 0x3F;
  431|    115|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 27, False: 88]
  ------------------
  432|     27|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 26]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|     26|      ans_.buf_offset = offset - 2;
  436|     26|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     88|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 31, False: 57]
  ------------------
  438|     31|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 31]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|     31|      ans_.buf_offset = offset - 3;
  442|     31|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     57|    } 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|    158|    ans_.state += l_rans_base;
  450|    158|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    158|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 30, False: 128]
  ------------------
  451|     30|      return 1;
  452|     30|    }
  453|    128|    return 0;
  454|    158|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  17.1M|  inline int rans_read() {
  463|  17.1M|    unsigned rem;
  464|  17.1M|    unsigned quo;
  465|  17.1M|    struct rans_dec_sym sym;
  466|  17.1M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 12.5M, False: 4.61M]
  |  Branch (466:40): [True: 4.42k, False: 12.5M]
  ------------------
  467|  4.42k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.42k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  4.42k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  17.1M|    quo = ans_.state / rans_precision;
  472|  17.1M|    rem = ans_.state % rans_precision;
  473|  17.1M|    fetch_sym(&sym, rem);
  474|  17.1M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  17.1M|    return sym.val;
  476|  17.1M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  17.1M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  17.1M|    uint32_t symbol = lut_table_[rem];
  507|  17.1M|    out->val = symbol;
  508|  17.1M|    out->prob = probability_table_[symbol].prob;
  509|  17.1M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  17.1M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    128|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    496|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    496|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    496|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 496]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    496|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    496|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    496|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 24, False: 472]
  ------------------
   67|     24|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 23]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     24|  } else
   72|    472|#endif
   73|    472|  {
   74|    472|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 471]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    472|  }
   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|    494|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 481]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    481|  probability_table_.resize(num_symbols_);
   86|    481|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 211, False: 270]
  ------------------
   87|    211|    return true;
   88|    211|  }
   89|       |  // Decode the table.
   90|  11.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 11.0k, False: 159]
  ------------------
   91|  11.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  11.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 12, False: 11.0k]
  ------------------
   95|     12|      return false;
   96|     12|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  11.0k|    const int token = prob_data & 3;
  102|  11.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.78k, False: 6.22k]
  ------------------
  103|  4.78k|      const uint32_t offset = prob_data >> 2;
  104|  4.78k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 89, False: 4.69k]
  ------------------
  105|     89|        return false;
  106|     89|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   206k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 201k, False: 4.69k]
  ------------------
  109|   201k|        probability_table_[i + j] = 0;
  110|   201k|      }
  111|  4.69k|      i += offset;
  112|  6.22k|    } else {
  113|  6.22k|      const int extra_bytes = token;
  114|  6.22k|      uint32_t prob = prob_data >> 2;
  115|  10.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.17k, False: 6.21k]
  ------------------
  116|  4.17k|        uint8_t eb;
  117|  4.17k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 4.16k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.16k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.16k|      }
  124|  6.21k|      probability_table_[i] = prob;
  125|  6.21k|    }
  126|  11.0k|  }
  127|    159|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 79, False: 80]
  ------------------
  128|     79|    return false;
  129|     79|  }
  130|     80|  return true;
  131|    159|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    185|    DecoderBuffer *buffer) {
  136|    185|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    185|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    185|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    185|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 14, False: 171]
  ------------------
  140|     14|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 13]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     14|  } else
  145|    171|#endif
  146|    171|  {
  147|    171|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 170]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    171|  }
  151|    183|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 21, False: 162]
  ------------------
  152|     21|    return false;
  153|     21|  }
  154|    162|  const uint8_t *const data_head =
  155|    162|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    162|  buffer->Advance(bytes_encoded);
  158|    162|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 61, False: 101]
  ------------------
  159|     61|    return false;
  160|     61|  }
  161|    101|  return true;
  162|    162|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    208|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  8.32M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|     78|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     78|  ans_.read_end();
  167|     78|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    285|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    285|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    285|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 285]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    285|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    285|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    285|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 270]
  ------------------
   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|    270|#endif
   73|    270|  {
   74|    270|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 265]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    270|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    280|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 271]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    271|  probability_table_.resize(num_symbols_);
   86|    271|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 268]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|  1.72M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.72M, False: 199]
  ------------------
   91|  1.72M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.72M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 23, False: 1.72M]
  ------------------
   95|     23|      return false;
   96|     23|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.72M|    const int token = prob_data & 3;
  102|  1.72M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 993k, False: 731k]
  ------------------
  103|   993k|      const uint32_t offset = prob_data >> 2;
  104|   993k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 993k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  59.4M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 58.4M, False: 993k]
  ------------------
  109|  58.4M|        probability_table_[i + j] = 0;
  110|  58.4M|      }
  111|   993k|      i += offset;
  112|   993k|    } else {
  113|   731k|      const int extra_bytes = token;
  114|   731k|      uint32_t prob = prob_data >> 2;
  115|   955k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 223k, False: 731k]
  ------------------
  116|   223k|        uint8_t eb;
  117|   223k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 223k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   223k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   223k|      }
  124|   731k|      probability_table_[i] = prob;
  125|   731k|    }
  126|  1.72M|  }
  127|    199|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 86, False: 113]
  ------------------
  128|     86|    return false;
  129|     86|  }
  130|    113|  return true;
  131|    199|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    116|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    113|    DecoderBuffer *buffer) {
  136|    113|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    113|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    113|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    113|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 112]
  ------------------
  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|    112|#endif
  146|    112|  {
  147|    112|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 112]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    112|  }
  151|    113|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 4, False: 109]
  ------------------
  152|      4|    return false;
  153|      4|  }
  154|    109|  const uint8_t *const data_head =
  155|    109|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    109|  buffer->Advance(bytes_encoded);
  158|    109|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 3, False: 106]
  ------------------
  159|      3|    return false;
  160|      3|  }
  161|    106|  return true;
  162|    109|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  8.67M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    106|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    106|  ans_.read_end();
  167|    106|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    171|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_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: 27, False: 144]
  ------------------
   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|    144|#endif
   73|    144|  {
   74|    144|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 144]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    144|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    171|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 164]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    164|  probability_table_.resize(num_symbols_);
   86|    164|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 164]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   661k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 661k, False: 98]
  ------------------
   91|   661k|    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|   661k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 661k]
  ------------------
   95|     31|      return false;
   96|     31|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   661k|    const int token = prob_data & 3;
  102|   661k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 77.5k, False: 583k]
  ------------------
  103|  77.5k|      const uint32_t offset = prob_data >> 2;
  104|  77.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 77.5k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.34M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.26M, False: 77.5k]
  ------------------
  109|  1.26M|        probability_table_[i + j] = 0;
  110|  1.26M|      }
  111|  77.5k|      i += offset;
  112|   583k|    } else {
  113|   583k|      const int extra_bytes = token;
  114|   583k|      uint32_t prob = prob_data >> 2;
  115|  1.10M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 524k, False: 583k]
  ------------------
  116|   524k|        uint8_t eb;
  117|   524k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 524k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   524k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   524k|      }
  124|   583k|      probability_table_[i] = prob;
  125|   583k|    }
  126|   661k|  }
  127|     98|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 84]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|     84|  return true;
  131|     98|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|     84|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|     84|    DecoderBuffer *buffer) {
  136|     84|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     84|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     84|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     84|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 6, False: 78]
  ------------------
  140|      6|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 6]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      6|  } else
  145|     78|#endif
  146|     78|  {
  147|     78|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 78]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     78|  }
  151|     84|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 26, False: 58]
  ------------------
  152|     26|    return false;
  153|     26|  }
  154|     58|  const uint8_t *const data_head =
  155|     58|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     58|  buffer->Advance(bytes_encoded);
  158|     58|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 15, False: 43]
  ------------------
  159|     15|    return false;
  160|     15|  }
  161|     43|  return true;
  162|     58|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|   581k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|     43|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     43|  ans_.read_end();
  167|     43|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    222|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    222|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    222|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 222]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    222|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    222|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    222|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 34, False: 188]
  ------------------
   67|     34|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 34]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     34|  } else
   72|    188|#endif
   73|    188|  {
   74|    188|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 188]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    188|  }
   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|    222|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 218]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|    218|  probability_table_.resize(num_symbols_);
   86|    218|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 218]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  16.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 15.9k, False: 176]
  ------------------
   91|  15.9k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  15.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 20, False: 15.9k]
  ------------------
   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|  15.9k|    const int token = prob_data & 3;
  102|  15.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.38k, False: 11.5k]
  ------------------
  103|  4.38k|      const uint32_t offset = prob_data >> 2;
  104|  4.38k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 14, False: 4.37k]
  ------------------
  105|     14|        return false;
  106|     14|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   125k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 121k, False: 4.37k]
  ------------------
  109|   121k|        probability_table_[i + j] = 0;
  110|   121k|      }
  111|  4.37k|      i += offset;
  112|  11.5k|    } else {
  113|  11.5k|      const int extra_bytes = token;
  114|  11.5k|      uint32_t prob = prob_data >> 2;
  115|  21.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 9.84k, False: 11.5k]
  ------------------
  116|  9.84k|        uint8_t eb;
  117|  9.84k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 9.84k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  9.84k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  9.84k|      }
  124|  11.5k|      probability_table_[i] = prob;
  125|  11.5k|    }
  126|  15.9k|  }
  127|    176|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 171]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|    171|  return true;
  131|    176|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    171|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    171|    DecoderBuffer *buffer) {
  136|    171|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    171|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    171|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    171|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 144]
  ------------------
  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|    144|#endif
  146|    144|  {
  147|    144|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 141]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    144|  }
  151|    167|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 34, False: 133]
  ------------------
  152|     34|    return false;
  153|     34|  }
  154|    133|  const uint8_t *const data_head =
  155|    133|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    133|  buffer->Advance(bytes_encoded);
  158|    133|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 11, False: 122]
  ------------------
  159|     11|    return false;
  160|     11|  }
  161|    122|  return true;
  162|    133|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  6.98M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    122|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    122|  ans_.read_end();
  167|    122|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    108|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    108|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    108|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 108]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    108|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    108|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    108|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 12, False: 96]
  ------------------
   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|     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|    108|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 97]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|     97|  probability_table_.resize(num_symbols_);
   86|     97|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 96]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  14.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 13.9k, False: 69]
  ------------------
   91|  13.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|  13.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 13.9k]
  ------------------
   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|  13.9k|    const int token = prob_data & 3;
  102|  13.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.54k, False: 9.42k]
  ------------------
  103|  4.54k|      const uint32_t offset = prob_data >> 2;
  104|  4.54k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 7, False: 4.53k]
  ------------------
  105|      7|        return false;
  106|      7|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   189k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 185k, False: 4.53k]
  ------------------
  109|   185k|        probability_table_[i + j] = 0;
  110|   185k|      }
  111|  4.53k|      i += offset;
  112|  9.42k|    } else {
  113|  9.42k|      const int extra_bytes = token;
  114|  9.42k|      uint32_t prob = prob_data >> 2;
  115|  15.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.63k, False: 9.42k]
  ------------------
  116|  5.63k|        uint8_t eb;
  117|  5.63k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 4, False: 5.63k]
  ------------------
  118|      4|          return false;
  119|      4|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.63k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.63k|      }
  124|  9.42k|      probability_table_[i] = prob;
  125|  9.42k|    }
  126|  13.9k|  }
  127|     69|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 65]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|     65|  return true;
  131|     69|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|     66|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|     65|    DecoderBuffer *buffer) {
  136|     65|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     65|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     65|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     65|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 65]
  ------------------
  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|     65|#endif
  146|     65|  {
  147|     65|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 65]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     65|  }
  151|     65|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 64]
  ------------------
  152|      1|    return false;
  153|      1|  }
  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: 2, False: 62]
  ------------------
  159|      2|    return false;
  160|      2|  }
  161|     62|  return true;
  162|     64|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|   686k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     62|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     62|  ans_.read_end();
  167|     62|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|     85|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|     85|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     85|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 85]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     85|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     85|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     85|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 32, False: 53]
  ------------------
   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|     53|#endif
   73|     53|  {
   74|     53|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 53]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     53|  }
   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|     85|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 78]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|     78|  probability_table_.resize(num_symbols_);
   86|     78|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 77]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  9.12k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 9.07k, False: 49]
  ------------------
   91|  9.07k|    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.07k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 12, False: 9.06k]
  ------------------
   95|     12|      return false;
   96|     12|    }
   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.06k|    const int token = prob_data & 3;
  102|  9.06k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.88k, False: 6.18k]
  ------------------
  103|  2.88k|      const uint32_t offset = prob_data >> 2;
  104|  2.88k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 14, False: 2.86k]
  ------------------
  105|     14|        return false;
  106|     14|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   114k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 111k, False: 2.86k]
  ------------------
  109|   111k|        probability_table_[i + j] = 0;
  110|   111k|      }
  111|  2.86k|      i += offset;
  112|  6.18k|    } else {
  113|  6.18k|      const int extra_bytes = token;
  114|  6.18k|      uint32_t prob = prob_data >> 2;
  115|  9.83k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.65k, False: 6.17k]
  ------------------
  116|  3.65k|        uint8_t eb;
  117|  3.65k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 3.65k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.65k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.65k|      }
  124|  6.17k|      probability_table_[i] = prob;
  125|  6.17k|    }
  126|  9.06k|  }
  127|     49|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 46]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|     46|  return true;
  131|     49|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|     47|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|     46|    DecoderBuffer *buffer) {
  136|     46|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     46|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     46|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     46|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 25, False: 21]
  ------------------
  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|     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|     46|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 25, False: 21]
  ------------------
  152|     25|    return false;
  153|     25|  }
  154|     21|  const uint8_t *const data_head =
  155|     21|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     21|  buffer->Advance(bytes_encoded);
  158|     21|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 13, False: 8]
  ------------------
  159|     13|    return false;
  160|     13|  }
  161|      8|  return true;
  162|     21|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  8.11M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|      8|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      8|  ans_.read_end();
  167|      8|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    180|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    180|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    180|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 180]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    180|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    180|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    180|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 32, False: 148]
  ------------------
   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|    148|#endif
   73|    148|  {
   74|    148|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 148]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    148|  }
   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|    180|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 176]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|    176|  probability_table_.resize(num_symbols_);
   86|    176|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 176]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   652k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 651k, False: 109]
  ------------------
   91|   651k|    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|   651k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 32, False: 651k]
  ------------------
   95|     32|      return false;
   96|     32|    }
   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|   651k|    const int token = prob_data & 3;
  102|   651k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 295k, False: 355k]
  ------------------
  103|   295k|      const uint32_t offset = prob_data >> 2;
  104|   295k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 295k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  11.9M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 11.6M, False: 295k]
  ------------------
  109|  11.6M|        probability_table_[i + j] = 0;
  110|  11.6M|      }
  111|   295k|      i += offset;
  112|   355k|    } else {
  113|   355k|      const int extra_bytes = token;
  114|   355k|      uint32_t prob = prob_data >> 2;
  115|   674k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 318k, False: 355k]
  ------------------
  116|   318k|        uint8_t eb;
  117|   318k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 318k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   318k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   318k|      }
  124|   355k|      probability_table_[i] = prob;
  125|   355k|    }
  126|   651k|  }
  127|    109|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 95]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|     95|  return true;
  131|    109|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|     95|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|     95|    DecoderBuffer *buffer) {
  136|     95|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     95|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     95|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     95|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 8, False: 87]
  ------------------
  140|      8|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 8]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      8|  } else
  145|     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|     95|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 9, False: 86]
  ------------------
  152|      9|    return false;
  153|      9|  }
  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: 3, False: 83]
  ------------------
  159|      3|    return false;
  160|      3|  }
  161|     83|  return true;
  162|     86|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  7.48M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     83|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     83|  ans_.read_end();
  167|     83|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    145|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    145|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    145|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 145]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    145|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    145|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    145|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 44, False: 101]
  ------------------
   67|     44|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 44]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     44|  } else
   72|    101|#endif
   73|    101|  {
   74|    101|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 101]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    101|  }
   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|    145|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 135]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    135|  probability_table_.resize(num_symbols_);
   86|    135|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 132]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   693k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 692k, False: 86]
  ------------------
   91|   692k|    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|   692k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 10, False: 692k]
  ------------------
   95|     10|      return false;
   96|     10|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   692k|    const int token = prob_data & 3;
  102|   692k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 114k, False: 578k]
  ------------------
  103|   114k|      const uint32_t offset = prob_data >> 2;
  104|   114k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 20, False: 114k]
  ------------------
  105|     20|        return false;
  106|     20|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.41M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.29M, False: 114k]
  ------------------
  109|  3.29M|        probability_table_[i + j] = 0;
  110|  3.29M|      }
  111|   114k|      i += offset;
  112|   578k|    } else {
  113|   578k|      const int extra_bytes = token;
  114|   578k|      uint32_t prob = prob_data >> 2;
  115|  1.12M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 550k, False: 578k]
  ------------------
  116|   550k|        uint8_t eb;
  117|   550k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 550k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   550k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   550k|      }
  124|   578k|      probability_table_[i] = prob;
  125|   578k|    }
  126|   692k|  }
  127|     86|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 7, False: 79]
  ------------------
  128|      7|    return false;
  129|      7|  }
  130|     79|  return true;
  131|     86|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|     82|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|     79|    DecoderBuffer *buffer) {
  136|     79|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     79|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     79|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     79|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 31, False: 48]
  ------------------
  140|     31|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 30]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     31|  } else
  145|     48|#endif
  146|     48|  {
  147|     48|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 46]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|     48|  }
  151|     76|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 32, False: 44]
  ------------------
  152|     32|    return false;
  153|     32|  }
  154|     44|  const uint8_t *const data_head =
  155|     44|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     44|  buffer->Advance(bytes_encoded);
  158|     44|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 11, False: 33]
  ------------------
  159|     11|    return false;
  160|     11|  }
  161|     33|  return true;
  162|     44|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  1.81M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     33|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     33|  ans_.read_end();
  167|     33|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    123|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    123|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    123|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 123]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    123|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    123|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    123|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 28, False: 95]
  ------------------
   67|     28|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 28]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     28|  } else
   72|     95|#endif
   73|     95|  {
   74|     95|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 95]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     95|  }
   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: 3, False: 120]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    120|  probability_table_.resize(num_symbols_);
   86|    120|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 120]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  23.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 23.0k, False: 80]
  ------------------
   91|  23.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  23.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 23.0k]
  ------------------
   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|  23.0k|    const int token = prob_data & 3;
  102|  23.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.03k, False: 18.0k]
  ------------------
  103|  5.03k|      const uint32_t offset = prob_data >> 2;
  104|  5.03k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 17, False: 5.02k]
  ------------------
  105|     17|        return false;
  106|     17|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   203k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 198k, False: 5.02k]
  ------------------
  109|   198k|        probability_table_[i + j] = 0;
  110|   198k|      }
  111|  5.02k|      i += offset;
  112|  18.0k|    } else {
  113|  18.0k|      const int extra_bytes = token;
  114|  18.0k|      uint32_t prob = prob_data >> 2;
  115|  28.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.6k, False: 18.0k]
  ------------------
  116|  10.6k|        uint8_t eb;
  117|  10.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 10.6k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.6k|      }
  124|  18.0k|      probability_table_[i] = prob;
  125|  18.0k|    }
  126|  23.0k|  }
  127|     80|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 67]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|     67|  return true;
  131|     80|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|     67|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|     67|    DecoderBuffer *buffer) {
  136|     67|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     67|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     67|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     67|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 58]
  ------------------
  140|      9|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 9]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      9|  } else
  145|     58|#endif
  146|     58|  {
  147|     58|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 58]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     58|  }
  151|     67|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 21, False: 46]
  ------------------
  152|     21|    return false;
  153|     21|  }
  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: 10, False: 36]
  ------------------
  159|     10|    return false;
  160|     10|  }
  161|     36|  return true;
  162|     46|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  7.32M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     36|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     36|  ans_.read_end();
  167|     36|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    121|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    121|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    121|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 121]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    121|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    121|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    121|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 28, False: 93]
  ------------------
   67|     28|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 28]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     28|  } 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|    121|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 120]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|    120|  probability_table_.resize(num_symbols_);
   86|    120|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 120]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   731k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 731k, False: 85]
  ------------------
   91|   731k|    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|   731k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 17, False: 731k]
  ------------------
   95|     17|      return false;
   96|     17|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   731k|    const int token = prob_data & 3;
  102|   731k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 92.8k, False: 638k]
  ------------------
  103|  92.8k|      const uint32_t offset = prob_data >> 2;
  104|  92.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 9, False: 92.8k]
  ------------------
  105|      9|        return false;
  106|      9|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.20M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.11M, False: 92.8k]
  ------------------
  109|  2.11M|        probability_table_[i + j] = 0;
  110|  2.11M|      }
  111|  92.8k|      i += offset;
  112|   638k|    } else {
  113|   638k|      const int extra_bytes = token;
  114|   638k|      uint32_t prob = prob_data >> 2;
  115|  1.20M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 564k, False: 638k]
  ------------------
  116|   564k|        uint8_t eb;
  117|   564k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 9, False: 564k]
  ------------------
  118|      9|          return false;
  119|      9|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   564k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   564k|      }
  124|   638k|      probability_table_[i] = prob;
  125|   638k|    }
  126|   731k|  }
  127|     85|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 71]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|     71|  return true;
  131|     85|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|     71|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|     71|    DecoderBuffer *buffer) {
  136|     71|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     71|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     71|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     71|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 55]
  ------------------
  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|     55|#endif
  146|     55|  {
  147|     55|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 55]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     55|  }
  151|     70|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 24, False: 46]
  ------------------
  152|     24|    return false;
  153|     24|  }
  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: 14, False: 32]
  ------------------
  159|     14|    return false;
  160|     14|  }
  161|     32|  return true;
  162|     46|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   245k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     32|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     32|  ans_.read_end();
  167|     32|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|     69|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|     69|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     69|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 69]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     69|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     69|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     69|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 13, False: 56]
  ------------------
   67|     13|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 13]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     13|  } else
   72|     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|     69|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 68]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|     68|  probability_table_.resize(num_symbols_);
   86|     68|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 66]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  15.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 15.6k, False: 22]
  ------------------
   91|  15.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|  15.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 13, False: 15.6k]
  ------------------
   95|     13|      return false;
   96|     13|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  15.6k|    const int token = prob_data & 3;
  102|  15.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.00k, False: 10.6k]
  ------------------
  103|  5.00k|      const uint32_t offset = prob_data >> 2;
  104|  5.00k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 20, False: 4.98k]
  ------------------
  105|     20|        return false;
  106|     20|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   176k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 171k, False: 4.98k]
  ------------------
  109|   171k|        probability_table_[i + j] = 0;
  110|   171k|      }
  111|  4.98k|      i += offset;
  112|  10.6k|    } else {
  113|  10.6k|      const int extra_bytes = token;
  114|  10.6k|      uint32_t prob = prob_data >> 2;
  115|  19.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.75k, False: 10.6k]
  ------------------
  116|  8.75k|        uint8_t eb;
  117|  8.75k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 8.74k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.74k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.74k|      }
  124|  10.6k|      probability_table_[i] = prob;
  125|  10.6k|    }
  126|  15.6k|  }
  127|     22|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 8]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|      8|  return true;
  131|     22|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|     10|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|      8|    DecoderBuffer *buffer) {
  136|      8|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      8|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      8|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      8|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 8]
  ------------------
  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|      8|#endif
  146|      8|  {
  147|      8|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 8]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      8|  }
  151|      8|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 4, False: 4]
  ------------------
  152|      4|    return false;
  153|      4|  }
  154|      4|  const uint8_t *const data_head =
  155|      4|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      4|  buffer->Advance(bytes_encoded);
  158|      4|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 4]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      4|  return true;
  162|      4|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  10.4k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|      4|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      4|  ans_.read_end();
  167|      4|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|     85|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|     85|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     85|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 85]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     85|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     85|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     85|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 11, False: 74]
  ------------------
   67|     11|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 11]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     11|  } else
   72|     74|#endif
   73|     74|  {
   74|     74|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 73]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|     74|  }
   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|     84|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 84]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     84|  probability_table_.resize(num_symbols_);
   86|     84|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 80]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  84.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 84.6k, False: 41]
  ------------------
   91|  84.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|  84.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 25, False: 84.6k]
  ------------------
   95|     25|      return false;
   96|     25|    }
   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|  84.6k|    const int token = prob_data & 3;
  102|  84.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 20.9k, False: 63.7k]
  ------------------
  103|  20.9k|      const uint32_t offset = prob_data >> 2;
  104|  20.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 6, False: 20.9k]
  ------------------
  105|      6|        return false;
  106|      6|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   776k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 755k, False: 20.9k]
  ------------------
  109|   755k|        probability_table_[i + j] = 0;
  110|   755k|      }
  111|  20.9k|      i += offset;
  112|  63.7k|    } else {
  113|  63.7k|      const int extra_bytes = token;
  114|  63.7k|      uint32_t prob = prob_data >> 2;
  115|   127k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 63.3k, False: 63.6k]
  ------------------
  116|  63.3k|        uint8_t eb;
  117|  63.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 63.2k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  63.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  63.2k|      }
  124|  63.6k|      probability_table_[i] = prob;
  125|  63.6k|    }
  126|  84.6k|  }
  127|     41|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 28]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|     28|  return true;
  131|     41|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|     32|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|     28|    DecoderBuffer *buffer) {
  136|     28|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     28|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     28|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     28|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 10, False: 18]
  ------------------
  140|     10|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 10]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     10|  } else
  145|     18|#endif
  146|     18|  {
  147|     18|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 18]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     18|  }
  151|     28|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 19, False: 9]
  ------------------
  152|     19|    return false;
  153|     19|  }
  154|      9|  const uint8_t *const data_head =
  155|      9|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      9|  buffer->Advance(bytes_encoded);
  158|      9|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 2, False: 7]
  ------------------
  159|      2|    return false;
  160|      2|  }
  161|      7|  return true;
  162|      9|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  23.5k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|      7|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      7|  ans_.read_end();
  167|      7|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    100|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    100|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    100|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 100]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    100|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    100|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    100|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 98]
  ------------------
   67|      2|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 2]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      2|  } else
   72|     98|#endif
   73|     98|  {
   74|     98|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 98]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     98|  }
   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|    100|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 94]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|     94|  probability_table_.resize(num_symbols_);
   86|     94|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 94]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   498k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 498k, False: 56]
  ------------------
   91|   498k|    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|   498k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 498k]
  ------------------
   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|   498k|    const int token = prob_data & 3;
  102|   498k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 274k, False: 223k]
  ------------------
  103|   274k|      const uint32_t offset = prob_data >> 2;
  104|   274k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 274k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  9.19M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.91M, False: 274k]
  ------------------
  109|  8.91M|        probability_table_[i + j] = 0;
  110|  8.91M|      }
  111|   274k|      i += offset;
  112|   274k|    } else {
  113|   223k|      const int extra_bytes = token;
  114|   223k|      uint32_t prob = prob_data >> 2;
  115|   380k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 156k, False: 223k]
  ------------------
  116|   156k|        uint8_t eb;
  117|   156k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 156k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   156k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   156k|      }
  124|   223k|      probability_table_[i] = prob;
  125|   223k|    }
  126|   498k|  }
  127|     56|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 18, False: 38]
  ------------------
  128|     18|    return false;
  129|     18|  }
  130|     38|  return true;
  131|     56|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|     38|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|     38|    DecoderBuffer *buffer) {
  136|     38|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     38|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     38|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     38|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 38]
  ------------------
  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|     38|#endif
  146|     38|  {
  147|     38|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 38]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     38|  }
  151|     38|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 37]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|     37|  const uint8_t *const data_head =
  155|     37|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     37|  buffer->Advance(bytes_encoded);
  158|     37|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 4, False: 33]
  ------------------
  159|      4|    return false;
  160|      4|  }
  161|     33|  return true;
  162|     37|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|  74.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     33|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     33|  ans_.read_end();
  167|     33|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    123|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    123|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    123|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 123]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    123|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    123|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    123|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 26, False: 97]
  ------------------
   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|     97|#endif
   73|     97|  {
   74|     97|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 94]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|     97|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    120|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 115]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    115|  probability_table_.resize(num_symbols_);
   86|    115|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 115]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   351k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 351k, False: 69]
  ------------------
   91|   351k|    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|   351k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 351k]
  ------------------
   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|   351k|    const int token = prob_data & 3;
  102|   351k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 127k, False: 223k]
  ------------------
  103|   127k|      const uint32_t offset = prob_data >> 2;
  104|   127k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 20, False: 127k]
  ------------------
  105|     20|        return false;
  106|     20|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  6.31M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 6.18M, False: 127k]
  ------------------
  109|  6.18M|        probability_table_[i + j] = 0;
  110|  6.18M|      }
  111|   127k|      i += offset;
  112|   223k|    } else {
  113|   223k|      const int extra_bytes = token;
  114|   223k|      uint32_t prob = prob_data >> 2;
  115|   505k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 281k, False: 223k]
  ------------------
  116|   281k|        uint8_t eb;
  117|   281k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 281k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   281k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   281k|      }
  124|   223k|      probability_table_[i] = prob;
  125|   223k|    }
  126|   351k|  }
  127|     69|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 7, False: 62]
  ------------------
  128|      7|    return false;
  129|      7|  }
  130|     62|  return true;
  131|     69|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|     62|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|     62|    DecoderBuffer *buffer) {
  136|     62|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     62|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     62|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     62|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 58]
  ------------------
  140|      4|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 4]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      4|  } else
  145|     58|#endif
  146|     58|  {
  147|     58|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 58]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     58|  }
  151|     62|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 14, False: 48]
  ------------------
  152|     14|    return false;
  153|     14|  }
  154|     48|  const uint8_t *const data_head =
  155|     48|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     48|  buffer->Advance(bytes_encoded);
  158|     48|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 10, False: 38]
  ------------------
  159|     10|    return false;
  160|     10|  }
  161|     38|  return true;
  162|     48|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|   110k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     38|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     38|  ans_.read_end();
  167|     38|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|     76|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|     76|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     76|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 76]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     76|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     76|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     76|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 18, False: 58]
  ------------------
   67|     18|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 18]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     18|  } else
   72|     58|#endif
   73|     58|  {
   74|     58|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 58]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     58|  }
   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|     76|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 73]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|     73|  probability_table_.resize(num_symbols_);
   86|     73|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 73]
  ------------------
   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: 42]
  ------------------
   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: 14, False: 104k]
  ------------------
   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|   104k|    const int token = prob_data & 3;
  102|   104k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 20.7k, False: 83.6k]
  ------------------
  103|  20.7k|      const uint32_t offset = prob_data >> 2;
  104|  20.7k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 7, False: 20.6k]
  ------------------
  105|      7|        return false;
  106|      7|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   750k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 730k, False: 20.6k]
  ------------------
  109|   730k|        probability_table_[i + j] = 0;
  110|   730k|      }
  111|  20.6k|      i += offset;
  112|  83.6k|    } else {
  113|  83.6k|      const int extra_bytes = token;
  114|  83.6k|      uint32_t prob = prob_data >> 2;
  115|   123k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 40.2k, False: 83.6k]
  ------------------
  116|  40.2k|        uint8_t eb;
  117|  40.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 40.2k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  40.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  40.2k|      }
  124|  83.6k|      probability_table_[i] = prob;
  125|  83.6k|    }
  126|   104k|  }
  127|     42|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 7, False: 35]
  ------------------
  128|      7|    return false;
  129|      7|  }
  130|     35|  return true;
  131|     42|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|     35|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|     35|    DecoderBuffer *buffer) {
  136|     35|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     35|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     35|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     35|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 6, False: 29]
  ------------------
  140|      6|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 6]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      6|  } else
  145|     29|#endif
  146|     29|  {
  147|     29|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 29]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     29|  }
  151|     35|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 10, False: 25]
  ------------------
  152|     10|    return false;
  153|     10|  }
  154|     25|  const uint8_t *const data_head =
  155|     25|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     25|  buffer->Advance(bytes_encoded);
  158|     25|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 11, False: 14]
  ------------------
  159|     11|    return false;
  160|     11|  }
  161|     14|  return true;
  162|     25|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  4.20M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     14|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     14|  ans_.read_end();
  167|     14|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|     60|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|     60|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     60|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 60]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     60|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     60|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     60|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 7, False: 53]
  ------------------
   67|      7|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 7]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      7|  } else
   72|     53|#endif
   73|     53|  {
   74|     53|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 53]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     53|  }
   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|     60|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 54]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|     54|  probability_table_.resize(num_symbols_);
   86|     54|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 54]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  16.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 16.0k, False: 29]
  ------------------
   91|  16.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  16.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 9, False: 16.0k]
  ------------------
   95|      9|      return false;
   96|      9|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  16.0k|    const int token = prob_data & 3;
  102|  16.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.14k, False: 10.9k]
  ------------------
  103|  5.14k|      const uint32_t offset = prob_data >> 2;
  104|  5.14k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 6, False: 5.13k]
  ------------------
  105|      6|        return false;
  106|      6|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   194k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 189k, False: 5.13k]
  ------------------
  109|   189k|        probability_table_[i + j] = 0;
  110|   189k|      }
  111|  5.13k|      i += offset;
  112|  10.9k|    } else {
  113|  10.9k|      const int extra_bytes = token;
  114|  10.9k|      uint32_t prob = prob_data >> 2;
  115|  19.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.10k, False: 10.9k]
  ------------------
  116|  8.10k|        uint8_t eb;
  117|  8.10k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 8.09k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.09k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.09k|      }
  124|  10.9k|      probability_table_[i] = prob;
  125|  10.9k|    }
  126|  16.0k|  }
  127|     29|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 28]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|     28|  return true;
  131|     29|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|     28|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|     28|    DecoderBuffer *buffer) {
  136|     28|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     28|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     28|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     28|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 28]
  ------------------
  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|     28|#endif
  146|     28|  {
  147|     28|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 28]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     28|  }
  151|     28|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 12, False: 16]
  ------------------
  152|     12|    return false;
  153|     12|  }
  154|     16|  const uint8_t *const data_head =
  155|     16|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     16|  buffer->Advance(bytes_encoded);
  158|     16|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 15]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|     15|  return true;
  162|     16|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  9.48M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     15|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     15|  ans_.read_end();
  167|     15|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    127|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    127|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    127|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 127]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    127|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    127|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    127|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 117]
  ------------------
   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|    117|#endif
   73|    117|  {
   74|    117|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 116]
  ------------------
   75|      1|      return false;
   76|      1|    }
   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|    126|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 116]
  ------------------
   83|     10|    return false;
   84|     10|  }
   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|   138k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 138k, False: 82]
  ------------------
   91|   138k|    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|   138k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 138k]
  ------------------
   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|   138k|    const int token = prob_data & 3;
  102|   138k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 92.5k, False: 46.0k]
  ------------------
  103|  92.5k|      const uint32_t offset = prob_data >> 2;
  104|  92.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 10, False: 92.4k]
  ------------------
  105|     10|        return false;
  106|     10|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.53M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.44M, False: 92.4k]
  ------------------
  109|  4.44M|        probability_table_[i + j] = 0;
  110|  4.44M|      }
  111|  92.4k|      i += offset;
  112|  92.4k|    } else {
  113|  46.0k|      const int extra_bytes = token;
  114|  46.0k|      uint32_t prob = prob_data >> 2;
  115|  53.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 7.58k, False: 46.0k]
  ------------------
  116|  7.58k|        uint8_t eb;
  117|  7.58k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 7.57k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  7.57k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  7.57k|      }
  124|  46.0k|      probability_table_[i] = prob;
  125|  46.0k|    }
  126|   138k|  }
  127|     82|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 15, False: 67]
  ------------------
  128|     15|    return false;
  129|     15|  }
  130|     67|  return true;
  131|     82|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|     67|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|     67|    DecoderBuffer *buffer) {
  136|     67|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     67|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     67|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     67|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 5, False: 62]
  ------------------
  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|     62|#endif
  146|     62|  {
  147|     62|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 57]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|     62|  }
  151|     62|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 16, False: 46]
  ------------------
  152|     16|    return false;
  153|     16|  }
  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: 4, False: 42]
  ------------------
  159|      4|    return false;
  160|      4|  }
  161|     42|  return true;
  162|     46|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  3.29M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     42|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     42|  ans_.read_end();
  167|     42|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    132|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    132|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    132|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 132]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    132|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    132|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    132|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 37, False: 95]
  ------------------
   67|     37|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 37]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     37|  } else
   72|     95|#endif
   73|     95|  {
   74|     95|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 95]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     95|  }
   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|    132|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 130]
  ------------------
   83|      2|    return false;
   84|      2|  }
   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|  44.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 44.3k, False: 99]
  ------------------
   91|  44.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  44.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 12, False: 44.3k]
  ------------------
   95|     12|      return false;
   96|     12|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  44.3k|    const int token = prob_data & 3;
  102|  44.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 8.46k, False: 35.8k]
  ------------------
  103|  8.46k|      const uint32_t offset = prob_data >> 2;
  104|  8.46k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 11, False: 8.45k]
  ------------------
  105|     11|        return false;
  106|     11|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   360k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 351k, False: 8.45k]
  ------------------
  109|   351k|        probability_table_[i + j] = 0;
  110|   351k|      }
  111|  8.45k|      i += offset;
  112|  35.8k|    } else {
  113|  35.8k|      const int extra_bytes = token;
  114|  35.8k|      uint32_t prob = prob_data >> 2;
  115|  53.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 17.3k, False: 35.8k]
  ------------------
  116|  17.3k|        uint8_t eb;
  117|  17.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 17.3k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  17.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  17.3k|      }
  124|  35.8k|      probability_table_[i] = prob;
  125|  35.8k|    }
  126|  44.3k|  }
  127|     99|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 86]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|     86|  return true;
  131|     99|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|     86|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|     86|    DecoderBuffer *buffer) {
  136|     86|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     86|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     86|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     86|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 28, False: 58]
  ------------------
  140|     28|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 27]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     28|  } else
  145|     58|#endif
  146|     58|  {
  147|     58|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 51]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|     58|  }
  151|     78|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 53, False: 25]
  ------------------
  152|     53|    return false;
  153|     53|  }
  154|     25|  const uint8_t *const data_head =
  155|     25|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     25|  buffer->Advance(bytes_encoded);
  158|     25|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 6, False: 19]
  ------------------
  159|      6|    return false;
  160|      6|  }
  161|     19|  return true;
  162|     25|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  38.2k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     19|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     19|  ans_.read_end();
  167|     19|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  4.03k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  4.03k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 1, False: 4.03k]
  ------------------
   35|      1|    return true;
   36|      1|  }
   37|       |  // Decode which scheme to use.
   38|  4.03k|  uint8_t scheme;
   39|  4.03k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 15, False: 4.01k]
  ------------------
   40|     15|    return false;
   41|     15|  }
   42|  4.01k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 361, False: 3.65k]
  ------------------
   43|    361|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    361|                                                  src_buffer, out_values);
   45|  3.65k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 2.49k, False: 1.16k]
  ------------------
   46|  2.49k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  2.49k|                                               out_values);
   48|  2.49k|  }
   49|  1.16k|  return false;
   50|  4.01k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    361|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    361|  SymbolDecoderT<5> tag_decoder;
   57|    361|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 200, False: 161]
  ------------------
   58|    200|    return false;
   59|    200|  }
   60|       |
   61|    161|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 83, False: 78]
  ------------------
   62|     83|    return false;
   63|     83|  }
   64|       |
   65|     78|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 78, False: 0]
  |  Branch (65:25): [True: 22, False: 56]
  ------------------
   66|     22|    return false;  // Wrong number of symbols.
   67|     22|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|     56|  src_buffer->StartBitDecoding(false, nullptr);
   72|     56|  int value_id = 0;
   73|  18.5k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 18.4k, False: 55]
  ------------------
   74|       |    // Decode the tag.
   75|  18.4k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  47.4k|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 28.9k, False: 18.4k]
  ------------------
   78|  28.9k|      uint32_t val;
   79|  28.9k|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 1, False: 28.9k]
  ------------------
   80|      1|        return false;
   81|      1|      }
   82|  28.9k|      out_values[value_id++] = val;
   83|  28.9k|    }
   84|  18.4k|  }
   85|     55|  tag_decoder.EndDecoding();
   86|     55|  src_buffer->EndBitDecoding();
   87|     55|  return true;
   88|     56|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  2.49k|                      uint32_t *out_values) {
  117|  2.49k|  uint8_t max_bit_length;
  118|  2.49k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 1, False: 2.49k]
  ------------------
  119|      1|    return false;
  120|      1|  }
  121|  2.49k|  switch (max_bit_length) {
  122|    285|    case 1:
  ------------------
  |  Branch (122:5): [True: 285, False: 2.20k]
  ------------------
  123|    285|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    285|                                                         out_values);
  125|    171|    case 2:
  ------------------
  |  Branch (125:5): [True: 171, False: 2.32k]
  ------------------
  126|    171|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    171|                                                         out_values);
  128|    222|    case 3:
  ------------------
  |  Branch (128:5): [True: 222, False: 2.27k]
  ------------------
  129|    222|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    222|                                                         out_values);
  131|    108|    case 4:
  ------------------
  |  Branch (131:5): [True: 108, False: 2.38k]
  ------------------
  132|    108|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    108|                                                         out_values);
  134|    135|    case 5:
  ------------------
  |  Branch (134:5): [True: 135, False: 2.35k]
  ------------------
  135|    135|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    135|                                                         out_values);
  137|     85|    case 6:
  ------------------
  |  Branch (137:5): [True: 85, False: 2.40k]
  ------------------
  138|     85|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|     85|                                                         out_values);
  140|    180|    case 7:
  ------------------
  |  Branch (140:5): [True: 180, False: 2.31k]
  ------------------
  141|    180|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    180|                                                         out_values);
  143|    145|    case 8:
  ------------------
  |  Branch (143:5): [True: 145, False: 2.34k]
  ------------------
  144|    145|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    145|                                                         out_values);
  146|    123|    case 9:
  ------------------
  |  Branch (146:5): [True: 123, False: 2.36k]
  ------------------
  147|    123|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    123|                                                         out_values);
  149|    121|    case 10:
  ------------------
  |  Branch (149:5): [True: 121, False: 2.37k]
  ------------------
  150|    121|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    121|          num_values, src_buffer, out_values);
  152|     69|    case 11:
  ------------------
  |  Branch (152:5): [True: 69, False: 2.42k]
  ------------------
  153|     69|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|     69|          num_values, src_buffer, out_values);
  155|     85|    case 12:
  ------------------
  |  Branch (155:5): [True: 85, False: 2.40k]
  ------------------
  156|     85|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|     85|          num_values, src_buffer, out_values);
  158|    100|    case 13:
  ------------------
  |  Branch (158:5): [True: 100, False: 2.39k]
  ------------------
  159|    100|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    100|          num_values, src_buffer, out_values);
  161|    123|    case 14:
  ------------------
  |  Branch (161:5): [True: 123, False: 2.36k]
  ------------------
  162|    123|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    123|          num_values, src_buffer, out_values);
  164|     76|    case 15:
  ------------------
  |  Branch (164:5): [True: 76, False: 2.41k]
  ------------------
  165|     76|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|     76|          num_values, src_buffer, out_values);
  167|     60|    case 16:
  ------------------
  |  Branch (167:5): [True: 60, False: 2.43k]
  ------------------
  168|     60|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|     60|          num_values, src_buffer, out_values);
  170|    127|    case 17:
  ------------------
  |  Branch (170:5): [True: 127, False: 2.36k]
  ------------------
  171|    127|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    127|          num_values, src_buffer, out_values);
  173|    132|    case 18:
  ------------------
  |  Branch (173:5): [True: 132, False: 2.36k]
  ------------------
  174|    132|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    132|          num_values, src_buffer, out_values);
  176|    145|    default:
  ------------------
  |  Branch (176:5): [True: 145, False: 2.34k]
  ------------------
  177|    145|      return false;
  178|  2.49k|  }
  179|  2.49k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    285|                              uint32_t *out_values) {
   93|    285|  SymbolDecoderT decoder;
   94|    285|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 169, False: 116]
  ------------------
   95|    169|    return false;
   96|    169|  }
   97|       |
   98|    116|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 116, False: 0]
  |  Branch (98:25): [True: 3, False: 113]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    113|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 7, False: 106]
  ------------------
  103|      7|    return false;
  104|      7|  }
  105|  8.67M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.67M, False: 106]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.67M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.67M|    out_values[i] = value;
  109|  8.67M|  }
  110|    106|  decoder.EndDecoding();
  111|    106|  return true;
  112|    113|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    171|                              uint32_t *out_values) {
   93|    171|  SymbolDecoderT decoder;
   94|    171|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 87, False: 84]
  ------------------
   95|     87|    return false;
   96|     87|  }
   97|       |
   98|     84|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 84, False: 0]
  |  Branch (98:25): [True: 0, False: 84]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     84|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 41, False: 43]
  ------------------
  103|     41|    return false;
  104|     41|  }
  105|   581k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 581k, False: 43]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   581k|    const uint32_t value = decoder.DecodeSymbol();
  108|   581k|    out_values[i] = value;
  109|   581k|  }
  110|     43|  decoder.EndDecoding();
  111|     43|  return true;
  112|     84|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    222|                              uint32_t *out_values) {
   93|    222|  SymbolDecoderT decoder;
   94|    222|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 51, False: 171]
  ------------------
   95|     51|    return false;
   96|     51|  }
   97|       |
   98|    171|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 171, False: 0]
  |  Branch (98:25): [True: 0, False: 171]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    171|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 49, False: 122]
  ------------------
  103|     49|    return false;
  104|     49|  }
  105|  6.98M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.98M, False: 122]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.98M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.98M|    out_values[i] = value;
  109|  6.98M|  }
  110|    122|  decoder.EndDecoding();
  111|    122|  return true;
  112|    171|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    108|                              uint32_t *out_values) {
   93|    108|  SymbolDecoderT decoder;
   94|    108|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 42, False: 66]
  ------------------
   95|     42|    return false;
   96|     42|  }
   97|       |
   98|     66|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 66, False: 0]
  |  Branch (98:25): [True: 1, False: 65]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     65|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 3, False: 62]
  ------------------
  103|      3|    return false;
  104|      3|  }
  105|   686k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 686k, False: 62]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   686k|    const uint32_t value = decoder.DecodeSymbol();
  108|   686k|    out_values[i] = value;
  109|   686k|  }
  110|     62|  decoder.EndDecoding();
  111|     62|  return true;
  112|     65|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    135|                              uint32_t *out_values) {
   93|    135|  SymbolDecoderT decoder;
   94|    135|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 5, False: 130]
  ------------------
   95|      5|    return false;
   96|      5|  }
   97|       |
   98|    130|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 130, False: 0]
  |  Branch (98:25): [True: 106, False: 24]
  ------------------
   99|    106|    return false;  // Wrong number of symbols.
  100|    106|  }
  101|       |
  102|     24|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 1, False: 23]
  ------------------
  103|      1|    return false;
  104|      1|  }
  105|  8.31M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.31M, False: 23]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.31M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.31M|    out_values[i] = value;
  109|  8.31M|  }
  110|     23|  decoder.EndDecoding();
  111|     23|  return true;
  112|     24|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|     85|                              uint32_t *out_values) {
   93|     85|  SymbolDecoderT decoder;
   94|     85|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 38, False: 47]
  ------------------
   95|     38|    return false;
   96|     38|  }
   97|       |
   98|     47|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 47, False: 0]
  |  Branch (98:25): [True: 1, False: 46]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     46|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 38, False: 8]
  ------------------
  103|     38|    return false;
  104|     38|  }
  105|  8.11M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.11M, False: 8]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.11M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.11M|    out_values[i] = value;
  109|  8.11M|  }
  110|      8|  decoder.EndDecoding();
  111|      8|  return true;
  112|     46|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    180|                              uint32_t *out_values) {
   93|    180|  SymbolDecoderT decoder;
   94|    180|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 85, False: 95]
  ------------------
   95|     85|    return false;
   96|     85|  }
   97|       |
   98|     95|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 95, False: 0]
  |  Branch (98:25): [True: 0, False: 95]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     95|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 12, False: 83]
  ------------------
  103|     12|    return false;
  104|     12|  }
  105|  7.48M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.48M, False: 83]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.48M|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.48M|    out_values[i] = value;
  109|  7.48M|  }
  110|     83|  decoder.EndDecoding();
  111|     83|  return true;
  112|     95|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    145|                              uint32_t *out_values) {
   93|    145|  SymbolDecoderT decoder;
   94|    145|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 63, False: 82]
  ------------------
   95|     63|    return false;
   96|     63|  }
   97|       |
   98|     82|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 82, False: 0]
  |  Branch (98:25): [True: 3, False: 79]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|     79|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 46, False: 33]
  ------------------
  103|     46|    return false;
  104|     46|  }
  105|  1.81M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.81M, False: 33]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.81M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.81M|    out_values[i] = value;
  109|  1.81M|  }
  110|     33|  decoder.EndDecoding();
  111|     33|  return true;
  112|     79|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    123|                              uint32_t *out_values) {
   93|    123|  SymbolDecoderT decoder;
   94|    123|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 56, False: 67]
  ------------------
   95|     56|    return false;
   96|     56|  }
   97|       |
   98|     67|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 67, False: 0]
  |  Branch (98:25): [True: 0, False: 67]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     67|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 31, False: 36]
  ------------------
  103|     31|    return false;
  104|     31|  }
  105|  7.32M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.32M, False: 36]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.32M|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.32M|    out_values[i] = value;
  109|  7.32M|  }
  110|     36|  decoder.EndDecoding();
  111|     36|  return true;
  112|     67|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    121|                              uint32_t *out_values) {
   93|    121|  SymbolDecoderT decoder;
   94|    121|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 50, False: 71]
  ------------------
   95|     50|    return false;
   96|     50|  }
   97|       |
   98|     71|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 71, False: 0]
  |  Branch (98:25): [True: 0, False: 71]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     71|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 39, False: 32]
  ------------------
  103|     39|    return false;
  104|     39|  }
  105|   245k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 245k, False: 32]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   245k|    const uint32_t value = decoder.DecodeSymbol();
  108|   245k|    out_values[i] = value;
  109|   245k|  }
  110|     32|  decoder.EndDecoding();
  111|     32|  return true;
  112|     71|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|     69|                              uint32_t *out_values) {
   93|     69|  SymbolDecoderT decoder;
   94|     69|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 59, False: 10]
  ------------------
   95|     59|    return false;
   96|     59|  }
   97|       |
   98|     10|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 10, False: 0]
  |  Branch (98:25): [True: 2, False: 8]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|      8|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 4, False: 4]
  ------------------
  103|      4|    return false;
  104|      4|  }
  105|  10.4k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.4k, False: 4]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.4k|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.4k|    out_values[i] = value;
  109|  10.4k|  }
  110|      4|  decoder.EndDecoding();
  111|      4|  return true;
  112|      8|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|     85|                              uint32_t *out_values) {
   93|     85|  SymbolDecoderT decoder;
   94|     85|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 53, False: 32]
  ------------------
   95|     53|    return false;
   96|     53|  }
   97|       |
   98|     32|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 32, False: 0]
  |  Branch (98:25): [True: 4, False: 28]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|     28|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 21, False: 7]
  ------------------
  103|     21|    return false;
  104|     21|  }
  105|  23.5k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 23.5k, False: 7]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  23.5k|    const uint32_t value = decoder.DecodeSymbol();
  108|  23.5k|    out_values[i] = value;
  109|  23.5k|  }
  110|      7|  decoder.EndDecoding();
  111|      7|  return true;
  112|     28|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    100|                              uint32_t *out_values) {
   93|    100|  SymbolDecoderT decoder;
   94|    100|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 62, False: 38]
  ------------------
   95|     62|    return false;
   96|     62|  }
   97|       |
   98|     38|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 38, False: 0]
  |  Branch (98:25): [True: 0, False: 38]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     38|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 5, False: 33]
  ------------------
  103|      5|    return false;
  104|      5|  }
  105|  74.8k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 74.8k, False: 33]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  74.8k|    const uint32_t value = decoder.DecodeSymbol();
  108|  74.8k|    out_values[i] = value;
  109|  74.8k|  }
  110|     33|  decoder.EndDecoding();
  111|     33|  return true;
  112|     38|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    123|                              uint32_t *out_values) {
   93|    123|  SymbolDecoderT decoder;
   94|    123|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 61, False: 62]
  ------------------
   95|     61|    return false;
   96|     61|  }
   97|       |
   98|     62|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 62, False: 0]
  |  Branch (98:25): [True: 0, False: 62]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     62|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 24, False: 38]
  ------------------
  103|     24|    return false;
  104|     24|  }
  105|   110k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 110k, False: 38]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   110k|    const uint32_t value = decoder.DecodeSymbol();
  108|   110k|    out_values[i] = value;
  109|   110k|  }
  110|     38|  decoder.EndDecoding();
  111|     38|  return true;
  112|     62|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|     76|                              uint32_t *out_values) {
   93|     76|  SymbolDecoderT decoder;
   94|     76|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 41, False: 35]
  ------------------
   95|     41|    return false;
   96|     41|  }
   97|       |
   98|     35|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 35, False: 0]
  |  Branch (98:25): [True: 0, False: 35]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     35|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 21, False: 14]
  ------------------
  103|     21|    return false;
  104|     21|  }
  105|  4.20M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.20M, False: 14]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.20M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.20M|    out_values[i] = value;
  109|  4.20M|  }
  110|     14|  decoder.EndDecoding();
  111|     14|  return true;
  112|     35|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|     60|                              uint32_t *out_values) {
   93|     60|  SymbolDecoderT decoder;
   94|     60|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 32, False: 28]
  ------------------
   95|     32|    return false;
   96|     32|  }
   97|       |
   98|     28|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 28, False: 0]
  |  Branch (98:25): [True: 0, False: 28]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     28|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 13, False: 15]
  ------------------
  103|     13|    return false;
  104|     13|  }
  105|  9.48M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.48M, False: 15]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.48M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.48M|    out_values[i] = value;
  109|  9.48M|  }
  110|     15|  decoder.EndDecoding();
  111|     15|  return true;
  112|     28|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    127|                              uint32_t *out_values) {
   93|    127|  SymbolDecoderT decoder;
   94|    127|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 60, False: 67]
  ------------------
   95|     60|    return false;
   96|     60|  }
   97|       |
   98|     67|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 67, False: 0]
  |  Branch (98:25): [True: 0, False: 67]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     67|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 25, False: 42]
  ------------------
  103|     25|    return false;
  104|     25|  }
  105|  3.29M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.29M, False: 42]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.29M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.29M|    out_values[i] = value;
  109|  3.29M|  }
  110|     42|  decoder.EndDecoding();
  111|     42|  return true;
  112|     67|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    132|                              uint32_t *out_values) {
   93|    132|  SymbolDecoderT decoder;
   94|    132|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 46, False: 86]
  ------------------
   95|     46|    return false;
   96|     46|  }
   97|       |
   98|     86|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 86, False: 0]
  |  Branch (98:25): [True: 0, False: 86]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     86|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 67, False: 19]
  ------------------
  103|     67|    return false;
  104|     67|  }
  105|  38.2k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 38.2k, False: 19]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  38.2k|    const uint32_t value = decoder.DecodeSymbol();
  108|  38.2k|    out_values[i] = value;
  109|  38.2k|  }
  110|     19|  decoder.EndDecoding();
  111|     19|  return true;
  112|     86|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  3.85k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  1.57k|  const CornerTable *GetCornerTable() const override {
   67|  1.57k|    return corner_table_.get();
   68|  1.57k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  2.46M|                       int *out_encoder_split_symbol_id) {
   87|  2.46M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 2.19M, False: 265k]
  ------------------
   88|  2.19M|      return false;
   89|  2.19M|    }
   90|   265k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 8, False: 265k]
  ------------------
   91|   265k|        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|      8|      *out_encoder_split_symbol_id = -1;
   98|      8|      return true;
   99|      8|    }
  100|   265k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 264k, False: 751]
  ------------------
  101|   264k|      return false;
  102|   264k|    }
  103|    751|    *out_face_edge =
  104|    751|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    751|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    751|    topology_split_data_.pop_back();
  108|    751|    return true;
  109|   265k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  10.5M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  10.5M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  10.5M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  10.5M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  6.64k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  2.84k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  2.24k|  const CornerTable *GetCornerTable() const override {
   67|  2.24k|    return corner_table_.get();
   68|  2.24k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  12.3M|                       int *out_encoder_split_symbol_id) {
   87|  12.3M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 12.1M, False: 260k]
  ------------------
   88|  12.1M|      return false;
   89|  12.1M|    }
   90|   260k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 27, False: 260k]
  ------------------
   91|   260k|        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|     27|      *out_encoder_split_symbol_id = -1;
   98|     27|      return true;
   99|     27|    }
  100|   260k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 259k, False: 1.05k]
  ------------------
  101|   259k|      return false;
  102|   259k|    }
  103|  1.05k|    *out_face_edge =
  104|  1.05k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.05k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.05k|    topology_split_data_.pop_back();
  108|  1.05k|    return true;
  109|   260k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  36.8M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  36.8M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  36.8M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  36.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  3.34k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  4.21k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|    965|  const CornerTable *GetCornerTable() const override {
   67|    965|    return corner_table_.get();
   68|    965|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  20.7M|                       int *out_encoder_split_symbol_id) {
   87|  20.7M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 20.4M, False: 320k]
  ------------------
   88|  20.4M|      return false;
   89|  20.4M|    }
   90|   320k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 18, False: 320k]
  ------------------
   91|   320k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     18|      *out_encoder_split_symbol_id = -1;
   98|     18|      return true;
   99|     18|    }
  100|   320k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 319k, False: 677]
  ------------------
  101|   319k|      return false;
  102|   319k|    }
  103|    677|    *out_face_edge =
  104|    677|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    677|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    677|    topology_split_data_.pop_back();
  108|    677|    return true;
  109|   320k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  24.8M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  24.8M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  24.8M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  24.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  1.34k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  3.23k|      : attribute_connectivity_decoders_(nullptr),
   34|  3.23k|        num_attribute_data_(0),
   35|  3.23k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  2.98k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  2.98k|    decoder_impl_ = decoder;
   38|  2.98k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  2.98k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  2.98k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  2.98k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  1.97k|  uint16_t BitstreamVersion() const {
   45|  1.97k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  1.97k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  1.28k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  2.98k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  2.23k|  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.23k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 16, False: 2.21k]
  ------------------
   63|     16|      return false;
   64|     16|    }
   65|       |
   66|  2.21k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 30, False: 2.18k]
  ------------------
   67|     30|      return false;
   68|     30|    }
   69|       |
   70|  2.18k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 10, False: 2.17k]
  ------------------
   71|     10|      return false;
   72|     10|    }
   73|  2.17k|    *out_buffer = buffer_;
   74|  2.17k|    return true;
   75|  2.18k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  2.53M|  inline bool DecodeStartFaceConfiguration() {
   79|  2.53M|    uint32_t face_configuration;
   80|  2.53M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  2.53M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.53M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 484, False: 2.53M]
  ------------------
   82|    484|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    484|    } else
   85|  2.53M|#endif
   86|  2.53M|    {
   87|  2.53M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  2.53M|    }
   89|  2.53M|    return face_configuration;
   90|  2.53M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  7.24M|  inline uint32_t DecodeSymbol() {
   94|  7.24M|    uint32_t symbol;
   95|  7.24M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  7.24M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 3.55M, False: 3.68M]
  ------------------
   97|  3.55M|      return symbol;
   98|  3.55M|    }
   99|       |    // Else decode two additional bits.
  100|  3.68M|    uint32_t symbol_suffix;
  101|  3.68M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  3.68M|    symbol |= (symbol_suffix << 1);
  103|  3.68M|    return symbol;
  104|  7.24M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  7.17M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  1.19M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  12.3M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  12.3M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  12.3M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  2.16k|  void Done() {
  123|  2.16k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 1.99k, False: 168]
  ------------------
  124|  1.99k|      symbol_buffer_.EndBitDecoding();
  125|  1.99k|    }
  126|  2.16k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  2.16k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.16k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 315, False: 1.85k]
  ------------------
  128|    315|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    315|    } else
  131|  1.85k|#endif
  132|  1.85k|    {
  133|  1.85k|      start_face_decoder_.EndDecoding();
  134|  1.85k|    }
  135|  2.16k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|    702|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  2.32k|  bool DecodeTraversalSymbols() {
  141|  2.32k|    uint64_t traversal_size;
  142|  2.32k|    symbol_buffer_ = buffer_;
  143|  2.32k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 2, False: 2.32k]
  ------------------
  144|      2|      return false;
  145|      2|    }
  146|  2.32k|    buffer_ = symbol_buffer_;
  147|  2.32k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 32, False: 2.29k]
  ------------------
  148|     32|      return false;
  149|     32|    }
  150|  2.29k|    buffer_.Advance(traversal_size);
  151|  2.29k|    return true;
  152|  2.32k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  2.94k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  2.94k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  2.94k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.94k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 433, False: 2.51k]
  ------------------
  158|    433|      start_face_buffer_ = buffer_;
  159|    433|      uint64_t traversal_size;
  160|    433|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 0, False: 433]
  ------------------
  161|      0|        return false;
  162|      0|      }
  163|    433|      buffer_ = start_face_buffer_;
  164|    433|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 48, False: 385]
  ------------------
  165|     48|        return false;
  166|     48|      }
  167|    385|      buffer_.Advance(traversal_size);
  168|    385|      return true;
  169|    433|    }
  170|  2.51k|#endif
  171|  2.51k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  2.94k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  2.89k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  2.89k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 2.23k, False: 658]
  ------------------
  177|  2.23k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  2.23k|          new BinaryDecoder[num_attribute_data_]);
  179|  8.19k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 5.96k, False: 2.22k]
  ------------------
  180|  5.96k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 12, False: 5.95k]
  ------------------
  181|     12|          return false;
  182|     12|        }
  183|  5.96k|      }
  184|  2.23k|    }
  185|  2.87k|    return true;
  186|  2.89k|  }

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    762|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_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: 1.56M, False: 86.7k]
  ------------------
   61|  1.56M|      return true;  // Already traversed.
   62|  1.56M|    }
   63|       |
   64|  86.7k|    corner_traversal_stack_.clear();
   65|  86.7k|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  86.7k|    const VertexIndex next_vert =
   69|  86.7k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  86.7k|    const VertexIndex prev_vert =
   71|  86.7k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  86.7k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 86.7k]
  |  Branch (72:45): [True: 0, False: 86.7k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  86.7k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 86.2k, False: 504]
  ------------------
   76|  86.2k|      this->MarkVertexVisited(next_vert);
   77|  86.2k|      this->traversal_observer().OnNewVertexVisited(
   78|  86.2k|          next_vert, this->corner_table()->Next(corner_id));
   79|  86.2k|    }
   80|  86.7k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.63k, False: 84.1k]
  ------------------
   81|  2.63k|      this->MarkVertexVisited(prev_vert);
   82|  2.63k|      this->traversal_observer().OnNewVertexVisited(
   83|  2.63k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.63k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|   185k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 98.8k, False: 86.7k]
  ------------------
   88|       |      // Currently processed corner.
   89|  98.8k|      corner_id = corner_traversal_stack_.back();
   90|  98.8k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  98.8k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 98.8k]
  |  Branch (92:47): [True: 559, False: 98.3k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    559|        corner_traversal_stack_.pop_back();
   95|    559|        continue;
   96|    559|      }
   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: 791k, False: 856k]
  ------------------
  105|   791k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   791k|          this->MarkVertexVisited(vert_id);
  107|   791k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   791k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 770k, False: 20.7k]
  ------------------
  109|   770k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   770k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   770k|            continue;
  112|   770k|          }
  113|   791k|        }
  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|   877k|        const CornerIndex right_corner_id =
  118|   877k|            this->corner_table()->GetRightCorner(corner_id);
  119|   877k|        const CornerIndex left_corner_id =
  120|   877k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   877k|        const FaceIndex right_face_id(
  122|   877k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 15.4k, False: 862k]
  ------------------
  123|   877k|                 ? kInvalidFaceIndex
  124|   877k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   877k|        const FaceIndex left_face_id(
  126|   877k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 91.0k, False: 786k]
  ------------------
  127|   877k|                 ? kInvalidFaceIndex
  128|   877k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   877k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 808k, False: 69.5k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   808k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 92.2k, False: 715k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  92.2k|            corner_traversal_stack_.pop_back();
  134|  92.2k|            break;  // Break from the while (true) loop.
  135|   715k|          } else {
  136|       |            // Go to the left face.
  137|   715k|            corner_id = left_corner_id;
  138|   715k|            face_id = left_face_id;
  139|   715k|          }
  140|   808k|        } else {
  141|       |          // Right face was not visited.
  142|  69.5k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 63.4k, False: 6.03k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  63.4k|            corner_id = right_corner_id;
  145|  63.4k|            face_id = right_face_id;
  146|  63.4k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  6.03k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  6.03k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  6.03k|            break;
  159|  6.03k|          }
  160|  69.5k|        }
  161|   877k|      }
  162|  98.3k|    }
  163|  86.7k|    return true;
  164|  86.7k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    762|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  1.56k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.01k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.41M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.41M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 883k, False: 1.53M]
  ------------------
   61|   883k|      return true;  // Already traversed.
   62|   883k|    }
   63|       |
   64|  1.53M|    corner_traversal_stack_.clear();
   65|  1.53M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  1.53M|    const VertexIndex next_vert =
   69|  1.53M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  1.53M|    const VertexIndex prev_vert =
   71|  1.53M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  1.53M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 1.53M]
  |  Branch (72:45): [True: 0, False: 1.53M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  1.53M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 1.53M, False: 800]
  ------------------
   76|  1.53M|      this->MarkVertexVisited(next_vert);
   77|  1.53M|      this->traversal_observer().OnNewVertexVisited(
   78|  1.53M|          next_vert, this->corner_table()->Next(corner_id));
   79|  1.53M|    }
   80|  1.53M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 1.48M, False: 47.2k]
  ------------------
   81|  1.48M|      this->MarkVertexVisited(prev_vert);
   82|  1.48M|      this->traversal_observer().OnNewVertexVisited(
   83|  1.48M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  1.48M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  3.11M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 1.58M, False: 1.53M]
  ------------------
   88|       |      // Currently processed corner.
   89|  1.58M|      corner_id = corner_traversal_stack_.back();
   90|  1.58M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  1.58M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 1.58M]
  |  Branch (92:47): [True: 3.42k, False: 1.57M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  3.42k|        corner_traversal_stack_.pop_back();
   95|  3.42k|        continue;
   96|  3.42k|      }
   97|  2.41M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.41M, Folded]
  ------------------
   98|  2.41M|        this->MarkFaceVisited(face_id);
   99|  2.41M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.41M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.41M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.41M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.41M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.94M, False: 471k]
  ------------------
  105|  1.94M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.94M|          this->MarkVertexVisited(vert_id);
  107|  1.94M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.94M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 416k, False: 1.52M]
  ------------------
  109|   416k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   416k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   416k|            continue;
  112|   416k|          }
  113|  1.94M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  2.00M|        const CornerIndex right_corner_id =
  118|  2.00M|            this->corner_table()->GetRightCorner(corner_id);
  119|  2.00M|        const CornerIndex left_corner_id =
  120|  2.00M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  2.00M|        const FaceIndex right_face_id(
  122|  2.00M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 1.50M, False: 490k]
  ------------------
  123|  2.00M|                 ? kInvalidFaceIndex
  124|  2.00M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  2.00M|        const FaceIndex left_face_id(
  126|  2.00M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 1.55M, False: 449k]
  ------------------
  127|  2.00M|                 ? kInvalidFaceIndex
  128|  2.00M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  2.00M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.92M, False: 76.9k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.92M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 1.55M, False: 369k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  1.55M|            corner_traversal_stack_.pop_back();
  134|  1.55M|            break;  // Break from the while (true) loop.
  135|  1.55M|          } else {
  136|       |            // Go to the left face.
  137|   369k|            corner_id = left_corner_id;
  138|   369k|            face_id = left_face_id;
  139|   369k|          }
  140|  1.92M|        } else {
  141|       |          // Right face was not visited.
  142|  76.9k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 52.2k, False: 24.7k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  52.2k|            corner_id = right_corner_id;
  145|  52.2k|            face_id = right_face_id;
  146|  52.2k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  24.7k|            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|  24.7k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  24.7k|            break;
  159|  24.7k|          }
  160|  76.9k|        }
  161|  2.00M|      }
  162|  1.57M|    }
  163|  1.53M|    return true;
  164|  1.53M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.01k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.06k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    199|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    479|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    479|    const auto *corner_table = traverser_.corner_table();
   50|    479|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    479|    const size_t num_faces = mesh_->num_faces();
   52|    479|    const size_t num_points = mesh_->num_points();
   53|  2.48M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 2.48M, False: 479]
  ------------------
   54|  2.48M|      const auto &face = mesh_->face(f);
   55|  9.92M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 7.44M, False: 2.48M]
  ------------------
   56|  7.44M|        const PointIndex point_id = face[p];
   57|  7.44M|        const VertexIndex vert_id =
   58|  7.44M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  7.44M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 7.44M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  7.44M|        const AttributeValueIndex att_entry_id(
   63|  7.44M|            encoding_data_
   64|  7.44M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  7.44M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 7.44M]
  |  Branch (65:13): [True: 0, False: 7.44M]
  |  Branch (65:39): [True: 0, False: 7.44M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  7.44M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  7.44M|      }
   71|  2.48M|    }
   72|    479|    return true;
   73|    479|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    195|  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|    195|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    195|    traverser_.OnTraversalStart();
   82|    195|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 195]
  ------------------
   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|    195|    } else {
   89|    195|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|   939k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 939k, False: 195]
  ------------------
   91|   939k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 939k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|   939k|      }
   95|    195|    }
   96|    195|    traverser_.OnTraversalEnd();
   97|    195|    return true;
   98|    195|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   939k|  bool ProcessCorner(CornerIndex corner_id) {
  102|   939k|    return traverser_.TraverseFromCorner(corner_id);
  103|   939k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    199|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    783|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.34k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  5.34k|    const auto *corner_table = traverser_.corner_table();
   50|  5.34k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.34k|    const size_t num_faces = mesh_->num_faces();
   52|  5.34k|    const size_t num_points = mesh_->num_points();
   53|  3.32M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 3.31M, False: 5.34k]
  ------------------
   54|  3.31M|      const auto &face = mesh_->face(f);
   55|  13.2M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 9.95M, False: 3.31M]
  ------------------
   56|  9.95M|        const PointIndex point_id = face[p];
   57|  9.95M|        const VertexIndex vert_id =
   58|  9.95M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  9.95M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 9.95M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  9.95M|        const AttributeValueIndex att_entry_id(
   63|  9.95M|            encoding_data_
   64|  9.95M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  9.95M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 9.95M]
  |  Branch (65:13): [True: 0, False: 9.95M]
  |  Branch (65:39): [True: 0, False: 9.95M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  9.95M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  9.95M|      }
   71|  3.31M|    }
   72|  5.34k|    return true;
   73|  5.34k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    762|  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|    762|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    762|    traverser_.OnTraversalStart();
   82|    762|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 762]
  ------------------
   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|    762|    } else {
   89|    762|      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: 762]
  ------------------
   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|    762|    }
   96|    762|    traverser_.OnTraversalEnd();
   97|    762|    return true;
   98|    762|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_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_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    783|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.03k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  4.13k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  4.13k|    const auto *corner_table = traverser_.corner_table();
   50|  4.13k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  4.13k|    const size_t num_faces = mesh_->num_faces();
   52|  4.13k|    const size_t num_points = mesh_->num_points();
   53|  4.35M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.34M, False: 4.13k]
  ------------------
   54|  4.34M|      const auto &face = mesh_->face(f);
   55|  17.3M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 13.0M, False: 4.34M]
  ------------------
   56|  13.0M|        const PointIndex point_id = face[p];
   57|  13.0M|        const VertexIndex vert_id =
   58|  13.0M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  13.0M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 13.0M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  13.0M|        const AttributeValueIndex att_entry_id(
   63|  13.0M|            encoding_data_
   64|  13.0M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  13.0M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 13.0M]
  |  Branch (65:13): [True: 0, False: 13.0M]
  |  Branch (65:39): [True: 0, False: 13.0M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  13.0M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  13.0M|      }
   71|  4.34M|    }
   72|  4.13k|    return true;
   73|  4.13k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.01k|  bool GenerateSequenceInternal() override {
   77|       |    // Preallocate memory for storing point indices. We expect the number of
   78|       |    // points to be the same as the number of corner table vertices.
   79|  1.01k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.01k|    traverser_.OnTraversalStart();
   82|  1.01k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.01k]
  ------------------
   83|      0|      for (uint32_t i = 0; i < corner_order_->size(); ++i) {
  ------------------
  |  Branch (83:28): [True: 0, False: 0]
  ------------------
   84|      0|        if (!ProcessCorner(corner_order_->at(i))) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          return false;
   86|      0|        }
   87|      0|      }
   88|  1.01k|    } else {
   89|  1.01k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.41M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.41M, False: 1.01k]
  ------------------
   91|  2.41M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.41M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.41M|      }
   95|  1.01k|    }
   96|  1.01k|    traverser_.OnTraversalEnd();
   97|  1.01k|    return true;
   98|  1.01k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.41M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.41M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.41M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.03k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  2.06k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  14.3M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  6.93M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  6.93M|    return is_vertex_visited_[vert_id.value()];
   65|  6.93M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  1.37M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  1.37M|    is_vertex_visited_[vert_id.value()] = true;
   68|  1.37M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  3.96M|  inline TraversalObserverT &traversal_observer() {
   75|  3.96M|    return traversal_observer_;
   76|  3.96M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  5.48M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  5.48M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 153k, False: 5.33M]
  ------------------
   47|   153k|      return true;  // Invalid faces are always considered as visited.
   48|   153k|    }
   49|  5.33M|    return is_face_visited_[face_id.value()];
   50|  5.48M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.58M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.58M|    is_face_visited_[face_id.value()] = true;
   62|  2.58M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  1.96k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  1.96k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    982|                    TraversalObserver traversal_observer) {
   37|    982|    corner_table_ = corner_table;
   38|    982|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    982|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    982|    traversal_observer_ = traversal_observer;
   41|    982|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_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_EEE12corner_tableEv:
   70|  17.9M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.41M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.41M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.41M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.41M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.41M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  5.48M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  5.48M|    return is_vertex_visited_[vert_id.value()];
   65|  5.48M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  4.96M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  4.96M|    is_vertex_visited_[vert_id.value()] = true;
   68|  4.96M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  7.37M|  inline TraversalObserverT &traversal_observer() {
   75|  7.37M|    return traversal_observer_;
   76|  7.37M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  5.58M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  5.58M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 3.06M, False: 2.52M]
  ------------------
   47|  3.06M|      return true;  // Invalid faces are always considered as visited.
   48|  3.06M|    }
   49|  2.52M|    return is_face_visited_[face_id.value()];
   50|  5.58M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.41M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.41M|    is_face_visited_[face_id.value()] = true;
   62|  2.41M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  2.06k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.03k|                    TraversalObserver traversal_observer) {
   37|  1.03k|    corner_table_ = corner_table;
   38|  1.03k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.03k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.03k|    traversal_observer_ = traversal_observer;
   41|  1.03k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    101|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    101|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 97]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|     97|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 91]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|     91|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 90]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     90|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 56, False: 34]
  ------------------
  196|     56|    return true;
  197|     56|  }
  198|     34|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 7, False: 27]
  ------------------
  199|      7|    return false;
  200|      7|  }
  201|     27|  num_decoded_points_ = 0;
  202|       |
  203|     27|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 24]
  ------------------
  204|      3|    return false;
  205|      3|  }
  206|     24|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 24]
  ------------------
  207|      0|    return false;
  208|      0|  }
  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: 0, False: 24]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     24|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 18, False: 6]
  ------------------
  217|     18|    return false;
  218|     18|  }
  219|       |
  220|      6|  numbers_decoder_.EndDecoding();
  221|      6|  remaining_bits_decoder_.EndDecoding();
  222|      6|  axis_decoder_.EndDecoding();
  223|      6|  half_decoder_.EndDecoding();
  224|       |
  225|      6|  return true;
  226|     24|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     24|    uint32_t num_points, OutputIteratorT &oit) {
  254|     24|  typedef DecodingStatus Status;
  255|     24|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     24|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     24|  DecodingStatus init_status(num_points, 0, 0);
  258|     24|  std::stack<Status> status_stack;
  259|     24|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  46.5k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 46.5k, False: 6]
  ------------------
  263|  46.5k|    const DecodingStatus status = status_stack.top();
  264|  46.5k|    status_stack.pop();
  265|       |
  266|  46.5k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  46.5k|    const uint32_t last_axis = status.last_axis;
  268|  46.5k|    const uint32_t stack_pos = status.stack_pos;
  269|  46.5k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  46.5k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  46.5k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 46.5k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  46.5k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  46.5k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 46.5k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  46.5k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  46.5k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 21.0k, False: 25.4k]
  ------------------
  285|  13.3M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 13.3M, False: 21.0k]
  ------------------
  286|  13.3M|        *oit = old_base;
  287|  13.3M|        ++oit;
  288|  13.3M|        ++num_decoded_points_;
  289|  13.3M|      }
  290|  21.0k|      continue;
  291|  21.0k|    }
  292|       |
  293|  25.4k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  25.4k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.94k, False: 23.5k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.94k|      axes_[0] = axis;
  300|  6.22k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 4.27k, False: 1.94k]
  ------------------
  301|  4.27k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  4.27k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.21k, False: 3.06k]
  |  |  ------------------
  ------------------
  302|  4.27k|      }
  303|  5.18k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.24k, False: 1.93k]
  ------------------
  304|  13.0k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 9.81k, False: 3.23k]
  ------------------
  305|  9.81k|          p_[axes_[j]] = 0;
  306|  9.81k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  9.81k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 9.05k, False: 758]
  ------------------
  308|  9.05k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 6, False: 9.04k]
  ------------------
  309|  9.05k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      6|              return false;
  311|      6|            }
  312|  9.05k|          }
  313|  9.80k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  9.80k|        }
  315|  3.23k|        *oit = p_;
  316|  3.23k|        ++oit;
  317|  3.23k|        ++num_decoded_points_;
  318|  3.23k|      }
  319|  1.93k|      continue;
  320|  1.94k|    }
  321|       |
  322|  23.5k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 23.5k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  23.5k|    const int num_remaining_bits = bit_length_ - level;
  327|  23.5k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  23.5k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  23.5k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  23.5k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  23.5k|    uint32_t number = 0;
  334|  23.5k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  23.5k|    uint32_t first_half = num_remaining_points / 2;
  337|  23.5k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 12, False: 23.4k]
  ------------------
  338|       |      // Invalid |number|.
  339|     12|      return false;
  340|     12|    }
  341|  23.4k|    first_half -= number;
  342|  23.4k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  23.4k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 8.27k, False: 15.2k]
  ------------------
  345|  8.27k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 6.13k, False: 2.14k]
  ------------------
  346|  6.13k|        std::swap(first_half, second_half);
  347|  6.13k|      }
  348|  8.27k|    }
  349|       |
  350|  23.4k|    levels_stack_[stack_pos][axis] += 1;
  351|  23.4k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  23.4k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 23.4k, False: 65]
  ------------------
  353|  23.4k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  23.4k|    }
  355|  23.4k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 23.3k, False: 167]
  ------------------
  356|  23.3k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  23.3k|    }
  358|  23.4k|  }
  359|      6|  return true;
  360|     24|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  1.96M|        : num_remaining_points(num_remaining_points_),
  135|  1.96M|          last_axis(last_axis_),
  136|  1.96M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|   984k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   984k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   984k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     55|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    154|      : bit_length_(0),
   87|    154|        num_points_(0),
   88|    154|        num_decoded_points_(0),
   89|    154|        dimension_(dimension),
   90|    154|        p_(dimension, 0),
   91|    154|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    154|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    154|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_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: 1, False: 34]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     34|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 4, False: 30]
  ------------------
  190|      4|    return false;
  191|      4|  }
  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: 1, False: 29]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     29|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 27]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|     27|  num_decoded_points_ = 0;
  202|       |
  203|     27|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 24]
  ------------------
  204|      3|    return false;
  205|      3|  }
  206|     24|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 21]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     21|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 20]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     20|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 19]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     19|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 14, False: 5]
  ------------------
  217|     14|    return false;
  218|     14|  }
  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|     19|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     19|    uint32_t num_points, OutputIteratorT &oit) {
  254|     19|  typedef DecodingStatus Status;
  255|     19|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     19|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     19|  DecodingStatus init_status(num_points, 0, 0);
  258|     19|  std::stack<Status> status_stack;
  259|     19|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.11M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.11M, False: 5]
  ------------------
  263|  1.11M|    const DecodingStatus status = status_stack.top();
  264|  1.11M|    status_stack.pop();
  265|       |
  266|  1.11M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.11M|    const uint32_t last_axis = status.last_axis;
  268|  1.11M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.11M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.11M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.11M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.11M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.11M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.11M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.11M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.11M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.11M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 553k, False: 556k]
  ------------------
  285|  11.8M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 11.3M, False: 553k]
  ------------------
  286|  11.3M|        *oit = old_base;
  287|  11.3M|        ++oit;
  288|  11.3M|        ++num_decoded_points_;
  289|  11.3M|      }
  290|   553k|      continue;
  291|   553k|    }
  292|       |
  293|   556k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   556k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.02k, False: 555k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.02k|      axes_[0] = axis;
  300|  7.56k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 6.53k, False: 1.02k]
  ------------------
  301|  6.53k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  6.53k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 259, False: 6.27k]
  |  |  ------------------
  ------------------
  302|  6.53k|      }
  303|  2.84k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.81k, False: 1.02k]
  ------------------
  304|  14.9k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 13.1k, False: 1.81k]
  ------------------
  305|  13.1k|          p_[axes_[j]] = 0;
  306|  13.1k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  13.1k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.64k, False: 9.46k]
  ------------------
  308|  3.64k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 3, False: 3.64k]
  ------------------
  309|  3.64k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      3|              return false;
  311|      3|            }
  312|  3.64k|          }
  313|  13.1k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  13.1k|        }
  315|  1.81k|        *oit = p_;
  316|  1.81k|        ++oit;
  317|  1.81k|        ++num_decoded_points_;
  318|  1.81k|      }
  319|  1.02k|      continue;
  320|  1.02k|    }
  321|       |
  322|   555k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 555k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   555k|    const int num_remaining_bits = bit_length_ - level;
  327|   555k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   555k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   555k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   555k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   555k|    uint32_t number = 0;
  334|   555k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   555k|    uint32_t first_half = num_remaining_points / 2;
  337|   555k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 11, False: 555k]
  ------------------
  338|       |      // Invalid |number|.
  339|     11|      return false;
  340|     11|    }
  341|   555k|    first_half -= number;
  342|   555k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   555k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 299k, False: 256k]
  ------------------
  345|   299k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 296k, False: 2.64k]
  ------------------
  346|   296k|        std::swap(first_half, second_half);
  347|   296k|      }
  348|   299k|    }
  349|       |
  350|   555k|    levels_stack_[stack_pos][axis] += 1;
  351|   555k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   555k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 555k, False: 28]
  ------------------
  353|   555k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   555k|    }
  355|   555k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 555k, False: 167]
  ------------------
  356|   555k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   555k|    }
  358|   555k|  }
  359|      5|  return true;
  360|     19|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  5.55M|        : num_remaining_points(num_remaining_points_),
  135|  5.55M|          last_axis(last_axis_),
  136|  5.55M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  5.55M|    uint32_t last_axis) {
  232|  5.55M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 5.55M, Folded]
  ------------------
  233|  5.55M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  5.55M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.33M, False: 3.21M]
  |  |  ------------------
  ------------------
  234|  5.55M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  5.55M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  2.77M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.77M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.77M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|      1|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     42|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     42|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 42]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     42|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 4, False: 38]
  ------------------
  190|      4|    return false;
  191|      4|  }
  192|     38|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 38]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     38|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 8, False: 30]
  ------------------
  196|      8|    return true;
  197|      8|  }
  198|     30|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 5, False: 25]
  ------------------
  199|      5|    return false;
  200|      5|  }
  201|     25|  num_decoded_points_ = 0;
  202|       |
  203|     25|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 22]
  ------------------
  204|      3|    return false;
  205|      3|  }
  206|     22|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 19]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     19|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 17]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     17|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 15]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     15|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 15, False: 0]
  ------------------
  217|     15|    return false;
  218|     15|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     15|    uint32_t num_points, OutputIteratorT &oit) {
  254|     15|  typedef DecodingStatus Status;
  255|     15|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     15|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     15|  DecodingStatus init_status(num_points, 0, 0);
  258|     15|  std::stack<Status> status_stack;
  259|     15|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  23.7k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 23.7k, False: 0]
  ------------------
  263|  23.7k|    const DecodingStatus status = status_stack.top();
  264|  23.7k|    status_stack.pop();
  265|       |
  266|  23.7k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  23.7k|    const uint32_t last_axis = status.last_axis;
  268|  23.7k|    const uint32_t stack_pos = status.stack_pos;
  269|  23.7k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  23.7k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  23.7k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 23.7k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  23.7k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  23.7k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 23.7k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  23.7k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  23.7k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.27k, False: 22.4k]
  ------------------
  285|  5.74k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 4.47k, False: 1.27k]
  ------------------
  286|  4.47k|        *oit = old_base;
  287|  4.47k|        ++oit;
  288|  4.47k|        ++num_decoded_points_;
  289|  4.47k|      }
  290|  1.27k|      continue;
  291|  1.27k|    }
  292|       |
  293|  22.4k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  22.4k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 98, False: 22.3k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     98|      axes_[0] = axis;
  300|    536|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 438, False: 98]
  ------------------
  301|    438|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    438|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 22, False: 416]
  |  |  ------------------
  ------------------
  302|    438|      }
  303|    260|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 168, False: 92]
  ------------------
  304|    710|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 548, False: 162]
  ------------------
  305|    548|          p_[axes_[j]] = 0;
  306|    548|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|    548|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 519, False: 29]
  ------------------
  308|    519|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 6, False: 513]
  ------------------
  309|    519|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      6|              return false;
  311|      6|            }
  312|    519|          }
  313|    542|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|    542|        }
  315|    162|        *oit = p_;
  316|    162|        ++oit;
  317|    162|        ++num_decoded_points_;
  318|    162|      }
  319|     92|      continue;
  320|     98|    }
  321|       |
  322|  22.3k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 22.3k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  22.3k|    const int num_remaining_bits = bit_length_ - level;
  327|  22.3k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  22.3k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  22.3k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  22.3k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  22.3k|    uint32_t number = 0;
  334|  22.3k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  22.3k|    uint32_t first_half = num_remaining_points / 2;
  337|  22.3k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 9, False: 22.3k]
  ------------------
  338|       |      // Invalid |number|.
  339|      9|      return false;
  340|      9|    }
  341|  22.3k|    first_half -= number;
  342|  22.3k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  22.3k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 21.5k, False: 757]
  ------------------
  345|  21.5k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 19.1k, False: 2.44k]
  ------------------
  346|  19.1k|        std::swap(first_half, second_half);
  347|  19.1k|      }
  348|  21.5k|    }
  349|       |
  350|  22.3k|    levels_stack_[stack_pos][axis] += 1;
  351|  22.3k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  22.3k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 19.9k, False: 2.36k]
  ------------------
  353|  19.9k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  19.9k|    }
  355|  22.3k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 3.86k, False: 18.4k]
  ------------------
  356|  3.86k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  3.86k|    }
  358|  22.3k|  }
  359|      0|  return true;
  360|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  66.0k|        : num_remaining_points(num_remaining_points_),
  135|  66.0k|          last_axis(last_axis_),
  136|  66.0k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  43.5k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  43.5k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  43.5k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|      8|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    103|      : bit_length_(0),
   87|    103|        num_points_(0),
   88|    103|        num_decoded_points_(0),
   89|    103|        dimension_(dimension),
   90|    103|        p_(dimension, 0),
   91|    103|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    103|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    103|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_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: 0, False: 36]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     36|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 28]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|     28|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 28]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     28|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 10, False: 18]
  ------------------
  196|     10|    return true;
  197|     10|  }
  198|     18|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 1, False: 17]
  ------------------
  199|      1|    return false;
  200|      1|  }
  201|     17|  num_decoded_points_ = 0;
  202|       |
  203|     17|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 16]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|     16|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 15]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     15|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 15]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     15|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 15]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     15|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 15, False: 0]
  ------------------
  217|     15|    return false;
  218|     15|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     15|    uint32_t num_points, OutputIteratorT &oit) {
  254|     15|  typedef DecodingStatus Status;
  255|     15|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     15|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     15|  DecodingStatus init_status(num_points, 0, 0);
  258|     15|  std::stack<Status> status_stack;
  259|     15|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  19.1k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 19.1k, False: 0]
  ------------------
  263|  19.1k|    const DecodingStatus status = status_stack.top();
  264|  19.1k|    status_stack.pop();
  265|       |
  266|  19.1k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  19.1k|    const uint32_t last_axis = status.last_axis;
  268|  19.1k|    const uint32_t stack_pos = status.stack_pos;
  269|  19.1k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  19.1k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  19.1k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 19.1k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  19.1k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  19.1k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 19.1k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  19.1k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  19.1k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 11, False: 19.0k]
  ------------------
  285|  4.10k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 4.09k, False: 11]
  ------------------
  286|  4.09k|        *oit = old_base;
  287|  4.09k|        ++oit;
  288|  4.09k|        ++num_decoded_points_;
  289|  4.09k|      }
  290|     11|      continue;
  291|     11|    }
  292|       |
  293|  19.0k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  19.0k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.13k, False: 17.9k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.13k|      axes_[0] = axis;
  300|  2.33k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.20k, False: 1.13k]
  ------------------
  301|  1.20k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.20k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 600, False: 602]
  |  |  ------------------
  ------------------
  302|  1.20k|      }
  303|  2.95k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.81k, False: 1.13k]
  ------------------
  304|  5.55k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.73k, False: 1.81k]
  ------------------
  305|  3.73k|          p_[axes_[j]] = 0;
  306|  3.73k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.73k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.70k, False: 33]
  ------------------
  308|  3.70k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 1, False: 3.70k]
  ------------------
  309|  3.70k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      1|              return false;
  311|      1|            }
  312|  3.70k|          }
  313|  3.73k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  3.73k|        }
  315|  1.81k|        *oit = p_;
  316|  1.81k|        ++oit;
  317|  1.81k|        ++num_decoded_points_;
  318|  1.81k|      }
  319|  1.13k|      continue;
  320|  1.13k|    }
  321|       |
  322|  17.9k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 17.9k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  17.9k|    const int num_remaining_bits = bit_length_ - level;
  327|  17.9k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  17.9k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  17.9k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  17.9k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  17.9k|    uint32_t number = 0;
  334|  17.9k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  17.9k|    uint32_t first_half = num_remaining_points / 2;
  337|  17.9k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 14, False: 17.9k]
  ------------------
  338|       |      // Invalid |number|.
  339|     14|      return false;
  340|     14|    }
  341|  17.9k|    first_half -= number;
  342|  17.9k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  17.9k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 17.5k, False: 401]
  ------------------
  345|  17.5k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 15.5k, False: 1.98k]
  ------------------
  346|  15.5k|        std::swap(first_half, second_half);
  347|  15.5k|      }
  348|  17.5k|    }
  349|       |
  350|  17.9k|    levels_stack_[stack_pos][axis] += 1;
  351|  17.9k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  17.9k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 16.0k, False: 1.93k]
  ------------------
  353|  16.0k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  16.0k|    }
  355|  17.9k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 3.26k, False: 14.6k]
  ------------------
  356|  3.26k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  3.26k|    }
  358|  17.9k|  }
  359|      0|  return true;
  360|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|   119k|        : num_remaining_points(num_remaining_points_),
  135|   119k|          last_axis(last_axis_),
  136|   119k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   118k|    uint32_t last_axis) {
  232|   118k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 118k, Folded]
  ------------------
  233|   118k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|   118k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 30.4k, False: 87.9k]
  |  |  ------------------
  ------------------
  234|   118k|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|   118k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  68.3k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  68.3k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  68.3k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|     10|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    135|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    135|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 135]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    135|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 5, False: 130]
  ------------------
  190|      5|    return false;
  191|      5|  }
  192|    130|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 130]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    130|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 24, False: 106]
  ------------------
  196|     24|    return true;
  197|     24|  }
  198|    106|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 8, False: 98]
  ------------------
  199|      8|    return false;
  200|      8|  }
  201|     98|  num_decoded_points_ = 0;
  202|       |
  203|     98|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 95]
  ------------------
  204|      3|    return false;
  205|      3|  }
  206|     95|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 94]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     94|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 91]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     91|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 90]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     90|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 59, False: 31]
  ------------------
  217|     59|    return false;
  218|     59|  }
  219|       |
  220|     31|  numbers_decoder_.EndDecoding();
  221|     31|  remaining_bits_decoder_.EndDecoding();
  222|     31|  axis_decoder_.EndDecoding();
  223|     31|  half_decoder_.EndDecoding();
  224|       |
  225|     31|  return true;
  226|     90|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     90|    uint32_t num_points, OutputIteratorT &oit) {
  254|     90|  typedef DecodingStatus Status;
  255|     90|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     90|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     90|  DecodingStatus init_status(num_points, 0, 0);
  258|     90|  std::stack<Status> status_stack;
  259|     90|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.33M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.33M, False: 31]
  ------------------
  263|  3.33M|    const DecodingStatus status = status_stack.top();
  264|  3.33M|    status_stack.pop();
  265|       |
  266|  3.33M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.33M|    const uint32_t last_axis = status.last_axis;
  268|  3.33M|    const uint32_t stack_pos = status.stack_pos;
  269|  3.33M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.33M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.33M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.33M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.33M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.33M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.33M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.33M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.33M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.57M, False: 1.76M]
  ------------------
  285|  76.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 74.7M, False: 1.57M]
  ------------------
  286|  74.7M|        *oit = old_base;
  287|  74.7M|        ++oit;
  288|  74.7M|        ++num_decoded_points_;
  289|  74.7M|      }
  290|  1.57M|      continue;
  291|  1.57M|    }
  292|       |
  293|  1.76M|    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.76M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 81.1k, False: 1.67M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  81.1k|      axes_[0] = axis;
  300|   130k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 49.8k, False: 81.1k]
  ------------------
  301|  49.8k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  49.8k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 18.1k, False: 31.7k]
  |  |  ------------------
  ------------------
  302|  49.8k|      }
  303|   205k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 124k, False: 81.1k]
  ------------------
  304|   316k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 192k, False: 124k]
  ------------------
  305|   192k|          p_[axes_[j]] = 0;
  306|   192k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   192k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 170k, False: 21.8k]
  ------------------
  308|   170k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 48, False: 170k]
  ------------------
  309|   170k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     48|              return false;
  311|     48|            }
  312|   170k|          }
  313|   192k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   192k|        }
  315|   124k|        *oit = p_;
  316|   124k|        ++oit;
  317|   124k|        ++num_decoded_points_;
  318|   124k|      }
  319|  81.1k|      continue;
  320|  81.1k|    }
  321|       |
  322|  1.67M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.67M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.67M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.67M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.67M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.67M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.67M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.67M|    uint32_t number = 0;
  334|  1.67M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.67M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.67M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 11, False: 1.67M]
  ------------------
  338|       |      // Invalid |number|.
  339|     11|      return false;
  340|     11|    }
  341|  1.67M|    first_half -= number;
  342|  1.67M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.67M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.62M, False: 51.6k]
  ------------------
  345|  1.62M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.59M, False: 30.5k]
  ------------------
  346|  1.59M|        std::swap(first_half, second_half);
  347|  1.59M|      }
  348|  1.62M|    }
  349|       |
  350|  1.67M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.67M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.67M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.66M, False: 11.1k]
  ------------------
  353|  1.66M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.66M|    }
  355|  1.67M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.66M, False: 16.5k]
  ------------------
  356|  1.66M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.66M|    }
  358|  1.67M|  }
  359|     31|  return true;
  360|     90|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  3.33M|        : num_remaining_points(num_remaining_points_),
  135|  3.33M|          last_axis(last_axis_),
  136|  3.33M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  1.67M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.67M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.67M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     55|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    160|      : bit_length_(0),
   87|    160|        num_points_(0),
   88|    160|        num_decoded_points_(0),
   89|    160|        dimension_(dimension),
   90|    160|        p_(dimension, 0),
   91|    160|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    160|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    160|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    143|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    143|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 143]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    143|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 141]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|    141|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 141]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    141|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 3, False: 138]
  ------------------
  196|      3|    return true;
  197|      3|  }
  198|    138|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 6, False: 132]
  ------------------
  199|      6|    return false;
  200|      6|  }
  201|    132|  num_decoded_points_ = 0;
  202|       |
  203|    132|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 18, False: 114]
  ------------------
  204|     18|    return false;
  205|     18|  }
  206|    114|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 110]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|    110|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 107]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|    107|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 4, False: 103]
  ------------------
  213|      4|    return false;
  214|      4|  }
  215|       |
  216|    103|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 57, False: 46]
  ------------------
  217|     57|    return false;
  218|     57|  }
  219|       |
  220|     46|  numbers_decoder_.EndDecoding();
  221|     46|  remaining_bits_decoder_.EndDecoding();
  222|     46|  axis_decoder_.EndDecoding();
  223|     46|  half_decoder_.EndDecoding();
  224|       |
  225|     46|  return true;
  226|    103|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|    103|    uint32_t num_points, OutputIteratorT &oit) {
  254|    103|  typedef DecodingStatus Status;
  255|    103|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|    103|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|    103|  DecodingStatus init_status(num_points, 0, 0);
  258|    103|  std::stack<Status> status_stack;
  259|    103|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.43M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.43M, False: 46]
  ------------------
  263|  2.43M|    const DecodingStatus status = status_stack.top();
  264|  2.43M|    status_stack.pop();
  265|       |
  266|  2.43M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.43M|    const uint32_t last_axis = status.last_axis;
  268|  2.43M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.43M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.43M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.43M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.43M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.43M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.43M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.43M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.43M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.43M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.11M, False: 1.31M]
  ------------------
  285|   117M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 116M, False: 1.11M]
  ------------------
  286|   116M|        *oit = old_base;
  287|   116M|        ++oit;
  288|   116M|        ++num_decoded_points_;
  289|   116M|      }
  290|  1.11M|      continue;
  291|  1.11M|    }
  292|       |
  293|  1.31M|    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.31M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 77.5k, False: 1.23M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  77.5k|      axes_[0] = axis;
  300|   264k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 187k, False: 77.5k]
  ------------------
  301|   187k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   187k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 25.2k, False: 161k]
  |  |  ------------------
  ------------------
  302|   187k|      }
  303|   190k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 113k, False: 77.4k]
  ------------------
  304|   529k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 416k, False: 113k]
  ------------------
  305|   416k|          p_[axes_[j]] = 0;
  306|   416k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   416k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 181k, False: 235k]
  ------------------
  308|   181k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 55, False: 181k]
  ------------------
  309|   181k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     55|              return false;
  311|     55|            }
  312|   181k|          }
  313|   416k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   416k|        }
  315|   113k|        *oit = p_;
  316|   113k|        ++oit;
  317|   113k|        ++num_decoded_points_;
  318|   113k|      }
  319|  77.4k|      continue;
  320|  77.5k|    }
  321|       |
  322|  1.23M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.23M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.23M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.23M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.23M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.23M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.23M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.23M|    uint32_t number = 0;
  334|  1.23M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.23M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.23M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 2, False: 1.23M]
  ------------------
  338|       |      // Invalid |number|.
  339|      2|      return false;
  340|      2|    }
  341|  1.23M|    first_half -= number;
  342|  1.23M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.23M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.20M, False: 30.2k]
  ------------------
  345|  1.20M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.15M, False: 50.0k]
  ------------------
  346|  1.15M|        std::swap(first_half, second_half);
  347|  1.15M|      }
  348|  1.20M|    }
  349|       |
  350|  1.23M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.23M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.23M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.22M, False: 16.5k]
  ------------------
  353|  1.22M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.22M|    }
  355|  1.23M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.21M, False: 25.8k]
  ------------------
  356|  1.21M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.21M|    }
  358|  1.23M|  }
  359|     46|  return true;
  360|    103|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  2.43M|        : num_remaining_points(num_remaining_points_),
  135|  2.43M|          last_axis(last_axis_),
  136|  2.43M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.43M|    uint32_t last_axis) {
  232|  2.43M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.43M, Folded]
  ------------------
  233|  2.43M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.43M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 865k, False: 1.56M]
  |  |  ------------------
  ------------------
  234|  2.43M|  }
  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.43M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.23M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.23M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.23M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     49|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    105|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    105|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 105]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    105|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 103]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|    103|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 103]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    103|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 8, False: 95]
  ------------------
  196|      8|    return true;
  197|      8|  }
  198|     95|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 4, False: 91]
  ------------------
  199|      4|    return false;
  200|      4|  }
  201|     91|  num_decoded_points_ = 0;
  202|       |
  203|     91|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 86]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     86|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 84]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     84|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 82]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     82|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 81]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     81|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 64, False: 17]
  ------------------
  217|     64|    return false;
  218|     64|  }
  219|       |
  220|     17|  numbers_decoder_.EndDecoding();
  221|     17|  remaining_bits_decoder_.EndDecoding();
  222|     17|  axis_decoder_.EndDecoding();
  223|     17|  half_decoder_.EndDecoding();
  224|       |
  225|     17|  return true;
  226|     81|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     81|    uint32_t num_points, OutputIteratorT &oit) {
  254|     81|  typedef DecodingStatus Status;
  255|     81|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     81|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     81|  DecodingStatus init_status(num_points, 0, 0);
  258|     81|  std::stack<Status> status_stack;
  259|     81|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   176k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 176k, False: 17]
  ------------------
  263|   176k|    const DecodingStatus status = status_stack.top();
  264|   176k|    status_stack.pop();
  265|       |
  266|   176k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   176k|    const uint32_t last_axis = status.last_axis;
  268|   176k|    const uint32_t stack_pos = status.stack_pos;
  269|   176k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   176k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   176k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 176k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   176k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   176k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 4, False: 176k]
  ------------------
  278|      4|      return false;
  279|      4|    }
  280|       |
  281|   176k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   176k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 498, False: 176k]
  ------------------
  285|  71.0k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 70.5k, False: 498]
  ------------------
  286|  70.5k|        *oit = old_base;
  287|  70.5k|        ++oit;
  288|  70.5k|        ++num_decoded_points_;
  289|  70.5k|      }
  290|    498|      continue;
  291|    498|    }
  292|       |
  293|   176k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   176k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 635, False: 175k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    635|      axes_[0] = axis;
  300|  44.8k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 44.1k, False: 635]
  ------------------
  301|  44.1k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  44.1k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 619, False: 43.5k]
  |  |  ------------------
  ------------------
  302|  44.1k|      }
  303|  1.44k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 846, False: 598]
  ------------------
  304|  57.5k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 56.7k, False: 809]
  ------------------
  305|  56.7k|          p_[axes_[j]] = 0;
  306|  56.7k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  56.7k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 56.5k, False: 231]
  ------------------
  308|  56.5k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 37, False: 56.5k]
  ------------------
  309|  56.5k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     37|              return false;
  311|     37|            }
  312|  56.5k|          }
  313|  56.7k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  56.7k|        }
  315|    809|        *oit = p_;
  316|    809|        ++oit;
  317|    809|        ++num_decoded_points_;
  318|    809|      }
  319|    598|      continue;
  320|    635|    }
  321|       |
  322|   175k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 175k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   175k|    const int num_remaining_bits = bit_length_ - level;
  327|   175k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   175k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   175k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   175k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   175k|    uint32_t number = 0;
  334|   175k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   175k|    uint32_t first_half = num_remaining_points / 2;
  337|   175k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 23, False: 175k]
  ------------------
  338|       |      // Invalid |number|.
  339|     23|      return false;
  340|     23|    }
  341|   175k|    first_half -= number;
  342|   175k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   175k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 175k, False: 75]
  ------------------
  345|   175k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 130k, False: 44.8k]
  ------------------
  346|   130k|        std::swap(first_half, second_half);
  347|   130k|      }
  348|   175k|    }
  349|       |
  350|   175k|    levels_stack_[stack_pos][axis] += 1;
  351|   175k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   175k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 131k, False: 44.3k]
  ------------------
  353|   131k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   131k|    }
  355|   175k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 45.6k, False: 129k]
  ------------------
  356|  45.6k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  45.6k|    }
  358|   175k|  }
  359|     17|  return true;
  360|     81|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   176k|        : num_remaining_points(num_remaining_points_),
  135|   176k|          last_axis(last_axis_),
  136|   176k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   175k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   175k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   175k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     25|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    107|      : bit_length_(0),
   87|    107|        num_points_(0),
   88|    107|        num_decoded_points_(0),
   89|    107|        dimension_(dimension),
   90|    107|        p_(dimension, 0),
   91|    107|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    107|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    107|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     27|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     27|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     27|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|     79|      : bit_length_(0),
   87|     79|        num_points_(0),
   88|     79|        num_decoded_points_(0),
   89|     79|        dimension_(dimension),
   90|     79|        p_(dimension, 0),
   91|     79|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     79|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     79|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     27|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     27|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     27|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      7|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      7|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      7|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    118|      : bit_length_(0),
   87|    118|        num_points_(0),
   88|    118|        num_decoded_points_(0),
   89|    118|        dimension_(dimension),
   90|    118|        p_(dimension, 0),
   91|    118|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    118|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    118|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     10|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     10|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     10|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    148|      : bit_length_(0),
   87|    148|        num_points_(0),
   88|    148|        num_decoded_points_(0),
   89|    148|        dimension_(dimension),
   90|    148|        p_(dimension, 0),
   91|    148|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    148|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    148|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.96M|    uint32_t last_axis) {
  232|  1.96M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.96M, Folded]
  ------------------
  233|  1.96M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.96M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 562k, False: 1.40M]
  |  |  ------------------
  ------------------
  234|  1.96M|  }
  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.96M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  65.0k|    uint32_t last_axis) {
  232|  65.0k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 65.0k, Folded]
  ------------------
  233|  65.0k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  65.0k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 13.2k, False: 51.7k]
  |  |  ------------------
  ------------------
  234|  65.0k|  }
  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|  65.0k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  3.33M|    uint32_t last_axis) {
  232|  3.33M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 3.33M, Folded]
  ------------------
  233|  3.33M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.33M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.19M, False: 131k]
  |  |  ------------------
  ------------------
  234|  3.33M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  3.33M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   176k|    uint32_t last_axis) {
  232|   176k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 176k]
  ------------------
  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|   176k|  uint32_t best_axis = 0;
  237|   176k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 176k, False: 603]
  ------------------
  238|  19.4M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 19.3M, False: 176k]
  ------------------
  239|  19.3M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 207k, False: 19.1M]
  ------------------
  240|   207k|        best_axis = axis;
  241|   207k|      }
  242|  19.3M|    }
  243|   176k|  } else {
  244|    603|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|    603|  }
  246|       |
  247|   176k|  return best_axis;
  248|   176k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_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: 1, False: 52]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     52|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 52]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     52|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 52]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     52|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 52]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     52|  num_decoded_points_ = 0;
  202|       |
  203|     52|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 50]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     50|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 47]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     47|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 46]
  ------------------
  210|      1|    return false;
  211|      1|  }
  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: 30, False: 16]
  ------------------
  217|     30|    return false;
  218|     30|  }
  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|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     46|    uint32_t num_points, OutputIteratorT &oit) {
  254|     46|  typedef DecodingStatus Status;
  255|     46|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     46|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     46|  DecodingStatus init_status(num_points, 0, 0);
  258|     46|  std::stack<Status> status_stack;
  259|     46|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.92M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.92M, False: 16]
  ------------------
  263|  1.92M|    const DecodingStatus status = status_stack.top();
  264|  1.92M|    status_stack.pop();
  265|       |
  266|  1.92M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.92M|    const uint32_t last_axis = status.last_axis;
  268|  1.92M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.92M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.92M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.92M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.92M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.92M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.92M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.92M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.92M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.92M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 959k, False: 962k]
  ------------------
  285|   180M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 179M, False: 959k]
  ------------------
  286|   179M|        *oit = old_base;
  287|   179M|        ++oit;
  288|   179M|        ++num_decoded_points_;
  289|   179M|      }
  290|   959k|      continue;
  291|   959k|    }
  292|       |
  293|   962k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   962k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.29k, False: 961k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.29k|      axes_[0] = axis;
  300|  3.88k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.59k, False: 1.29k]
  ------------------
  301|  2.59k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.59k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 285, False: 2.30k]
  |  |  ------------------
  ------------------
  302|  2.59k|      }
  303|  3.59k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.31k, False: 1.28k]
  ------------------
  304|  9.20k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.90k, False: 2.29k]
  ------------------
  305|  6.90k|          p_[axes_[j]] = 0;
  306|  6.90k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.90k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.20k, False: 3.70k]
  ------------------
  308|  3.20k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 16, False: 3.18k]
  ------------------
  309|  3.20k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     16|              return false;
  311|     16|            }
  312|  3.20k|          }
  313|  6.89k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.89k|        }
  315|  2.29k|        *oit = p_;
  316|  2.29k|        ++oit;
  317|  2.29k|        ++num_decoded_points_;
  318|  2.29k|      }
  319|  1.28k|      continue;
  320|  1.29k|    }
  321|       |
  322|   961k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 961k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   961k|    const int num_remaining_bits = bit_length_ - level;
  327|   961k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   961k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   961k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   961k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   961k|    uint32_t number = 0;
  334|   961k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   961k|    uint32_t first_half = num_remaining_points / 2;
  337|   961k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 14, False: 961k]
  ------------------
  338|       |      // Invalid |number|.
  339|     14|      return false;
  340|     14|    }
  341|   961k|    first_half -= number;
  342|   961k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   961k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 459k, False: 502k]
  ------------------
  345|   459k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 419k, False: 39.4k]
  ------------------
  346|   419k|        std::swap(first_half, second_half);
  347|   419k|      }
  348|   459k|    }
  349|       |
  350|   961k|    levels_stack_[stack_pos][axis] += 1;
  351|   961k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   961k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 961k, False: 71]
  ------------------
  353|   961k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   961k|    }
  355|   961k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 961k, False: 139]
  ------------------
  356|   961k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   961k|    }
  358|   961k|  }
  359|     16|  return true;
  360|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     44|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     44|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     44|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     44|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     44|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 44]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     44|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 41]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     41|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 41]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     41|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 41]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     41|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 41]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     41|  num_decoded_points_ = 0;
  202|       |
  203|     41|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 37]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|     37|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 35]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     35|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 34]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     34|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 34]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     34|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 23, False: 11]
  ------------------
  217|     23|    return false;
  218|     23|  }
  219|       |
  220|     11|  numbers_decoder_.EndDecoding();
  221|     11|  remaining_bits_decoder_.EndDecoding();
  222|     11|  axis_decoder_.EndDecoding();
  223|     11|  half_decoder_.EndDecoding();
  224|       |
  225|     11|  return true;
  226|     34|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     34|    uint32_t num_points, OutputIteratorT &oit) {
  254|     34|  typedef DecodingStatus Status;
  255|     34|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     34|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     34|  DecodingStatus init_status(num_points, 0, 0);
  258|     34|  std::stack<Status> status_stack;
  259|     34|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  4.44M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.44M, False: 11]
  ------------------
  263|  4.44M|    const DecodingStatus status = status_stack.top();
  264|  4.44M|    status_stack.pop();
  265|       |
  266|  4.44M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.44M|    const uint32_t last_axis = status.last_axis;
  268|  4.44M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.44M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.44M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.44M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.44M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.44M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.44M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.44M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.44M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.44M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.21M, False: 2.22M]
  ------------------
  285|  30.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 28.5M, False: 2.21M]
  ------------------
  286|  28.5M|        *oit = old_base;
  287|  28.5M|        ++oit;
  288|  28.5M|        ++num_decoded_points_;
  289|  28.5M|      }
  290|  2.21M|      continue;
  291|  2.21M|    }
  292|       |
  293|  2.22M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  2.22M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.51k, False: 2.22M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.51k|      axes_[0] = axis;
  300|  4.55k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 3.03k, False: 1.51k]
  ------------------
  301|  3.03k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  3.03k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 339, False: 2.69k]
  |  |  ------------------
  ------------------
  302|  3.03k|      }
  303|  4.21k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.71k, False: 1.50k]
  ------------------
  304|  10.8k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 8.11k, False: 2.69k]
  ------------------
  305|  8.11k|          p_[axes_[j]] = 0;
  306|  8.11k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  8.11k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.71k, False: 4.39k]
  ------------------
  308|  3.71k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 17, False: 3.69k]
  ------------------
  309|  3.71k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     17|              return false;
  311|     17|            }
  312|  3.71k|          }
  313|  8.09k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  8.09k|        }
  315|  2.69k|        *oit = p_;
  316|  2.69k|        ++oit;
  317|  2.69k|        ++num_decoded_points_;
  318|  2.69k|      }
  319|  1.50k|      continue;
  320|  1.51k|    }
  321|       |
  322|  2.22M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.22M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.22M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.22M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.22M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.22M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.22M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.22M|    uint32_t number = 0;
  334|  2.22M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.22M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.22M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 6, False: 2.22M]
  ------------------
  338|       |      // Invalid |number|.
  339|      6|      return false;
  340|      6|    }
  341|  2.22M|    first_half -= number;
  342|  2.22M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.22M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.29M, False: 929k]
  ------------------
  345|  1.29M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.29M, False: 2.23k]
  ------------------
  346|  1.29M|        std::swap(first_half, second_half);
  347|  1.29M|      }
  348|  1.29M|    }
  349|       |
  350|  2.22M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.22M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.22M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.22M, False: 79]
  ------------------
  353|  2.22M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.22M|    }
  355|  2.22M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.22M, False: 66]
  ------------------
  356|  2.22M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.22M|    }
  358|  2.22M|  }
  359|     11|  return true;
  360|     34|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     61|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     61|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     61|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     61|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     61|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 61]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     61|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 61]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     61|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 61]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     61|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 61]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     61|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 61]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     61|  num_decoded_points_ = 0;
  202|       |
  203|     61|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 7, False: 54]
  ------------------
  204|      7|    return false;
  205|      7|  }
  206|     54|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 54]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     54|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 54]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     54|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 53]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     53|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 49, False: 4]
  ------------------
  217|     49|    return false;
  218|     49|  }
  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|     53|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     53|    uint32_t num_points, OutputIteratorT &oit) {
  254|     53|  typedef DecodingStatus Status;
  255|     53|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     53|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     53|  DecodingStatus init_status(num_points, 0, 0);
  258|     53|  std::stack<Status> status_stack;
  259|     53|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  41.3k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 41.3k, False: 4]
  ------------------
  263|  41.3k|    const DecodingStatus status = status_stack.top();
  264|  41.3k|    status_stack.pop();
  265|       |
  266|  41.3k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  41.3k|    const uint32_t last_axis = status.last_axis;
  268|  41.3k|    const uint32_t stack_pos = status.stack_pos;
  269|  41.3k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  41.3k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  41.3k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 41.3k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  41.3k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  41.3k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 41.3k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  41.3k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  41.3k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 19.0k, False: 22.2k]
  ------------------
  285|  25.9M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 25.9M, False: 19.0k]
  ------------------
  286|  25.9M|        *oit = old_base;
  287|  25.9M|        ++oit;
  288|  25.9M|        ++num_decoded_points_;
  289|  25.9M|      }
  290|  19.0k|      continue;
  291|  19.0k|    }
  292|       |
  293|  22.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|  22.2k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.01k, False: 21.2k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.01k|      axes_[0] = axis;
  300|  3.03k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.02k, False: 1.01k]
  ------------------
  301|  2.02k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.02k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 217, False: 1.80k]
  |  |  ------------------
  ------------------
  302|  2.02k|      }
  303|  2.74k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.74k, False: 1.00k]
  ------------------
  304|  6.96k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 5.23k, False: 1.73k]
  ------------------
  305|  5.23k|          p_[axes_[j]] = 0;
  306|  5.23k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  5.23k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.48k, False: 2.74k]
  ------------------
  308|  2.48k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 8, False: 2.47k]
  ------------------
  309|  2.48k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      8|              return false;
  311|      8|            }
  312|  2.48k|          }
  313|  5.22k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  5.22k|        }
  315|  1.73k|        *oit = p_;
  316|  1.73k|        ++oit;
  317|  1.73k|        ++num_decoded_points_;
  318|  1.73k|      }
  319|  1.00k|      continue;
  320|  1.01k|    }
  321|       |
  322|  21.2k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 21.2k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  21.2k|    const int num_remaining_bits = bit_length_ - level;
  327|  21.2k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  21.2k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  21.2k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  21.2k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  21.2k|    uint32_t number = 0;
  334|  21.2k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  21.2k|    uint32_t first_half = num_remaining_points / 2;
  337|  21.2k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 41, False: 21.2k]
  ------------------
  338|       |      // Invalid |number|.
  339|     41|      return false;
  340|     41|    }
  341|  21.2k|    first_half -= number;
  342|  21.2k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  21.2k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 11.2k, False: 9.98k]
  ------------------
  345|  11.2k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 6.12k, False: 5.11k]
  ------------------
  346|  6.12k|        std::swap(first_half, second_half);
  347|  6.12k|      }
  348|  11.2k|    }
  349|       |
  350|  21.2k|    levels_stack_[stack_pos][axis] += 1;
  351|  21.2k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  21.2k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 21.1k, False: 92]
  ------------------
  353|  21.1k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  21.1k|    }
  355|  21.2k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 21.0k, False: 143]
  ------------------
  356|  21.0k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  21.0k|    }
  358|  21.2k|  }
  359|      4|  return true;
  360|     53|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     82|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     82|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     82|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     82|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     82|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 82]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     82|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 5, False: 77]
  ------------------
  190|      5|    return false;
  191|      5|  }
  192|     77|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 77]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     77|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 77]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     77|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 77]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     77|  num_decoded_points_ = 0;
  202|       |
  203|     77|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 6, False: 71]
  ------------------
  204|      6|    return false;
  205|      6|  }
  206|     71|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 67]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     67|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 65]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     65|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 65]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     65|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 62, False: 3]
  ------------------
  217|     62|    return false;
  218|     62|  }
  219|       |
  220|      3|  numbers_decoder_.EndDecoding();
  221|      3|  remaining_bits_decoder_.EndDecoding();
  222|      3|  axis_decoder_.EndDecoding();
  223|      3|  half_decoder_.EndDecoding();
  224|       |
  225|      3|  return true;
  226|     65|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     65|    uint32_t num_points, OutputIteratorT &oit) {
  254|     65|  typedef DecodingStatus Status;
  255|     65|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     65|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     65|  DecodingStatus init_status(num_points, 0, 0);
  258|     65|  std::stack<Status> status_stack;
  259|     65|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  99.2k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 99.2k, False: 3]
  ------------------
  263|  99.2k|    const DecodingStatus status = status_stack.top();
  264|  99.2k|    status_stack.pop();
  265|       |
  266|  99.2k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  99.2k|    const uint32_t last_axis = status.last_axis;
  268|  99.2k|    const uint32_t stack_pos = status.stack_pos;
  269|  99.2k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  99.2k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  99.2k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 99.2k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  99.2k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  99.2k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 99.2k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  99.2k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  99.2k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 46.6k, False: 52.5k]
  ------------------
  285|  9.11M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 9.07M, False: 46.6k]
  ------------------
  286|  9.07M|        *oit = old_base;
  287|  9.07M|        ++oit;
  288|  9.07M|        ++num_decoded_points_;
  289|  9.07M|      }
  290|  46.6k|      continue;
  291|  46.6k|    }
  292|       |
  293|  52.5k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  52.5k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 2.15k, False: 50.4k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  2.15k|      axes_[0] = axis;
  300|  6.47k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 4.31k, False: 2.15k]
  ------------------
  301|  4.31k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  4.31k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 642, False: 3.67k]
  |  |  ------------------
  ------------------
  302|  4.31k|      }
  303|  6.07k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.93k, False: 2.13k]
  ------------------
  304|  15.6k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 11.7k, False: 3.91k]
  ------------------
  305|  11.7k|          p_[axes_[j]] = 0;
  306|  11.7k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  11.7k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 6.37k, False: 5.40k]
  ------------------
  308|  6.37k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 18, False: 6.35k]
  ------------------
  309|  6.37k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     18|              return false;
  311|     18|            }
  312|  6.37k|          }
  313|  11.7k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  11.7k|        }
  315|  3.91k|        *oit = p_;
  316|  3.91k|        ++oit;
  317|  3.91k|        ++num_decoded_points_;
  318|  3.91k|      }
  319|  2.13k|      continue;
  320|  2.15k|    }
  321|       |
  322|  50.4k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 50.4k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  50.4k|    const int num_remaining_bits = bit_length_ - level;
  327|  50.4k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  50.4k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  50.4k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  50.4k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  50.4k|    uint32_t number = 0;
  334|  50.4k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  50.4k|    uint32_t first_half = num_remaining_points / 2;
  337|  50.4k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 44, False: 50.3k]
  ------------------
  338|       |      // Invalid |number|.
  339|     44|      return false;
  340|     44|    }
  341|  50.3k|    first_half -= number;
  342|  50.3k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  50.3k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 30.2k, False: 20.0k]
  ------------------
  345|  30.2k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 21.0k, False: 9.20k]
  ------------------
  346|  21.0k|        std::swap(first_half, second_half);
  347|  21.0k|      }
  348|  30.2k|    }
  349|       |
  350|  50.3k|    levels_stack_[stack_pos][axis] += 1;
  351|  50.3k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  50.3k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 50.2k, False: 108]
  ------------------
  353|  50.2k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  50.2k|    }
  355|  50.3k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 50.1k, False: 243]
  ------------------
  356|  50.1k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  50.1k|    }
  358|  50.3k|  }
  359|      3|  return true;
  360|     65|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     25|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     25|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     25|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_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: 6, False: 19]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|     19|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 19]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     19|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 19]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     19|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 19]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     19|  num_decoded_points_ = 0;
  202|       |
  203|     19|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 19, False: 0]
  ------------------
  204|     19|    return false;
  205|     19|  }
  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|      5|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      5|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      5|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      5|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      5|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 5]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      5|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 5]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      5|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 5]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      5|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 5]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      5|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 5]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      5|  num_decoded_points_ = 0;
  202|       |
  203|      5|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 0]
  ------------------
  204|      5|    return false;
  205|      5|  }
  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|      2|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      2|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      2|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      2|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 2]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      2|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 2]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      2|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 2]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      2|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 2]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      2|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 2]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      2|  num_decoded_points_ = 0;
  202|       |
  203|      2|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 0]
  ------------------
  204|      2|    return false;
  205|      2|  }
  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|    289|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    289|  qinfo_.quantization_bits = 0;
   67|    289|  qinfo_.range = 0;
   68|    289|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    281|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    281|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 281]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|    281|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 0, False: 281]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|    281|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 281]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|    281|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 281]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|    281|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 14, False: 267]
  |  Branch (84:38): [True: 8, False: 6]
  ------------------
   85|      8|    return false;
   86|      8|  }
   87|    273|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 273]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    273|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 1, False: 272]
  ------------------
   93|      1|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      1|#define DRACO_LOGE printf
  ------------------
   94|      1|               compression_level_);
   95|      1|    return false;
   96|      1|  }
   97|       |
   98|    272|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    272|      std::back_inserter(*qpoints);
  100|    272|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    272|                           Converter>
  102|    272|      oit(oit_qpoints);
  103|    272|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 272, False: 0]
  ------------------
  104|    272|    qpoints->reserve(num_points_);
  105|    272|    switch (compression_level_) {
  106|     53|      case 0: {
  ------------------
  |  Branch (106:7): [True: 53, False: 219]
  ------------------
  107|     53|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|     53|        qpoints_decoder.DecodePoints(buffer, oit);
  109|     53|        break;
  110|      0|      }
  111|     44|      case 1: {
  ------------------
  |  Branch (111:7): [True: 44, False: 228]
  ------------------
  112|     44|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     44|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     44|        break;
  115|      0|      }
  116|     61|      case 2: {
  ------------------
  |  Branch (116:7): [True: 61, False: 211]
  ------------------
  117|     61|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     61|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     61|        break;
  120|      0|      }
  121|     82|      case 3: {
  ------------------
  |  Branch (121:7): [True: 82, False: 190]
  ------------------
  122|     82|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|     82|        qpoints_decoder.DecodePoints(buffer, oit);
  124|     82|        break;
  125|      0|      }
  126|     25|      case 4: {
  ------------------
  |  Branch (126:7): [True: 25, False: 247]
  ------------------
  127|     25|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     25|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     25|        break;
  130|      0|      }
  131|      5|      case 5: {
  ------------------
  |  Branch (131:7): [True: 5, False: 267]
  ------------------
  132|      5|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|      5|        qpoints_decoder.DecodePoints(buffer, oit);
  134|      5|        break;
  135|      0|      }
  136|      2|      case 6: {
  ------------------
  |  Branch (136:7): [True: 2, False: 270]
  ------------------
  137|      2|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|      2|        qpoints_decoder.DecodePoints(buffer, oit);
  139|      2|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 272]
  ------------------
  142|      0|        return false;
  143|    272|    }
  144|    272|  }
  145|       |
  146|    272|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 268, False: 4]
  ------------------
  147|    268|    return false;
  148|    268|  }
  149|      4|  return true;
  150|    272|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    272|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   242M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   242M|  const Self &operator=(const SourceType &source) {
   56|   242M|    *oit_ = Converter()(source);
   57|   242M|    return *this;
   58|   242M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   242M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   242M|    return Point3ui(v[0], v[1], v[2]);
   31|   242M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   242M|  const Self &operator++() {
   46|   242M|    ++oit_;
   47|   242M|    return *this;
   48|   242M|  }

_ZN5draco22FloatPointsTreeDecoder26set_num_points_from_headerEj:
   69|    289|  void set_num_points_from_header(uint32_t num_points) {
   70|    289|    num_points_from_header_ = num_points;
   71|    289|  }
_ZN5draco22FloatPointsTreeDecoder16DecodePointCloudINS_34PointAttributeVectorOutputIteratorIfEEEEbPNS_13DecoderBufferERT_:
  102|    289|                                              OutputIteratorT &out) {
  103|    289|  std::vector<Point3ui> qpoints;
  104|       |
  105|    289|  uint32_t decoded_version;
  106|    289|  if (!buffer->Decode(&decoded_version)) {
  ------------------
  |  Branch (106:7): [True: 0, False: 289]
  ------------------
  107|      0|    return false;
  108|      0|  }
  109|       |
  110|    289|  if (decoded_version == 3) {
  ------------------
  |  Branch (110:7): [True: 1, False: 288]
  ------------------
  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|    288|  } else if (decoded_version == 2) {  // Version 2 only uses KDTREE method.
  ------------------
  |  Branch (126:14): [True: 281, False: 7]
  ------------------
  127|    281|    if (!DecodePointCloudKdTreeInternal(buffer, &qpoints)) {
  ------------------
  |  Branch (127:9): [True: 277, False: 4]
  ------------------
  128|    277|      return false;
  129|    277|    }
  130|    281|  } else {  // Unsupported version.
  131|      7|    fprintf(stderr, "Version not supported. \n");
  132|      7|    return false;
  133|      7|  }
  134|       |
  135|      4|  DequantizePoints3(qpoints.begin(), qpoints.end(), qinfo_, out);
  136|      4|  return true;
  137|    289|}

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  10.9M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  10.9M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 10.9M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  10.9M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  10.9M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   246M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   246M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 283, False: 246M]
  ------------------
   78|    283|      return false;  // Buffer overflow.
   79|    283|    }
   80|   246M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   246M|    pos_ += size_to_decode;
   82|   246M|    return true;
   83|   246M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  25.9k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  5.55k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  32.6k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   265k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  2.98k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  10.9M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  2.57M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  3.91k|    inline void reset(const void *b, size_t s) {
  131|  3.91k|      bit_offset_ = 0;
  132|  3.91k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  3.91k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  3.91k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  3.46k|    inline uint64_t BitsDecoded() const {
  138|  3.46k|      return static_cast<uint64_t>(bit_offset_);
  139|  3.46k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  10.9M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  10.9M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 1, False: 10.9M]
  ------------------
  162|      1|        return false;
  163|      1|      }
  164|  10.9M|      uint32_t value = 0;
  165|  25.6M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 14.6M, False: 10.9M]
  ------------------
  166|  14.6M|        value |= GetBit() << bit;
  167|  14.6M|      }
  168|  10.9M|      *x = value;
  169|  10.9M|      return true;
  170|  10.9M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  14.6M|    inline int GetBit() {
  176|  14.6M|      const size_t off = bit_offset_;
  177|  14.6M|      const size_t byte_offset = off >> 3;
  178|  14.6M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  14.6M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 14.5M, False: 150k]
  ------------------
  180|  14.5M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  14.5M|        bit_offset_ = off + 1;
  182|  14.5M|        return bit;
  183|  14.5M|      }
  184|   150k|      return 0;
  185|  14.6M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  9.83M|  bool Decode(T *out_val) {
   69|  9.83M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 1.07k, False: 9.83M]
  ------------------
   70|  1.07k|      return false;
   71|  1.07k|    }
   72|  9.83M|    pos_ += sizeof(T);
   73|  9.83M|    return true;
   74|  9.83M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  9.83M|  bool Peek(T *out_val) {
   88|  9.83M|    const size_t size_to_decode = sizeof(T);
   89|  9.83M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 1.07k, False: 9.83M]
  ------------------
   90|  1.07k|      return false;  // Buffer overflow.
   91|  1.07k|    }
   92|  9.83M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  9.83M|    return true;
   94|  9.83M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  8.06k|  bool Decode(T *out_val) {
   69|  8.06k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 32, False: 8.02k]
  ------------------
   70|     32|      return false;
   71|     32|    }
   72|  8.02k|    pos_ += sizeof(T);
   73|  8.02k|    return true;
   74|  8.06k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  8.06k|  bool Peek(T *out_val) {
   88|  8.06k|    const size_t size_to_decode = sizeof(T);
   89|  8.06k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 32, False: 8.02k]
  ------------------
   90|     32|      return false;  // Buffer overflow.
   91|     32|    }
   92|  8.02k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  8.02k|    return true;
   94|  8.06k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   342k|  bool Decode(T *out_val) {
   69|   342k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 75, False: 342k]
  ------------------
   70|     75|      return false;
   71|     75|    }
   72|   342k|    pos_ += sizeof(T);
   73|   342k|    return true;
   74|   342k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   342k|  bool Peek(T *out_val) {
   88|   342k|    const size_t size_to_decode = sizeof(T);
   89|   342k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 75, False: 342k]
  ------------------
   90|     75|      return false;  // Buffer overflow.
   91|     75|    }
   92|   342k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   342k|    return true;
   94|   342k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  14.3k|  bool Decode(T *out_val) {
   69|  14.3k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 114, False: 14.1k]
  ------------------
   70|    114|      return false;
   71|    114|    }
   72|  14.1k|    pos_ += sizeof(T);
   73|  14.1k|    return true;
   74|  14.3k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  14.3k|  bool Peek(T *out_val) {
   88|  14.3k|    const size_t size_to_decode = sizeof(T);
   89|  14.3k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 114, False: 14.1k]
  ------------------
   90|    114|      return false;  // Buffer overflow.
   91|    114|    }
   92|  14.1k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  14.1k|    return true;
   94|  14.3k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   557k|  bool Decode(T *out_val) {
   69|   557k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 80, False: 557k]
  ------------------
   70|     80|      return false;
   71|     80|    }
   72|   557k|    pos_ += sizeof(T);
   73|   557k|    return true;
   74|   557k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   557k|  bool Peek(T *out_val) {
   88|   557k|    const size_t size_to_decode = sizeof(T);
   89|   557k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 80, False: 557k]
  ------------------
   90|     80|      return false;  // Buffer overflow.
   91|     80|    }
   92|   557k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   557k|    return true;
   94|   557k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|   120k|  bool Decode(T *out_val) {
   69|   120k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 8, False: 120k]
  ------------------
   70|      8|      return false;
   71|      8|    }
   72|   120k|    pos_ += sizeof(T);
   73|   120k|    return true;
   74|   120k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|   120k|  bool Peek(T *out_val) {
   88|   120k|    const size_t size_to_decode = sizeof(T);
   89|   120k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 8, False: 120k]
  ------------------
   90|      8|      return false;  // Buffer overflow.
   91|      8|    }
   92|   120k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   120k|    return true;
   94|   120k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.08k|  bool Decode(T *out_val) {
   69|  1.08k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 5, False: 1.08k]
  ------------------
   70|      5|      return false;
   71|      5|    }
   72|  1.08k|    pos_ += sizeof(T);
   73|  1.08k|    return true;
   74|  1.08k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.08k|  bool Peek(T *out_val) {
   88|  1.08k|    const size_t size_to_decode = sizeof(T);
   89|  1.08k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 5, False: 1.08k]
  ------------------
   90|      5|      return false;  // Buffer overflow.
   91|      5|    }
   92|  1.08k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.08k|    return true;
   94|  1.08k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    457|  bool Decode(T *out_val) {
   69|    457|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2, False: 455]
  ------------------
   70|      2|      return false;
   71|      2|    }
   72|    455|    pos_ += sizeof(T);
   73|    455|    return true;
   74|    457|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    457|  bool Peek(T *out_val) {
   88|    457|    const size_t size_to_decode = sizeof(T);
   89|    457|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2, False: 455]
  ------------------
   90|      2|      return false;  // Buffer overflow.
   91|      2|    }
   92|    455|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    455|    return true;
   94|    457|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   344M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   353M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  6.00M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  6.00M|    return value_ >= val;
  100|  6.00M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   138M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  1.57G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  16.1M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  61.3M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  61.3M|    value_ = i.value_;
  153|  61.3M|    return *this;
  154|  61.3M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   392M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   392M|    value_ = i.value_;
  153|   392M|    return *this;
  154|   392M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  16.1M|  inline ThisIndexType &operator++() {
  103|  16.1M|    ++value_;
  104|  16.1M|    return *this;
  105|  16.1M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  1.17G|  constexpr bool operator==(const IndexType &i) const {
   76|  1.17G|    return value_ == i.value_;
   77|  1.17G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   450M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  6.27k|  constexpr bool operator<(const IndexType &i) const {
   88|  6.27k|    return value_ < i.value_;
   89|  6.27k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|  70.6M|  constexpr bool operator==(const IndexType &i) const {
   76|  70.6M|    return value_ == i.value_;
   77|  70.6M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   111M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   111M|    return ThisIndexType(value_ - val);
  133|   111M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   339M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   339M|    return ThisIndexType(value_ + val);
  127|   339M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  11.0M|  constexpr bool operator==(const IndexType &i) const {
   76|  11.0M|    return value_ == i.value_;
   77|  11.0M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   114M|  constexpr bool operator!=(const IndexType &i) const {
   82|   114M|    return value_ != i.value_;
   83|   114M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   183M|  constexpr bool operator!=(const IndexType &i) const {
   82|   183M|    return value_ != i.value_;
   83|   183M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   252M|  inline ThisIndexType &operator++() {
  103|   252M|    ++value_;
  104|   252M|    return *this;
  105|   252M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   196M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   196M|    value_ = i.value_;
  153|   196M|    return *this;
  154|   196M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   475M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   475M|    value_ = i.value_;
  153|   475M|    return *this;
  154|   475M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  30.4M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  30.4M|    return value_ >= val;
  100|  30.4M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  5.73M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   551M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  7.55G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|  92.9M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  5.17G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|  96.2M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  12.0M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  12.0M|    return ThisIndexType(value_ + val);
  127|  12.0M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|  87.5M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  15.5M|  constexpr bool operator<(const IndexType &i) const {
   88|  15.5M|    return value_ < i.value_;
   89|  15.5M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   433M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   392M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  40.4M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   329M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   473M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  3.32M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  3.32M|    value_ = i.value_;
  153|  3.32M|    return *this;
  154|  3.32M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  5.73M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  5.73M|    value_ += val;
  141|  5.73M|    return *this;
  142|  5.73M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  18.1M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  18.1M|    value_ = val;
  157|  18.1M|    return *this;
  158|  18.1M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   374M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  4.62M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  4.62M|  inline ThisIndexType &operator++() {
  103|  4.62M|    ++value_;
  104|  4.62M|    return *this;
  105|  4.62M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  16.5M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|    181|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   232M|  inline ThisIndexType &operator++() {
  103|   232M|    ++value_;
  104|   232M|    return *this;
  105|   232M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|     76|  inline ThisIndexType &operator++() {
  103|     76|    ++value_;
  104|     76|    return *this;
  105|     76|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   279M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   279M|    return value_ >= val;
  100|   279M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  27.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  27.3M|    return vector_[index.value()];
   75|  27.3M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  16.5M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  8.77k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  12.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|  46.9M|  inline reference operator[](const IndexTypeT &index) {
   71|  46.9M|    return vector_[index.value()];
   72|  46.9M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  49.7k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  12.0M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  2.16k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   70|  6.00M|  inline reference operator[](const IndexTypeT &index) {
   71|  6.00M|    return vector_[index.value()];
   72|  6.00M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  16.4M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  16.4M|    return vector_[index.value()];
   75|  16.4M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|  91.1M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  8.19M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   164M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   164M|    return vector_[index.value()];
   75|   164M|  }
_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|   171M|  inline reference operator[](const IndexTypeT &index) {
   71|   171M|    return vector_[index.value()];
   72|   171M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  31.0M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  31.0M|    return vector_[index.value()];
   75|  31.0M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   144M|  inline reference operator[](const IndexTypeT &index) {
   71|   144M|    return vector_[index.value()];
   72|   144M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  47.7M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|  97.3M|  inline reference operator[](const IndexTypeT &index) {
   71|  97.3M|    return vector_[index.value()];
   72|  97.3M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|    896|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|  86.2M|  inline reference operator[](const IndexTypeT &index) {
   71|  86.2M|    return vector_[index.value()];
   72|  86.2M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  23.9k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|   939k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  22.7k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  3.19k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  3.19k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  3.19k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  3.19k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  8.22k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  8.22k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  8.22k|    vector_.swap(arg.vector_);
   57|  8.22k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  8.22k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  8.22k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  8.22k|    vector_.swap(arg.vector_);
   57|  8.22k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  3.19k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  3.19k|  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.19k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  4.58k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  28.5k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  51.1k|int32_t DataTypeLength(DataType dt) {
   20|  51.1k|  switch (dt) {
   21|  15.9k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 15.9k, False: 35.2k]
  ------------------
   22|  19.1k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.25k, False: 47.8k]
  ------------------
   23|  19.1k|      return 1;
   24|  2.82k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 2.82k, False: 48.3k]
  ------------------
   25|  8.65k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 5.82k, False: 45.3k]
  ------------------
   26|  8.65k|      return 2;
   27|  18.2k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 18.2k, False: 32.8k]
  ------------------
   28|  19.3k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.09k, False: 50.0k]
  ------------------
   29|  19.3k|      return 4;
   30|    353|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 353, False: 50.8k]
  ------------------
   31|    702|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 349, False: 50.8k]
  ------------------
   32|    702|      return 8;
   33|  2.88k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 2.88k, False: 48.2k]
  ------------------
   34|  2.88k|      return 4;
   35|     62|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 62, False: 51.0k]
  ------------------
   36|     62|      return 8;
   37|    299|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 299, False: 50.8k]
  ------------------
   38|    299|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 51.1k]
  ------------------
   40|      0|      return -1;
   41|  51.1k|  }
   42|  51.1k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    975|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  4.58k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|      1|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  5.55k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  5.55k|  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|  5.14k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  5.55k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    414|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|    975|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|    975|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  4.58k|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  4.58k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   599k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   599k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 599k, Folded]
  ------------------
   65|   599k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 318, False: 599k]
  ------------------
   66|    318|      return false;
   67|    318|    }
   68|   599k|  } 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|   599k|  return true;
   77|   599k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   243k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   243k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   243k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 59, False: 243k]
  ------------------
   33|     59|    return false;
   34|     59|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   243k|  uint8_t in;
   39|   243k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 160, False: 243k]
  ------------------
   40|    160|    return false;
   41|    160|  }
   42|   243k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 22.8k, False: 220k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  22.8k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 302, False: 22.5k]
  ------------------
   45|    302|      return false;
   46|    302|    }
   47|       |    // Append decoded info from this byte.
   48|  22.5k|    *out_val <<= 7;
   49|  22.5k|    *out_val |= in & ((1 << 7) - 1);
   50|   220k|  } else {
   51|       |    // Last byte reached
   52|   220k|    *out_val = in;
   53|   220k|  }
   54|   242k|  return true;
   55|   243k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  29.5k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  29.5k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  29.5k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 29.5k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  29.5k|  uint8_t in;
   39|  29.5k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 3, False: 29.5k]
  ------------------
   40|      3|    return false;
   41|      3|  }
   42|  29.5k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 339, False: 29.1k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    339|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 6, False: 333]
  ------------------
   45|      6|      return false;
   46|      6|    }
   47|       |    // Append decoded info from this byte.
   48|    333|    *out_val <<= 7;
   49|    333|    *out_val |= in & ((1 << 7) - 1);
   50|  29.1k|  } else {
   51|       |    // Last byte reached
   52|  29.1k|    *out_val = in;
   53|  29.1k|  }
   54|  29.5k|  return true;
   55|  29.5k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  3.00k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  3.00k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 3.00k, Folded]
  ------------------
   65|  3.00k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 20, False: 2.98k]
  ------------------
   66|     20|      return false;
   67|     20|    }
   68|  3.00k|  } 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.98k|  return true;
   77|  3.00k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  1.87k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.87k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.87k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 1.87k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.87k|  uint8_t in;
   39|  1.87k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 2, False: 1.87k]
  ------------------
   40|      2|    return false;
   41|      2|  }
   42|  1.87k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 11, False: 1.86k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     11|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 11]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     11|    *out_val <<= 7;
   49|     11|    *out_val |= in & ((1 << 7) - 1);
   50|  1.86k|  } else {
   51|       |    // Last byte reached
   52|  1.86k|    *out_val = in;
   53|  1.86k|  }
   54|  1.87k|  return true;
   55|  1.87k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   296k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   296k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   296k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 12, False: 296k]
  ------------------
   33|     12|    return false;
   34|     12|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   296k|  uint8_t in;
   39|   296k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 45, False: 296k]
  ------------------
   40|     45|    return false;
   41|     45|  }
   42|   296k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 993, False: 295k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    993|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 68, False: 925]
  ------------------
   45|     68|      return false;
   46|     68|    }
   47|       |    // Append decoded info from this byte.
   48|    925|    *out_val <<= 7;
   49|    925|    *out_val |= in & ((1 << 7) - 1);
   50|   295k|  } else {
   51|       |    // Last byte reached
   52|   295k|    *out_val = in;
   53|   295k|  }
   54|   296k|  return true;
   55|   296k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  2.77k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.77k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 2.77k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  2.77k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  2.77k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  2.77k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 16, False: 2.75k]
  ------------------
   72|     16|      return false;
   73|     16|    }
   74|  2.75k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  2.75k|  }
   76|  2.75k|  return true;
   77|  2.77k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.13k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.13k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.13k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 3.13k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.13k|  uint8_t in;
   39|  3.13k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 13, False: 3.12k]
  ------------------
   40|     13|    return false;
   41|     13|  }
   42|  3.12k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 365, False: 2.75k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    365|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 22, False: 343]
  ------------------
   45|     22|      return false;
   46|     22|    }
   47|       |    // Append decoded info from this byte.
   48|    343|    *out_val <<= 7;
   49|    343|    *out_val |= in & ((1 << 7) - 1);
   50|  2.75k|  } else {
   51|       |    // Last byte reached
   52|  2.75k|    *out_val = in;
   53|  2.75k|  }
   54|  3.10k|  return true;
   55|  3.12k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.43k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.43k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.43k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 2.43k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.43k|  uint8_t in;
   39|  2.43k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 6, False: 2.43k]
  ------------------
   40|      6|    return false;
   41|      6|  }
   42|  2.43k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 489, False: 1.94k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    489|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 3, False: 486]
  ------------------
   45|      3|      return false;
   46|      3|    }
   47|       |    // Append decoded info from this byte.
   48|    486|    *out_val <<= 7;
   49|    486|    *out_val |= in & ((1 << 7) - 1);
   50|  1.94k|  } else {
   51|       |    // Last byte reached
   52|  1.94k|    *out_val = in;
   53|  1.94k|  }
   54|  2.42k|  return true;
   55|  2.43k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  21.6k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  21.6k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  21.6k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 21.6k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  21.6k|  uint8_t in;
   39|  21.6k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 5, False: 21.6k]
  ------------------
   40|      5|    return false;
   41|      5|  }
   42|  21.6k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 525, False: 21.1k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    525|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 10, False: 515]
  ------------------
   45|     10|      return false;
   46|     10|    }
   47|       |    // Append decoded info from this byte.
   48|    515|    *out_val <<= 7;
   49|    515|    *out_val |= in & ((1 << 7) - 1);
   50|  21.1k|  } else {
   51|       |    // Last byte reached
   52|  21.1k|    *out_val = in;
   53|  21.1k|  }
   54|  21.6k|  return true;
   55|  21.6k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.10k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.10k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.10k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 7, False: 3.09k]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.09k|  uint8_t in;
   39|  3.09k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 4, False: 3.09k]
  ------------------
   40|      4|    return false;
   41|      4|  }
   42|  3.09k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 798, False: 2.29k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    798|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 35, False: 763]
  ------------------
   45|     35|      return false;
   46|     35|    }
   47|       |    // Append decoded info from this byte.
   48|    763|    *out_val <<= 7;
   49|    763|    *out_val |= in & ((1 << 7) - 1);
   50|  2.29k|  } else {
   51|       |    // Last byte reached
   52|  2.29k|    *out_val = in;
   53|  2.29k|  }
   54|  3.06k|  return true;
   55|  3.09k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  2.17k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.17k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.17k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 15, False: 2.16k]
  ------------------
   33|     15|    return false;
   34|     15|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.16k|  uint8_t in;
   39|  2.16k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 3, False: 2.15k]
  ------------------
   40|      3|    return false;
   41|      3|  }
   42|  2.15k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.03k, False: 1.12k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.03k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 166, False: 871]
  ------------------
   45|    166|      return false;
   46|    166|    }
   47|       |    // Append decoded info from this byte.
   48|    871|    *out_val <<= 7;
   49|    871|    *out_val |= in & ((1 << 7) - 1);
   50|  1.12k|  } else {
   51|       |    // Last byte reached
   52|  1.12k|    *out_val = in;
   53|  1.12k|  }
   54|  1.99k|  return true;
   55|  2.15k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  32.1k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  32.1k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  32.1k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 32.1k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  32.1k|  uint8_t in;
   39|  32.1k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 13, False: 32.1k]
  ------------------
   40|     13|    return false;
   41|     13|  }
   42|  32.1k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.67k, False: 29.4k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.67k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 14, False: 2.66k]
  ------------------
   45|     14|      return false;
   46|     14|    }
   47|       |    // Append decoded info from this byte.
   48|  2.66k|    *out_val <<= 7;
   49|  2.66k|    *out_val |= in & ((1 << 7) - 1);
   50|  29.4k|  } else {
   51|       |    // Last byte reached
   52|  29.4k|    *out_val = in;
   53|  29.4k|  }
   54|  32.1k|  return true;
   55|  32.1k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   125k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   158k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  13.2k|  Self operator-(const Self &o) const {
  138|  13.2k|    Self ret;
  139|  52.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 39.7k, False: 13.2k]
  ------------------
  140|  39.7k|      ret[i] = (*this)[i] - o[i];
  141|  39.7k|    }
  142|  13.2k|    return ret;
  143|  13.2k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  32.8k|  VectorD() {
   41|   131k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 98.5k, False: 32.8k]
  ------------------
   42|  98.5k|      (*this)[i] = Scalar(0);
   43|  98.5k|    }
   44|  32.8k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  1.61G|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|     12|      : v_({{c0, c1, c2}}) {
   60|     12|    DRACO_DCHECK_EQ(dimension, 3);
   61|     12|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   112M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  9.29M|  Self operator-(const Self &o) const {
  138|  9.29M|    Self ret;
  139|  37.1M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 27.8M, False: 9.29M]
  ------------------
  140|  27.8M|      ret[i] = (*this)[i] - o[i];
  141|  27.8M|    }
  142|  9.29M|    return ret;
  143|  9.29M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  4.63M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  4.63M|  static_assert(std::is_signed<ScalarT>::value,
  321|  4.63M|                "ScalarT must be a signed type. ");
  322|  4.63M|  VectorD<ScalarT, 3> r;
  323|  4.63M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  4.63M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  4.63M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  4.63M|  return r;
  327|  4.63M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  4.63M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  4.63M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  1.47M|  Scalar AbsSum() const {
  238|  1.47M|    Scalar result(0);
  239|  5.89M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 4.42M, False: 1.46M]
  ------------------
  240|  4.42M|      Scalar next_value = std::abs(v_[i]);
  241|  4.42M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 11.1k, False: 4.41M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  11.1k|        return std::numeric_limits<Scalar>::max();
  244|  11.1k|      }
  245|  4.41M|      result += next_value;
  246|  4.41M|    }
  247|  1.46M|    return result;
  248|  1.47M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   225k|  Self operator/(const Scalar &o) const {
  183|   225k|    Self ret;
  184|   900k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 675k, False: 225k]
  ------------------
  185|   675k|      ret[i] = (*this)[i] / o;
  186|   675k|    }
  187|   225k|    return ret;
  188|   225k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   136M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  8.22M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  4.43M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.37M|  Self operator-() const {
  121|  1.37M|    Self ret;
  122|  5.48M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 4.11M, False: 1.37M]
  ------------------
  123|  4.11M|      ret[i] = -(*this)[i];
  124|  4.11M|    }
  125|  1.37M|    return ret;
  126|  1.37M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  4.11M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   699k|  Self operator-(const Self &o) const {
  138|   699k|    Self ret;
  139|  2.09M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.39M, False: 699k]
  ------------------
  140|  1.39M|      ret[i] = (*this)[i] - o[i];
  141|  1.39M|    }
  142|   699k|    return ret;
  143|   699k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  8.39M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  12.5M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  56.6M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  1.39M|  Self operator+(const Self &o) const {
  130|  1.39M|    Self ret;
  131|  4.19M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.79M, False: 1.39M]
  ------------------
  132|  2.79M|      ret[i] = (*this)[i] + o[i];
  133|  2.79M|    }
  134|  1.39M|    return ret;
  135|  1.39M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  44.9M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  1.62M|  Self operator-(const Self &o) const {
  138|  1.62M|    Self ret;
  139|  4.87M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.24M, False: 1.62M]
  ------------------
  140|  3.24M|      ret[i] = (*this)[i] - o[i];
  141|  3.24M|    }
  142|  1.62M|    return ret;
  143|  1.62M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  1.62M|  Self operator+(const Self &o) const {
  130|  1.62M|    Self ret;
  131|  4.87M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 3.24M, False: 1.62M]
  ------------------
  132|  3.24M|      ret[i] = (*this)[i] + o[i];
  133|  3.24M|    }
  134|  1.62M|    return ret;
  135|  1.62M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   437k|  bool operator==(const Self &o) const {
  207|  1.30M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 869k, False: 431k]
  ------------------
  208|   869k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 6.36k, False: 863k]
  ------------------
  209|  6.36k|        return false;
  210|  6.36k|      }
  211|   869k|    }
  212|   431k|    return true;
  213|   437k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  5.25M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  6.88k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  7.40k|  Scalar Dot(const Self &o) const {
  251|  7.40k|    Scalar ret(0);
  252|  29.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 22.2k, False: 7.40k]
  ------------------
  253|  22.2k|      ret += (*this)[i] * o[i];
  254|  22.2k|    }
  255|  7.40k|    return ret;
  256|  7.40k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    518|  Self operator*(const Scalar &o) const {
  175|    518|    Self ret;
  176|  2.07k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.55k, False: 518]
  ------------------
  177|  1.55k|      ret[i] = (*this)[i] * o;
  178|  1.55k|    }
  179|    518|    return ret;
  180|    518|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  6.36k|  Self operator-(const Self &o) const {
  138|  6.36k|    Self ret;
  139|  19.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 12.7k, False: 6.36k]
  ------------------
  140|  12.7k|      ret[i] = (*this)[i] - o[i];
  141|  12.7k|    }
  142|  6.36k|    return ret;
  143|  6.36k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  12.7k|  VectorD() {
   41|  38.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 25.4k, False: 12.7k]
  ------------------
   42|  25.4k|      (*this)[i] = Scalar(0);
   43|  25.4k|    }
   44|  12.7k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   882k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   882k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   882k|    v_[0] = c0;
   55|   882k|    v_[1] = c1;
   56|   882k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  50.8k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   338k|  bool operator==(const Self &o) const {
  207|   979k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 659k, False: 320k]
  ------------------
  208|   659k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 18.1k, False: 640k]
  ------------------
  209|  18.1k|        return false;
  210|  18.1k|      }
  211|   659k|    }
  212|   320k|    return true;
  213|   338k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  2.05M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  26.4M|  VectorD() {
   41|   105M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 79.2M, False: 26.4M]
  ------------------
   42|  79.2M|      (*this)[i] = Scalar(0);
   43|  79.2M|    }
   44|  26.4M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  22.0k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  25.9k|  Scalar Dot(const Self &o) const {
  251|  25.9k|    Scalar ret(0);
  252|   103k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 77.7k, False: 25.9k]
  ------------------
  253|  77.7k|      ret += (*this)[i] * o[i];
  254|  77.7k|    }
  255|  25.9k|    return ret;
  256|  25.9k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  3.89k|  Self operator-(const Self &o) const {
  138|  3.89k|    Self ret;
  139|  11.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 7.78k, False: 3.89k]
  ------------------
  140|  7.78k|      ret[i] = (*this)[i] - o[i];
  141|  7.78k|    }
  142|  3.89k|    return ret;
  143|  3.89k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  11.5k|  Self operator*(const Scalar &o) const {
  175|  11.5k|    Self ret;
  176|  34.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 23.1k, False: 11.5k]
  ------------------
  177|  23.1k|      ret[i] = (*this)[i] * o;
  178|  23.1k|    }
  179|  11.5k|    return ret;
  180|  11.5k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  3.86k|  Self operator+(const Self &o) const {
  130|  3.86k|    Self ret;
  131|  11.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 7.72k, False: 3.86k]
  ------------------
  132|  7.72k|      ret[i] = (*this)[i] + o[i];
  133|  7.72k|    }
  134|  3.86k|    return ret;
  135|  3.86k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.86k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.86k|  return v * o;
  294|  3.86k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  3.85k|  Self operator+(const Self &o) const {
  130|  3.85k|    Self ret;
  131|  15.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 11.5k, False: 3.85k]
  ------------------
  132|  11.5k|      ret[i] = (*this)[i] + o[i];
  133|  11.5k|    }
  134|  3.85k|    return ret;
  135|  3.85k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.85k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.85k|  return v * o;
  294|  3.85k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  3.85k|  Self operator*(const Scalar &o) const {
  175|  3.85k|    Self ret;
  176|  15.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 11.5k, False: 3.85k]
  ------------------
  177|  11.5k|      ret[i] = (*this)[i] * o;
  178|  11.5k|    }
  179|  3.85k|    return ret;
  180|  3.85k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   680k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   680k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   680k|    v_[0] = c0;
   55|   680k|    v_[1] = c1;
   56|   680k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  27.0k|  VectorD() {
   41|  81.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 54.0k, False: 27.0k]
  ------------------
   42|  54.0k|      (*this)[i] = Scalar(0);
   43|  54.0k|    }
   44|  27.0k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  7.68k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  23.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 15.3k, False: 7.68k]
  ------------------
  104|  15.3k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 15.3k, False: 0]
  ------------------
  105|  15.3k|        v_[i] = Scalar(src_vector[i]);
  106|  15.3k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  15.3k|    }
  110|  7.68k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|  1.48k|  Self operator+(const Self &o) const {
  130|  1.48k|    Self ret;
  131|  4.44k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.96k, False: 1.48k]
  ------------------
  132|  2.96k|      ret[i] = (*this)[i] + o[i];
  133|  2.96k|    }
  134|  1.48k|    return ret;
  135|  1.48k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  3.84k|  VectorD() {
   41|  11.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 7.68k, False: 3.84k]
  ------------------
   42|  7.68k|      (*this)[i] = Scalar(0);
   43|  7.68k|    }
   44|  3.84k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  23.0k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  15.3k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  3.84k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  11.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 7.68k, False: 3.84k]
  ------------------
  104|  7.68k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 7.68k, False: 0]
  ------------------
  105|  7.68k|        v_[i] = Scalar(src_vector[i]);
  106|  7.68k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  7.68k|    }
  110|  3.84k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  3.84k|  Self operator/(const Scalar &o) const {
  183|  3.84k|    Self ret;
  184|  11.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 7.68k, False: 3.84k]
  ------------------
  185|  7.68k|      ret[i] = (*this)[i] / o;
  186|  7.68k|    }
  187|  3.84k|    return ret;
  188|  3.84k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  2.36k|  Self operator-(const Self &o) const {
  138|  2.36k|    Self ret;
  139|  7.08k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.72k, False: 2.36k]
  ------------------
  140|  4.72k|      ret[i] = (*this)[i] - o[i];
  141|  4.72k|    }
  142|  2.36k|    return ret;
  143|  2.36k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|   108k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.37M|  VectorD() {
   41|  5.48M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.11M, False: 1.37M]
  ------------------
   42|  4.11M|      (*this)[i] = Scalar(0);
   43|  4.11M|    }
   44|  1.37M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  10.2M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  10.2M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  10.2M|    v_[0] = c0;
   55|  10.2M|    v_[1] = c1;
   56|  10.2M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  4.19M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  12.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 8.39M, False: 4.19M]
  ------------------
  104|  8.39M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 8.39M, False: 0]
  ------------------
  105|  8.39M|        v_[i] = Scalar(src_vector[i]);
  106|  8.39M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  8.39M|    }
  110|  4.19M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  2.09M|  VectorD() {
   41|  6.29M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.19M, False: 2.09M]
  ------------------
   42|  4.19M|      (*this)[i] = Scalar(0);
   43|  4.19M|    }
   44|  2.09M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  2.09M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  6.29M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 4.19M, False: 2.09M]
  ------------------
  104|  4.19M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 4.19M, False: 0]
  ------------------
  105|  4.19M|        v_[i] = Scalar(src_vector[i]);
  106|  4.19M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  4.19M|    }
  110|  2.09M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  7.23M|  VectorD(const Self &o) {
   89|  21.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 14.4M, False: 7.23M]
  ------------------
   90|  14.4M|      (*this)[i] = o[i];
   91|  14.4M|    }
   92|  7.23M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  3.24M|  VectorD() {
   41|  9.74M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.49M, False: 3.24M]
  ------------------
   42|  6.49M|      (*this)[i] = Scalar(0);
   43|  6.49M|    }
   44|  3.24M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   538M|  VectorD(const Self &o) {
   89|  2.15G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 1.61G, False: 538M]
  ------------------
   90|  1.61G|      (*this)[i] = o[i];
   91|  1.61G|    }
   92|   538M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  1.61G|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   242M|      : v_({{c0, c1, c2}}) {
   60|   242M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   242M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  43.3M|  inline int num_vertices() const {
   74|  43.3M|    return static_cast<int>(vertex_corners_.size());
   75|  43.3M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  5.75M|  inline int num_corners() const {
   77|  5.75M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  5.75M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  2.44M|  inline int num_faces() const {
   80|  2.44M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  2.44M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   164M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   164M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 164M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   164M|    return opposite_corners_[corner];
   88|   164M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   260M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   260M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 8.00M, False: 252M]
  ------------------
   91|  8.00M|      return corner;
   92|  8.00M|    }
   93|   252M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 220M, False: 31.6M]
  ------------------
   94|   260M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   232M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   232M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 2.94M, False: 229M]
  ------------------
   97|  2.94M|      return corner;
   98|  2.94M|    }
   99|   229M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 79.3M, False: 149M]
  ------------------
  100|   232M|  }
_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|  20.9M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  20.9M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 20.9M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  20.9M|    return FaceIndex(corner.value() / 3);
  117|  20.9M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   481M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  31.0M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  31.0M|    return vertex_corners_[v];
  152|  31.0M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|   791k|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|   791k|    const CornerIndex corner = LeftMostCorner(vert);
  187|   791k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 20.7k, False: 770k]
  ------------------
  188|  20.7k|      return true;
  189|  20.7k|    }
  190|   770k|    return false;
  191|   791k|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  46.3M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  46.3M|    return Previous(Opposite(Previous(corner)));
  202|  46.3M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  8.62M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  8.62M|    return Next(Opposite(Next(corner)));
  207|  8.62M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  1.81M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  1.81M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 1.81M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  1.81M|    return Opposite(Previous(corner_id));
  222|  1.81M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  2.58M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  2.58M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 2.58M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  2.58M|    return Opposite(Next(corner_id));
  228|  2.58M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   144M|                                CornerIndex opp_corner_id) {
  249|   144M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   144M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   144M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   171M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   171M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   171M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   171M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  47.7M|  VertexIndex AddNewVertex() {
  271|  47.7M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  47.7M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  47.7M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  47.7M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|  96.1M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|  96.1M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|  96.1M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 96.1M, False: 0]
  ------------------
  295|  96.1M|      vertex_corners_[vert] = corner;
  296|  96.1M|    }
  297|  96.1M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  1.21M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  1.21M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  1.21M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  1.21M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  5.82k|      : corner_table_(table),
  229|  5.82k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  5.82k|        corner_(start_corner_),
  231|  5.82k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  3.68M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  19.3k|  VertexCornersIterator &operator++() {
  268|  19.3k|    Next();
  269|  19.3k|    return *this;
  270|  19.3k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.14M|  void Next() {
  248|  3.14M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.11M, False: 32.8k]
  ------------------
  249|  3.11M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.11M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 26.2k, False: 3.08M]
  ------------------
  251|       |        // Open boundary reached.
  252|  26.2k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  26.2k|        left_traversal_ = false;
  254|  3.08M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 513k, False: 2.57M]
  ------------------
  255|       |        // End reached.
  256|   513k|        corner_ = kInvalidCornerIndex;
  257|   513k|      }
  258|  3.11M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  32.8k|      corner_ = corner_table_->SwingRight(corner_);
  262|  32.8k|    }
  263|  3.14M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  5.26M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  2.45M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  2.56M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  1.50M|  void Next() {
  248|  1.50M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 1.48M, False: 18.6k]
  ------------------
  249|  1.48M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  1.48M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 835k, False: 654k]
  ------------------
  251|       |        // Open boundary reached.
  252|   835k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|   835k|        left_traversal_ = false;
  254|   835k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 107k, False: 546k]
  ------------------
  255|       |        // End reached.
  256|   107k|        corner_ = kInvalidCornerIndex;
  257|   107k|      }
  258|  1.48M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  18.6k|      corner_ = corner_table_->SwingRight(corner_);
  262|  18.6k|    }
  263|  1.50M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   942k|      : corner_table_(table),
  236|   942k|        start_corner_(corner_id),
  237|   942k|        corner_(start_corner_),
  238|   942k|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   534k|      : corner_table_(table),
  236|   534k|        start_corner_(corner_id),
  237|   534k|        corner_(start_corner_),
  238|   534k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  36.2M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  36.2M|    return is_edge_on_seam_[corner.value()];
   47|  36.2M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  16.2M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  16.2M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 16.2M]
  |  Branch (50:42): [True: 12.7M, False: 3.47M]
  ------------------
   51|  12.7M|      return kInvalidCornerIndex;
   52|  12.7M|    }
   53|  3.47M|    return corner_table_->Opposite(corner);
   54|  16.2M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  25.1M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  25.1M|    return corner_table_->Next(corner);
   58|  25.1M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  11.8M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  11.8M|    return corner_table_->Previous(corner);
   62|  11.8M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  2.88M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  2.88M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  2.88M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.00M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  2.00M|    return Opposite(Previous(corner));
   73|  2.00M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  2.41M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  2.41M|    return Opposite(Next(corner));
   76|  2.41M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  1.79M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  1.79M|    return Previous(Opposite(Previous(corner)));
   81|  1.79M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  8.21M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  8.21M|    return Next(Opposite(Next(corner)));
   86|  8.21M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  7.08k|  int num_vertices() const {
   89|  7.08k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  7.08k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  2.05k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|    962|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  62.0M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  62.0M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  62.0M|    return ConfidentVertex(corner);
   97|  62.0M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  62.0M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  62.0M|    return corner_to_vertex_map_[corner.value()];
  100|  62.0M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  1.94M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  1.94M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  1.94M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  1.94M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  1.94M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  1.94M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 1.94M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  1.94M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 1.52M, False: 416k]
  ------------------
  128|  1.52M|      return true;
  129|  1.52M|    }
  130|   416k|    return false;
  131|  1.94M|  }

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

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

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

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

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

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

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

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

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

