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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.70k|      : quantization_bits_(-1),
   54|  2.70k|        max_quantized_value_(-1),
   55|  2.70k|        max_value_(-1),
   56|  2.70k|        dequantization_scale_(1.f),
   57|  2.70k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  2.43k|  bool SetQuantizationBits(int32_t q) {
   60|  2.43k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 888, False: 1.54k]
  |  Branch (60:18): [True: 106, False: 1.44k]
  ------------------
   61|    994|      return false;
   62|    994|    }
   63|  1.44k|    quantization_bits_ = q;
   64|  1.44k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.44k|    max_value_ = max_quantized_value_ - 1;
   66|  1.44k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.44k|    center_value_ = max_value_ / 2;
   68|  1.44k|    return true;
   69|  2.43k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.88M|                                           int32_t *out_t) const {
   77|  2.88M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 3.99k, False: 2.88M]
  |  Branch (77:20): [True: 0, False: 3.99k]
  |  Branch (77:32): [True: 3.99k, False: 2.88M]
  |  Branch (77:42): [True: 0, False: 3.99k]
  ------------------
   78|  2.88M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 2.23M, False: 652k]
  |  Branch (78:29): [True: 4.78k, False: 2.22M]
  ------------------
   79|  4.78k|      s = max_value_;
   80|  4.78k|      t = max_value_;
   81|  2.88M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 3.99k, False: 2.87M]
  |  Branch (81:26): [True: 1.06k, False: 2.92k]
  ------------------
   82|  1.06k|      t = center_value_ - (t - center_value_);
   83|  2.88M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 2.22M, False: 650k]
  |  Branch (83:35): [True: 5.86k, False: 2.22M]
  ------------------
   84|  5.86k|      t = center_value_ + (center_value_ - t);
   85|  2.87M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 2.22M, False: 648k]
  |  Branch (85:35): [True: 612, False: 2.22M]
  ------------------
   86|    612|      s = center_value_ + (center_value_ - s);
   87|  2.87M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 6.14k, False: 2.86M]
  |  Branch (87:26): [True: 2.16k, False: 3.97k]
  ------------------
   88|  2.16k|      s = center_value_ - (s - center_value_);
   89|  2.16k|    }
   90|       |
   91|  2.88M|    *out_s = s;
   92|  2.88M|    *out_t = t;
   93|  2.88M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.88M|                                                       int32_t *out_t) const {
  100|  2.88M|    DRACO_DCHECK_EQ(
  101|  2.88M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.88M|        center_value_);
  103|  2.88M|    int32_t s, t;
  104|  2.88M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.36M, False: 1.52M]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.36M|      s = (int_vec[1] + center_value_);
  107|  1.36M|      t = (int_vec[2] + center_value_);
  108|  1.52M|    } else {
  109|       |      // Left hemisphere.
  110|  1.52M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 40.7k, False: 1.48M]
  ------------------
  111|  40.7k|        s = std::abs(int_vec[2]);
  112|  1.48M|      } else {
  113|  1.48M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.48M|      }
  115|  1.52M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 48.3k, False: 1.47M]
  ------------------
  116|  48.3k|        t = std::abs(int_vec[1]);
  117|  1.47M|      } else {
  118|  1.47M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.47M|      }
  120|  1.52M|    }
  121|  2.88M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.88M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   580k|                                                    float *out_vector) const {
  199|   580k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   580k|                                 in_t * dequantization_scale_ - 1.f,
  201|   580k|                                 out_vector);
  202|   580k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  2.36M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  2.36M|    DRACO_DCHECK_LE(s, center_value_);
  208|  2.36M|    DRACO_DCHECK_LE(t, center_value_);
  209|  2.36M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  2.36M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  2.36M|    const uint32_t st =
  212|  2.36M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  2.36M|    return st <= center_value_;
  214|  2.36M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  3.61M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  3.61M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  3.61M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  3.61M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  3.61M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  3.61M|    int32_t sign_s = 0;
  223|  3.61M|    int32_t sign_t = 0;
  224|  3.61M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 3.52M, False: 90.6k]
  |  Branch (224:20): [True: 3.46M, False: 62.2k]
  ------------------
  225|  3.46M|      sign_s = 1;
  226|  3.46M|      sign_t = 1;
  227|  3.46M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 93.0k, False: 59.8k]
  |  Branch (227:27): [True: 44.1k, False: 48.9k]
  ------------------
  228|  44.1k|      sign_s = -1;
  229|  44.1k|      sign_t = -1;
  230|   108k|    } else {
  231|   108k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 59.8k, False: 48.9k]
  ------------------
  232|   108k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 48.9k, False: 59.8k]
  ------------------
  233|   108k|    }
  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|  3.61M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  3.61M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  3.61M|    uint32_t us = *s;
  241|  3.61M|    uint32_t ut = *t;
  242|  3.61M|    us = us + us - corner_point_s;
  243|  3.61M|    ut = ut + ut - corner_point_t;
  244|  3.61M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 3.50M, False: 108k]
  ------------------
  245|  3.50M|      uint32_t temp = us;
  246|  3.50M|      us = -ut;
  247|  3.50M|      ut = -temp;
  248|  3.50M|    } else {
  249|   108k|      std::swap(us, ut);
  250|   108k|    }
  251|  3.61M|    us = us + corner_point_s;
  252|  3.61M|    ut = ut + corner_point_t;
  253|       |
  254|  3.61M|    *s = us;
  255|  3.61M|    *t = ut;
  256|  3.61M|    *s /= 2;
  257|  3.61M|    *t /= 2;
  258|  3.61M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  4.73M|  int32_t ModMax(int32_t x) const {
  273|  4.73M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 5.93k, False: 4.72M]
  ------------------
  274|  5.93k|      return x - this->max_quantized_value();
  275|  5.93k|    }
  276|  4.72M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 2.62k, False: 4.72M]
  ------------------
  277|  2.62k|      return x + this->max_quantized_value();
  278|  2.62k|    }
  279|  4.72M|    return x;
  280|  4.72M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.38k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  8.56k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  14.1M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   580k|                                           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|   580k|    float y = in_s_scaled;
  329|   580k|    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|   580k|    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|   580k|    float x_offset = -x;
  342|   580k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 145k, False: 435k]
  ------------------
  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|   580k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 10.6k, False: 569k]
  ------------------
  348|   580k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 10.3k, False: 570k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   580k|    const float norm_squared = x * x + y * y + z * z;
  352|   580k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 580k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   580k|    } else {
  357|   580k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   580k|      out_vector[0] = x * d;
  359|   580k|      out_vector[1] = y * d;
  360|   580k|      out_vector[2] = z * d;
  361|   580k|    }
  362|   580k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.88M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  2.88M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.88M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.88M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.88M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.88M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.88M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 2.64M, False: 238k]
  ------------------
  181|  2.64M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  2.64M|    } else {
  183|   238k|      vec[0] =
  184|   238k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   238k|          abs_sum;
  186|   238k|      vec[1] =
  187|   238k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   238k|          abs_sum;
  189|   238k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 132k, False: 105k]
  ------------------
  190|   132k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   132k|      } else {
  192|   105k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   105k|      }
  194|   238k|    }
  195|  2.88M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    468|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    468|            attribute, transform, mesh_data),
   52|    468|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    464|                                                                *buffer) {
  194|    464|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    464|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    464|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 10, False: 454]
  ------------------
  196|       |    // Decode prediction mode.
  197|     10|    uint8_t mode;
  198|     10|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 1, False: 9]
  ------------------
  199|      1|      return false;
  200|      1|    }
  201|       |
  202|      9|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 7, False: 2]
  ------------------
  203|       |      // Unsupported mode.
  204|      7|      return false;
  205|      7|    }
  206|      9|  }
  207|    456|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  2.11k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.72k, False: 384]
  ------------------
  211|  1.72k|    uint32_t num_flags;
  212|  1.72k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 16, False: 1.71k]
  ------------------
  213|     16|      return false;
  214|     16|    }
  215|  1.71k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 39, False: 1.67k]
  ------------------
  216|     39|      return false;
  217|     39|    }
  218|  1.67k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 495, False: 1.17k]
  ------------------
  219|    495|      is_crease_edge_[i].resize(num_flags);
  220|    495|      RAnsBitDecoder decoder;
  221|    495|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 17, False: 478]
  ------------------
  222|     17|        return false;
  223|     17|      }
  224|  1.34M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.34M, False: 478]
  ------------------
  225|  1.34M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.34M|      }
  227|    478|      decoder.EndDecoding();
  228|    478|    }
  229|  1.67k|  }
  230|    384|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    384|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    456|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    360|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    360|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    360|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.80k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.44k, False: 360]
  ------------------
   93|  1.44k|    pred_vals[i].resize(num_components, 0);
   94|  1.44k|  }
   95|    360|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    360|                                         out_data);
   97|       |
   98|    360|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    360|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    360|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    360|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    360|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    360|  const int corner_map_size =
  109|    360|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   858k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 857k, False: 238]
  ------------------
  111|   857k|    const CornerIndex start_corner_id =
  112|   857k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   857k|    CornerIndex corner_id(start_corner_id);
  115|   857k|    int num_parallelograms = 0;
  116|   857k|    bool first_pass = true;
  117|  1.83M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 1.00M, False: 831k]
  ------------------
  118|  1.00M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 57.5k, False: 946k]
  ------------------
  119|  1.00M|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  1.00M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  57.5k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  57.5k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 464, False: 57.0k]
  ------------------
  127|    464|          break;
  128|    464|        }
  129|  57.5k|      }
  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.00M|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 996k, False: 7.60k]
  ------------------
  134|   996k|        corner_id = table->SwingLeft(corner_id);
  135|   996k|      } else {
  136|  7.60k|        corner_id = table->SwingRight(corner_id);
  137|  7.60k|      }
  138|  1.00M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 26.2k, False: 977k]
  ------------------
  139|  26.2k|        break;
  140|  26.2k|      }
  141|   977k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 834k, False: 143k]
  |  Branch (141:47): [True: 831k, False: 3.22k]
  ------------------
  142|   831k|        first_pass = false;
  143|   831k|        corner_id = table->SwingRight(start_corner_id);
  144|   831k|      }
  145|   977k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   857k|    int num_used_parallelograms = 0;
  150|   857k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 31.4k, False: 826k]
  ------------------
  151|  2.65M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 2.61M, False: 31.4k]
  ------------------
  152|  2.61M|        multi_pred_vals[i] = 0;
  153|  2.61M|      }
  154|       |      // Check which parallelograms are actually used.
  155|  88.7k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 57.4k, False: 31.3k]
  ------------------
  156|  57.4k|        const int context = num_parallelograms - 1;
  157|  57.4k|        const int pos = is_crease_edge_pos[context]++;
  158|  57.4k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 122, False: 57.3k]
  ------------------
  159|    122|          return false;
  160|    122|        }
  161|  57.3k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  57.3k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 26.2k, False: 31.1k]
  ------------------
  163|  26.2k|          ++num_used_parallelograms;
  164|  2.88M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 2.85M, False: 26.2k]
  ------------------
  165|  2.85M|            multi_pred_vals[j] =
  166|  2.85M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  2.85M|          }
  168|  26.2k|        }
  169|  57.3k|      }
  170|  31.4k|    }
  171|   857k|    const int dst_offset = p * num_components;
  172|   857k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 844k, False: 13.4k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   844k|      const int src_offset = (p - 1) * num_components;
  176|   844k|      this->transform().ComputeOriginalValue(
  177|   844k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   844k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  1.46M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 1.44M, False: 13.4k]
  ------------------
  181|  1.44M|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  1.44M|      }
  183|  13.4k|      this->transform().ComputeOriginalValue(
  184|  13.4k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  13.4k|    }
  186|   857k|  }
  187|    238|  return true;
  188|    360|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    421|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    421|            attribute, transform, mesh_data),
   52|    421|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    405|                                                                *buffer) {
  194|    405|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    405|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    405|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 2, False: 403]
  ------------------
  196|       |    // Decode prediction mode.
  197|      2|    uint8_t mode;
  198|      2|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 2]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      2|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 1, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      1|      return false;
  205|      1|    }
  206|      2|  }
  207|    404|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.74k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.44k, False: 300]
  ------------------
  211|  1.44k|    uint32_t num_flags;
  212|  1.44k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 13, False: 1.42k]
  ------------------
  213|     13|      return false;
  214|     13|    }
  215|  1.42k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 61, False: 1.36k]
  ------------------
  216|     61|      return false;
  217|     61|    }
  218|  1.36k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 692, False: 676]
  ------------------
  219|    692|      is_crease_edge_[i].resize(num_flags);
  220|    692|      RAnsBitDecoder decoder;
  221|    692|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 30, False: 662]
  ------------------
  222|     30|        return false;
  223|     30|      }
  224|  1.08M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.08M, False: 662]
  ------------------
  225|  1.08M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.08M|      }
  227|    662|      decoder.EndDecoding();
  228|    662|    }
  229|  1.36k|  }
  230|    300|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    300|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    404|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    267|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    267|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    267|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.33k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.06k, False: 267]
  ------------------
   93|  1.06k|    pred_vals[i].resize(num_components, 0);
   94|  1.06k|  }
   95|    267|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    267|                                         out_data);
   97|       |
   98|    267|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    267|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    267|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    267|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    267|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    267|  const int corner_map_size =
  109|    267|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   145k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 145k, False: 130]
  ------------------
  111|   145k|    const CornerIndex start_corner_id =
  112|   145k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   145k|    CornerIndex corner_id(start_corner_id);
  115|   145k|    int num_parallelograms = 0;
  116|   145k|    bool first_pass = true;
  117|   841k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 832k, False: 9.70k]
  ------------------
  118|   832k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 270k, False: 561k]
  ------------------
  119|   832k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   832k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   270k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   270k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 457, False: 270k]
  ------------------
  127|    457|          break;
  128|    457|        }
  129|   270k|      }
  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|   831k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 823k, False: 8.46k]
  ------------------
  134|   823k|        corner_id = table->SwingLeft(corner_id);
  135|   823k|      } else {
  136|  8.46k|        corner_id = table->SwingRight(corner_id);
  137|  8.46k|      }
  138|   831k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 135k, False: 696k]
  ------------------
  139|   135k|        break;
  140|   135k|      }
  141|   696k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 14.2k, False: 682k]
  |  Branch (141:47): [True: 9.71k, False: 4.52k]
  ------------------
  142|  9.71k|        first_pass = false;
  143|  9.71k|        corner_id = table->SwingRight(start_corner_id);
  144|  9.71k|      }
  145|   696k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   145k|    int num_used_parallelograms = 0;
  150|   145k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 139k, False: 6.34k]
  ------------------
  151|  24.1M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 23.9M, False: 139k]
  ------------------
  152|  23.9M|        multi_pred_vals[i] = 0;
  153|  23.9M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   409k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 270k, False: 139k]
  ------------------
  156|   270k|        const int context = num_parallelograms - 1;
  157|   270k|        const int pos = is_crease_edge_pos[context]++;
  158|   270k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 137, False: 270k]
  ------------------
  159|    137|          return false;
  160|    137|        }
  161|   270k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   270k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 157k, False: 112k]
  ------------------
  163|   157k|          ++num_used_parallelograms;
  164|  29.3M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 29.1M, False: 157k]
  ------------------
  165|  29.1M|            multi_pred_vals[j] =
  166|  29.1M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  29.1M|          }
  168|   157k|        }
  169|   270k|      }
  170|   139k|    }
  171|   145k|    const int dst_offset = p * num_components;
  172|   145k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 65.4k, False: 80.0k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  65.4k|      const int src_offset = (p - 1) * num_components;
  176|  65.4k|      this->transform().ComputeOriginalValue(
  177|  65.4k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  80.0k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  14.7M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 14.6M, False: 80.0k]
  ------------------
  181|  14.6M|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  14.6M|      }
  183|  80.0k|      this->transform().ComputeOriginalValue(
  184|  80.0k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  80.0k|    }
  186|   145k|  }
  187|    130|  return true;
  188|    267|}

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

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   479k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   236k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  1.15M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   193k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.26k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.26k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  8.08M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.13k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.13k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  2.96M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    171|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    171|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    156|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    156|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    192|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    192|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    132|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    132|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    340|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    171|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    171|    DRACO_DCHECK_EQ(i, 0);
   70|    171|    (void)i;
   71|    171|    return GeometryAttribute::POSITION;
   72|    171|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    171|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    171|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 171]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    171|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 169]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    169|    predictor_.SetPositionAttribute(*att);
   82|    169|    return true;
   83|    171|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    168|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    168|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 163]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    163|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    163|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    163|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 61, False: 102]
  ------------------
  150|     61|    uint8_t prediction_mode;
  151|     61|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 60]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     60|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 10, False: 50]
  ------------------
  155|       |      // Invalid prediction mode.
  156|     10|      return false;
  157|     10|    }
  158|       |
  159|     50|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 50]
  ------------------
  160|     50|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     50|  }
  164|    152|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    152|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 14, False: 138]
  ------------------
  168|     14|    return false;
  169|     14|  }
  170|       |
  171|    138|  return true;
  172|    152|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    138|                                      const PointIndex *entry_to_point_id_map) {
  103|    138|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    138|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    138|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    138|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    138|  const int corner_map_size =
  111|    138|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    138|  VectorD<int32_t, 3> pred_normal_3d;
  114|    138|  int32_t pred_normal_oct[2];
  115|       |
  116|   479k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 479k, False: 138]
  ------------------
  117|   479k|    const CornerIndex corner_id =
  118|   479k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   479k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   479k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   479k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   479k|                    octahedron_tool_box_.center_value());
  125|   479k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 430k, False: 49.5k]
  ------------------
  126|   430k|      pred_normal_3d = -pred_normal_3d;
  127|   430k|    }
  128|   479k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   479k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   479k|    const int data_offset = data_id * 2;
  132|   479k|    this->transform().ComputeOriginalValue(
  133|   479k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   479k|  }
  135|    138|  flip_normal_bit_decoder_.EndDecoding();
  136|    138|  return true;
  137|    138|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    138|  void SetQuantizationBits(int q) {
   85|    138|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    138|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    307|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    156|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    156|    DRACO_DCHECK_EQ(i, 0);
   70|    156|    (void)i;
   71|    156|    return GeometryAttribute::POSITION;
   72|    156|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    156|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    156|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 156]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    156|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 5, False: 151]
  ------------------
   79|      5|      return false;  // Currently works only for 3 component positions.
   80|      5|    }
   81|    151|    predictor_.SetPositionAttribute(*att);
   82|    151|    return true;
   83|    156|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    151|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    151|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 10, False: 141]
  ------------------
  145|     10|    return false;
  146|     10|  }
  147|       |
  148|    141|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    141|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    141|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 19, False: 122]
  ------------------
  150|     19|    uint8_t prediction_mode;
  151|     19|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 18]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     18|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 17]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     17|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 17]
  ------------------
  160|     17|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     17|  }
  164|    139|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    139|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 134]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    134|  return true;
  172|    139|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    134|                                      const PointIndex *entry_to_point_id_map) {
  103|    134|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    134|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    134|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    134|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    134|  const int corner_map_size =
  111|    134|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    134|  VectorD<int32_t, 3> pred_normal_3d;
  114|    134|  int32_t pred_normal_oct[2];
  115|       |
  116|   236k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 235k, False: 134]
  ------------------
  117|   235k|    const CornerIndex corner_id =
  118|   235k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   235k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   235k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   235k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   235k|                    octahedron_tool_box_.center_value());
  125|   235k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 210k, False: 25.4k]
  ------------------
  126|   210k|      pred_normal_3d = -pred_normal_3d;
  127|   210k|    }
  128|   235k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   235k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   235k|    const int data_offset = data_id * 2;
  132|   235k|    this->transform().ComputeOriginalValue(
  133|   235k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   235k|  }
  135|    134|  flip_normal_bit_decoder_.EndDecoding();
  136|    134|  return true;
  137|    134|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    134|  void SetQuantizationBits(int q) {
   85|    134|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    134|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    381|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    192|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    192|    DRACO_DCHECK_EQ(i, 0);
   70|    192|    (void)i;
   71|    192|    return GeometryAttribute::POSITION;
   72|    192|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    192|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    192|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 192]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    192|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 189]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    189|    predictor_.SetPositionAttribute(*att);
   82|    189|    return true;
   83|    192|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    189|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    189|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 8, False: 181]
  ------------------
  145|      8|    return false;
  146|      8|  }
  147|       |
  148|    181|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    181|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    181|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 56, False: 125]
  ------------------
  150|     56|    uint8_t prediction_mode;
  151|     56|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 56]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     56|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 3, False: 53]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      3|      return false;
  157|      3|    }
  158|       |
  159|     53|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 53]
  ------------------
  160|     53|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     53|  }
  164|    178|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    178|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 16, False: 162]
  ------------------
  168|     16|    return false;
  169|     16|  }
  170|       |
  171|    162|  return true;
  172|    178|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    162|                                      const PointIndex *entry_to_point_id_map) {
  103|    162|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    162|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    162|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    162|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    162|  const int corner_map_size =
  111|    162|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    162|  VectorD<int32_t, 3> pred_normal_3d;
  114|    162|  int32_t pred_normal_oct[2];
  115|       |
  116|  1.15M|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 1.15M, False: 162]
  ------------------
  117|  1.15M|    const CornerIndex corner_id =
  118|  1.15M|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|  1.15M|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|  1.15M|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|  1.15M|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|  1.15M|                    octahedron_tool_box_.center_value());
  125|  1.15M|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 800k, False: 358k]
  ------------------
  126|   800k|      pred_normal_3d = -pred_normal_3d;
  127|   800k|    }
  128|  1.15M|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|  1.15M|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|  1.15M|    const int data_offset = data_id * 2;
  132|  1.15M|    this->transform().ComputeOriginalValue(
  133|  1.15M|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|  1.15M|  }
  135|    162|  flip_normal_bit_decoder_.EndDecoding();
  136|    162|  return true;
  137|    162|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    162|  void SetQuantizationBits(int q) {
   85|    162|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    162|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    260|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    132|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    132|    DRACO_DCHECK_EQ(i, 0);
   70|    132|    (void)i;
   71|    132|    return GeometryAttribute::POSITION;
   72|    132|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    132|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    132|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 132]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    132|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 4, False: 128]
  ------------------
   79|      4|      return false;  // Currently works only for 3 component positions.
   80|      4|    }
   81|    128|    predictor_.SetPositionAttribute(*att);
   82|    128|    return true;
   83|    132|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    128|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    128|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 4, False: 124]
  ------------------
  145|      4|    return false;
  146|      4|  }
  147|       |
  148|    124|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    124|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    124|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 26, False: 98]
  ------------------
  150|     26|    uint8_t prediction_mode;
  151|     26|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 26]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     26|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 24]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|     24|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 24]
  ------------------
  160|     24|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     24|  }
  164|    122|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    122|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 1, False: 121]
  ------------------
  168|      1|    return false;
  169|      1|  }
  170|       |
  171|    121|  return true;
  172|    122|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    121|                                      const PointIndex *entry_to_point_id_map) {
  103|    121|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    121|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    121|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    121|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    121|  const int corner_map_size =
  111|    121|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    121|  VectorD<int32_t, 3> pred_normal_3d;
  114|    121|  int32_t pred_normal_oct[2];
  115|       |
  116|   193k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 193k, False: 121]
  ------------------
  117|   193k|    const CornerIndex corner_id =
  118|   193k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   193k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   193k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   193k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   193k|                    octahedron_tool_box_.center_value());
  125|   193k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 188k, False: 4.99k]
  ------------------
  126|   188k|      pred_normal_3d = -pred_normal_3d;
  127|   188k|    }
  128|   193k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   193k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   193k|    const int data_offset = data_id * 2;
  132|   193k|    this->transform().ComputeOriginalValue(
  133|   193k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   193k|  }
  135|    121|  flip_normal_bit_decoder_.EndDecoding();
  136|    121|  return true;
  137|    121|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    121|  void SetQuantizationBits(int q) {
   85|    121|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    121|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    406|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    406|            attribute, transform, mesh_data),
   37|    406|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    810|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    406|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    406|    DRACO_DCHECK_EQ(i, 0);
   70|    406|    (void)i;
   71|    406|    return GeometryAttribute::POSITION;
   72|    406|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    405|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    405|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 405]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    405|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 404]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    404|    predictor_.SetPositionAttribute(*att);
   82|    404|    return true;
   83|    405|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    403|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    403|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 29, False: 374]
  ------------------
  145|     29|    return false;
  146|     29|  }
  147|       |
  148|    374|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    374|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    374|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 244, False: 130]
  ------------------
  150|    244|    uint8_t prediction_mode;
  151|    244|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 244]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|    244|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 8, False: 236]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      8|      return false;
  157|      8|    }
  158|       |
  159|    236|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 236]
  ------------------
  160|    236|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    236|  }
  164|    366|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    366|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 19, False: 347]
  ------------------
  168|     19|    return false;
  169|     19|  }
  170|       |
  171|    347|  return true;
  172|    366|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    347|                                      const PointIndex *entry_to_point_id_map) {
  103|    347|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    347|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    347|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    347|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    347|  const int corner_map_size =
  111|    347|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    347|  VectorD<int32_t, 3> pred_normal_3d;
  114|    347|  int32_t pred_normal_oct[2];
  115|       |
  116|   664k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 663k, False: 347]
  ------------------
  117|   663k|    const CornerIndex corner_id =
  118|   663k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   663k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   663k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   663k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   663k|                    octahedron_tool_box_.center_value());
  125|   663k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 661k, False: 2.25k]
  ------------------
  126|   661k|      pred_normal_3d = -pred_normal_3d;
  127|   661k|    }
  128|   663k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   663k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   663k|    const int data_offset = data_id * 2;
  132|   663k|    this->transform().ComputeOriginalValue(
  133|   663k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   663k|  }
  135|    347|  flip_normal_bit_decoder_.EndDecoding();
  136|    347|  return true;
  137|    347|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    347|  void SetQuantizationBits(int q) {
   85|    347|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    347|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    456|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    456|            attribute, transform, mesh_data),
   37|    456|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    910|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    456|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    456|    DRACO_DCHECK_EQ(i, 0);
   70|    456|    (void)i;
   71|    456|    return GeometryAttribute::POSITION;
   72|    456|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    456|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    456|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 456]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    456|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 454]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    454|    predictor_.SetPositionAttribute(*att);
   82|    454|    return true;
   83|    456|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    451|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    451|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 30, False: 421]
  ------------------
  145|     30|    return false;
  146|     30|  }
  147|       |
  148|    421|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    421|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    421|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 130, False: 291]
  ------------------
  150|    130|    uint8_t prediction_mode;
  151|    130|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 129]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    129|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 128]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|    128|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 128]
  ------------------
  160|    128|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    128|  }
  164|    419|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    419|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 22, False: 397]
  ------------------
  168|     22|    return false;
  169|     22|  }
  170|       |
  171|    397|  return true;
  172|    419|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    397|                                      const PointIndex *entry_to_point_id_map) {
  103|    397|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    397|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    397|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    397|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    397|  const int corner_map_size =
  111|    397|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    397|  VectorD<int32_t, 3> pred_normal_3d;
  114|    397|  int32_t pred_normal_oct[2];
  115|       |
  116|   156k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 155k, False: 397]
  ------------------
  117|   155k|    const CornerIndex corner_id =
  118|   155k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   155k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   155k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   155k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   155k|                    octahedron_tool_box_.center_value());
  125|   155k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 143k, False: 12.2k]
  ------------------
  126|   143k|      pred_normal_3d = -pred_normal_3d;
  127|   143k|    }
  128|   155k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   155k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   155k|    const int data_offset = data_id * 2;
  132|   155k|    this->transform().ComputeOriginalValue(
  133|   155k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   155k|  }
  135|    397|  flip_normal_bit_decoder_.EndDecoding();
  136|    397|  return true;
  137|    397|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    397|  void SetQuantizationBits(int q) {
   85|    397|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    397|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    171|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    171|            attribute, transform, mesh_data),
   37|    171|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    156|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    156|            attribute, transform, mesh_data),
   37|    156|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    192|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    192|            attribute, transform, mesh_data),
   37|    192|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    132|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    132|            attribute, transform, mesh_data),
   37|    132|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    221|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    221|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 48, False: 173]
  ------------------
  105|     48|      this->normal_prediction_mode_ = mode;
  106|     48|      return true;
  107|    173|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 173, False: 0]
  ------------------
  108|    173|      this->normal_prediction_mode_ = mode;
  109|    173|      return true;
  110|    173|    }
  111|      0|    return false;
  112|    221|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   479k|                             DataTypeT *prediction) override {
   42|   479k|    DRACO_DCHECK(this->IsInitialized());
   43|   479k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   479k|    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|   479k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   479k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   479k|    VectorD<int64_t, 3> normal;
   53|   479k|    CornerIndex c_next, c_prev;
   54|   976k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 496k, False: 479k]
  ------------------
   55|       |      // Getting corners.
   56|   496k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 222, False: 496k]
  ------------------
   57|    222|        c_next = corner_table->Next(corner_id);
   58|    222|        c_prev = corner_table->Previous(corner_id);
   59|   496k|      } else {
   60|   496k|        c_next = corner_table->Next(cit.Corner());
   61|   496k|        c_prev = corner_table->Previous(cit.Corner());
   62|   496k|      }
   63|   496k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   496k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   496k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   496k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   496k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   496k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   496k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   496k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   496k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   496k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   496k|      cit.Next();
   81|   496k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   479k|    constexpr int64_t upper_bound = 1 << 29;
   85|   479k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 148, False: 479k]
  ------------------
   86|    148|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    148|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 44, False: 104]
  ------------------
   88|     44|        const int64_t quotient = abs_sum / upper_bound;
   89|     44|        normal = normal / quotient;
   90|     44|      }
   91|   479k|    } else {
   92|   479k|      const int64_t abs_sum = normal.AbsSum();
   93|   479k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.86k, False: 476k]
  ------------------
   94|  2.86k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.86k|        normal = normal / quotient;
   96|  2.86k|      }
   97|   479k|    }
   98|   479k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   479k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   479k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   479k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   479k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    173|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    173|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 15, False: 158]
  ------------------
  105|     15|      this->normal_prediction_mode_ = mode;
  106|     15|      return true;
  107|    158|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 158, False: 0]
  ------------------
  108|    158|      this->normal_prediction_mode_ = mode;
  109|    158|      return true;
  110|    158|    }
  111|      0|    return false;
  112|    173|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   235k|                             DataTypeT *prediction) override {
   42|   235k|    DRACO_DCHECK(this->IsInitialized());
   43|   235k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   235k|    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|   235k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   235k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   235k|    VectorD<int64_t, 3> normal;
   53|   235k|    CornerIndex c_next, c_prev;
   54|  1.64M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.40M, False: 235k]
  ------------------
   55|       |      // Getting corners.
   56|  1.40M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 90, False: 1.40M]
  ------------------
   57|     90|        c_next = corner_table->Next(corner_id);
   58|     90|        c_prev = corner_table->Previous(corner_id);
   59|  1.40M|      } else {
   60|  1.40M|        c_next = corner_table->Next(cit.Corner());
   61|  1.40M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.40M|      }
   63|  1.40M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.40M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.40M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.40M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.40M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.40M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.40M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.40M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.40M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.40M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.40M|      cit.Next();
   81|  1.40M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   235k|    constexpr int64_t upper_bound = 1 << 29;
   85|   235k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 60, False: 235k]
  ------------------
   86|     60|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     60|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 17, False: 43]
  ------------------
   88|     17|        const int64_t quotient = abs_sum / upper_bound;
   89|     17|        normal = normal / quotient;
   90|     17|      }
   91|   235k|    } else {
   92|   235k|      const int64_t abs_sum = normal.AbsSum();
   93|   235k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 129k, False: 106k]
  ------------------
   94|   129k|        const int64_t quotient = abs_sum / upper_bound;
   95|   129k|        normal = normal / quotient;
   96|   129k|      }
   97|   235k|    }
   98|   235k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   235k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   235k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   235k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   235k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    245|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    245|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 51, False: 194]
  ------------------
  105|     51|      this->normal_prediction_mode_ = mode;
  106|     51|      return true;
  107|    194|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 194, False: 0]
  ------------------
  108|    194|      this->normal_prediction_mode_ = mode;
  109|    194|      return true;
  110|    194|    }
  111|      0|    return false;
  112|    245|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  1.15M|                             DataTypeT *prediction) override {
   42|  1.15M|    DRACO_DCHECK(this->IsInitialized());
   43|  1.15M|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  1.15M|    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|  1.15M|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  1.15M|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  1.15M|    VectorD<int64_t, 3> normal;
   53|  1.15M|    CornerIndex c_next, c_prev;
   54|  2.50M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.34M, False: 1.15M]
  ------------------
   55|       |      // Getting corners.
   56|  1.34M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 252, False: 1.34M]
  ------------------
   57|    252|        c_next = corner_table->Next(corner_id);
   58|    252|        c_prev = corner_table->Previous(corner_id);
   59|  1.34M|      } else {
   60|  1.34M|        c_next = corner_table->Next(cit.Corner());
   61|  1.34M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.34M|      }
   63|  1.34M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.34M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.34M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.34M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.34M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.34M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.34M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.34M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.34M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.34M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.34M|      cit.Next();
   81|  1.34M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  1.15M|    constexpr int64_t upper_bound = 1 << 29;
   85|  1.15M|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 168, False: 1.15M]
  ------------------
   86|    168|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    168|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 45, False: 123]
  ------------------
   88|     45|        const int64_t quotient = abs_sum / upper_bound;
   89|     45|        normal = normal / quotient;
   90|     45|      }
   91|  1.15M|    } else {
   92|  1.15M|      const int64_t abs_sum = normal.AbsSum();
   93|  1.15M|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.29k, False: 1.15M]
  ------------------
   94|  2.29k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.29k|        normal = normal / quotient;
   96|  2.29k|      }
   97|  1.15M|    }
   98|  1.15M|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  1.15M|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  1.15M|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  1.15M|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  1.15M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    156|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    156|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 24, False: 132]
  ------------------
  105|     24|      this->normal_prediction_mode_ = mode;
  106|     24|      return true;
  107|    132|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 132, False: 0]
  ------------------
  108|    132|      this->normal_prediction_mode_ = mode;
  109|    132|      return true;
  110|    132|    }
  111|      0|    return false;
  112|    156|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   193k|                             DataTypeT *prediction) override {
   42|   193k|    DRACO_DCHECK(this->IsInitialized());
   43|   193k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   193k|    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|   193k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   193k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   193k|    VectorD<int64_t, 3> normal;
   53|   193k|    CornerIndex c_next, c_prev;
   54|  1.34M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.14M, False: 193k]
  ------------------
   55|       |      // Getting corners.
   56|  1.14M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 144, False: 1.14M]
  ------------------
   57|    144|        c_next = corner_table->Next(corner_id);
   58|    144|        c_prev = corner_table->Previous(corner_id);
   59|  1.14M|      } else {
   60|  1.14M|        c_next = corner_table->Next(cit.Corner());
   61|  1.14M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.14M|      }
   63|  1.14M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.14M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.14M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.14M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.14M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.14M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.14M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.14M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.14M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.14M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.14M|      cit.Next();
   81|  1.14M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   193k|    constexpr int64_t upper_bound = 1 << 29;
   85|   193k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 96, False: 192k]
  ------------------
   86|     96|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     96|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 25, False: 71]
  ------------------
   88|     25|        const int64_t quotient = abs_sum / upper_bound;
   89|     25|        normal = normal / quotient;
   90|     25|      }
   91|   192k|    } else {
   92|   192k|      const int64_t abs_sum = normal.AbsSum();
   93|   192k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 74.6k, False: 118k]
  ------------------
   94|  74.6k|        const int64_t quotient = abs_sum / upper_bound;
   95|  74.6k|        normal = normal / quotient;
   96|  74.6k|      }
   97|   192k|    }
   98|   193k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   193k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   193k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   193k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   193k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    406|      : Base(md) {
   35|    406|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    406|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    642|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    642|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 229, False: 413]
  ------------------
  105|    229|      this->normal_prediction_mode_ = mode;
  106|    229|      return true;
  107|    413|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 413, False: 0]
  ------------------
  108|    413|      this->normal_prediction_mode_ = mode;
  109|    413|      return true;
  110|    413|    }
  111|      0|    return false;
  112|    642|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   663k|                             DataTypeT *prediction) override {
   42|   663k|    DRACO_DCHECK(this->IsInitialized());
   43|   663k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   663k|    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|   663k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   663k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   663k|    VectorD<int64_t, 3> normal;
   53|   663k|    CornerIndex c_next, c_prev;
   54|  1.34M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 680k, False: 663k]
  ------------------
   55|       |      // Getting corners.
   56|   680k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 1.30k, False: 679k]
  ------------------
   57|  1.30k|        c_next = corner_table->Next(corner_id);
   58|  1.30k|        c_prev = corner_table->Previous(corner_id);
   59|   679k|      } else {
   60|   679k|        c_next = corner_table->Next(cit.Corner());
   61|   679k|        c_prev = corner_table->Previous(cit.Corner());
   62|   679k|      }
   63|   680k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   680k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   680k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   680k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   680k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   680k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   680k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   680k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   680k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   680k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   680k|      cit.Next();
   81|   680k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   663k|    constexpr int64_t upper_bound = 1 << 29;
   85|   663k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 868, False: 662k]
  ------------------
   86|    868|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    868|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 316, False: 552]
  ------------------
   88|    316|        const int64_t quotient = abs_sum / upper_bound;
   89|    316|        normal = normal / quotient;
   90|    316|      }
   91|   662k|    } else {
   92|   662k|      const int64_t abs_sum = normal.AbsSum();
   93|   662k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.21k, False: 660k]
  ------------------
   94|  2.21k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.21k|        normal = normal / quotient;
   96|  2.21k|      }
   97|   662k|    }
   98|   663k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   663k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   663k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   663k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   663k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    456|      : Base(md) {
   35|    456|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    456|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    584|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    584|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 127, False: 457]
  ------------------
  105|    127|      this->normal_prediction_mode_ = mode;
  106|    127|      return true;
  107|    457|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 457, False: 0]
  ------------------
  108|    457|      this->normal_prediction_mode_ = mode;
  109|    457|      return true;
  110|    457|    }
  111|      0|    return false;
  112|    584|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   155k|                             DataTypeT *prediction) override {
   42|   155k|    DRACO_DCHECK(this->IsInitialized());
   43|   155k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   155k|    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|   155k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   155k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   155k|    VectorD<int64_t, 3> normal;
   53|   155k|    CornerIndex c_next, c_prev;
   54|  1.01M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 859k, False: 155k]
  ------------------
   55|       |      // Getting corners.
   56|   859k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 744, False: 859k]
  ------------------
   57|    744|        c_next = corner_table->Next(corner_id);
   58|    744|        c_prev = corner_table->Previous(corner_id);
   59|   859k|      } else {
   60|   859k|        c_next = corner_table->Next(cit.Corner());
   61|   859k|        c_prev = corner_table->Previous(cit.Corner());
   62|   859k|      }
   63|   859k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   859k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   859k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   859k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   859k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   859k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   859k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   859k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   859k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   859k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   859k|      cit.Next();
   81|   859k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   155k|    constexpr int64_t upper_bound = 1 << 29;
   85|   155k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 496, False: 155k]
  ------------------
   86|    496|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    496|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 155, False: 341]
  ------------------
   88|    155|        const int64_t quotient = abs_sum / upper_bound;
   89|    155|        normal = normal / quotient;
   90|    155|      }
   91|   155k|    } else {
   92|   155k|      const int64_t abs_sum = normal.AbsSum();
   93|   155k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.35k, False: 152k]
  ------------------
   94|  2.35k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.35k|        normal = normal / quotient;
   96|  2.35k|      }
   97|   155k|    }
   98|   155k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   155k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   155k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   155k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   155k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    171|      : Base(md) {
   35|    171|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    171|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    156|      : Base(md) {
   35|    156|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    156|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    192|      : Base(md) {
   35|    192|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    192|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    132|      : Base(md) {
   35|    132|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    132|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.47M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.47M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.47M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.47M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.47M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.47M|    return GetPositionForDataId(data_id);
   77|  1.47M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.47M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.47M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.47M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.47M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.47M|    VectorD<int64_t, 3> pos;
   68|  1.47M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.47M|    return pos;
   70|  1.47M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    169|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    169|    pos_attribute_ = &position_attribute;
   43|    169|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    138|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    138|    entry_to_point_id_map_ = map;
   46|    138|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.05M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.05M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.05M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.05M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.05M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.05M|    return GetPositionForDataId(data_id);
   77|  3.05M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.05M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.05M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.05M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.05M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.05M|    VectorD<int64_t, 3> pos;
   68|  3.05M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.05M|    return pos;
   70|  3.05M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    151|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    151|    pos_attribute_ = &position_attribute;
   43|    151|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    134|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    134|    entry_to_point_id_map_ = map;
   46|    134|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.84M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.84M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.84M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.84M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.84M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.84M|    return GetPositionForDataId(data_id);
   77|  3.84M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  3.84M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.84M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.84M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.84M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.84M|    VectorD<int64_t, 3> pos;
   68|  3.84M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.84M|    return pos;
   70|  3.84M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    189|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    189|    pos_attribute_ = &position_attribute;
   43|    189|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    162|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    162|    entry_to_point_id_map_ = map;
   46|    162|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.49M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.49M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.49M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.49M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.49M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.49M|    return GetPositionForDataId(data_id);
   77|  2.49M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.49M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.49M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.49M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.49M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.49M|    VectorD<int64_t, 3> pos;
   68|  2.49M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.49M|    return pos;
   70|  2.49M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    128|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    128|    pos_attribute_ = &position_attribute;
   43|    128|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    121|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    121|    entry_to_point_id_map_ = map;
   46|    121|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    406|      : pos_attribute_(nullptr),
   36|    406|        entry_to_point_id_map_(nullptr),
   37|    406|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    406|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.02M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.02M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.02M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.02M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.02M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.02M|    return GetPositionForDataId(data_id);
   77|  2.02M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.02M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.02M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.02M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.02M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.02M|    VectorD<int64_t, 3> pos;
   68|  2.02M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.02M|    return pos;
   70|  2.02M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    404|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    404|    pos_attribute_ = &position_attribute;
   43|    404|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    347|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    347|    entry_to_point_id_map_ = map;
   46|    347|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    456|      : pos_attribute_(nullptr),
   36|    456|        entry_to_point_id_map_(nullptr),
   37|    456|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    456|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.87M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.87M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.87M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.87M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.87M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.87M|    return GetPositionForDataId(data_id);
   77|  1.87M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.87M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.87M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.87M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.87M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.87M|    VectorD<int64_t, 3> pos;
   68|  1.87M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.87M|    return pos;
   70|  1.87M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    454|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    454|    pos_attribute_ = &position_attribute;
   43|    454|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    397|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    397|    entry_to_point_id_map_ = map;
   46|    397|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    171|      : pos_attribute_(nullptr),
   36|    171|        entry_to_point_id_map_(nullptr),
   37|    171|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    171|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    156|      : pos_attribute_(nullptr),
   36|    156|        entry_to_point_id_map_(nullptr),
   37|    156|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    156|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    192|      : pos_attribute_(nullptr),
   36|    192|        entry_to_point_id_map_(nullptr),
   37|    192|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    192|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    132|      : pos_attribute_(nullptr),
   36|    132|        entry_to_point_id_map_(nullptr),
   37|    132|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    132|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    349|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    349|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    340|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    340|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    340|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    340|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    340|      new DataTypeT[num_components]());
   70|       |
   71|    340|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    340|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    340|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    340|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    340|  const int corner_map_size =
   78|    340|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  2.83M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 2.82M, False: 340]
  ------------------
   80|  2.82M|    const CornerIndex start_corner_id =
   81|  2.82M|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  2.82M|    CornerIndex corner_id(start_corner_id);
   84|  2.82M|    int num_parallelograms = 0;
   85|  53.3M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 50.4M, False: 2.82M]
  ------------------
   86|  50.4M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  50.4M|    }
   88|  6.09M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 3.26M, False: 2.82M]
  ------------------
   89|  3.26M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 178k, False: 3.08M]
  ------------------
   90|  3.26M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  3.26M|              num_components, parallelogram_pred_vals.get())) {
   92|  16.9M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 16.7M, False: 178k]
  ------------------
   93|  16.7M|          pred_vals[c] =
   94|  16.7M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  16.7M|        }
   96|   178k|        ++num_parallelograms;
   97|   178k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  3.26M|      corner_id = table->SwingRight(corner_id);
  101|  3.26M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 82.0k, False: 3.17M]
  ------------------
  102|  82.0k|        corner_id = kInvalidCornerIndex;
  103|  82.0k|      }
  104|  3.26M|    }
  105|       |
  106|  2.82M|    const int dst_offset = p * num_components;
  107|  2.82M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 2.73M, False: 97.9k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  2.73M|      const int src_offset = (p - 1) * num_components;
  111|  2.73M|      this->transform().ComputeOriginalValue(
  112|  2.73M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  2.73M|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  8.88M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 8.79M, False: 97.9k]
  ------------------
  116|  8.79M|        pred_vals[c] /= num_parallelograms;
  117|  8.79M|      }
  118|  97.9k|      this->transform().ComputeOriginalValue(
  119|  97.9k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  97.9k|    }
  121|  2.82M|  }
  122|    340|  return true;
  123|    340|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    409|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    409|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    384|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    384|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    384|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    384|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    384|      new DataTypeT[num_components]());
   70|       |
   71|    384|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    384|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    384|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    384|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    384|  const int corner_map_size =
   78|    384|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  1.02M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 1.02M, False: 384]
  ------------------
   80|  1.02M|    const CornerIndex start_corner_id =
   81|  1.02M|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  1.02M|    CornerIndex corner_id(start_corner_id);
   84|  1.02M|    int num_parallelograms = 0;
   85|  37.2M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 36.2M, False: 1.02M]
  ------------------
   86|  36.2M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  36.2M|    }
   88|  7.01M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 5.98M, False: 1.02M]
  ------------------
   89|  5.98M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.96M, False: 4.01M]
  ------------------
   90|  5.98M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  5.98M|              num_components, parallelogram_pred_vals.get())) {
   92|  65.2M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 63.2M, False: 1.96M]
  ------------------
   93|  63.2M|          pred_vals[c] =
   94|  63.2M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  63.2M|        }
   96|  1.96M|        ++num_parallelograms;
   97|  1.96M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  5.98M|      corner_id = table->SwingRight(corner_id);
  101|  5.98M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 991k, False: 4.99M]
  ------------------
  102|   991k|        corner_id = kInvalidCornerIndex;
  103|   991k|      }
  104|  5.98M|    }
  105|       |
  106|  1.02M|    const int dst_offset = p * num_components;
  107|  1.02M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 18.5k, False: 1.00M]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  18.5k|      const int src_offset = (p - 1) * num_components;
  111|  18.5k|      this->transform().ComputeOriginalValue(
  112|  18.5k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  1.00M|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  33.9M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 32.9M, False: 1.00M]
  ------------------
  116|  32.9M|        pred_vals[c] /= num_parallelograms;
  117|  32.9M|      }
  118|  1.00M|      this->transform().ComputeOriginalValue(
  119|  1.00M|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  1.00M|    }
  121|  1.02M|  }
  122|    384|  return true;
  123|    384|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  6.75M|    int num_components, DataTypeT *out_prediction) {
   49|  6.75M|  const CornerIndex oci = table->Opposite(ci);
   50|  6.75M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 6.00M, False: 756k]
  ------------------
   51|  6.00M|    return false;
   52|  6.00M|  }
   53|   756k|  int vert_opp, vert_next, vert_prev;
   54|   756k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   756k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   756k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 404k, False: 351k]
  |  Branch (56:35): [True: 314k, False: 89.9k]
  ------------------
   57|   314k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 296k, False: 17.8k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   296k|    const int v_opp_off = vert_opp * num_components;
   60|   296k|    const int v_next_off = vert_next * num_components;
   61|   296k|    const int v_prev_off = vert_prev * num_components;
   62|  22.9M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 22.6M, False: 296k]
  ------------------
   63|  22.6M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  22.6M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  22.6M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  22.6M|      const int64_t result =
   67|  22.6M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  22.6M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  22.6M|    }
   71|   296k|    return true;
   72|   296k|  }
   73|   459k|  return false;  // Not all data is available for prediction
   74|   756k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   756k|    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|   756k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   756k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   756k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   756k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  7.10M|    int num_components, DataTypeT *out_prediction) {
   49|  7.10M|  const CornerIndex oci = table->Opposite(ci);
   50|  7.10M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 46.2k, False: 7.05M]
  ------------------
   51|  46.2k|    return false;
   52|  46.2k|  }
   53|  7.05M|  int vert_opp, vert_next, vert_prev;
   54|  7.05M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  7.05M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  7.05M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 3.64M, False: 3.41M]
  |  Branch (56:35): [True: 2.78M, False: 858k]
  ------------------
   57|  2.78M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 2.52M, False: 263k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  2.52M|    const int v_opp_off = vert_opp * num_components;
   60|  2.52M|    const int v_next_off = vert_next * num_components;
   61|  2.52M|    const int v_prev_off = vert_prev * num_components;
   62|   146M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 144M, False: 2.52M]
  ------------------
   63|   144M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|   144M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|   144M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|   144M|      const int64_t result =
   67|   144M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|   144M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|   144M|    }
   71|  2.52M|    return true;
   72|  2.52M|  }
   73|  4.53M|  return false;  // Not all data is available for prediction
   74|  7.05M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  7.05M|    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|  7.05M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  7.05M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  7.05M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  7.05M|}

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

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

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

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     85|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    394|  bool AreCorrectionsPositive() override {
   71|    394|    return transform_.AreCorrectionsPositive();
   72|    394|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     75|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     75|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 6, False: 69]
  ------------------
   50|      6|      return false;
   51|      6|    }
   52|     69|    return true;
   53|     75|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   718k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    130|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    443|  bool AreCorrectionsPositive() override {
   71|    443|    return transform_.AreCorrectionsPositive();
   72|    443|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    126|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    126|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 14, False: 112]
  ------------------
   50|     14|      return false;
   51|     14|    }
   52|    112|    return true;
   53|    126|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  1.64M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  4.69k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  3.13k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  4.52k|  bool AreCorrectionsPositive() override {
   71|  4.52k|    return transform_.AreCorrectionsPositive();
   72|  4.52k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  3.42k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  3.42k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 194, False: 3.22k]
  ------------------
   50|    194|      return false;
   51|    194|    }
   52|  3.22k|    return true;
   53|  3.42k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  9.08M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    412|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    454|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    412|                                 const PointCloudDecoder *decoder) {
  188|    412|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    412|      method, att_id, decoder, TransformT());
  190|    412|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    412|                                 const TransformT &transform) {
  156|    412|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 412]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    412|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    412|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 412, 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|    412|    const MeshDecoder *const mesh_decoder =
  167|    412|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    412|    auto ret = CreateMeshPredictionScheme<
  170|    412|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    412|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    412|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    412|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 327, False: 85]
  ------------------
  174|    327|      return ret;
  175|    327|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    412|  }
  178|       |  // Create delta decoder.
  179|     85|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     85|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    412|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    185|      uint16_t bitstream_version) {
  143|    185|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    185|        method, attribute, transform, mesh_data, bitstream_version);
  145|    185|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    185|        uint16_t bitstream_version) {
  127|    185|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 171, False: 14]
  ------------------
  128|    171|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    171|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    171|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    171|                                                  mesh_data));
  132|    171|      }
  133|     14|      return nullptr;
  134|    185|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    161|      uint16_t bitstream_version) {
  143|    161|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    161|        method, attribute, transform, mesh_data, bitstream_version);
  145|    161|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    161|        uint16_t bitstream_version) {
  127|    161|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 156, False: 5]
  ------------------
  128|    156|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    156|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    156|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    156|                                                  mesh_data));
  132|    156|      }
  133|      5|      return nullptr;
  134|    161|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    454|                                 const PointCloudDecoder *decoder) {
  188|    454|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    454|      method, att_id, decoder, TransformT());
  190|    454|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    454|                                 const TransformT &transform) {
  156|    454|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 454]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    454|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    454|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 454, 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|    454|    const MeshDecoder *const mesh_decoder =
  167|    454|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    454|    auto ret = CreateMeshPredictionScheme<
  170|    454|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    454|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    454|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    454|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 324, False: 130]
  ------------------
  174|    324|      return ret;
  175|    324|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    454|  }
  178|       |  // Create delta decoder.
  179|    130|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    130|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    454|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    202|      uint16_t bitstream_version) {
  143|    202|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    202|        method, attribute, transform, mesh_data, bitstream_version);
  145|    202|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    202|        uint16_t bitstream_version) {
  111|    202|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 192, False: 10]
  ------------------
  112|    192|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    192|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    192|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    192|                                                  mesh_data));
  116|    192|      }
  117|     10|      return nullptr;
  118|    202|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    134|      uint16_t bitstream_version) {
  143|    134|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    134|        method, attribute, transform, mesh_data, bitstream_version);
  145|    134|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    134|        uint16_t bitstream_version) {
  111|    134|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 132, False: 2]
  ------------------
  112|    132|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    132|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    132|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    132|                                                  mesh_data));
  116|    132|      }
  117|      2|      return nullptr;
  118|    134|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  4.69k|                                 const PointCloudDecoder *decoder) {
  188|  4.69k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  4.69k|      method, att_id, decoder, TransformT());
  190|  4.69k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  4.69k|                                 const TransformT &transform) {
  156|  4.69k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 4.69k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  4.69k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  4.69k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 4.69k, 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|  4.69k|    const MeshDecoder *const mesh_decoder =
  167|  4.69k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  4.69k|    auto ret = CreateMeshPredictionScheme<
  170|  4.69k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  4.69k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  4.69k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  4.69k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 4.40k, False: 290]
  ------------------
  174|  4.40k|      return ret;
  175|  4.40k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  4.69k|  }
  178|       |  // Create delta decoder.
  179|    290|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    290|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  4.69k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.26k|      uint16_t bitstream_version) {
  143|  2.26k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.26k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.26k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.26k|        uint16_t bitstream_version) {
   53|  2.26k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 673, False: 1.58k]
  ------------------
   54|    673|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    673|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    673|                                                         MeshDataT>(
   57|    673|                attribute, transform, mesh_data));
   58|    673|      }
   59|  1.58k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.58k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 349, False: 1.24k]
  ------------------
   61|    349|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    349|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    349|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    349|                                                  mesh_data));
   65|    349|      }
   66|  1.24k|#endif
   67|  1.24k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 468, False: 772]
  ------------------
   68|    468|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    468|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    468|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    468|                                                  mesh_data));
   72|    468|      }
   73|    772|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    772|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 165, False: 607]
  ------------------
   75|    165|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    165|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    165|                                                     MeshDataT>(
   78|    165|                attribute, transform, mesh_data, bitstream_version));
   79|    165|      }
   80|    607|#endif
   81|    607|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 201, False: 406]
  ------------------
   82|    201|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    201|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    201|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    201|                                                  mesh_data));
   86|    201|      }
   87|    406|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    406|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 406, False: 0]
  ------------------
   89|    406|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    406|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    406|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    406|                                                  mesh_data));
   93|    406|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.26k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.13k|      uint16_t bitstream_version) {
  143|  2.13k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.13k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.13k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.13k|        uint16_t bitstream_version) {
   53|  2.13k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 529, False: 1.61k]
  ------------------
   54|    529|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    529|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    529|                                                         MeshDataT>(
   57|    529|                attribute, transform, mesh_data));
   58|    529|      }
   59|  1.61k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.61k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 409, False: 1.20k]
  ------------------
   61|    409|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    409|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    409|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    409|                                                  mesh_data));
   65|    409|      }
   66|  1.20k|#endif
   67|  1.20k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 421, False: 780]
  ------------------
   68|    421|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    421|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    421|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    421|                                                  mesh_data));
   72|    421|      }
   73|    780|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    780|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 130, False: 650]
  ------------------
   75|    130|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    130|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    130|                                                     MeshDataT>(
   78|    130|                attribute, transform, mesh_data, bitstream_version));
   79|    130|      }
   80|    650|#endif
   81|    650|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 194, False: 456]
  ------------------
   82|    194|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    194|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    194|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    194|                                                  mesh_data));
   86|    194|      }
   87|    456|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    456|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 456, False: 0]
  ------------------
   89|    456|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    456|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    456|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    456|                                                  mesh_data));
   93|    456|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.13k|    }

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     69|    const PointIndex *) {
   50|     69|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     69|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     69|  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|  2.31k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 2.24k, False: 69]
  ------------------
   57|  2.24k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  2.24k|                                           in_corr + i, out_data + i);
   59|  2.24k|  }
   60|     69|  return true;
   61|     69|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    112|    const PointIndex *) {
   50|    112|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    112|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    112|  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|   296k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 296k, False: 112]
  ------------------
   57|   296k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   296k|                                           in_corr + i, out_data + i);
   59|   296k|  }
   60|    112|  return true;
   61|    112|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    290|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    233|    const PointIndex *) {
   50|    233|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    233|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    233|  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|  24.5k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 24.3k, False: 233]
  ------------------
   57|  24.3k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  24.3k|                                           in_corr + i, out_data + i);
   59|  24.3k|  }
   60|    233|  return true;
   61|    233|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     85|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    130|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    412|    uint16_t bitstream_version) {
   38|    412|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    412|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 412, False: 0]
  ------------------
   40|    412|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 20, False: 392]
  ------------------
   41|    392|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 18, False: 374]
  ------------------
   42|    374|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 12, False: 362]
  ------------------
   43|    362|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 362]
  ------------------
   44|    362|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 334, False: 28]
  ------------------
   45|    394|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 10, False: 18]
  ------------------
   46|    394|    const CornerTable *const ct = source->GetCornerTable();
   47|    394|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    394|        source->GetAttributeEncodingData(att_id);
   49|    394|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 48, False: 346]
  |  Branch (49:26): [True: 0, False: 346]
  ------------------
   50|       |      // No connectivity data found.
   51|     48|      return nullptr;
   52|     48|    }
   53|       |    // Connectivity data exists.
   54|    346|    const MeshAttributeCornerTable *const att_ct =
   55|    346|        source->GetAttributeCornerTable(att_id);
   56|    346|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 185, False: 161]
  ------------------
   57|    185|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    185|      MeshData md;
   59|    185|      md.Set(source->mesh(), att_ct,
   60|    185|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    185|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    185|      MeshPredictionSchemeFactoryT factory;
   63|    185|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    185|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 171, False: 14]
  ------------------
   65|    171|        return ret;
   66|    171|      }
   67|    185|    } else {
   68|    161|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    161|      MeshData md;
   70|    161|      md.Set(source->mesh(), ct,
   71|    161|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    161|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    161|      MeshPredictionSchemeFactoryT factory;
   74|    161|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    161|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 156, False: 5]
  ------------------
   76|    156|        return ret;
   77|    156|      }
   78|    161|    }
   79|    346|  }
   80|     37|  return nullptr;
   81|    412|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    454|    uint16_t bitstream_version) {
   38|    454|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    454|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 454, False: 0]
  ------------------
   40|    454|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 4, False: 450]
  ------------------
   41|    450|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 41, False: 409]
  ------------------
   42|    409|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 21, False: 388]
  ------------------
   43|    388|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 387]
  ------------------
   44|    387|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 331, False: 56]
  ------------------
   45|    414|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 16, False: 40]
  ------------------
   46|    414|    const CornerTable *const ct = source->GetCornerTable();
   47|    414|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    414|        source->GetAttributeEncodingData(att_id);
   49|    414|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 78, False: 336]
  |  Branch (49:26): [True: 0, False: 336]
  ------------------
   50|       |      // No connectivity data found.
   51|     78|      return nullptr;
   52|     78|    }
   53|       |    // Connectivity data exists.
   54|    336|    const MeshAttributeCornerTable *const att_ct =
   55|    336|        source->GetAttributeCornerTable(att_id);
   56|    336|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 202, False: 134]
  ------------------
   57|    202|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    202|      MeshData md;
   59|    202|      md.Set(source->mesh(), att_ct,
   60|    202|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    202|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    202|      MeshPredictionSchemeFactoryT factory;
   63|    202|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    202|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 192, False: 10]
  ------------------
   65|    192|        return ret;
   66|    192|      }
   67|    202|    } else {
   68|    134|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    134|      MeshData md;
   70|    134|      md.Set(source->mesh(), ct,
   71|    134|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    134|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    134|      MeshPredictionSchemeFactoryT factory;
   74|    134|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    134|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 132, False: 2]
  ------------------
   76|    132|        return ret;
   77|    132|      }
   78|    134|    }
   79|    336|  }
   80|     52|  return nullptr;
   81|    454|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  4.69k|    uint16_t bitstream_version) {
   38|  4.69k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  4.69k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 4.69k, False: 0]
  ------------------
   40|  4.69k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.29k, False: 3.39k]
  ------------------
   41|  3.39k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 764, False: 2.63k]
  ------------------
   42|  2.63k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 904, False: 1.72k]
  ------------------
   43|  1.72k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 396, False: 1.33k]
  ------------------
   44|  1.33k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 862, False: 471]
  ------------------
   45|  4.51k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 297, False: 174]
  ------------------
   46|  4.51k|    const CornerTable *const ct = source->GetCornerTable();
   47|  4.51k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  4.51k|        source->GetAttributeEncodingData(att_id);
   49|  4.51k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 116, False: 4.40k]
  |  Branch (49:26): [True: 0, False: 4.40k]
  ------------------
   50|       |      // No connectivity data found.
   51|    116|      return nullptr;
   52|    116|    }
   53|       |    // Connectivity data exists.
   54|  4.40k|    const MeshAttributeCornerTable *const att_ct =
   55|  4.40k|        source->GetAttributeCornerTable(att_id);
   56|  4.40k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 2.26k, False: 2.13k]
  ------------------
   57|  2.26k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  2.26k|      MeshData md;
   59|  2.26k|      md.Set(source->mesh(), att_ct,
   60|  2.26k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  2.26k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  2.26k|      MeshPredictionSchemeFactoryT factory;
   63|  2.26k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  2.26k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 2.26k, False: 0]
  ------------------
   65|  2.26k|        return ret;
   66|  2.26k|      }
   67|  2.26k|    } else {
   68|  2.13k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.13k|      MeshData md;
   70|  2.13k|      md.Set(source->mesh(), ct,
   71|  2.13k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.13k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.13k|      MeshPredictionSchemeFactoryT factory;
   74|  2.13k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.13k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.13k, False: 0]
  ------------------
   76|  2.13k|        return ret;
   77|  2.13k|      }
   78|  2.13k|    }
   79|  4.40k|  }
   80|    174|  return nullptr;
   81|  4.69k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  1.64M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  1.64M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 1.56M, False: 84.1k]
  |  Branch (93:22): [True: 1.55M, False: 6.30k]
  ------------------
   94|  1.55M|      return true;
   95|  1.55M|    }
   96|  90.4k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 42.2k, False: 48.1k]
  |  Branch (96:25): [True: 20.3k, False: 21.9k]
  ------------------
   97|  1.64M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  1.64M|  int32_t GetRotationCount(Point2 pred) const {
   51|  1.64M|    const DataType sign_x = pred[0];
   52|  1.64M|    const DataType sign_y = pred[1];
   53|       |
   54|  1.64M|    int32_t rotation_count = 0;
   55|  1.64M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 1.56M, False: 84.1k]
  ------------------
   56|  1.56M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 1.55M, False: 6.30k]
  ------------------
   57|  1.55M|        rotation_count = 0;
   58|  1.55M|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 3.23k, False: 3.07k]
  ------------------
   59|  3.23k|        rotation_count = 3;
   60|  3.23k|      } else {
   61|  3.07k|        rotation_count = 1;
   62|  3.07k|      }
   63|  1.56M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 41.8k, False: 42.2k]
  ------------------
   64|  41.8k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 19.5k, False: 22.2k]
  ------------------
   65|  19.5k|        rotation_count = 2;
   66|  22.2k|      } else {
   67|  22.2k|        rotation_count = 1;
   68|  22.2k|      }
   69|  42.2k|    } else {
   70|  42.2k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 20.3k, False: 21.9k]
  ------------------
   71|  20.3k|        rotation_count = 0;
   72|  21.9k|      } else {
   73|  21.9k|        rotation_count = 3;
   74|  21.9k|      }
   75|  42.2k|    }
   76|  1.64M|    return rotation_count;
   77|  1.64M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   140k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   140k|    switch (rotation_count) {
   81|  50.4k|      case 1:
  ------------------
  |  Branch (81:7): [True: 50.4k, False: 89.6k]
  ------------------
   82|  50.4k|        return Point2(p[1], -p[0]);
   83|  39.1k|      case 2:
  ------------------
  |  Branch (83:7): [True: 39.1k, False: 100k]
  ------------------
   84|  39.1k|        return Point2(-p[0], -p[1]);
   85|  50.4k|      case 3:
  ------------------
  |  Branch (85:7): [True: 50.4k, False: 89.6k]
  ------------------
   86|  50.4k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 140k]
  ------------------
   88|      0|        return p;
   89|   140k|    }
   90|   140k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    454|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

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

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  8.56k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  5.24M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  5.55k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  30.2k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  9.45k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  9.45k|    portable_attribute_ = std::move(att);
   71|  9.45k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  33.2k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  25.5k|  virtual ~SequentialAttributeDecoder() = default;

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

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

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

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

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

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

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

_ZN5draco14RAnsBitDecoderC2Ev:
   23|  20.2k|RAnsBitDecoder::RAnsBitDecoder() : prob_zero_(0) {}
_ZN5draco14RAnsBitDecoderD2Ev:
   25|  20.2k|RAnsBitDecoder::~RAnsBitDecoder() { Clear(); }
_ZN5draco14RAnsBitDecoder13StartDecodingEPNS_13DecoderBufferE:
   27|  17.8k|bool RAnsBitDecoder::StartDecoding(DecoderBuffer *source_buffer) {
   28|  17.8k|  Clear();
   29|       |
   30|  17.8k|  if (!source_buffer->Decode(&prob_zero_)) {
  ------------------
  |  Branch (30:7): [True: 21, False: 17.8k]
  ------------------
   31|     21|    return false;
   32|     21|  }
   33|       |
   34|  17.8k|  uint32_t size_in_bytes;
   35|  17.8k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  17.8k|  if (source_buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  17.8k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (36:7): [True: 914, False: 16.9k]
  ------------------
   37|    914|    if (!source_buffer->Decode(&size_in_bytes)) {
  ------------------
  |  Branch (37:9): [True: 6, False: 908]
  ------------------
   38|      6|      return false;
   39|      6|    }
   40|       |
   41|    914|  } else
   42|  16.9k|#endif
   43|  16.9k|  {
   44|  16.9k|    if (!DecodeVarint(&size_in_bytes, source_buffer)) {
  ------------------
  |  Branch (44:9): [True: 19, False: 16.9k]
  ------------------
   45|     19|      return false;
   46|     19|    }
   47|  16.9k|  }
   48|       |
   49|  17.8k|  if (size_in_bytes > source_buffer->remaining_size()) {
  ------------------
  |  Branch (49:7): [True: 90, False: 17.7k]
  ------------------
   50|     90|    return false;
   51|     90|  }
   52|       |
   53|  17.7k|  if (ans_read_init(&ans_decoder_,
  ------------------
  |  Branch (53:7): [True: 46, False: 17.7k]
  ------------------
   54|  17.7k|                    reinterpret_cast<uint8_t *>(
   55|  17.7k|                        const_cast<char *>(source_buffer->data_head())),
   56|  17.7k|                    size_in_bytes) != 0) {
   57|     46|    return false;
   58|     46|  }
   59|  17.7k|  source_buffer->Advance(size_in_bytes);
   60|  17.7k|  return true;
   61|  17.7k|}
_ZN5draco14RAnsBitDecoder13DecodeNextBitEv:
   63|  11.1G|bool RAnsBitDecoder::DecodeNextBit() {
   64|  11.1G|  const uint8_t bit = rabs_read(&ans_decoder_, prob_zero_);
  ------------------
  |  |  246|  11.1G|#define rabs_read rabs_desc_read
  ------------------
   65|  11.1G|  return bit > 0;
   66|  11.1G|}
_ZN5draco14RAnsBitDecoder5ClearEv:
   80|  38.1k|void RAnsBitDecoder::Clear() { ans_read_end(&ans_decoder_); }

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

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

_ZN5draco17CreateMeshDecoderEh:
   45|  7.64k|StatusOr<std::unique_ptr<MeshDecoder>> CreateMeshDecoder(uint8_t method) {
   46|  7.64k|  if (method == MESH_SEQUENTIAL_ENCODING) {
  ------------------
  |  Branch (46:7): [True: 1.85k, False: 5.79k]
  ------------------
   47|  1.85k|    return std::unique_ptr<MeshDecoder>(new MeshSequentialDecoder());
   48|  5.79k|  } else if (method == MESH_EDGEBREAKER_ENCODING) {
  ------------------
  |  Branch (48:14): [True: 5.79k, False: 0]
  ------------------
   49|  5.79k|    return std::unique_ptr<MeshDecoder>(new MeshEdgebreakerDecoder());
   50|  5.79k|  }
   51|      0|  return Status(Status::DRACO_ERROR, "Unsupported encoding method.");
   52|  7.64k|}
_ZN5draco7Decoder20DecodeMeshFromBufferEPNS_13DecoderBufferE:
   87|  7.64k|    DecoderBuffer *in_buffer) {
   88|  7.64k|  std::unique_ptr<Mesh> mesh(new Mesh());
   89|  7.64k|  DRACO_RETURN_IF_ERROR(DecodeBufferToGeometry(in_buffer, mesh.get()))
  ------------------
  |  |   74|  7.64k|  {                                                   \
  |  |   75|  7.64k|    const draco::Status _local_status = (expression); \
  |  |   76|  7.64k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 6.80k, False: 844]
  |  |  ------------------
  |  |   77|  6.80k|      return _local_status;                           \
  |  |   78|  6.80k|    }                                                 \
  |  |   79|  7.64k|  }
  ------------------
   90|    844|  return std::move(mesh);
   91|  7.64k|}
_ZN5draco7Decoder22DecodeBufferToGeometryEPNS_13DecoderBufferEPNS_4MeshE:
  113|  7.64k|                                       Mesh *out_geometry) {
  114|  7.64k|#ifdef DRACO_MESH_COMPRESSION_SUPPORTED
  115|  7.64k|  DecoderBuffer temp_buffer(*in_buffer);
  116|  7.64k|  DracoHeader header;
  117|  7.64k|  DRACO_RETURN_IF_ERROR(PointCloudDecoder::DecodeHeader(&temp_buffer, &header))
  ------------------
  |  |   74|  7.64k|  {                                                   \
  |  |   75|  7.64k|    const draco::Status _local_status = (expression); \
  |  |   76|  7.64k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 0, False: 7.64k]
  |  |  ------------------
  |  |   77|      0|      return _local_status;                           \
  |  |   78|      0|    }                                                 \
  |  |   79|  7.64k|  }
  ------------------
  118|  7.64k|  if (header.encoder_type != TRIANGULAR_MESH) {
  ------------------
  |  Branch (118:7): [True: 0, False: 7.64k]
  ------------------
  119|      0|    return Status(Status::DRACO_ERROR, "Input is not a mesh.");
  120|      0|  }
  121|  15.2k|  DRACO_ASSIGN_OR_RETURN(std::unique_ptr<MeshDecoder> decoder,
  ------------------
  |  |   66|  7.64k|  DRACO_ASSIGN_OR_RETURN_IMPL_(DRACO_MACROS_IMPL_CONCAT_(_statusor, __LINE__), \
  |  |  ------------------
  |  |  |  |   71|  7.64k|  auto statusor = (expression);                                             \
  |  |  |  |   72|  7.64k|  if (!statusor.ok()) {                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (72:7): [True: 0, False: 7.64k]
  |  |  |  |  ------------------
  |  |  |  |   73|      0|    auto _status = std::move(statusor.status());                            \
  |  |  |  |   74|      0|    (void)_status; /* error_expression may not use it */                    \
  |  |  |  |   75|      0|    return error_expr;                                                      \
  |  |  |  |   76|      0|  }                                                                         \
  |  |  |  |   77|  7.64k|  lhs = std::move(statusor).value();
  |  |  ------------------
  |  |   67|  7.64k|                               lhs, expression, _status)
  ------------------
  122|  15.2k|                         CreateMeshDecoder(header.encoder_method))
  123|       |
  124|  15.2k|  DRACO_RETURN_IF_ERROR(decoder->Decode(options_, in_buffer, out_geometry))
  ------------------
  |  |   74|  7.64k|  {                                                   \
  |  |   75|  7.64k|    const draco::Status _local_status = (expression); \
  |  |   76|  7.64k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 6.80k, False: 844]
  |  |  ------------------
  |  |   77|  6.80k|      return _local_status;                           \
  |  |   78|  6.80k|    }                                                 \
  |  |   79|  7.64k|  }
  ------------------
  125|    844|  return OkStatus();
  126|       |#else
  127|       |  return Status(Status::DRACO_ERROR, "Unsupported geometry type.");
  128|       |#endif
  129|  15.2k|}

_ZN5draco10AnsDecoderC2Ev:
   56|  25.3k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  17.7k|                                const uint8_t *const buf, int offset) {
  301|  17.7k|  unsigned x;
  302|  17.7k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 33, False: 17.7k]
  ------------------
  303|     33|    return 1;
  304|     33|  }
  305|  17.7k|  ans->buf = buf;
  306|  17.7k|  x = buf[offset - 1] >> 6;
  307|  17.7k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 14.4k, False: 3.24k]
  ------------------
  308|  14.4k|    ans->buf_offset = offset - 1;
  309|  14.4k|    ans->state = buf[offset - 1] & 0x3F;
  310|  14.4k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.95k, False: 288]
  ------------------
  311|  2.95k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 6, False: 2.94k]
  ------------------
  312|      6|      return 1;
  313|      6|    }
  314|  2.94k|    ans->buf_offset = offset - 2;
  315|  2.94k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.94k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 283, False: 5]
  ------------------
  317|    283|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 0, False: 283]
  ------------------
  318|      0|      return 1;
  319|      0|    }
  320|    283|    ans->buf_offset = offset - 3;
  321|    283|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    283|  } else {
  323|      5|    return 1;
  324|      5|  }
  325|  17.7k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  17.7k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  17.7k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  17.7k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  17.7k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 2, False: 17.7k]
  ------------------
  327|      2|    return 1;
  328|      2|  }
  329|  17.7k|  return 0;
  330|  17.7k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.94k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.94k|  uint32_t val;
   69|  2.94k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.94k|  val = mem[1] << 8;
   72|  2.94k|  val |= mem[0];
   73|  2.94k|  return val;
   74|  2.94k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    283|static uint32_t mem_get_le24(const void *vmem) {
   77|    283|  uint32_t val;
   78|    283|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    283|  val = mem[2] << 16;
   81|    283|  val |= mem[1] << 8;
   82|    283|  val |= mem[0];
   83|    283|  return val;
   84|    283|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  11.1G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  11.1G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  11.1G|  unsigned quot, rem, x, xn;
  172|  11.1G|#endif
  173|  11.1G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  11.1G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  11.1G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  22.2G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 10.2G, False: 845M]
  |  Branch (174:40): [True: 258k, False: 10.2G]
  ------------------
  175|   258k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   258k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   258k|  }
  177|       |#if DRACO_ANS_IMPL1
  178|       |  val = ans->state % DRACO_ANS_P8_PRECISION < p;
  179|       |  l_s = val ? p : p0;
  180|       |  ans->state = (ans->state / DRACO_ANS_P8_PRECISION) * l_s +
  181|       |               ans->state % DRACO_ANS_P8_PRECISION - (!val * p);
  182|       |#else
  183|  11.1G|  x = ans->state;
  184|  11.1G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  11.1G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  11.1G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  11.1G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  11.1G|  xn = quot * p;
  187|  11.1G|  val = rem < p;
  188|  11.1G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  22.2G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 10.2G, False: 815M]
  |  |  ------------------
  ------------------
  189|  10.2G|    ans->state = xn + rem;
  190|  10.2G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   815M|    ans->state = x - xn - p;
  193|   815M|  }
  194|  11.1G|#endif
  195|  11.1G|  return val;
  196|  11.1G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  38.1k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  38.1k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  38.1k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  38.1k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  2.97k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  1.83k|                                       uint32_t num_symbols) {
  482|  1.83k|    lut_table_.resize(rans_precision);
  483|  1.83k|    probability_table_.resize(num_symbols);
  484|  1.83k|    uint32_t cum_prob = 0;
  485|  1.83k|    uint32_t act_prob = 0;
  486|  15.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 14.1k, False: 1.64k]
  ------------------
  487|  14.1k|      probability_table_[i].prob = token_probs[i];
  488|  14.1k|      probability_table_[i].cum_prob = cum_prob;
  489|  14.1k|      cum_prob += token_probs[i];
  490|  14.1k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 189, False: 13.9k]
  ------------------
  491|    189|        return false;
  492|    189|      }
  493|  6.18M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 6.16M, False: 13.9k]
  ------------------
  494|  6.16M|        lut_table_[j] = i;
  495|  6.16M|      }
  496|  13.9k|      act_prob = cum_prob;
  497|  13.9k|    }
  498|  1.64k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 172, False: 1.47k]
  ------------------
  499|    172|      return false;
  500|    172|    }
  501|  1.47k|    return true;
  502|  1.64k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.26k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.26k|    unsigned x;
  423|  1.26k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 87, False: 1.17k]
  ------------------
  424|     87|      return 1;
  425|     87|    }
  426|  1.17k|    ans_.buf = buf;
  427|  1.17k|    x = buf[offset - 1] >> 6;
  428|  1.17k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 700, False: 479]
  ------------------
  429|    700|      ans_.buf_offset = offset - 1;
  430|    700|      ans_.state = buf[offset - 1] & 0x3F;
  431|    700|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 209, False: 270]
  ------------------
  432|    209|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 40, False: 169]
  ------------------
  433|     40|        return 1;
  434|     40|      }
  435|    169|      ans_.buf_offset = offset - 2;
  436|    169|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    270|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 186, False: 84]
  ------------------
  438|    186|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 39, False: 147]
  ------------------
  439|     39|        return 1;
  440|     39|      }
  441|    147|      ans_.buf_offset = offset - 3;
  442|    147|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    147|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 84, False: 0]
  ------------------
  444|     84|      ans_.buf_offset = offset - 4;
  445|     84|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     84|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.10k|    ans_.state += l_rans_base;
  450|  1.10k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.10k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 94, False: 1.00k]
  ------------------
  451|     94|      return 1;
  452|     94|    }
  453|  1.00k|    return 0;
  454|  1.10k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    276|static uint32_t mem_get_le16(const void *vmem) {
   68|    276|  uint32_t val;
   69|    276|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    276|  val = mem[1] << 8;
   72|    276|  val |= mem[0];
   73|    276|  return val;
   74|    276|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    249|static uint32_t mem_get_le24(const void *vmem) {
   77|    249|  uint32_t val;
   78|    249|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    249|  val = mem[2] << 16;
   81|    249|  val |= mem[1] << 8;
   82|    249|  val |= mem[0];
   83|    249|  return val;
   84|    249|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    266|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    266|  uint32_t val;
   88|    266|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    266|  val = mem[3] << 24;
   91|    266|  val |= mem[2] << 16;
   92|    266|  val |= mem[1] << 8;
   93|    266|  val |= mem[0];
   94|    266|  return val;
   95|    266|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|   125M|  inline int rans_read() {
  463|   125M|    unsigned rem;
  464|   125M|    unsigned quo;
  465|   125M|    struct rans_dec_sym sym;
  466|   125M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 113M, False: 12.3M]
  |  Branch (466:40): [True: 23.8k, False: 113M]
  ------------------
  467|  23.8k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  23.8k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  23.8k|    }
  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|   125M|    quo = ans_.state / rans_precision;
  472|   125M|    rem = ans_.state % rans_precision;
  473|   125M|    fetch_sym(&sym, rem);
  474|   125M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   125M|    return sym.val;
  476|   125M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|   125M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   125M|    uint32_t symbol = lut_table_[rem];
  507|   125M|    out->val = symbol;
  508|   125M|    out->prob = probability_table_[symbol].prob;
  509|   125M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   125M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|    967|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    196|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    128|                                       uint32_t num_symbols) {
  482|    128|    lut_table_.resize(rans_precision);
  483|    128|    probability_table_.resize(num_symbols);
  484|    128|    uint32_t cum_prob = 0;
  485|    128|    uint32_t act_prob = 0;
  486|  1.70k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.58k, False: 114]
  ------------------
  487|  1.58k|      probability_table_[i].prob = token_probs[i];
  488|  1.58k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.58k|      cum_prob += token_probs[i];
  490|  1.58k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 14, False: 1.57k]
  ------------------
  491|     14|        return false;
  492|     14|      }
  493|   923k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 922k, False: 1.57k]
  ------------------
  494|   922k|        lut_table_[j] = i;
  495|   922k|      }
  496|  1.57k|      act_prob = cum_prob;
  497|  1.57k|    }
  498|    114|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 7, False: 107]
  ------------------
  499|      7|      return false;
  500|      7|    }
  501|    107|    return true;
  502|    114|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     70|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     70|    unsigned x;
  423|     70|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 2, False: 68]
  ------------------
  424|      2|      return 1;
  425|      2|    }
  426|     68|    ans_.buf = buf;
  427|     68|    x = buf[offset - 1] >> 6;
  428|     68|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 30, False: 38]
  ------------------
  429|     30|      ans_.buf_offset = offset - 1;
  430|     30|      ans_.state = buf[offset - 1] & 0x3F;
  431|     38|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 12, False: 26]
  ------------------
  432|     12|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 2, False: 10]
  ------------------
  433|      2|        return 1;
  434|      2|      }
  435|     10|      ans_.buf_offset = offset - 2;
  436|     10|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     26|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 12, False: 14]
  ------------------
  438|     12|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 8, False: 4]
  ------------------
  439|      8|        return 1;
  440|      8|      }
  441|      4|      ans_.buf_offset = offset - 3;
  442|      4|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     14|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 14, False: 0]
  ------------------
  444|     14|      ans_.buf_offset = offset - 4;
  445|     14|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     14|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     58|    ans_.state += l_rans_base;
  450|     58|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     58|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 13, False: 45]
  ------------------
  451|     13|      return 1;
  452|     13|    }
  453|     45|    return 0;
  454|     58|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|   277k|  inline int rans_read() {
  463|   277k|    unsigned rem;
  464|   277k|    unsigned quo;
  465|   277k|    struct rans_dec_sym sym;
  466|   278k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 188k, False: 89.5k]
  |  Branch (466:40): [True: 968, False: 187k]
  ------------------
  467|    968|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    968|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    968|    }
  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|   277k|    quo = ans_.state / rans_precision;
  472|   277k|    rem = ans_.state % rans_precision;
  473|   277k|    fetch_sym(&sym, rem);
  474|   277k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   277k|    return sym.val;
  476|   277k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|   277k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   277k|    uint32_t symbol = lut_table_[rem];
  507|   277k|    out->val = symbol;
  508|   277k|    out->prob = probability_table_[symbol].prob;
  509|   277k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   277k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     45|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    187|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    129|                                       uint32_t num_symbols) {
  482|    129|    lut_table_.resize(rans_precision);
  483|    129|    probability_table_.resize(num_symbols);
  484|    129|    uint32_t cum_prob = 0;
  485|    129|    uint32_t act_prob = 0;
  486|  4.45k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.34k, False: 112]
  ------------------
  487|  4.34k|      probability_table_[i].prob = token_probs[i];
  488|  4.34k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.34k|      cum_prob += token_probs[i];
  490|  4.34k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 17, False: 4.32k]
  ------------------
  491|     17|        return false;
  492|     17|      }
  493|  3.27M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 3.27M, False: 4.32k]
  ------------------
  494|  3.27M|        lut_table_[j] = i;
  495|  3.27M|      }
  496|  4.32k|      act_prob = cum_prob;
  497|  4.32k|    }
  498|    112|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 21, False: 91]
  ------------------
  499|     21|      return false;
  500|     21|    }
  501|     91|    return true;
  502|    112|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     78|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     78|    unsigned x;
  423|     78|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 9, False: 69]
  ------------------
  424|      9|      return 1;
  425|      9|    }
  426|     69|    ans_.buf = buf;
  427|     69|    x = buf[offset - 1] >> 6;
  428|     69|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 21, False: 48]
  ------------------
  429|     21|      ans_.buf_offset = offset - 1;
  430|     21|      ans_.state = buf[offset - 1] & 0x3F;
  431|     48|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 25, False: 23]
  ------------------
  432|     25|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 7, False: 18]
  ------------------
  433|      7|        return 1;
  434|      7|      }
  435|     18|      ans_.buf_offset = offset - 2;
  436|     18|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     23|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 7, False: 16]
  ------------------
  438|      7|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 2, False: 5]
  ------------------
  439|      2|        return 1;
  440|      2|      }
  441|      5|      ans_.buf_offset = offset - 3;
  442|      5|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     16|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 16, False: 0]
  ------------------
  444|     16|      ans_.buf_offset = offset - 4;
  445|     16|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     16|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     60|    ans_.state += l_rans_base;
  450|     60|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     60|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 14, False: 46]
  ------------------
  451|     14|      return 1;
  452|     14|    }
  453|     46|    return 0;
  454|     60|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   330k|  inline int rans_read() {
  463|   330k|    unsigned rem;
  464|   330k|    unsigned quo;
  465|   330k|    struct rans_dec_sym sym;
  466|   331k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 88.1k, False: 243k]
  |  Branch (466:40): [True: 905, False: 87.2k]
  ------------------
  467|    905|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    905|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    905|    }
  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|   330k|    quo = ans_.state / rans_precision;
  472|   330k|    rem = ans_.state % rans_precision;
  473|   330k|    fetch_sym(&sym, rem);
  474|   330k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   330k|    return sym.val;
  476|   330k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   330k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   330k|    uint32_t symbol = lut_table_[rem];
  507|   330k|    out->val = symbol;
  508|   330k|    out->prob = probability_table_[symbol].prob;
  509|   330k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   330k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     46|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    207|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    116|                                       uint32_t num_symbols) {
  482|    116|    lut_table_.resize(rans_precision);
  483|    116|    probability_table_.resize(num_symbols);
  484|    116|    uint32_t cum_prob = 0;
  485|    116|    uint32_t act_prob = 0;
  486|  4.09k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.99k, False: 101]
  ------------------
  487|  3.99k|      probability_table_[i].prob = token_probs[i];
  488|  3.99k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.99k|      cum_prob += token_probs[i];
  490|  3.99k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 15, False: 3.97k]
  ------------------
  491|     15|        return false;
  492|     15|      }
  493|  6.36M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 6.36M, False: 3.97k]
  ------------------
  494|  6.36M|        lut_table_[j] = i;
  495|  6.36M|      }
  496|  3.97k|      act_prob = cum_prob;
  497|  3.97k|    }
  498|    101|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 9, False: 92]
  ------------------
  499|      9|      return false;
  500|      9|    }
  501|     92|    return true;
  502|    101|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     72|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     72|    unsigned x;
  423|     72|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 7, False: 65]
  ------------------
  424|      7|      return 1;
  425|      7|    }
  426|     65|    ans_.buf = buf;
  427|     65|    x = buf[offset - 1] >> 6;
  428|     65|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 18, False: 47]
  ------------------
  429|     18|      ans_.buf_offset = offset - 1;
  430|     18|      ans_.state = buf[offset - 1] & 0x3F;
  431|     47|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 21, False: 26]
  ------------------
  432|     21|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 12]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     26|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 19, False: 7]
  ------------------
  438|     19|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 7, False: 12]
  ------------------
  439|      7|        return 1;
  440|      7|      }
  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|     49|    ans_.state += l_rans_base;
  450|     49|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     49|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 2, False: 47]
  ------------------
  451|      2|      return 1;
  452|      2|    }
  453|     47|    return 0;
  454|     49|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|   185k|  inline int rans_read() {
  463|   185k|    unsigned rem;
  464|   185k|    unsigned quo;
  465|   185k|    struct rans_dec_sym sym;
  466|   186k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 128k, False: 57.2k]
  |  Branch (466:40): [True: 517, False: 128k]
  ------------------
  467|    517|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    517|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    517|    }
  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|   185k|    quo = ans_.state / rans_precision;
  472|   185k|    rem = ans_.state % rans_precision;
  473|   185k|    fetch_sym(&sym, rem);
  474|   185k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   185k|    return sym.val;
  476|   185k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|   185k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   185k|    uint32_t symbol = lut_table_[rem];
  507|   185k|    out->val = symbol;
  508|   185k|    out->prob = probability_table_[symbol].prob;
  509|   185k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   185k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     47|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    233|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    156|                                       uint32_t num_symbols) {
  482|    156|    lut_table_.resize(rans_precision);
  483|    156|    probability_table_.resize(num_symbols);
  484|    156|    uint32_t cum_prob = 0;
  485|    156|    uint32_t act_prob = 0;
  486|  2.84k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.70k, False: 141]
  ------------------
  487|  2.70k|      probability_table_[i].prob = token_probs[i];
  488|  2.70k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.70k|      cum_prob += token_probs[i];
  490|  2.70k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 15, False: 2.68k]
  ------------------
  491|     15|        return false;
  492|     15|      }
  493|  34.8M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 34.8M, False: 2.68k]
  ------------------
  494|  34.8M|        lut_table_[j] = i;
  495|  34.8M|      }
  496|  2.68k|      act_prob = cum_prob;
  497|  2.68k|    }
  498|    141|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 21, False: 120]
  ------------------
  499|     21|      return false;
  500|     21|    }
  501|    120|    return true;
  502|    141|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     74|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     74|    unsigned x;
  423|     74|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 10, False: 64]
  ------------------
  424|     10|      return 1;
  425|     10|    }
  426|     64|    ans_.buf = buf;
  427|     64|    x = buf[offset - 1] >> 6;
  428|     64|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 19, False: 45]
  ------------------
  429|     19|      ans_.buf_offset = offset - 1;
  430|     19|      ans_.state = buf[offset - 1] & 0x3F;
  431|     45|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 18, False: 27]
  ------------------
  432|     18|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 6, False: 12]
  ------------------
  433|      6|        return 1;
  434|      6|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     27|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 17, False: 10]
  ------------------
  438|     17|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 14]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     14|      ans_.buf_offset = offset - 3;
  442|     14|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     14|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 10, False: 0]
  ------------------
  444|     10|      ans_.buf_offset = offset - 4;
  445|     10|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     10|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     55|    ans_.state += l_rans_base;
  450|     55|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     55|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 6, False: 49]
  ------------------
  451|      6|      return 1;
  452|      6|    }
  453|     49|    return 0;
  454|     55|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|   287k|  inline int rans_read() {
  463|   287k|    unsigned rem;
  464|   287k|    unsigned quo;
  465|   287k|    struct rans_dec_sym sym;
  466|   288k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 207k, False: 80.6k]
  |  Branch (466:40): [True: 621, False: 207k]
  ------------------
  467|    621|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    621|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    621|    }
  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|   287k|    quo = ans_.state / rans_precision;
  472|   287k|    rem = ans_.state % rans_precision;
  473|   287k|    fetch_sym(&sym, rem);
  474|   287k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   287k|    return sym.val;
  476|   287k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|   287k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   287k|    uint32_t symbol = lut_table_[rem];
  507|   287k|    out->val = symbol;
  508|   287k|    out->prob = probability_table_[symbol].prob;
  509|   287k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   287k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     49|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    314|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    207|                                       uint32_t num_symbols) {
  482|    207|    lut_table_.resize(rans_precision);
  483|    207|    probability_table_.resize(num_symbols);
  484|    207|    uint32_t cum_prob = 0;
  485|    207|    uint32_t act_prob = 0;
  486|  4.93k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.75k, False: 186]
  ------------------
  487|  4.75k|      probability_table_[i].prob = token_probs[i];
  488|  4.75k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.75k|      cum_prob += token_probs[i];
  490|  4.75k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 21, False: 4.73k]
  ------------------
  491|     21|        return false;
  492|     21|      }
  493|  93.1M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 93.1M, False: 4.73k]
  ------------------
  494|  93.1M|        lut_table_[j] = i;
  495|  93.1M|      }
  496|  4.73k|      act_prob = cum_prob;
  497|  4.73k|    }
  498|    186|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 17, False: 169]
  ------------------
  499|     17|      return false;
  500|     17|    }
  501|    169|    return true;
  502|    186|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|    107|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    107|    unsigned x;
  423|    107|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 7, False: 100]
  ------------------
  424|      7|      return 1;
  425|      7|    }
  426|    100|    ans_.buf = buf;
  427|    100|    x = buf[offset - 1] >> 6;
  428|    100|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 19, False: 81]
  ------------------
  429|     19|      ans_.buf_offset = offset - 1;
  430|     19|      ans_.state = buf[offset - 1] & 0x3F;
  431|     81|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 16, False: 65]
  ------------------
  432|     16|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 7]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|      7|      ans_.buf_offset = offset - 2;
  436|      7|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     65|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 26, False: 39]
  ------------------
  438|     26|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 11, False: 15]
  ------------------
  439|     11|        return 1;
  440|     11|      }
  441|     15|      ans_.buf_offset = offset - 3;
  442|     15|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     39|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 39, False: 0]
  ------------------
  444|     39|      ans_.buf_offset = offset - 4;
  445|     39|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     39|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     80|    ans_.state += l_rans_base;
  450|     80|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     80|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 16, False: 64]
  ------------------
  451|     16|      return 1;
  452|     16|    }
  453|     64|    return 0;
  454|     80|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   517k|  inline int rans_read() {
  463|   517k|    unsigned rem;
  464|   517k|    unsigned quo;
  465|   517k|    struct rans_dec_sym sym;
  466|   518k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 272k, False: 246k]
  |  Branch (466:40): [True: 836, False: 271k]
  ------------------
  467|    836|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    836|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    836|    }
  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|   517k|    quo = ans_.state / rans_precision;
  472|   517k|    rem = ans_.state % rans_precision;
  473|   517k|    fetch_sym(&sym, rem);
  474|   517k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   517k|    return sym.val;
  476|   517k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   517k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   517k|    uint32_t symbol = lut_table_[rem];
  507|   517k|    out->val = symbol;
  508|   517k|    out->prob = probability_table_[symbol].prob;
  509|   517k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   517k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     64|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.02k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    581|                                       uint32_t num_symbols) {
  482|    581|    lut_table_.resize(rans_precision);
  483|    581|    probability_table_.resize(num_symbols);
  484|    581|    uint32_t cum_prob = 0;
  485|    581|    uint32_t act_prob = 0;
  486|  4.42k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.87k, False: 550]
  ------------------
  487|  3.87k|      probability_table_[i].prob = token_probs[i];
  488|  3.87k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.87k|      cum_prob += token_probs[i];
  490|  3.87k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 31, False: 3.83k]
  ------------------
  491|     31|        return false;
  492|     31|      }
  493|   543M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 543M, False: 3.83k]
  ------------------
  494|   543M|        lut_table_[j] = i;
  495|   543M|      }
  496|  3.83k|      act_prob = cum_prob;
  497|  3.83k|    }
  498|    550|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 43, False: 507]
  ------------------
  499|     43|      return false;
  500|     43|    }
  501|    507|    return true;
  502|    550|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    349|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    349|    unsigned x;
  423|    349|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 28, False: 321]
  ------------------
  424|     28|      return 1;
  425|     28|    }
  426|    321|    ans_.buf = buf;
  427|    321|    x = buf[offset - 1] >> 6;
  428|    321|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 74, False: 247]
  ------------------
  429|     74|      ans_.buf_offset = offset - 1;
  430|     74|      ans_.state = buf[offset - 1] & 0x3F;
  431|    247|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 65, False: 182]
  ------------------
  432|     65|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 17, False: 48]
  ------------------
  433|     17|        return 1;
  434|     17|      }
  435|     48|      ans_.buf_offset = offset - 2;
  436|     48|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    182|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 86, False: 96]
  ------------------
  438|     86|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 34, False: 52]
  ------------------
  439|     34|        return 1;
  440|     34|      }
  441|     52|      ans_.buf_offset = offset - 3;
  442|     52|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     96|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 96, False: 0]
  ------------------
  444|     96|      ans_.buf_offset = offset - 4;
  445|     96|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     96|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    270|    ans_.state += l_rans_base;
  450|    270|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    270|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 19, False: 251]
  ------------------
  451|     19|      return 1;
  452|     19|    }
  453|    251|    return 0;
  454|    270|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  78.1M|  inline int rans_read() {
  463|  78.1M|    unsigned rem;
  464|  78.1M|    unsigned quo;
  465|  78.1M|    struct rans_dec_sym sym;
  466|  78.1M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 65.3M, False: 12.8M]
  |  Branch (466:40): [True: 5.01k, False: 65.3M]
  ------------------
  467|  5.01k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  5.01k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  5.01k|    }
  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|  78.1M|    quo = ans_.state / rans_precision;
  472|  78.1M|    rem = ans_.state % rans_precision;
  473|  78.1M|    fetch_sym(&sym, rem);
  474|  78.1M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  78.1M|    return sym.val;
  476|  78.1M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  78.1M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  78.1M|    uint32_t symbol = lut_table_[rem];
  507|  78.1M|    out->val = symbol;
  508|  78.1M|    out->prob = probability_table_[symbol].prob;
  509|  78.1M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  78.1M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    251|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    962|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    962|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    962|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 962]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    962|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    962|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    962|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 138, False: 824]
  ------------------
   67|    138|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 7, False: 131]
  ------------------
   68|      7|      return false;
   69|      7|    }
   70|       |
   71|    138|  } else
   72|    824|#endif
   73|    824|  {
   74|    824|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 15, False: 809]
  ------------------
   75|     15|      return false;
   76|     15|    }
   77|    824|  }
   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|    940|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 102, False: 838]
  ------------------
   83|    102|    return false;
   84|    102|  }
   85|    838|  probability_table_.resize(num_symbols_);
   86|    838|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 238, False: 600]
  ------------------
   87|    238|    return true;
   88|    238|  }
   89|       |  // Decode the table.
   90|  1.11M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.11M, False: 477]
  ------------------
   91|  1.11M|    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.11M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 1.11M]
  ------------------
   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|  1.11M|    const int token = prob_data & 3;
  102|  1.11M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 618k, False: 499k]
  ------------------
  103|   618k|      const uint32_t offset = prob_data >> 2;
  104|   618k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 69, False: 618k]
  ------------------
  105|     69|        return false;
  106|     69|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  36.9M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 36.3M, False: 618k]
  ------------------
  109|  36.3M|        probability_table_[i + j] = 0;
  110|  36.3M|      }
  111|   618k|      i += offset;
  112|   618k|    } else {
  113|   499k|      const int extra_bytes = token;
  114|   499k|      uint32_t prob = prob_data >> 2;
  115|  1.23M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 737k, False: 499k]
  ------------------
  116|   737k|        uint8_t eb;
  117|   737k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 737k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   737k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   737k|      }
  124|   499k|      probability_table_[i] = prob;
  125|   499k|    }
  126|  1.11M|  }
  127|    477|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 124, False: 353]
  ------------------
  128|    124|    return false;
  129|    124|  }
  130|    353|  return true;
  131|    477|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    518|    DecoderBuffer *buffer) {
  136|    518|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    518|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    518|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    518|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 41, False: 477]
  ------------------
  140|     41|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 37]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     41|  } else
  145|    477|#endif
  146|    477|  {
  147|    477|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 472]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    477|  }
  151|    509|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 51, False: 458]
  ------------------
  152|     51|    return false;
  153|     51|  }
  154|    458|  const uint8_t *const data_head =
  155|    458|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    458|  buffer->Advance(bytes_encoded);
  158|    458|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 80, False: 378]
  ------------------
  159|     80|    return false;
  160|     80|  }
  161|    378|  return true;
  162|    458|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    459|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  16.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    339|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    339|  ans_.read_end();
  167|    339|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    360|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    360|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    360|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 360]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    360|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    360|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    360|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 38, False: 322]
  ------------------
   67|     38|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 35]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     38|  } else
   72|    322|#endif
   73|    322|  {
   74|    322|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 319]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    322|  }
   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|    354|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 335]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    335|  probability_table_.resize(num_symbols_);
   86|    335|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 16, False: 319]
  ------------------
   87|     16|    return true;
   88|     16|  }
   89|       |  // Decode the table.
   90|  1.17M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.17M, False: 226]
  ------------------
   91|  1.17M|    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.17M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 27, False: 1.17M]
  ------------------
   95|     27|      return false;
   96|     27|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.17M|    const int token = prob_data & 3;
  102|  1.17M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 678k, False: 494k]
  ------------------
  103|   678k|      const uint32_t offset = prob_data >> 2;
  104|   678k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 44, False: 678k]
  ------------------
  105|     44|        return false;
  106|     44|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  23.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 23.1M, False: 678k]
  ------------------
  109|  23.1M|        probability_table_[i + j] = 0;
  110|  23.1M|      }
  111|   678k|      i += offset;
  112|   678k|    } else {
  113|   494k|      const int extra_bytes = token;
  114|   494k|      uint32_t prob = prob_data >> 2;
  115|   783k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 289k, False: 494k]
  ------------------
  116|   289k|        uint8_t eb;
  117|   289k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 289k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   289k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   289k|      }
  124|   494k|      probability_table_[i] = prob;
  125|   494k|    }
  126|  1.17M|  }
  127|    226|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 106, False: 120]
  ------------------
  128|    106|    return false;
  129|    106|  }
  130|    120|  return true;
  131|    226|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    136|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    120|    DecoderBuffer *buffer) {
  136|    120|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    120|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    120|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    120|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 111]
  ------------------
  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|    111|#endif
  146|    111|  {
  147|    111|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 108]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    111|  }
  151|    117|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 27, False: 90]
  ------------------
  152|     27|    return false;
  153|     27|  }
  154|     90|  const uint8_t *const data_head =
  155|     90|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     90|  buffer->Advance(bytes_encoded);
  158|     90|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 19, False: 71]
  ------------------
  159|     19|    return false;
  160|     19|  }
  161|     71|  return true;
  162|     90|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  4.95M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|     71|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     71|  ans_.read_end();
  167|     71|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    353|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    353|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    353|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 353]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    353|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    353|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    353|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 311]
  ------------------
   67|     42|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 42]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     42|  } else
   72|    311|#endif
   73|    311|  {
   74|    311|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 303]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    311|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    345|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 338]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    338|  probability_table_.resize(num_symbols_);
   86|    338|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 327]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|  2.83M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.83M, False: 232]
  ------------------
   91|  2.83M|    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|  2.83M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 34, False: 2.83M]
  ------------------
   95|     34|      return false;
   96|     34|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  2.83M|    const int token = prob_data & 3;
  102|  2.83M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.01M, False: 823k]
  ------------------
  103|  2.01M|      const uint32_t offset = prob_data >> 2;
  104|  2.01M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 45, False: 2.01M]
  ------------------
  105|     45|        return false;
  106|     45|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  75.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 73.5M, False: 2.01M]
  ------------------
  109|  73.5M|        probability_table_[i + j] = 0;
  110|  73.5M|      }
  111|  2.01M|      i += offset;
  112|  2.01M|    } else {
  113|   823k|      const int extra_bytes = token;
  114|   823k|      uint32_t prob = prob_data >> 2;
  115|  1.18M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 363k, False: 823k]
  ------------------
  116|   363k|        uint8_t eb;
  117|   363k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 363k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   363k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   363k|      }
  124|   823k|      probability_table_[i] = prob;
  125|   823k|    }
  126|  2.83M|  }
  127|    232|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 49, False: 183]
  ------------------
  128|     49|    return false;
  129|     49|  }
  130|    183|  return true;
  131|    232|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    194|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    183|    DecoderBuffer *buffer) {
  136|    183|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    183|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    183|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    183|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 156]
  ------------------
  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|    156|#endif
  146|    156|  {
  147|    156|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 147]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    156|  }
  151|    173|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 40, False: 133]
  ------------------
  152|     40|    return false;
  153|     40|  }
  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: 34, False: 99]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|     99|  return true;
  162|    133|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  16.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|     99|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     99|  ans_.read_end();
  167|     99|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    306|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    306|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    306|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 306]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    306|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    306|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    306|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 48, False: 258]
  ------------------
   67|     48|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 48]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     48|  } else
   72|    258|#endif
   73|    258|  {
   74|    258|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 251]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    258|  }
   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|    299|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 289]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    289|  probability_table_.resize(num_symbols_);
   86|    289|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 289]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  11.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 11.5k, False: 228]
  ------------------
   91|  11.5k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  11.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 21, False: 11.5k]
  ------------------
   95|     21|      return false;
   96|     21|    }
   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.5k|    const int token = prob_data & 3;
  102|  11.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.85k, False: 6.65k]
  ------------------
  103|  4.85k|      const uint32_t offset = prob_data >> 2;
  104|  4.85k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 4.82k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   177k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 172k, False: 4.82k]
  ------------------
  109|   172k|        probability_table_[i + j] = 0;
  110|   172k|      }
  111|  4.82k|      i += offset;
  112|  6.65k|    } else {
  113|  6.65k|      const int extra_bytes = token;
  114|  6.65k|      uint32_t prob = prob_data >> 2;
  115|  11.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.00k, False: 6.64k]
  ------------------
  116|  5.00k|        uint8_t eb;
  117|  5.00k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 4.99k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.99k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.99k|      }
  124|  6.64k|      probability_table_[i] = prob;
  125|  6.64k|    }
  126|  11.5k|  }
  127|    228|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 25, False: 203]
  ------------------
  128|     25|    return false;
  129|     25|  }
  130|    203|  return true;
  131|    228|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    203|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    203|    DecoderBuffer *buffer) {
  136|    203|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    203|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    203|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    203|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 47, False: 156]
  ------------------
  140|     47|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 44]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     47|  } else
  145|    156|#endif
  146|    156|  {
  147|    156|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 149]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    156|  }
  151|    193|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 53, False: 140]
  ------------------
  152|     53|    return false;
  153|     53|  }
  154|    140|  const uint8_t *const data_head =
  155|    140|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    140|  buffer->Advance(bytes_encoded);
  158|    140|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 114]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|    114|  return true;
  162|    140|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  24.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    114|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    114|  ans_.read_end();
  167|    114|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    164|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    164|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    164|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 164]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    164|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    164|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    164|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 149]
  ------------------
   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|    149|#endif
   73|    149|  {
   74|    149|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 139]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    149|  }
   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|    154|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 148]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|    148|  probability_table_.resize(num_symbols_);
   86|    148|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 148]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  8.19k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 8.10k, False: 88]
  ------------------
   91|  8.10k|    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|  8.10k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 21, False: 8.08k]
  ------------------
   95|     21|      return false;
   96|     21|    }
   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|  8.08k|    const int token = prob_data & 3;
  102|  8.08k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.60k, False: 4.47k]
  ------------------
  103|  3.60k|      const uint32_t offset = prob_data >> 2;
  104|  3.60k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 3.57k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   131k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 127k, False: 3.57k]
  ------------------
  109|   127k|        probability_table_[i + j] = 0;
  110|   127k|      }
  111|  3.57k|      i += offset;
  112|  4.47k|    } else {
  113|  4.47k|      const int extra_bytes = token;
  114|  4.47k|      uint32_t prob = prob_data >> 2;
  115|  7.35k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.88k, False: 4.46k]
  ------------------
  116|  2.88k|        uint8_t eb;
  117|  2.88k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 9, False: 2.87k]
  ------------------
  118|      9|          return false;
  119|      9|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.87k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.87k|      }
  124|  4.46k|      probability_table_[i] = prob;
  125|  4.46k|    }
  126|  8.08k|  }
  127|     88|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 86]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|     86|  return true;
  131|     88|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|     86|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_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: 14, False: 72]
  ------------------
  140|     14|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 10]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     14|  } else
  145|     72|#endif
  146|     72|  {
  147|     72|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 69]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|     72|  }
  151|     79|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 12, False: 67]
  ------------------
  152|     12|    return false;
  153|     12|  }
  154|     67|  const uint8_t *const data_head =
  155|     67|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     67|  buffer->Advance(bytes_encoded);
  158|     67|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 22, False: 45]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|     45|  return true;
  162|     67|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|   805k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     45|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     45|  ans_.read_end();
  167|     45|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    289|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    289|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    289|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 289]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    289|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    289|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    289|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 53, False: 236]
  ------------------
   67|     53|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 52]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     53|  } else
   72|    236|#endif
   73|    236|  {
   74|    236|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 236]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    236|  }
   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|    288|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 268]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    268|  probability_table_.resize(num_symbols_);
   86|    268|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 268]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  68.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 68.7k, False: 215]
  ------------------
   91|  68.7k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  68.7k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 28, False: 68.7k]
  ------------------
   95|     28|      return false;
   96|     28|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  68.7k|    const int token = prob_data & 3;
  102|  68.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 32.9k, False: 35.7k]
  ------------------
  103|  32.9k|      const uint32_t offset = prob_data >> 2;
  104|  32.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 32.9k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.08M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.04M, False: 32.9k]
  ------------------
  109|  1.04M|        probability_table_[i + j] = 0;
  110|  1.04M|      }
  111|  32.9k|      i += offset;
  112|  35.7k|    } else {
  113|  35.7k|      const int extra_bytes = token;
  114|  35.7k|      uint32_t prob = prob_data >> 2;
  115|  64.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 28.5k, False: 35.7k]
  ------------------
  116|  28.5k|        uint8_t eb;
  117|  28.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 28.5k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  28.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  28.5k|      }
  124|  35.7k|      probability_table_[i] = prob;
  125|  35.7k|    }
  126|  68.7k|  }
  127|    215|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 17, False: 198]
  ------------------
  128|     17|    return false;
  129|     17|  }
  130|    198|  return true;
  131|    215|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    198|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    198|    DecoderBuffer *buffer) {
  136|    198|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    198|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    198|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    198|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 37, False: 161]
  ------------------
  140|     37|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 35]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     37|  } else
  145|    161|#endif
  146|    161|  {
  147|    161|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 152]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    161|  }
  151|    187|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 40, False: 147]
  ------------------
  152|     40|    return false;
  153|     40|  }
  154|    147|  const uint8_t *const data_head =
  155|    147|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    147|  buffer->Advance(bytes_encoded);
  158|    147|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 21, False: 126]
  ------------------
  159|     21|    return false;
  160|     21|  }
  161|    126|  return true;
  162|    147|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  1.68M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    126|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    126|  ans_.read_end();
  167|    126|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    301|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    301|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    301|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 301]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    301|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    301|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    301|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 36, False: 265]
  ------------------
   67|     36|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 36]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     36|  } else
   72|    265|#endif
   73|    265|  {
   74|    265|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 257]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    265|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    293|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 286]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    286|  probability_table_.resize(num_symbols_);
   86|    286|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 285]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  1.03M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.03M, False: 207]
  ------------------
   91|  1.03M|    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.03M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 39, False: 1.03M]
  ------------------
   95|     39|      return false;
   96|     39|    }
   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.03M|    const int token = prob_data & 3;
  102|  1.03M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 253k, False: 785k]
  ------------------
  103|   253k|      const uint32_t offset = prob_data >> 2;
  104|   253k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 20, False: 253k]
  ------------------
  105|     20|        return false;
  106|     20|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  7.34M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.09M, False: 253k]
  ------------------
  109|  7.09M|        probability_table_[i + j] = 0;
  110|  7.09M|      }
  111|   253k|      i += offset;
  112|   785k|    } else {
  113|   785k|      const int extra_bytes = token;
  114|   785k|      uint32_t prob = prob_data >> 2;
  115|  1.51M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 728k, False: 785k]
  ------------------
  116|   728k|        uint8_t eb;
  117|   728k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 728k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   728k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   728k|      }
  124|   785k|      probability_table_[i] = prob;
  125|   785k|    }
  126|  1.03M|  }
  127|    207|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 186]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    186|  return true;
  131|    207|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    187|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    186|    DecoderBuffer *buffer) {
  136|    186|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    186|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    186|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    186|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 6, False: 180]
  ------------------
  140|      6|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 5]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      6|  } else
  145|    180|#endif
  146|    180|  {
  147|    180|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 12, False: 168]
  ------------------
  148|     12|      return false;
  149|     12|    }
  150|    180|  }
  151|    173|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 33, False: 140]
  ------------------
  152|     33|    return false;
  153|     33|  }
  154|    140|  const uint8_t *const data_head =
  155|    140|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    140|  buffer->Advance(bytes_encoded);
  158|    140|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 30, False: 110]
  ------------------
  159|     30|    return false;
  160|     30|  }
  161|    110|  return true;
  162|    140|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  33.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    110|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    110|  ans_.read_end();
  167|    110|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    237|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    237|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    237|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 237]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    237|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    237|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    237|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 57, False: 180]
  ------------------
   67|     57|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 54]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     57|  } else
   72|    180|#endif
   73|    180|  {
   74|    180|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 178]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    180|  }
   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|    232|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 218]
  ------------------
   83|     14|    return false;
   84|     14|  }
   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|   738k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 738k, False: 161]
  ------------------
   91|   738k|    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|   738k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 27, False: 738k]
  ------------------
   95|     27|      return false;
   96|     27|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   738k|    const int token = prob_data & 3;
  102|   738k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 606k, False: 131k]
  ------------------
  103|   606k|      const uint32_t offset = prob_data >> 2;
  104|   606k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 16, False: 606k]
  ------------------
  105|     16|        return false;
  106|     16|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  31.0M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 30.4M, False: 606k]
  ------------------
  109|  30.4M|        probability_table_[i + j] = 0;
  110|  30.4M|      }
  111|   606k|      i += offset;
  112|   606k|    } else {
  113|   131k|      const int extra_bytes = token;
  114|   131k|      uint32_t prob = prob_data >> 2;
  115|   236k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 104k, False: 131k]
  ------------------
  116|   104k|        uint8_t eb;
  117|   104k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 104k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   104k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   104k|      }
  124|   131k|      probability_table_[i] = prob;
  125|   131k|    }
  126|   738k|  }
  127|    161|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 17, False: 144]
  ------------------
  128|     17|    return false;
  129|     17|  }
  130|    144|  return true;
  131|    161|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    144|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    144|    DecoderBuffer *buffer) {
  136|    144|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    144|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    144|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    144|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 42, False: 102]
  ------------------
  140|     42|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 41]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     42|  } else
  145|    102|#endif
  146|    102|  {
  147|    102|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 101]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    102|  }
  151|    142|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 51, False: 91]
  ------------------
  152|     51|    return false;
  153|     51|  }
  154|     91|  const uint8_t *const data_head =
  155|     91|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     91|  buffer->Advance(bytes_encoded);
  158|     91|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 28, False: 63]
  ------------------
  159|     28|    return false;
  160|     28|  }
  161|     63|  return true;
  162|     91|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  25.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     63|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     63|  ans_.read_end();
  167|     63|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    196|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    196|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    196|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 196]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    196|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    196|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    196|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 22, False: 174]
  ------------------
   67|     22|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 22]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     22|  } else
   72|    174|#endif
   73|    174|  {
   74|    174|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 165]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    174|  }
   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|    187|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 178]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    178|  probability_table_.resize(num_symbols_);
   86|    178|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 174]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  56.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 56.7k, False: 128]
  ------------------
   91|  56.7k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  56.7k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 23, False: 56.7k]
  ------------------
   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|  56.7k|    const int token = prob_data & 3;
  102|  56.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.19k, False: 50.5k]
  ------------------
  103|  6.19k|      const uint32_t offset = prob_data >> 2;
  104|  6.19k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 6.18k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   262k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 256k, False: 6.18k]
  ------------------
  109|   256k|        probability_table_[i + j] = 0;
  110|   256k|      }
  111|  6.18k|      i += offset;
  112|  50.5k|    } else {
  113|  50.5k|      const int extra_bytes = token;
  114|  50.5k|      uint32_t prob = prob_data >> 2;
  115|  84.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 33.6k, False: 50.4k]
  ------------------
  116|  33.6k|        uint8_t eb;
  117|  33.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 33.6k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  33.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  33.6k|      }
  124|  50.4k|      probability_table_[i] = prob;
  125|  50.4k|    }
  126|  56.7k|  }
  127|    128|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 107]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    107|  return true;
  131|    128|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    111|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    107|    DecoderBuffer *buffer) {
  136|    107|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    107|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    107|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    107|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 11, False: 96]
  ------------------
  140|     11|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 11]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     11|  } else
  145|     96|#endif
  146|     96|  {
  147|     96|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 87]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|     96|  }
  151|     98|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 28, False: 70]
  ------------------
  152|     28|    return false;
  153|     28|  }
  154|     70|  const uint8_t *const data_head =
  155|     70|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     70|  buffer->Advance(bytes_encoded);
  158|     70|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 45]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     45|  return true;
  162|     70|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   277k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     45|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     45|  ans_.read_end();
  167|     45|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    187|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    187|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    187|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 187]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    187|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    187|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    187|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 3, False: 184]
  ------------------
   67|      3|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 3]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      3|  } else
   72|    184|#endif
   73|    184|  {
   74|    184|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 182]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    184|  }
   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|    185|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 183]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    183|  probability_table_.resize(num_symbols_);
   86|    183|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 181]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  30.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 30.6k, False: 129]
  ------------------
   91|  30.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|  30.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 26, False: 30.6k]
  ------------------
   95|     26|      return false;
   96|     26|    }
   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|  30.6k|    const int token = prob_data & 3;
  102|  30.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.55k, False: 21.0k]
  ------------------
  103|  9.55k|      const uint32_t offset = prob_data >> 2;
  104|  9.55k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 16, False: 9.53k]
  ------------------
  105|     16|        return false;
  106|     16|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   350k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 341k, False: 9.53k]
  ------------------
  109|   341k|        probability_table_[i + j] = 0;
  110|   341k|      }
  111|  9.53k|      i += offset;
  112|  21.0k|    } else {
  113|  21.0k|      const int extra_bytes = token;
  114|  21.0k|      uint32_t prob = prob_data >> 2;
  115|  33.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 12.0k, False: 21.0k]
  ------------------
  116|  12.0k|        uint8_t eb;
  117|  12.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 11.9k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  11.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  11.9k|      }
  124|  21.0k|      probability_table_[i] = prob;
  125|  21.0k|    }
  126|  30.6k|  }
  127|    129|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 38, False: 91]
  ------------------
  128|     38|    return false;
  129|     38|  }
  130|     91|  return true;
  131|    129|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|     93|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|     91|    DecoderBuffer *buffer) {
  136|     91|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     91|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     91|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     91|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 91]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|     91|#endif
  146|     91|  {
  147|     91|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 89]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|     91|  }
  151|     89|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 11, False: 78]
  ------------------
  152|     11|    return false;
  153|     11|  }
  154|     78|  const uint8_t *const data_head =
  155|     78|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     78|  buffer->Advance(bytes_encoded);
  158|     78|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 32, False: 46]
  ------------------
  159|     32|    return false;
  160|     32|  }
  161|     46|  return true;
  162|     78|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   330k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     46|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     46|  ans_.read_end();
  167|     46|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    207|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    207|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    207|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 207]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    207|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    207|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    207|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 14, False: 193]
  ------------------
   67|     14|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 14]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     14|  } else
   72|    193|#endif
   73|    193|  {
   74|    193|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 188]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    193|  }
   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|    202|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 195]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    195|  probability_table_.resize(num_symbols_);
   86|    195|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 189]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|   107k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 107k, False: 116]
  ------------------
   91|   107k|    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|   107k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 33, False: 107k]
  ------------------
   95|     33|      return false;
   96|     33|    }
   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|   107k|    const int token = prob_data & 3;
  102|   107k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 37.1k, False: 70.1k]
  ------------------
  103|  37.1k|      const uint32_t offset = prob_data >> 2;
  104|  37.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 23, False: 37.1k]
  ------------------
  105|     23|        return false;
  106|     23|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   879k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 841k, False: 37.1k]
  ------------------
  109|   841k|        probability_table_[i + j] = 0;
  110|   841k|      }
  111|  37.1k|      i += offset;
  112|  70.1k|    } else {
  113|  70.1k|      const int extra_bytes = token;
  114|  70.1k|      uint32_t prob = prob_data >> 2;
  115|   122k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 52.2k, False: 70.1k]
  ------------------
  116|  52.2k|        uint8_t eb;
  117|  52.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 52.1k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  52.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  52.1k|      }
  124|  70.1k|      probability_table_[i] = prob;
  125|  70.1k|    }
  126|   107k|  }
  127|    116|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 24, False: 92]
  ------------------
  128|     24|    return false;
  129|     24|  }
  130|     92|  return true;
  131|    116|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|     98|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|     92|    DecoderBuffer *buffer) {
  136|     92|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     92|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     92|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     92|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 91]
  ------------------
  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|     91|#endif
  146|     91|  {
  147|     91|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 91]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     91|  }
  151|     92|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 20, False: 72]
  ------------------
  152|     20|    return false;
  153|     20|  }
  154|     72|  const uint8_t *const data_head =
  155|     72|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     72|  buffer->Advance(bytes_encoded);
  158|     72|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 47]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     47|  return true;
  162|     72|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   185k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     47|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     47|  ans_.read_end();
  167|     47|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    233|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    233|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    233|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 233]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    233|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    233|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    233|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 44, False: 189]
  ------------------
   67|     44|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 42]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     44|  } else
   72|    189|#endif
   73|    189|  {
   74|    189|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 188]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    189|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    230|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 218]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    218|  probability_table_.resize(num_symbols_);
   86|    218|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 217]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   490k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 490k, False: 156]
  ------------------
   91|   490k|    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|   490k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 21, False: 489k]
  ------------------
   95|     21|      return false;
   96|     21|    }
   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|   489k|    const int token = prob_data & 3;
  102|   489k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 243k, False: 246k]
  ------------------
  103|   243k|      const uint32_t offset = prob_data >> 2;
  104|   243k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 243k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  7.22M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 6.98M, False: 243k]
  ------------------
  109|  6.98M|        probability_table_[i + j] = 0;
  110|  6.98M|      }
  111|   243k|      i += offset;
  112|   246k|    } else {
  113|   246k|      const int extra_bytes = token;
  114|   246k|      uint32_t prob = prob_data >> 2;
  115|   491k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 245k, False: 246k]
  ------------------
  116|   245k|        uint8_t eb;
  117|   245k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 245k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   245k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   245k|      }
  124|   246k|      probability_table_[i] = prob;
  125|   246k|    }
  126|   489k|  }
  127|    156|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 36, False: 120]
  ------------------
  128|     36|    return false;
  129|     36|  }
  130|    120|  return true;
  131|    156|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    121|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    120|    DecoderBuffer *buffer) {
  136|    120|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    120|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    120|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    120|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 13, False: 107]
  ------------------
  140|     13|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 13]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     13|  } else
  145|    107|#endif
  146|    107|  {
  147|    107|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 100]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    107|  }
  151|    113|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 39, False: 74]
  ------------------
  152|     39|    return false;
  153|     39|  }
  154|     74|  const uint8_t *const data_head =
  155|     74|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     74|  buffer->Advance(bytes_encoded);
  158|     74|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 49]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     49|  return true;
  162|     74|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   287k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     49|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     49|  ans_.read_end();
  167|     49|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    314|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    314|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    314|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 314]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    314|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    314|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    314|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 58, False: 256]
  ------------------
   67|     58|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 58]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     58|  } else
   72|    256|#endif
   73|    256|  {
   74|    256|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 247]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    256|  }
   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|    305|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 290]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    290|  probability_table_.resize(num_symbols_);
   86|    290|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 15, False: 275]
  ------------------
   87|     15|    return true;
   88|     15|  }
   89|       |  // Decode the table.
   90|  1.17M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.17M, False: 207]
  ------------------
   91|  1.17M|    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.17M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 23, False: 1.17M]
  ------------------
   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.17M|    const int token = prob_data & 3;
  102|  1.17M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 345k, False: 826k]
  ------------------
  103|   345k|      const uint32_t offset = prob_data >> 2;
  104|   345k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 345k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  10.1M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 9.77M, False: 345k]
  ------------------
  109|  9.77M|        probability_table_[i + j] = 0;
  110|  9.77M|      }
  111|   345k|      i += offset;
  112|   826k|    } else {
  113|   826k|      const int extra_bytes = token;
  114|   826k|      uint32_t prob = prob_data >> 2;
  115|  1.65M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 824k, False: 826k]
  ------------------
  116|   824k|        uint8_t eb;
  117|   824k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 824k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   824k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   824k|      }
  124|   826k|      probability_table_[i] = prob;
  125|   826k|    }
  126|  1.17M|  }
  127|    207|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 38, False: 169]
  ------------------
  128|     38|    return false;
  129|     38|  }
  130|    169|  return true;
  131|    207|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    184|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    169|    DecoderBuffer *buffer) {
  136|    169|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    169|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    169|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    169|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 33, False: 136]
  ------------------
  140|     33|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 33]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     33|  } else
  145|    136|#endif
  146|    136|  {
  147|    136|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 126]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    136|  }
  151|    159|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 52, False: 107]
  ------------------
  152|     52|    return false;
  153|     52|  }
  154|    107|  const uint8_t *const data_head =
  155|    107|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    107|  buffer->Advance(bytes_encoded);
  158|    107|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 43, False: 64]
  ------------------
  159|     43|    return false;
  160|     43|  }
  161|     64|  return true;
  162|    107|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   517k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     64|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     64|  ans_.read_end();
  167|     64|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    233|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    233|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    233|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 233]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    233|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    233|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    233|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 50, False: 183]
  ------------------
   67|     50|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 49]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     50|  } else
   72|    183|#endif
   73|    183|  {
   74|    183|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 176]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    183|  }
   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|    225|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 26, False: 199]
  ------------------
   83|     26|    return false;
   84|     26|  }
   85|    199|  probability_table_.resize(num_symbols_);
   86|    199|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 194]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|   155k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 155k, False: 122]
  ------------------
   91|   155k|    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|   155k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 24, False: 155k]
  ------------------
   95|     24|      return false;
   96|     24|    }
   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|   155k|    const int token = prob_data & 3;
  102|   155k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 121k, False: 33.9k]
  ------------------
  103|   121k|      const uint32_t offset = prob_data >> 2;
  104|   121k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 34, False: 121k]
  ------------------
  105|     34|        return false;
  106|     34|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  7.31M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.19M, False: 121k]
  ------------------
  109|  7.19M|        probability_table_[i + j] = 0;
  110|  7.19M|      }
  111|   121k|      i += offset;
  112|   121k|    } else {
  113|  33.9k|      const int extra_bytes = token;
  114|  33.9k|      uint32_t prob = prob_data >> 2;
  115|  72.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 39.0k, False: 33.9k]
  ------------------
  116|  39.0k|        uint8_t eb;
  117|  39.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 39.0k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  39.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  39.0k|      }
  124|  33.9k|      probability_table_[i] = prob;
  125|  33.9k|    }
  126|   155k|  }
  127|    122|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 16, False: 106]
  ------------------
  128|     16|    return false;
  129|     16|  }
  130|    106|  return true;
  131|    122|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    111|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    106|    DecoderBuffer *buffer) {
  136|    106|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    106|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    106|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    106|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 19, False: 87]
  ------------------
  140|     19|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 19]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     19|  } else
  145|     87|#endif
  146|     87|  {
  147|     87|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 80]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|     87|  }
  151|     99|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 29, False: 70]
  ------------------
  152|     29|    return false;
  153|     29|  }
  154|     70|  const uint8_t *const data_head =
  155|     70|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     70|  buffer->Advance(bytes_encoded);
  158|     70|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 12, False: 58]
  ------------------
  159|     12|    return false;
  160|     12|  }
  161|     58|  return true;
  162|     70|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  3.40M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    217|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    217|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    217|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 217]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    217|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    217|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    217|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 38, False: 179]
  ------------------
   67|     38|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 38]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     38|  } else
   72|    179|#endif
   73|    179|  {
   74|    179|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 175]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    179|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    213|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 41, False: 172]
  ------------------
   83|     41|    return false;
   84|     41|  }
   85|    172|  probability_table_.resize(num_symbols_);
   86|    172|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 170]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   296k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 295k, False: 113]
  ------------------
   91|   295k|    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|   295k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 295k]
  ------------------
   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|   295k|    const int token = prob_data & 3;
  102|   295k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 162k, False: 133k]
  ------------------
  103|   162k|      const uint32_t offset = prob_data >> 2;
  104|   162k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 14, False: 162k]
  ------------------
  105|     14|        return false;
  106|     14|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.96M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.80M, False: 162k]
  ------------------
  109|  5.80M|        probability_table_[i + j] = 0;
  110|  5.80M|      }
  111|   162k|      i += offset;
  112|   162k|    } else {
  113|   133k|      const int extra_bytes = token;
  114|   133k|      uint32_t prob = prob_data >> 2;
  115|   253k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 120k, False: 133k]
  ------------------
  116|   120k|        uint8_t eb;
  117|   120k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 120k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   120k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   120k|      }
  124|   133k|      probability_table_[i] = prob;
  125|   133k|    }
  126|   295k|  }
  127|    113|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 16, False: 97]
  ------------------
  128|     16|    return false;
  129|     16|  }
  130|     97|  return true;
  131|    113|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|     99|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|     97|    DecoderBuffer *buffer) {
  136|     97|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     97|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     97|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     97|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 96]
  ------------------
  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|     96|#endif
  146|     96|  {
  147|     96|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 90]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|     96|  }
  151|     91|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 20, False: 71]
  ------------------
  152|     20|    return false;
  153|     20|  }
  154|     71|  const uint8_t *const data_head =
  155|     71|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     71|  buffer->Advance(bytes_encoded);
  158|     71|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 23, False: 48]
  ------------------
  159|     23|    return false;
  160|     23|  }
  161|     48|  return true;
  162|     71|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  24.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     48|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     48|  ans_.read_end();
  167|     48|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    201|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    201|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    201|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 201]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    201|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    201|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    201|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 34, False: 167]
  ------------------
   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|    167|#endif
   73|    167|  {
   74|    167|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 156]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    167|  }
   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|    190|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 186]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|    186|  probability_table_.resize(num_symbols_);
   86|    186|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 186]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   315k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 315k, False: 121]
  ------------------
   91|   315k|    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|   315k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 33, False: 315k]
  ------------------
   95|     33|      return false;
   96|     33|    }
   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|   315k|    const int token = prob_data & 3;
  102|   315k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 154k, False: 160k]
  ------------------
  103|   154k|      const uint32_t offset = prob_data >> 2;
  104|   154k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 154k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.85M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.70M, False: 154k]
  ------------------
  109|  5.70M|        probability_table_[i + j] = 0;
  110|  5.70M|      }
  111|   154k|      i += offset;
  112|   160k|    } else {
  113|   160k|      const int extra_bytes = token;
  114|   160k|      uint32_t prob = prob_data >> 2;
  115|   284k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 124k, False: 160k]
  ------------------
  116|   124k|        uint8_t eb;
  117|   124k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 124k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   124k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   124k|      }
  124|   160k|      probability_table_[i] = prob;
  125|   160k|    }
  126|   315k|  }
  127|    121|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 15, False: 106]
  ------------------
  128|     15|    return false;
  129|     15|  }
  130|    106|  return true;
  131|    121|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    106|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    106|    DecoderBuffer *buffer) {
  136|    106|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    106|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    106|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    106|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 90]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 16]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     16|  } else
  145|     90|#endif
  146|     90|  {
  147|     90|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 89]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     90|  }
  151|    105|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 34, False: 71]
  ------------------
  152|     34|    return false;
  153|     34|  }
  154|     71|  const uint8_t *const data_head =
  155|     71|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     71|  buffer->Advance(bytes_encoded);
  158|     71|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 27, False: 44]
  ------------------
  159|     27|    return false;
  160|     27|  }
  161|     44|  return true;
  162|     71|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  10.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     44|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     44|  ans_.read_end();
  167|     44|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    184|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    184|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    184|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 184]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    184|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    184|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    184|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 45, False: 139]
  ------------------
   67|     45|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 44]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     45|  } else
   72|    139|#endif
   73|    139|  {
   74|    139|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 135]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    139|  }
   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|    179|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 172]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    172|  probability_table_.resize(num_symbols_);
   86|    172|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 172]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   247k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 246k, False: 112]
  ------------------
   91|   246k|    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|   246k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 22, False: 246k]
  ------------------
   95|     22|      return false;
   96|     22|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   246k|    const int token = prob_data & 3;
  102|   246k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 168k, False: 78.3k]
  ------------------
  103|   168k|      const uint32_t offset = prob_data >> 2;
  104|   168k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 168k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  6.80M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 6.63M, False: 168k]
  ------------------
  109|  6.63M|        probability_table_[i + j] = 0;
  110|  6.63M|      }
  111|   168k|      i += offset;
  112|   168k|    } else {
  113|  78.3k|      const int extra_bytes = token;
  114|  78.3k|      uint32_t prob = prob_data >> 2;
  115|   140k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 62.1k, False: 78.3k]
  ------------------
  116|  62.1k|        uint8_t eb;
  117|  62.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 62.1k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  62.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  62.1k|      }
  124|  78.3k|      probability_table_[i] = prob;
  125|  78.3k|    }
  126|   246k|  }
  127|    112|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 16, False: 96]
  ------------------
  128|     16|    return false;
  129|     16|  }
  130|     96|  return true;
  131|    112|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|     96|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|     96|    DecoderBuffer *buffer) {
  136|     96|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     96|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     96|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     96|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 19, False: 77]
  ------------------
  140|     19|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 19]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     19|  } else
  145|     77|#endif
  146|     77|  {
  147|     77|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 77]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     77|  }
  151|     96|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 23, False: 73]
  ------------------
  152|     23|    return false;
  153|     23|  }
  154|     73|  const uint8_t *const data_head =
  155|     73|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     73|  buffer->Advance(bytes_encoded);
  158|     73|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 21, False: 52]
  ------------------
  159|     21|    return false;
  160|     21|  }
  161|     52|  return true;
  162|     73|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  9.46M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     52|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     52|  ans_.read_end();
  167|     52|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    191|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    191|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    191|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 191]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    191|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    191|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    191|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 162]
  ------------------
   67|     29|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 29]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     29|  } else
   72|    162|#endif
   73|    162|  {
   74|    162|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 156]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    162|  }
   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|    185|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 183]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    183|  probability_table_.resize(num_symbols_);
   86|    183|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 174]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  1.94M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.94M, False: 113]
  ------------------
   91|  1.94M|    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.94M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 39, False: 1.94M]
  ------------------
   95|     39|      return false;
   96|     39|    }
   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.94M|    const int token = prob_data & 3;
  102|  1.94M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.25M, False: 699k]
  ------------------
  103|  1.25M|      const uint32_t offset = prob_data >> 2;
  104|  1.25M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 1.25M]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  32.6M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 31.4M, False: 1.25M]
  ------------------
  109|  31.4M|        probability_table_[i + j] = 0;
  110|  31.4M|      }
  111|  1.25M|      i += offset;
  112|  1.25M|    } else {
  113|   699k|      const int extra_bytes = token;
  114|   699k|      uint32_t prob = prob_data >> 2;
  115|  1.25M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 557k, False: 699k]
  ------------------
  116|   557k|        uint8_t eb;
  117|   557k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 557k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   557k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   557k|      }
  124|   699k|      probability_table_[i] = prob;
  125|   699k|    }
  126|  1.94M|  }
  127|    113|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 11, False: 102]
  ------------------
  128|     11|    return false;
  129|     11|  }
  130|    102|  return true;
  131|    113|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    111|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    102|    DecoderBuffer *buffer) {
  136|    102|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    102|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    102|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    102|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 82]
  ------------------
  140|     20|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 20]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     20|  } else
  145|     82|#endif
  146|     82|  {
  147|     82|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 72]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|     82|  }
  151|     92|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 28, False: 64]
  ------------------
  152|     28|    return false;
  153|     28|  }
  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: 15, False: 49]
  ------------------
  159|     15|    return false;
  160|     15|  }
  161|     49|  return true;
  162|     64|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  29.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     49|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     49|  ans_.read_end();
  167|     49|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  7.95k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  7.95k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 7, False: 7.94k]
  ------------------
   35|      7|    return true;
   36|      7|  }
   37|       |  // Decode which scheme to use.
   38|  7.94k|  uint8_t scheme;
   39|  7.94k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 116, False: 7.83k]
  ------------------
   40|    116|    return false;
   41|    116|  }
   42|  7.83k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 790, False: 7.04k]
  ------------------
   43|    790|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    790|                                                  src_buffer, out_values);
   45|  7.04k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 4.55k, False: 2.48k]
  ------------------
   46|  4.55k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  4.55k|                                               out_values);
   48|  4.55k|  }
   49|  2.48k|  return false;
   50|  7.83k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    790|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    790|  SymbolDecoderT<5> tag_decoder;
   57|    790|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 351, False: 439]
  ------------------
   58|    351|    return false;
   59|    351|  }
   60|       |
   61|    439|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 132, False: 307]
  ------------------
   62|    132|    return false;
   63|    132|  }
   64|       |
   65|    307|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 307, False: 0]
  |  Branch (65:25): [True: 37, False: 270]
  ------------------
   66|     37|    return false;  // Wrong number of symbols.
   67|     37|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    270|  src_buffer->StartBitDecoding(false, nullptr);
   72|    270|  int value_id = 0;
   73|  5.57M|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 5.56M, False: 268]
  ------------------
   74|       |    // Decode the tag.
   75|  5.56M|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  11.3M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 5.80M, False: 5.56M]
  ------------------
   78|  5.80M|      uint32_t val;
   79|  5.80M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 2, False: 5.80M]
  ------------------
   80|      2|        return false;
   81|      2|      }
   82|  5.80M|      out_values[value_id++] = val;
   83|  5.80M|    }
   84|  5.56M|  }
   85|    268|  tag_decoder.EndDecoding();
   86|    268|  src_buffer->EndBitDecoding();
   87|    268|  return true;
   88|    270|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  4.55k|                      uint32_t *out_values) {
  117|  4.55k|  uint8_t max_bit_length;
  118|  4.55k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 18, False: 4.54k]
  ------------------
  119|     18|    return false;
  120|     18|  }
  121|  4.54k|  switch (max_bit_length) {
  122|    360|    case 1:
  ------------------
  |  Branch (122:5): [True: 360, False: 4.18k]
  ------------------
  123|    360|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    360|                                                         out_values);
  125|    353|    case 2:
  ------------------
  |  Branch (125:5): [True: 353, False: 4.18k]
  ------------------
  126|    353|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    353|                                                         out_values);
  128|    306|    case 3:
  ------------------
  |  Branch (128:5): [True: 306, False: 4.23k]
  ------------------
  129|    306|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    306|                                                         out_values);
  131|    164|    case 4:
  ------------------
  |  Branch (131:5): [True: 164, False: 4.37k]
  ------------------
  132|    164|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    164|                                                         out_values);
  134|    172|    case 5:
  ------------------
  |  Branch (134:5): [True: 172, False: 4.36k]
  ------------------
  135|    172|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    172|                                                         out_values);
  137|    289|    case 6:
  ------------------
  |  Branch (137:5): [True: 289, False: 4.25k]
  ------------------
  138|    289|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    289|                                                         out_values);
  140|    301|    case 7:
  ------------------
  |  Branch (140:5): [True: 301, False: 4.23k]
  ------------------
  141|    301|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    301|                                                         out_values);
  143|    237|    case 8:
  ------------------
  |  Branch (143:5): [True: 237, False: 4.30k]
  ------------------
  144|    237|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    237|                                                         out_values);
  146|    196|    case 9:
  ------------------
  |  Branch (146:5): [True: 196, False: 4.34k]
  ------------------
  147|    196|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    196|                                                         out_values);
  149|    187|    case 10:
  ------------------
  |  Branch (149:5): [True: 187, False: 4.35k]
  ------------------
  150|    187|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    187|          num_values, src_buffer, out_values);
  152|    207|    case 11:
  ------------------
  |  Branch (152:5): [True: 207, False: 4.33k]
  ------------------
  153|    207|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    207|          num_values, src_buffer, out_values);
  155|    233|    case 12:
  ------------------
  |  Branch (155:5): [True: 233, False: 4.30k]
  ------------------
  156|    233|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    233|          num_values, src_buffer, out_values);
  158|    314|    case 13:
  ------------------
  |  Branch (158:5): [True: 314, False: 4.22k]
  ------------------
  159|    314|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    314|          num_values, src_buffer, out_values);
  161|    233|    case 14:
  ------------------
  |  Branch (161:5): [True: 233, False: 4.30k]
  ------------------
  162|    233|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    233|          num_values, src_buffer, out_values);
  164|    217|    case 15:
  ------------------
  |  Branch (164:5): [True: 217, False: 4.32k]
  ------------------
  165|    217|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    217|          num_values, src_buffer, out_values);
  167|    201|    case 16:
  ------------------
  |  Branch (167:5): [True: 201, False: 4.33k]
  ------------------
  168|    201|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    201|          num_values, src_buffer, out_values);
  170|    184|    case 17:
  ------------------
  |  Branch (170:5): [True: 184, False: 4.35k]
  ------------------
  171|    184|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    184|          num_values, src_buffer, out_values);
  173|    191|    case 18:
  ------------------
  |  Branch (173:5): [True: 191, False: 4.34k]
  ------------------
  174|    191|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    191|          num_values, src_buffer, out_values);
  176|    195|    default:
  ------------------
  |  Branch (176:5): [True: 195, False: 4.34k]
  ------------------
  177|    195|      return false;
  178|  4.54k|  }
  179|  4.54k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    360|                              uint32_t *out_values) {
   93|    360|  SymbolDecoderT decoder;
   94|    360|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 224, False: 136]
  ------------------
   95|    224|    return false;
   96|    224|  }
   97|       |
   98|    136|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 136, False: 0]
  |  Branch (98:25): [True: 16, False: 120]
  ------------------
   99|     16|    return false;  // Wrong number of symbols.
  100|     16|  }
  101|       |
  102|    120|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 49, False: 71]
  ------------------
  103|     49|    return false;
  104|     49|  }
  105|  4.95M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.95M, False: 71]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.95M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.95M|    out_values[i] = value;
  109|  4.95M|  }
  110|     71|  decoder.EndDecoding();
  111|     71|  return true;
  112|    120|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    353|                              uint32_t *out_values) {
   93|    353|  SymbolDecoderT decoder;
   94|    353|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 159, False: 194]
  ------------------
   95|    159|    return false;
   96|    159|  }
   97|       |
   98|    194|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 194, False: 0]
  |  Branch (98:25): [True: 11, False: 183]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    183|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 84, False: 99]
  ------------------
  103|     84|    return false;
  104|     84|  }
  105|  16.8M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 16.8M, False: 99]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  16.8M|    const uint32_t value = decoder.DecodeSymbol();
  108|  16.8M|    out_values[i] = value;
  109|  16.8M|  }
  110|     99|  decoder.EndDecoding();
  111|     99|  return true;
  112|    183|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    306|                              uint32_t *out_values) {
   93|    306|  SymbolDecoderT decoder;
   94|    306|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 103, False: 203]
  ------------------
   95|    103|    return false;
   96|    103|  }
   97|       |
   98|    203|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 203, False: 0]
  |  Branch (98:25): [True: 0, False: 203]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    203|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 89, False: 114]
  ------------------
  103|     89|    return false;
  104|     89|  }
  105|  24.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 24.9M, False: 114]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  24.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  24.9M|    out_values[i] = value;
  109|  24.9M|  }
  110|    114|  decoder.EndDecoding();
  111|    114|  return true;
  112|    203|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    164|                              uint32_t *out_values) {
   93|    164|  SymbolDecoderT decoder;
   94|    164|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 78, False: 86]
  ------------------
   95|     78|    return false;
   96|     78|  }
   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: 41, False: 45]
  ------------------
  103|     41|    return false;
  104|     41|  }
  105|   805k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 805k, False: 45]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   805k|    const uint32_t value = decoder.DecodeSymbol();
  108|   805k|    out_values[i] = value;
  109|   805k|  }
  110|     45|  decoder.EndDecoding();
  111|     45|  return true;
  112|     86|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    172|                              uint32_t *out_values) {
   93|    172|  SymbolDecoderT decoder;
   94|    172|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 20, False: 152]
  ------------------
   95|     20|    return false;
   96|     20|  }
   97|       |
   98|    152|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 152, False: 0]
  |  Branch (98:25): [True: 73, False: 79]
  ------------------
   99|     73|    return false;  // Wrong number of symbols.
  100|     73|  }
  101|       |
  102|     79|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 8, False: 71]
  ------------------
  103|      8|    return false;
  104|      8|  }
  105|  11.2M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 11.2M, False: 71]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  11.2M|    const uint32_t value = decoder.DecodeSymbol();
  108|  11.2M|    out_values[i] = value;
  109|  11.2M|  }
  110|     71|  decoder.EndDecoding();
  111|     71|  return true;
  112|     79|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    289|                              uint32_t *out_values) {
   93|    289|  SymbolDecoderT decoder;
   94|    289|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 91, False: 198]
  ------------------
   95|     91|    return false;
   96|     91|  }
   97|       |
   98|    198|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 198, False: 0]
  |  Branch (98:25): [True: 0, False: 198]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    198|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 72, False: 126]
  ------------------
  103|     72|    return false;
  104|     72|  }
  105|  1.68M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.68M, False: 126]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.68M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.68M|    out_values[i] = value;
  109|  1.68M|  }
  110|    126|  decoder.EndDecoding();
  111|    126|  return true;
  112|    198|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    301|                              uint32_t *out_values) {
   93|    301|  SymbolDecoderT decoder;
   94|    301|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 114, False: 187]
  ------------------
   95|    114|    return false;
   96|    114|  }
   97|       |
   98|    187|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 187, False: 0]
  |  Branch (98:25): [True: 1, False: 186]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    186|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 76, False: 110]
  ------------------
  103|     76|    return false;
  104|     76|  }
  105|  33.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 33.6M, False: 110]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  33.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  33.6M|    out_values[i] = value;
  109|  33.6M|  }
  110|    110|  decoder.EndDecoding();
  111|    110|  return true;
  112|    186|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    237|                              uint32_t *out_values) {
   93|    237|  SymbolDecoderT decoder;
   94|    237|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 93, False: 144]
  ------------------
   95|     93|    return false;
   96|     93|  }
   97|       |
   98|    144|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 144, False: 0]
  |  Branch (98:25): [True: 0, False: 144]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    144|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 81, False: 63]
  ------------------
  103|     81|    return false;
  104|     81|  }
  105|  25.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 25.9M, False: 63]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  25.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  25.9M|    out_values[i] = value;
  109|  25.9M|  }
  110|     63|  decoder.EndDecoding();
  111|     63|  return true;
  112|    144|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    196|                              uint32_t *out_values) {
   93|    196|  SymbolDecoderT decoder;
   94|    196|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 85, False: 111]
  ------------------
   95|     85|    return false;
   96|     85|  }
   97|       |
   98|    111|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 111, False: 0]
  |  Branch (98:25): [True: 4, False: 107]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    107|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 62, False: 45]
  ------------------
  103|     62|    return false;
  104|     62|  }
  105|   277k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 277k, False: 45]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   277k|    const uint32_t value = decoder.DecodeSymbol();
  108|   277k|    out_values[i] = value;
  109|   277k|  }
  110|     45|  decoder.EndDecoding();
  111|     45|  return true;
  112|    107|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    187|                              uint32_t *out_values) {
   93|    187|  SymbolDecoderT decoder;
   94|    187|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 94, False: 93]
  ------------------
   95|     94|    return false;
   96|     94|  }
   97|       |
   98|     93|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 93, False: 0]
  |  Branch (98:25): [True: 2, False: 91]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|     91|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 45, False: 46]
  ------------------
  103|     45|    return false;
  104|     45|  }
  105|   330k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 330k, False: 46]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   330k|    const uint32_t value = decoder.DecodeSymbol();
  108|   330k|    out_values[i] = value;
  109|   330k|  }
  110|     46|  decoder.EndDecoding();
  111|     46|  return true;
  112|     91|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    207|                              uint32_t *out_values) {
   93|    207|  SymbolDecoderT decoder;
   94|    207|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 109, False: 98]
  ------------------
   95|    109|    return false;
   96|    109|  }
   97|       |
   98|     98|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 98, False: 0]
  |  Branch (98:25): [True: 6, False: 92]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|     92|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 45, False: 47]
  ------------------
  103|     45|    return false;
  104|     45|  }
  105|   185k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 185k, False: 47]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   185k|    const uint32_t value = decoder.DecodeSymbol();
  108|   185k|    out_values[i] = value;
  109|   185k|  }
  110|     47|  decoder.EndDecoding();
  111|     47|  return true;
  112|     92|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    233|                              uint32_t *out_values) {
   93|    233|  SymbolDecoderT decoder;
   94|    233|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 112, False: 121]
  ------------------
   95|    112|    return false;
   96|    112|  }
   97|       |
   98|    121|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 121, False: 0]
  |  Branch (98:25): [True: 1, False: 120]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    120|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 71, False: 49]
  ------------------
  103|     71|    return false;
  104|     71|  }
  105|   287k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 287k, False: 49]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   287k|    const uint32_t value = decoder.DecodeSymbol();
  108|   287k|    out_values[i] = value;
  109|   287k|  }
  110|     49|  decoder.EndDecoding();
  111|     49|  return true;
  112|    120|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    314|                              uint32_t *out_values) {
   93|    314|  SymbolDecoderT decoder;
   94|    314|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 130, False: 184]
  ------------------
   95|    130|    return false;
   96|    130|  }
   97|       |
   98|    184|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 184, False: 0]
  |  Branch (98:25): [True: 15, False: 169]
  ------------------
   99|     15|    return false;  // Wrong number of symbols.
  100|     15|  }
  101|       |
  102|    169|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 105, False: 64]
  ------------------
  103|    105|    return false;
  104|    105|  }
  105|   517k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 517k, False: 64]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   517k|    const uint32_t value = decoder.DecodeSymbol();
  108|   517k|    out_values[i] = value;
  109|   517k|  }
  110|     64|  decoder.EndDecoding();
  111|     64|  return true;
  112|    169|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    233|                              uint32_t *out_values) {
   93|    233|  SymbolDecoderT decoder;
   94|    233|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 122, False: 111]
  ------------------
   95|    122|    return false;
   96|    122|  }
   97|       |
   98|    111|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 111, False: 0]
  |  Branch (98:25): [True: 5, False: 106]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    106|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 48, False: 58]
  ------------------
  103|     48|    return false;
  104|     48|  }
  105|  3.40M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.40M, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.40M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.40M|    out_values[i] = value;
  109|  3.40M|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|    106|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    217|                              uint32_t *out_values) {
   93|    217|  SymbolDecoderT decoder;
   94|    217|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 118, False: 99]
  ------------------
   95|    118|    return false;
   96|    118|  }
   97|       |
   98|     99|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 99, False: 0]
  |  Branch (98:25): [True: 2, False: 97]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|     97|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 49, False: 48]
  ------------------
  103|     49|    return false;
  104|     49|  }
  105|  24.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 24.7M, False: 48]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  24.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  24.7M|    out_values[i] = value;
  109|  24.7M|  }
  110|     48|  decoder.EndDecoding();
  111|     48|  return true;
  112|     97|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    201|                              uint32_t *out_values) {
   93|    201|  SymbolDecoderT decoder;
   94|    201|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 95, False: 106]
  ------------------
   95|     95|    return false;
   96|     95|  }
   97|       |
   98|    106|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 106, False: 0]
  |  Branch (98:25): [True: 0, False: 106]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    106|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 62, False: 44]
  ------------------
  103|     62|    return false;
  104|     62|  }
  105|  10.8M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.8M, False: 44]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.8M|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.8M|    out_values[i] = value;
  109|  10.8M|  }
  110|     44|  decoder.EndDecoding();
  111|     44|  return true;
  112|    106|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    184|                              uint32_t *out_values) {
   93|    184|  SymbolDecoderT decoder;
   94|    184|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 88, False: 96]
  ------------------
   95|     88|    return false;
   96|     88|  }
   97|       |
   98|     96|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 96, False: 0]
  |  Branch (98:25): [True: 0, False: 96]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     96|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 44, False: 52]
  ------------------
  103|     44|    return false;
  104|     44|  }
  105|  9.46M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.46M, False: 52]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.46M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.46M|    out_values[i] = value;
  109|  9.46M|  }
  110|     52|  decoder.EndDecoding();
  111|     52|  return true;
  112|     96|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    191|                              uint32_t *out_values) {
   93|    191|  SymbolDecoderT decoder;
   94|    191|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 80, False: 111]
  ------------------
   95|     80|    return false;
   96|     80|  }
   97|       |
   98|    111|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 111, False: 0]
  |  Branch (98:25): [True: 9, False: 102]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    102|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 53, False: 49]
  ------------------
  103|     53|    return false;
  104|     53|  }
  105|  29.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 29.7M, False: 49]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  29.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  29.7M|    out_values[i] = value;
  109|  29.7M|  }
  110|     49|  decoder.EndDecoding();
  111|     49|  return true;
  112|    102|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  1.95k|    : decoder_(nullptr),
   49|  1.95k|      last_symbol_id_(-1),
   50|  1.95k|      last_vert_id_(-1),
   51|  1.95k|      last_face_id_(-1),
   52|  1.95k|      num_new_vertices_(0),
   53|  1.95k|      num_encoded_vertices_(0),
   54|  1.95k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  1.95k|    MeshEdgebreakerDecoder *decoder) {
   59|  1.95k|  decoder_ = decoder;
   60|  1.95k|  return true;
   61|  1.95k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  2.50k|    int att_id) const {
   67|  4.52k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 4.08k, False: 438]
  ------------------
   68|  4.08k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  4.08k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 2.01k, False: 2.07k]
  |  Branch (69:27): [True: 0, False: 2.07k]
  ------------------
   70|  2.01k|      continue;
   71|  2.01k|    }
   72|  2.07k|    const AttributesDecoderInterface *const dec =
   73|  2.07k|        decoder_->attributes_decoder(decoder_id);
   74|  8.63k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 8.63k, False: 0]
  ------------------
   75|  8.63k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 2.07k, False: 6.56k]
  ------------------
   76|  2.07k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.38k, False: 682]
  ------------------
   77|  1.38k|          return &attribute_data_[i].connectivity_data;
   78|  1.38k|        }
   79|    682|        return nullptr;
   80|  2.07k|      }
   81|  8.63k|    }
   82|  2.07k|  }
   83|    438|  return nullptr;
   84|  2.50k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  2.50k|    int att_id) const {
   90|  4.52k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 4.08k, False: 438]
  ------------------
   91|  4.08k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  4.08k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 2.01k, False: 2.07k]
  |  Branch (92:27): [True: 0, False: 2.07k]
  ------------------
   93|  2.01k|      continue;
   94|  2.01k|    }
   95|  2.07k|    const AttributesDecoderInterface *const dec =
   96|  2.07k|        decoder_->attributes_decoder(decoder_id);
   97|  8.63k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 8.63k, False: 0]
  ------------------
   98|  8.63k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 2.07k, False: 6.56k]
  ------------------
   99|  2.07k|        return &attribute_data_[i].encoding_data;
  100|  2.07k|      }
  101|  8.63k|    }
  102|  2.07k|  }
  103|    438|  return &pos_encoding_data_;
  104|  2.50k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  1.59k|    int32_t att_decoder_id) {
  131|  1.59k|  int8_t att_data_id;
  132|  1.59k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 10, False: 1.58k]
  ------------------
  133|     10|    return false;
  134|     10|  }
  135|  1.58k|  uint8_t decoder_type;
  136|  1.58k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 3, False: 1.58k]
  ------------------
  137|      3|    return false;
  138|      3|  }
  139|       |
  140|  1.58k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.24k, False: 339]
  ------------------
  141|  1.24k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 49, False: 1.19k]
  ------------------
  142|     49|      return false;  // Unexpected attribute data.
  143|     49|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.19k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 5, False: 1.18k]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|       |
  151|  1.18k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.18k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    339|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 0, False: 339]
  ------------------
  155|      0|      return false;  // Some other decoder is already using the data. Error.
  156|      0|    }
  157|    339|    pos_data_decoder_id_ = att_decoder_id;
  158|    339|  }
  159|       |
  160|  1.52k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.52k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.52k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.52k, False: 2]
  ------------------
  162|  1.52k|    uint8_t traversal_method_encoded;
  163|  1.52k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 2, False: 1.52k]
  ------------------
  164|      2|      return false;
  165|      2|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.52k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 8, False: 1.51k]
  ------------------
  168|      8|      return false;
  169|      8|    }
  170|  1.51k|    traversal_method =
  171|  1.51k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.51k|  }
  173|       |
  174|  1.51k|  const Mesh *mesh = decoder_->mesh();
  175|  1.51k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.51k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 720, False: 798]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    720|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    720|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 329, False: 391]
  ------------------
  182|    329|      encoding_data = &pos_encoding_data_;
  183|    391|    } else {
  184|    391|      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|    391|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    391|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    720|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 225, False: 495]
  ------------------
  191|    225|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    225|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    225|          AttTraverser;
  194|    225|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    495|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 495, False: 0]
  ------------------
  196|    495|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    495|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    495|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    495|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    798|  } else {
  203|    798|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 4, False: 794]
  ------------------
  204|      4|      return false;  // Unsupported method.
  205|      4|    }
  206|    794|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 3, False: 791]
  ------------------
  207|      3|      return false;  // Attribute data must be specified.
  208|      3|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    791|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    791|        AttObserver;
  214|    791|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    791|        AttTraverser;
  216|       |
  217|    791|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    791|        &attribute_data_[att_data_id].encoding_data;
  219|    791|    const MeshAttributeCornerTable *const corner_table =
  220|    791|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    791|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    791|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    791|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    791|                             encoding_data);
  227|       |
  228|    791|    AttTraverser att_traverser;
  229|    791|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    791|    traversal_sequencer->SetTraverser(att_traverser);
  232|    791|    sequencer = std::move(traversal_sequencer);
  233|    791|  }
  234|       |
  235|  1.51k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.51k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.51k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.51k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.51k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.51k|                                        std::move(att_controller));
  244|  1.51k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  1.95k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  1.95k|  num_new_vertices_ = 0;
  249|  1.95k|  new_to_parent_vertex_map_.clear();
  250|  1.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  1.95k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 518, False: 1.43k]
  ------------------
  252|    518|    uint32_t num_new_verts;
  253|    518|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    518|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 101, False: 417]
  ------------------
  254|    101|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 101]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    417|    } else {
  258|    417|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 417]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    417|    }
  262|    518|    num_new_vertices_ = num_new_verts;
  263|    518|  }
  264|  1.95k|#endif
  265|       |
  266|  1.95k|  uint32_t num_encoded_vertices;
  267|  1.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  1.95k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 101, False: 1.85k]
  ------------------
  269|    101|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 101]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    101|  } else
  274|  1.85k|#endif
  275|  1.85k|  {
  276|  1.85k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 1.85k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  1.85k|  }
  280|  1.95k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  1.95k|  uint32_t num_faces;
  283|  1.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  1.95k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 101, False: 1.85k]
  ------------------
  285|    101|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 101]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    101|  } else
  290|  1.85k|#endif
  291|  1.85k|  {
  292|  1.85k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 1.85k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  1.85k|  }
  296|  1.95k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 3, False: 1.94k]
  ------------------
  297|      3|    return false;  // Draco cannot handle this many faces.
  298|      3|  }
  299|       |
  300|  1.94k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 1, False: 1.94k]
  ------------------
  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.94k|  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.94k|  const uint64_t num_encoded_vertices_64 =
  311|  1.94k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  1.94k|  const uint64_t max_num_vertex_edges =
  313|  1.94k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  1.94k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 0, False: 1.94k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      0|    return false;
  317|      0|  }
  318|       |
  319|  1.94k|  uint8_t num_attribute_data;
  320|  1.94k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 1.94k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  1.94k|  uint32_t num_encoded_symbols;
  325|  1.94k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  1.94k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.94k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 97, False: 1.85k]
  ------------------
  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|  1.85k|#endif
  333|  1.85k|  {
  334|  1.85k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 1.85k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  1.85k|  }
  338|       |
  339|  1.94k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 2, False: 1.94k]
  ------------------
  340|       |    // Number of faces needs to be the same or greater than the number of
  341|       |    // symbols (it can be greater because the initial face may not be encoded as
  342|       |    // a symbol).
  343|      2|    return false;
  344|      2|  }
  345|  1.94k|  const uint32_t max_encoded_faces =
  346|  1.94k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  1.94k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 5, False: 1.94k]
  ------------------
  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.94k|  uint32_t num_encoded_split_symbols;
  355|  1.94k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  1.94k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.94k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 93, False: 1.84k]
  ------------------
  357|     93|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 93]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|     93|  } else
  362|  1.84k|#endif
  363|  1.84k|  {
  364|  1.84k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 1.84k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  1.84k|  }
  368|       |
  369|  1.94k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 6, False: 1.93k]
  ------------------
  370|      6|    return false;  // Split symbols are a sub-set of all symbols.
  371|      6|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  1.93k|  vertex_traversal_length_.clear();
  375|  1.93k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  1.93k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 1.93k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  1.93k|  processed_corner_ids_.clear();
  380|  1.93k|  processed_corner_ids_.reserve(num_faces);
  381|  1.93k|  processed_connectivity_corners_.clear();
  382|  1.93k|  processed_connectivity_corners_.reserve(num_faces);
  383|  1.93k|  topology_split_data_.clear();
  384|  1.93k|  hole_event_data_.clear();
  385|  1.93k|  init_face_configurations_.clear();
  386|  1.93k|  init_corners_.clear();
  387|       |
  388|  1.93k|  last_symbol_id_ = -1;
  389|  1.93k|  last_face_id_ = -1;
  390|  1.93k|  last_vert_id_ = -1;
  391|       |
  392|  1.93k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  1.93k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  1.93k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 1.93k]
  ------------------
  397|  1.93k|          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.93k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  1.93k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  1.93k|  int32_t topology_split_decoded_bytes = -1;
  410|  1.93k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.93k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 504, False: 1.43k]
  ------------------
  411|    504|    uint32_t encoded_connectivity_size;
  412|    504|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    504|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 87, False: 417]
  ------------------
  413|     87|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 0, False: 87]
  ------------------
  414|      0|        return false;
  415|      0|      }
  416|    417|    } else {
  417|    417|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 417]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|    417|    }
  421|    504|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 2, False: 502]
  ------------------
  422|    502|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 2, False: 500]
  ------------------
  423|      4|      return false;
  424|      4|    }
  425|    500|    DecoderBuffer event_buffer;
  426|    500|    event_buffer.Init(
  427|    500|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    500|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    500|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    500|    topology_split_decoded_bytes =
  432|    500|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    500|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 86, False: 414]
  ------------------
  434|     86|      return false;
  435|     86|    }
  436|       |
  437|    500|  } else
  438|  1.43k|#endif
  439|  1.43k|  {
  440|  1.43k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 10, False: 1.42k]
  ------------------
  441|     10|      return false;
  442|     10|    }
  443|  1.43k|  }
  444|       |
  445|  1.83k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  1.83k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  1.83k|                                           num_encoded_split_symbols);
  449|  1.83k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  1.83k|  DecoderBuffer traversal_end_buffer;
  452|  1.83k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 64, False: 1.77k]
  ------------------
  453|     64|    return false;
  454|     64|  }
  455|       |
  456|  1.77k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.77k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 184, False: 1.58k]
  ------------------
  458|    184|    return false;
  459|    184|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.58k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.58k|                           traversal_end_buffer.remaining_size(),
  464|  1.58k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.58k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.58k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.58k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 351, False: 1.23k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    351|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    351|  }
  471|  1.58k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.58k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.55k, False: 31]
  ------------------
  475|  1.55k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.55k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.55k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 346, False: 1.20k]
  ------------------
  477|  2.02k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.67k, False: 346]
  ------------------
  478|  1.67k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.67k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.67k|      }
  482|       |
  483|    346|    } else
  484|  1.20k|#endif
  485|  1.20k|    {
  486|   248k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 247k, False: 1.20k]
  ------------------
  487|   247k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 247k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   247k|      }
  491|  1.20k|    }
  492|  1.55k|  }
  493|  1.58k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  6.26k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 4.68k, False: 1.58k]
  ------------------
  498|  4.68k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  4.69M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 4.69M, False: 4.68k]
  ------------------
  501|  4.69M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  4.69M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  4.68k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 4.68k]
  ------------------
  505|  4.68k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  4.68k|  }
  509|       |
  510|  1.58k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  6.26k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 4.68k, False: 1.58k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  4.68k|    int32_t att_connectivity_verts =
  517|  4.68k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  4.68k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 542, False: 4.14k]
  ------------------
  519|    542|      att_connectivity_verts = corner_table_->num_vertices();
  520|    542|    }
  521|  4.68k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  4.68k|  }
  523|  1.58k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 1, False: 1.58k]
  ------------------
  524|      1|    return false;
  525|      1|  }
  526|  1.58k|  return true;
  527|  1.58k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|    256|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    256|  return true;
  532|    256|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  1.77k|    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.77k|  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.77k|  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.77k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.77k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.77k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.77k|  int num_faces = 0;
  562|  30.8M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 30.8M, False: 1.63k]
  ------------------
  563|  30.8M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  30.8M|    bool check_topology_split = false;
  566|  30.8M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  30.8M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 12.9M, False: 17.8M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  12.9M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 0, False: 12.9M]
  ------------------
  588|      0|        return -1;
  589|      0|      }
  590|       |
  591|  12.9M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  12.9M|      const VertexIndex vertex_x =
  593|  12.9M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  12.9M|      const CornerIndex corner_b =
  595|  12.9M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  12.9M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 106, False: 12.9M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    106|        return -1;
  600|    106|      }
  601|  12.9M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 12.9M]
  |  Branch (601:11): [True: 0, False: 12.9M]
  ------------------
  602|  12.9M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 12.9M]
  ------------------
  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.9M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  12.9M|      SetOppositeCorners(corner_a, corner + 1);
  612|  12.9M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  12.9M|      const VertexIndex vert_a_prev =
  616|  12.9M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  12.9M|      const VertexIndex vert_b_next =
  618|  12.9M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  12.9M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 12.9M]
  |  Branch (619:38): [True: 0, False: 12.9M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  12.9M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  12.9M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  12.9M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  12.9M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  12.9M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  12.9M|      active_corner_stack.back() = corner;
  631|  17.8M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 5.03M, False: 12.8M]
  |  Branch (631:40): [True: 3.30M, False: 9.53M]
  ------------------
  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|  8.34M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 8.34M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  8.34M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  8.34M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 8.34M]
  ------------------
  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|  8.34M|      const CornerIndex corner(3 * face.value());
  658|  8.34M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  8.34M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 5.03M, False: 3.30M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  5.03M|        opp_corner = corner + 2;
  662|  5.03M|        corner_l = corner + 1;
  663|  5.03M|        corner_r = corner;
  664|  5.03M|      } else {
  665|       |        // "l" is the new first corner.
  666|  3.30M|        opp_corner = corner + 1;
  667|  3.30M|        corner_l = corner;
  668|  3.30M|        corner_r = corner + 2;
  669|  3.30M|      }
  670|  8.34M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  8.34M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  8.34M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 0, False: 8.34M]
  ------------------
  675|      0|        return -1;  // Unexpected number of decoded vertices.
  676|      0|      }
  677|       |
  678|  8.34M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  8.34M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  8.34M|      const VertexIndex vertex_r =
  682|  8.34M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  8.34M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  8.34M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  8.34M|      corner_table_->MapCornerToVertex(
  688|  8.34M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  8.34M|      active_corner_stack.back() = corner;
  690|  8.34M|      check_topology_split = true;
  691|  9.53M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 4.54M, False: 4.99M]
  ------------------
  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|  4.54M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 4.54M]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  4.54M|      const CornerIndex corner_b = active_corner_stack.back();
  706|  4.54M|      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|  4.54M|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  4.54M|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 63, False: 4.54M]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     63|        active_corner_stack.push_back(it->second);
  714|     63|      }
  715|  4.54M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 3, False: 4.54M]
  ------------------
  716|      3|        return -1;
  717|      3|      }
  718|  4.54M|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  4.54M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 4.54M]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  4.54M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 5, False: 4.54M]
  |  Branch (724:11): [True: 5, False: 4.54M]
  ------------------
  725|  4.54M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 4.54M]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      5|        return -1;
  729|      5|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  4.54M|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  4.54M|      SetOppositeCorners(corner_a, corner + 2);
  735|  4.54M|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  4.54M|      const VertexIndex vertex_p =
  739|  4.54M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  4.54M|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  4.54M|      corner_table_->MapCornerToVertex(
  742|  4.54M|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  4.54M|      const VertexIndex vert_b_prev =
  744|  4.54M|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  4.54M|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  4.54M|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  4.54M|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  4.54M|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  4.54M|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  4.54M|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  4.54M|                                       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|  4.54M|      const CornerIndex first_corner = corner_n;
  757|  14.9M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 10.3M, False: 4.54M]
  ------------------
  758|  10.3M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  10.3M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  10.3M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 2, False: 10.3M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      2|          return -1;
  764|      2|        }
  765|  10.3M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  4.54M|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  4.54M|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 12.4k, False: 4.53M]
  ------------------
  770|  12.4k|        invalid_vertices.push_back(vertex_n);
  771|  12.4k|      }
  772|  4.54M|      active_corner_stack.back() = corner;
  773|  4.99M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 4.99M, False: 0]
  ------------------
  774|  4.99M|      const CornerIndex corner(3 * face.value());
  775|  4.99M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  4.99M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  4.99M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  4.99M|                                       corner_table_->AddNewVertex());
  780|  4.99M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  4.99M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  4.99M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 1, False: 4.99M]
  ------------------
  784|      1|        return -1;  // Unexpected number of decoded vertices.
  785|      1|      }
  786|       |
  787|  4.99M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  4.99M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  4.99M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  4.99M|      active_corner_stack.push_back(corner);
  792|  4.99M|      check_topology_split = true;
  793|  4.99M|    } 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|  30.8M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  30.8M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 13.3M, False: 17.5M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  13.3M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  13.3M|      EdgeFaceName split_edge;
  812|  13.3M|      int encoder_split_symbol_id;
  813|  13.3M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.95k, False: 13.3M]
  ------------------
  814|  13.3M|                             &encoder_split_symbol_id)) {
  815|  1.95k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 16, False: 1.94k]
  ------------------
  816|     16|          return -1;  // Wrong split symbol id.
  817|     16|        }
  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.94k|        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.94k|        CornerIndex new_active_corner;
  831|  1.94k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 746, False: 1.19k]
  ------------------
  832|    746|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.19k|        } else {
  834|  1.19k|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|  1.19k|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.94k|        const int decoder_split_symbol_id =
  839|  1.94k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.94k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.94k|            new_active_corner;
  842|  1.94k|      }
  843|  13.3M|    }
  844|  30.8M|  }
  845|  1.63k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.63k]
  ------------------
  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|  65.7k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 64.1k, False: 1.60k]
  ------------------
  850|  64.1k|    const CornerIndex corner = active_corner_stack.back();
  851|  64.1k|    active_corner_stack.pop_back();
  852|  64.1k|    const bool interior_face =
  853|  64.1k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  64.1k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 57.6k, False: 6.54k]
  ------------------
  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|  57.6k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 7, False: 57.6k]
  ------------------
  877|      7|        return -1;  // More faces than expected added to the mesh.
  878|      7|      }
  879|       |
  880|  57.6k|      const CornerIndex corner_a = corner;
  881|  57.6k|      const VertexIndex vert_n =
  882|  57.6k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  57.6k|      const CornerIndex corner_b =
  884|  57.6k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  57.6k|      const VertexIndex vert_x =
  887|  57.6k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  57.6k|      const CornerIndex corner_c =
  889|  57.6k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  57.6k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 3, False: 57.6k]
  |  Branch (891:33): [True: 18, False: 57.5k]
  |  Branch (891:55): [True: 0, False: 57.5k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     21|        return -1;
  894|     21|      }
  895|  57.5k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 3, False: 57.5k]
  |  Branch (895:11): [True: 7, False: 57.5k]
  ------------------
  896|  57.5k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 1, False: 57.5k]
  ------------------
  897|  57.5k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 3, False: 57.5k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      7|        return -1;
  901|      7|      }
  902|       |
  903|  57.5k|      const VertexIndex vert_p =
  904|  57.5k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  57.5k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  57.5k|      const CornerIndex new_corner(3 * face.value());
  909|  57.5k|      SetOppositeCorners(new_corner, corner);
  910|  57.5k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  57.5k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  57.5k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  57.5k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  57.5k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|   230k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 172k, False: 57.5k]
  ------------------
  920|   172k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|   172k|      }
  922|       |
  923|  57.5k|      init_face_configurations_.push_back(true);
  924|  57.5k|      init_corners_.push_back(new_corner);
  925|  57.5k|    } 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|  6.54k|      init_face_configurations_.push_back(false);
  930|  6.54k|      init_corners_.push_back(corner);
  931|  6.54k|    }
  932|  64.1k|  }
  933|  1.60k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 16, False: 1.58k]
  ------------------
  934|     16|    return -1;  // Unexpected number of decoded faces.
  935|     16|  }
  936|       |
  937|  1.58k|  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.64k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 3.64k, False: 1.58k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  3.64k|    VertexIndex src_vert(num_vertices - 1);
  943|  3.90k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 264, False: 3.64k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    264|      src_vert = VertexIndex(--num_vertices - 1);
  946|    264|    }
  947|  3.64k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 264, False: 3.38k]
  ------------------
  948|    264|      continue;  // No need to swap anything.
  949|    264|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  3.38k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  35.3k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 31.9k, False: 3.38k]
  ------------------
  954|  31.9k|      const CornerIndex cid = vcit.Corner();
  955|  31.9k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 0, False: 31.9k]
  ------------------
  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|  31.9k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  31.9k|    }
  962|  3.38k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  3.38k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  3.38k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  3.38k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  3.38k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  3.38k|    num_vertices--;
  972|  3.38k|  }
  973|  1.58k|  return num_vertices;
  974|  1.58k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  1.93k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  1.93k|  uint32_t num_topology_splits;
  982|  1.93k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  1.93k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.93k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 83, False: 1.84k]
  ------------------
  984|     83|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 83]
  ------------------
  985|      0|      return -1;
  986|      0|    }
  987|       |
  988|     83|  } else
  989|  1.84k|#endif
  990|  1.84k|  {
  991|  1.84k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 1.84k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  1.84k|  }
  995|  1.93k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 1.36k, False: 568]
  ------------------
  996|  1.36k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 1, False: 1.36k]
  ------------------
  997|  1.36k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|      1|      return -1;
  999|      1|    }
 1000|  1.36k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  1.36k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.36k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 48, False: 1.31k]
  ------------------
 1002|  23.1k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 23.0k, False: 26]
  ------------------
 1003|  23.0k|        TopologySplitEventData event_data;
 1004|  23.0k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 11, False: 23.0k]
  ------------------
 1005|     11|          return -1;
 1006|     11|        }
 1007|  23.0k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 8, False: 23.0k]
  ------------------
 1008|      8|          return -1;
 1009|      8|        }
 1010|  23.0k|        uint8_t edge_data;
 1011|  23.0k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 3, False: 23.0k]
  ------------------
 1012|      3|          return -1;
 1013|      3|        }
 1014|  23.0k|        event_data.source_edge = edge_data & 1;
 1015|  23.0k|        topology_split_data_.push_back(event_data);
 1016|  23.0k|      }
 1017|       |
 1018|     48|    } else
 1019|  1.31k|#endif
 1020|  1.31k|    {
 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|  1.31k|      int last_source_symbol_id = 0;
 1024|  5.99k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 4.68k, False: 1.30k]
  ------------------
 1025|  4.68k|        TopologySplitEventData event_data;
 1026|  4.68k|        uint32_t delta;
 1027|  4.68k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 4, False: 4.68k]
  ------------------
 1028|      4|          return -1;
 1029|      4|        }
 1030|  4.68k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  4.68k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 2, False: 4.68k]
  ------------------
 1032|      2|          return -1;
 1033|      2|        }
 1034|  4.68k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 4, False: 4.67k]
  ------------------
 1035|      4|          return -1;
 1036|      4|        }
 1037|  4.67k|        event_data.split_symbol_id =
 1038|  4.67k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  4.67k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  4.67k|        topology_split_data_.push_back(event_data);
 1041|  4.67k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  1.30k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  5.51k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 4.21k, False: 1.30k]
  ------------------
 1045|  4.21k|        uint32_t edge_data;
 1046|  4.21k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.21k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 884, False: 3.33k]
  ------------------
 1047|    884|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  3.33k|        } else {
 1049|  3.33k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  3.33k|        }
 1051|  4.21k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  4.21k|        event_data.source_edge = edge_data & 1;
 1053|  4.21k|      }
 1054|  1.30k|      decoder_buffer->EndBitDecoding();
 1055|  1.30k|    }
 1056|  1.36k|  }
 1057|  1.89k|  uint32_t num_hole_events = 0;
 1058|  1.89k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  1.89k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.89k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 60, False: 1.83k]
  ------------------
 1060|     60|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 57]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  1.83k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.83k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 416, False: 1.42k]
  ------------------
 1064|    416|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 5, False: 411]
  ------------------
 1065|      5|      return -1;
 1066|      5|    }
 1067|    416|  }
 1068|  1.88k|#endif
 1069|  1.88k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 58, False: 1.83k]
  ------------------
 1070|     58|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     58|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     58|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 44, False: 14]
  ------------------
 1072|   251k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 251k, False: 1]
  ------------------
 1073|   251k|        HoleEventData event_data;
 1074|   251k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 43, False: 251k]
  ------------------
 1075|     43|          return -1;
 1076|     43|        }
 1077|   251k|        hole_event_data_.push_back(event_data);
 1078|   251k|      }
 1079|       |
 1080|     44|    } else
 1081|     14|#endif
 1082|     14|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     14|      int last_symbol_id = 0;
 1085|  1.05k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 1.05k, False: 2]
  ------------------
 1086|  1.05k|        HoleEventData event_data;
 1087|  1.05k|        uint32_t delta;
 1088|  1.05k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 12, False: 1.04k]
  ------------------
 1089|     12|          return -1;
 1090|     12|        }
 1091|  1.04k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  1.04k|        last_symbol_id = event_data.symbol_id;
 1093|  1.04k|        hole_event_data_.push_back(event_data);
 1094|  1.04k|      }
 1095|     14|    }
 1096|     58|  }
 1097|  1.83k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  1.88k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.67k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.67k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.67k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  6.70k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 5.03k, False: 1.67k]
  ------------------
 1109|  5.03k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  5.03k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 1.62k, False: 3.41k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  3.31k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 1.69k, False: 1.62k]
  ------------------
 1114|  1.69k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  1.69k|      }
 1116|  1.62k|      continue;
 1117|  1.62k|    }
 1118|       |
 1119|  7.33k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 3.92k, False: 3.41k]
  ------------------
 1120|  3.92k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  3.92k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 2.58k, False: 1.33k]
  ------------------
 1122|  2.58k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  2.58k|      }
 1124|  3.92k|    }
 1125|  3.41k|  }
 1126|  1.67k|  return true;
 1127|  1.67k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   247k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   247k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   247k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   247k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|   988k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 741k, False: 247k]
  ------------------
 1139|   741k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   741k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 35.3k, False: 706k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   482k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 447k, False: 35.3k]
  ------------------
 1144|   447k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   447k|      }
 1146|  35.3k|      continue;
 1147|  35.3k|    }
 1148|   706k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   706k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 353k, False: 353k]
  ------------------
 1151|   353k|      continue;
 1152|   353k|    }
 1153|       |
 1154|  4.71M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 4.36M, False: 353k]
  ------------------
 1155|  4.36M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  4.36M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 4.24M, False: 121k]
  ------------------
 1157|  4.24M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  4.24M|      }
 1159|  4.36M|    }
 1160|   353k|  }
 1161|   247k|  return true;
 1162|   247k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  1.58k|    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.58k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.58k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 31, False: 1.55k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  88.2k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 88.2k, False: 31]
  ------------------
 1176|  88.2k|      Mesh::Face face;
 1177|  88.2k|      const CornerIndex start_corner(3 * f.value());
 1178|   352k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 264k, False: 88.2k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   264k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   264k|        face[c] = vert_id;
 1182|   264k|      }
 1183|  88.2k|      decoder_->mesh()->SetFace(f, face);
 1184|  88.2k|    }
 1185|     31|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     31|    return true;
 1187|     31|  }
 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.55k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.55k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   156k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 155k, False: 1.55k]
  ------------------
 1197|   155k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   155k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 4.18k, False: 151k]
  ------------------
 1199|  4.18k|      continue;  // Isolated vertex.
 1200|  4.18k|    }
 1201|   151k|    CornerIndex deduplication_first_corner = c;
 1202|   151k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 36.9k, False: 114k]
  ------------------
 1203|       |      // If the vertex is on a boundary, start deduplication from the left most
 1204|       |      // corner that is guaranteed to lie on the boundary.
 1205|  36.9k|      deduplication_first_corner = c;
 1206|   114k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   134k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 119k, False: 14.4k]
  ------------------
 1210|   119k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 12.7k, False: 106k]
  ------------------
 1211|  12.7k|          continue;  // No seam for this attribute, ignore it.
 1212|  12.7k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|   106k|        const VertexIndex vert_id =
 1217|   106k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   106k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   106k|        bool seam_found = false;
 1220|   127k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 119k, False: 7.26k]
  ------------------
 1221|   119k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 1, False: 119k]
  ------------------
 1222|      1|            return false;
 1223|      1|          }
 1224|   119k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 99.5k, False: 20.4k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  99.5k|            deduplication_first_corner = act_c;
 1227|  99.5k|            seam_found = true;
 1228|  99.5k|            break;
 1229|  99.5k|          }
 1230|  20.4k|          act_c = corner_table_->SwingRight(act_c);
 1231|  20.4k|        }
 1232|   106k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 99.5k, False: 7.26k]
  ------------------
 1233|  99.5k|          break;  // No reason to process other attributes if we found a seam.
 1234|  99.5k|        }
 1235|   106k|      }
 1236|   114k|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|   151k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   151k|    corner_to_point_map[c.value()] =
 1246|   151k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   151k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   151k|    CornerIndex prev_c = c;
 1250|   151k|    c = corner_table_->SwingRight(c);
 1251|   807k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 770k, False: 37.1k]
  |  Branch (1251:40): [True: 656k, False: 113k]
  ------------------
 1252|   656k|      bool attribute_seam = false;
 1253|   766k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 685k, False: 81.1k]
  ------------------
 1254|   685k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 574k, False: 110k]
  ------------------
 1255|   685k|            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|   574k|          attribute_seam = true;
 1259|   574k|          break;
 1260|   574k|        }
 1261|   685k|      }
 1262|   656k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 574k, False: 81.1k]
  ------------------
 1263|   574k|        corner_to_point_map[c.value()] =
 1264|   574k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   574k|        point_to_corner_map.push_back(c.value());
 1266|   574k|      } else {
 1267|  81.1k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  81.1k|      }
 1269|   656k|      prev_c = c;
 1270|   656k|      c = corner_table_->SwingRight(c);
 1271|   656k|    }
 1272|   151k|  }
 1273|       |  // Add faces.
 1274|   250k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 248k, False: 1.55k]
  ------------------
 1275|   248k|    Mesh::Face face;
 1276|   995k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 746k, False: 248k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   746k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   746k|    }
 1280|   248k|    decoder_->mesh()->SetFace(f, face);
 1281|   248k|  }
 1282|  1.55k|  decoder_->point_cloud()->set_num_points(
 1283|  1.55k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.55k|  return true;
 1285|  1.55k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  1.87k|    : decoder_(nullptr),
   49|  1.87k|      last_symbol_id_(-1),
   50|  1.87k|      last_vert_id_(-1),
   51|  1.87k|      last_face_id_(-1),
   52|  1.87k|      num_new_vertices_(0),
   53|  1.87k|      num_encoded_vertices_(0),
   54|  1.87k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  1.87k|    MeshEdgebreakerDecoder *decoder) {
   59|  1.87k|  decoder_ = decoder;
   60|  1.87k|  return true;
   61|  1.87k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  2.15k|    int att_id) const {
   67|  3.37k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 2.71k, False: 663]
  ------------------
   68|  2.71k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  2.71k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.22k, False: 1.49k]
  |  Branch (69:27): [True: 0, False: 1.49k]
  ------------------
   70|  1.22k|      continue;
   71|  1.22k|    }
   72|  1.49k|    const AttributesDecoderInterface *const dec =
   73|  1.49k|        decoder_->attributes_decoder(decoder_id);
   74|  4.37k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 4.37k, False: 0]
  ------------------
   75|  4.37k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.49k, False: 2.88k]
  ------------------
   76|  1.49k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.00k, False: 488]
  ------------------
   77|  1.00k|          return &attribute_data_[i].connectivity_data;
   78|  1.00k|        }
   79|    488|        return nullptr;
   80|  1.49k|      }
   81|  4.37k|    }
   82|  1.49k|  }
   83|    663|  return nullptr;
   84|  2.15k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  2.15k|    int att_id) const {
   90|  3.37k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 2.71k, False: 663]
  ------------------
   91|  2.71k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  2.71k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.22k, False: 1.49k]
  |  Branch (92:27): [True: 0, False: 1.49k]
  ------------------
   93|  1.22k|      continue;
   94|  1.22k|    }
   95|  1.49k|    const AttributesDecoderInterface *const dec =
   96|  1.49k|        decoder_->attributes_decoder(decoder_id);
   97|  4.37k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 4.37k, False: 0]
  ------------------
   98|  4.37k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.49k, False: 2.88k]
  ------------------
   99|  1.49k|        return &attribute_data_[i].encoding_data;
  100|  1.49k|      }
  101|  4.37k|    }
  102|  1.49k|  }
  103|    663|  return &pos_encoding_data_;
  104|  2.15k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  1.54k|    int32_t att_decoder_id) {
  131|  1.54k|  int8_t att_data_id;
  132|  1.54k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 8, False: 1.53k]
  ------------------
  133|      8|    return false;
  134|      8|  }
  135|  1.53k|  uint8_t decoder_type;
  136|  1.53k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 4, False: 1.53k]
  ------------------
  137|      4|    return false;
  138|      4|  }
  139|       |
  140|  1.53k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.05k, False: 473]
  ------------------
  141|  1.05k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 27, False: 1.03k]
  ------------------
  142|     27|      return false;  // Unexpected attribute data.
  143|     27|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.03k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 3, False: 1.02k]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|       |
  151|  1.02k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.02k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    473|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 0, False: 473]
  ------------------
  155|      0|      return false;  // Some other decoder is already using the data. Error.
  156|      0|    }
  157|    473|    pos_data_decoder_id_ = att_decoder_id;
  158|    473|  }
  159|       |
  160|  1.50k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.50k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.50k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.50k, False: 0]
  ------------------
  162|  1.50k|    uint8_t traversal_method_encoded;
  163|  1.50k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 1, False: 1.50k]
  ------------------
  164|      1|      return false;
  165|      1|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.50k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 10, False: 1.49k]
  ------------------
  168|     10|      return false;
  169|     10|    }
  170|  1.49k|    traversal_method =
  171|  1.49k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.49k|  }
  173|       |
  174|  1.49k|  const Mesh *mesh = decoder_->mesh();
  175|  1.49k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.49k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 783, False: 707]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    783|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    783|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 463, False: 320]
  ------------------
  182|    463|      encoding_data = &pos_encoding_data_;
  183|    463|    } else {
  184|    320|      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|    320|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    320|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    783|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 282, False: 501]
  ------------------
  191|    282|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    282|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    282|          AttTraverser;
  194|    282|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    501|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 501, False: 0]
  ------------------
  196|    501|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    501|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    501|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    501|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    783|  } else {
  203|    707|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 6, False: 701]
  ------------------
  204|      6|      return false;  // Unsupported method.
  205|      6|    }
  206|    701|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 699]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    699|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    699|        AttObserver;
  214|    699|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    699|        AttTraverser;
  216|       |
  217|    699|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    699|        &attribute_data_[att_data_id].encoding_data;
  219|    699|    const MeshAttributeCornerTable *const corner_table =
  220|    699|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    699|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    699|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    699|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    699|                             encoding_data);
  227|       |
  228|    699|    AttTraverser att_traverser;
  229|    699|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    699|    traversal_sequencer->SetTraverser(att_traverser);
  232|    699|    sequencer = std::move(traversal_sequencer);
  233|    699|  }
  234|       |
  235|  1.48k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.48k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.48k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.48k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.48k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.48k|                                        std::move(att_controller));
  244|  1.48k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  1.87k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  1.87k|  num_new_vertices_ = 0;
  249|  1.87k|  new_to_parent_vertex_map_.clear();
  250|  1.87k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  1.87k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.87k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 179, False: 1.69k]
  ------------------
  252|    179|    uint32_t num_new_verts;
  253|    179|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    179|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 142, False: 37]
  ------------------
  254|    142|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 142]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    142|    } else {
  258|     37|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 37]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|     37|    }
  262|    179|    num_new_vertices_ = num_new_verts;
  263|    179|  }
  264|  1.87k|#endif
  265|       |
  266|  1.87k|  uint32_t num_encoded_vertices;
  267|  1.87k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  1.87k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.87k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 142, False: 1.73k]
  ------------------
  269|    142|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 142]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    142|  } else
  274|  1.73k|#endif
  275|  1.73k|  {
  276|  1.73k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 1.73k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  1.73k|  }
  280|  1.87k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  1.87k|  uint32_t num_faces;
  283|  1.87k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  1.87k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.87k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 142, False: 1.73k]
  ------------------
  285|    142|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 142]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    142|  } else
  290|  1.73k|#endif
  291|  1.73k|  {
  292|  1.73k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 1.73k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  1.73k|  }
  296|  1.87k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 0, False: 1.87k]
  ------------------
  297|      0|    return false;  // Draco cannot handle this many faces.
  298|      0|  }
  299|       |
  300|  1.87k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 1, False: 1.87k]
  ------------------
  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.87k|  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.87k|  const uint64_t num_encoded_vertices_64 =
  311|  1.87k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  1.87k|  const uint64_t max_num_vertex_edges =
  313|  1.87k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  1.87k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 0, False: 1.87k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      0|    return false;
  317|      0|  }
  318|       |
  319|  1.87k|  uint8_t num_attribute_data;
  320|  1.87k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 1.87k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  1.87k|  uint32_t num_encoded_symbols;
  325|  1.87k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  1.87k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.87k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 141, False: 1.73k]
  ------------------
  327|    141|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 141]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    141|  } else
  332|  1.73k|#endif
  333|  1.73k|  {
  334|  1.73k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 1.73k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  1.73k|  }
  338|       |
  339|  1.87k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 1, False: 1.87k]
  ------------------
  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|  1.87k|  const uint32_t max_encoded_faces =
  346|  1.87k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  1.87k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 8, False: 1.86k]
  ------------------
  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|      8|    return false;
  352|      8|  }
  353|       |
  354|  1.86k|  uint32_t num_encoded_split_symbols;
  355|  1.86k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  1.86k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.86k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 135, False: 1.72k]
  ------------------
  357|    135|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 135]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    135|  } else
  362|  1.72k|#endif
  363|  1.72k|  {
  364|  1.72k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 1.72k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  1.72k|  }
  368|       |
  369|  1.86k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 1, False: 1.86k]
  ------------------
  370|      1|    return false;  // Split symbols are a sub-set of all symbols.
  371|      1|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  1.86k|  vertex_traversal_length_.clear();
  375|  1.86k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  1.86k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 1.86k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  1.86k|  processed_corner_ids_.clear();
  380|  1.86k|  processed_corner_ids_.reserve(num_faces);
  381|  1.86k|  processed_connectivity_corners_.clear();
  382|  1.86k|  processed_connectivity_corners_.reserve(num_faces);
  383|  1.86k|  topology_split_data_.clear();
  384|  1.86k|  hole_event_data_.clear();
  385|  1.86k|  init_face_configurations_.clear();
  386|  1.86k|  init_corners_.clear();
  387|       |
  388|  1.86k|  last_symbol_id_ = -1;
  389|  1.86k|  last_face_id_ = -1;
  390|  1.86k|  last_vert_id_ = -1;
  391|       |
  392|  1.86k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  1.86k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  1.86k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 1.86k]
  ------------------
  397|  1.86k|          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.86k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  1.86k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  1.86k|  int32_t topology_split_decoded_bytes = -1;
  410|  1.86k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.86k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 171, False: 1.69k]
  ------------------
  411|    171|    uint32_t encoded_connectivity_size;
  412|    171|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    171|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 134, False: 37]
  ------------------
  413|    134|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 0, False: 134]
  ------------------
  414|      0|        return false;
  415|      0|      }
  416|    134|    } else {
  417|     37|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 37]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|     37|    }
  421|    171|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 2, False: 169]
  ------------------
  422|    169|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 8, False: 161]
  ------------------
  423|     10|      return false;
  424|     10|    }
  425|    161|    DecoderBuffer event_buffer;
  426|    161|    event_buffer.Init(
  427|    161|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    161|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    161|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    161|    topology_split_decoded_bytes =
  432|    161|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    161|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 122, False: 39]
  ------------------
  434|    122|      return false;
  435|    122|    }
  436|       |
  437|    161|  } else
  438|  1.69k|#endif
  439|  1.69k|  {
  440|  1.69k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 5, False: 1.68k]
  ------------------
  441|      5|      return false;
  442|      5|    }
  443|  1.69k|  }
  444|       |
  445|  1.72k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  1.72k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  1.72k|                                           num_encoded_split_symbols);
  449|  1.72k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  1.72k|  DecoderBuffer traversal_end_buffer;
  452|  1.72k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 37, False: 1.68k]
  ------------------
  453|     37|    return false;
  454|     37|  }
  455|       |
  456|  1.68k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.68k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 120, False: 1.56k]
  ------------------
  458|    120|    return false;
  459|    120|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.56k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.56k|                           traversal_end_buffer.remaining_size(),
  464|  1.56k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.56k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.56k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 18, False: 1.54k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|     18|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|     18|  }
  471|  1.56k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.56k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.53k, False: 28]
  ------------------
  475|  1.53k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.53k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.53k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 17, False: 1.52k]
  ------------------
  477|  1.62k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.60k, False: 17]
  ------------------
  478|  1.60k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.60k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.60k|      }
  482|       |
  483|     17|    } else
  484|  1.52k|#endif
  485|  1.52k|    {
  486|  8.79M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 8.78M, False: 1.52k]
  ------------------
  487|  8.78M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 8.78M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  8.78M|      }
  491|  1.52k|    }
  492|  1.53k|  }
  493|  1.56k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  3.71k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 2.14k, False: 1.56k]
  ------------------
  498|  2.14k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  16.5M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 16.5M, False: 2.14k]
  ------------------
  501|  16.5M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  16.5M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  2.14k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 2.14k]
  ------------------
  505|  2.14k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  2.14k|  }
  509|       |
  510|  1.56k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  3.71k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 2.14k, False: 1.56k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  2.14k|    int32_t att_connectivity_verts =
  517|  2.14k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  2.14k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 224, False: 1.92k]
  ------------------
  519|    224|      att_connectivity_verts = corner_table_->num_vertices();
  520|    224|    }
  521|  2.14k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  2.14k|  }
  523|  1.56k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 3, False: 1.56k]
  ------------------
  524|      3|    return false;
  525|      3|  }
  526|  1.56k|  return true;
  527|  1.56k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    404|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    404|  return true;
  532|    404|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  1.68k|    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.68k|  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.68k|  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.68k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.68k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.68k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.68k|  int num_faces = 0;
  562|  61.1M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 61.1M, False: 1.62k]
  ------------------
  563|  61.1M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  61.1M|    bool check_topology_split = false;
  566|  61.1M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  61.1M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 29.8M, False: 31.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|  29.8M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 0, False: 29.8M]
  ------------------
  588|      0|        return -1;
  589|      0|      }
  590|       |
  591|  29.8M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  29.8M|      const VertexIndex vertex_x =
  593|  29.8M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  29.8M|      const CornerIndex corner_b =
  595|  29.8M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  29.8M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 30, False: 29.8M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     30|        return -1;
  600|     30|      }
  601|  29.8M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 29.8M]
  |  Branch (601:11): [True: 0, False: 29.8M]
  ------------------
  602|  29.8M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 29.8M]
  ------------------
  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|  29.8M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  29.8M|      SetOppositeCorners(corner_a, corner + 1);
  612|  29.8M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  29.8M|      const VertexIndex vert_a_prev =
  616|  29.8M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  29.8M|      const VertexIndex vert_b_next =
  618|  29.8M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  29.8M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 29.8M]
  |  Branch (619:38): [True: 0, False: 29.8M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  29.8M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  29.8M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  29.8M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  29.8M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  29.8M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  29.8M|      active_corner_stack.back() = corner;
  631|  31.3M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 31.1M, False: 153k]
  |  Branch (631:40): [True: 25.2k, False: 128k]
  ------------------
  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|  31.2M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 31.2M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  31.2M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  31.2M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 31.2M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  31.2M|      const CornerIndex corner(3 * face.value());
  658|  31.2M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  31.2M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 31.1M, False: 25.2k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  31.1M|        opp_corner = corner + 2;
  662|  31.1M|        corner_l = corner + 1;
  663|  31.1M|        corner_r = corner;
  664|  31.1M|      } else {
  665|       |        // "l" is the new first corner.
  666|  25.2k|        opp_corner = corner + 1;
  667|  25.2k|        corner_l = corner;
  668|  25.2k|        corner_r = corner + 2;
  669|  25.2k|      }
  670|  31.2M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  31.2M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  31.2M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 3, False: 31.2M]
  ------------------
  675|      3|        return -1;  // Unexpected number of decoded vertices.
  676|      3|      }
  677|       |
  678|  31.2M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  31.2M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  31.2M|      const VertexIndex vertex_r =
  682|  31.2M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  31.2M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  31.2M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  31.2M|      corner_table_->MapCornerToVertex(
  688|  31.2M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  31.2M|      active_corner_stack.back() = corner;
  690|  31.2M|      check_topology_split = true;
  691|  31.2M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 21.8k, False: 106k]
  ------------------
  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|  21.8k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 21.8k]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  21.8k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  21.8k|      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|  21.8k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  21.8k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 16, False: 21.8k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     16|        active_corner_stack.push_back(it->second);
  714|     16|      }
  715|  21.8k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 5, False: 21.8k]
  ------------------
  716|      5|        return -1;
  717|      5|      }
  718|  21.8k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  21.8k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 21.8k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  21.8k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 3, False: 21.8k]
  |  Branch (724:11): [True: 3, False: 21.8k]
  ------------------
  725|  21.8k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 21.8k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      3|        return -1;
  729|      3|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  21.8k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  21.8k|      SetOppositeCorners(corner_a, corner + 2);
  735|  21.8k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  21.8k|      const VertexIndex vertex_p =
  739|  21.8k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  21.8k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  21.8k|      corner_table_->MapCornerToVertex(
  742|  21.8k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  21.8k|      const VertexIndex vert_b_prev =
  744|  21.8k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  21.8k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  21.8k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  21.8k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  21.8k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  21.8k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  21.8k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  21.8k|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  21.8k|      const CornerIndex first_corner = corner_n;
  757|   110k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 88.8k, False: 21.8k]
  ------------------
  758|  88.8k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  88.8k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  88.8k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 88.8k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  88.8k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  21.8k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  21.8k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 3.95k, False: 17.8k]
  ------------------
  770|  3.95k|        invalid_vertices.push_back(vertex_n);
  771|  3.95k|      }
  772|  21.8k|      active_corner_stack.back() = corner;
  773|   106k|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 106k, False: 0]
  ------------------
  774|   106k|      const CornerIndex corner(3 * face.value());
  775|   106k|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|   106k|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|   106k|      corner_table_->MapCornerToVertex(corner + 1,
  779|   106k|                                       corner_table_->AddNewVertex());
  780|   106k|      corner_table_->MapCornerToVertex(corner + 2,
  781|   106k|                                       corner_table_->AddNewVertex());
  782|       |
  783|   106k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 5, False: 106k]
  ------------------
  784|      5|        return -1;  // Unexpected number of decoded vertices.
  785|      5|      }
  786|       |
  787|   106k|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|   106k|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|   106k|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|   106k|      active_corner_stack.push_back(corner);
  792|   106k|      check_topology_split = true;
  793|   106k|    } 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|  61.1M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  61.1M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 31.3M, False: 29.8M]
  ------------------
  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|  31.3M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  31.3M|      EdgeFaceName split_edge;
  812|  31.3M|      int encoder_split_symbol_id;
  813|  31.3M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.11k, False: 31.3M]
  ------------------
  814|  31.3M|                             &encoder_split_symbol_id)) {
  815|  1.11k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 13, False: 1.10k]
  ------------------
  816|     13|          return -1;  // Wrong split symbol id.
  817|     13|        }
  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.10k|        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.10k|        CornerIndex new_active_corner;
  831|  1.10k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 614, False: 488]
  ------------------
  832|    614|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    614|        } else {
  834|    488|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    488|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.10k|        const int decoder_split_symbol_id =
  839|  1.10k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.10k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.10k|            new_active_corner;
  842|  1.10k|      }
  843|  31.3M|    }
  844|  61.1M|  }
  845|  1.62k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.62k]
  ------------------
  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|  47.4k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 45.8k, False: 1.61k]
  ------------------
  850|  45.8k|    const CornerIndex corner = active_corner_stack.back();
  851|  45.8k|    active_corner_stack.pop_back();
  852|  45.8k|    const bool interior_face =
  853|  45.8k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  45.8k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 42.9k, False: 2.88k]
  ------------------
  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|  42.9k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 3, False: 42.9k]
  ------------------
  877|      3|        return -1;  // More faces than expected added to the mesh.
  878|      3|      }
  879|       |
  880|  42.9k|      const CornerIndex corner_a = corner;
  881|  42.9k|      const VertexIndex vert_n =
  882|  42.9k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  42.9k|      const CornerIndex corner_b =
  884|  42.9k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  42.9k|      const VertexIndex vert_x =
  887|  42.9k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  42.9k|      const CornerIndex corner_c =
  889|  42.9k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  42.9k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 7, False: 42.9k]
  |  Branch (891:33): [True: 5, False: 42.9k]
  |  Branch (891:55): [True: 0, False: 42.9k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     12|        return -1;
  894|     12|      }
  895|  42.9k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 42.9k]
  |  Branch (895:11): [True: 1, False: 42.9k]
  ------------------
  896|  42.9k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 42.9k]
  ------------------
  897|  42.9k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 42.9k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      1|        return -1;
  901|      1|      }
  902|       |
  903|  42.9k|      const VertexIndex vert_p =
  904|  42.9k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  42.9k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  42.9k|      const CornerIndex new_corner(3 * face.value());
  909|  42.9k|      SetOppositeCorners(new_corner, corner);
  910|  42.9k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  42.9k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  42.9k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  42.9k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  42.9k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|   171k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 128k, False: 42.9k]
  ------------------
  920|   128k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|   128k|      }
  922|       |
  923|  42.9k|      init_face_configurations_.push_back(true);
  924|  42.9k|      init_corners_.push_back(new_corner);
  925|  42.9k|    } 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|  2.88k|      init_face_configurations_.push_back(false);
  930|  2.88k|      init_corners_.push_back(corner);
  931|  2.88k|    }
  932|  45.8k|  }
  933|  1.61k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 40, False: 1.57k]
  ------------------
  934|     40|    return -1;  // Unexpected number of decoded faces.
  935|     40|  }
  936|       |
  937|  1.57k|  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.57k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 679, False: 1.56k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    679|    VertexIndex src_vert(num_vertices - 1);
  943|    707|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 28, False: 679]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|     28|      src_vert = VertexIndex(--num_vertices - 1);
  946|     28|    }
  947|    679|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 28, False: 651]
  ------------------
  948|     28|      continue;  // No need to swap anything.
  949|     28|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    651|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  3.25k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 2.60k, False: 648]
  ------------------
  954|  2.60k|      const CornerIndex cid = vcit.Corner();
  955|  2.60k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 3, False: 2.60k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      3|        return -1;
  959|      3|      }
  960|  2.60k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  2.60k|    }
  962|    648|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    648|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    648|    corner_table_->MakeVertexIsolated(src_vert);
  967|    648|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    648|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    648|    num_vertices--;
  972|    648|  }
  973|  1.56k|  return num_vertices;
  974|  1.57k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  1.85k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  1.85k|  uint32_t num_topology_splits;
  982|  1.85k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  1.85k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.85k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 124, False: 1.72k]
  ------------------
  984|    124|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 124]
  ------------------
  985|      0|      return -1;
  986|      0|    }
  987|       |
  988|    124|  } else
  989|  1.72k|#endif
  990|  1.72k|  {
  991|  1.72k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 1.72k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  1.72k|  }
  995|  1.85k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 535, False: 1.31k]
  ------------------
  996|    535|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 15, False: 520]
  ------------------
  997|    535|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     15|      return -1;
  999|     15|    }
 1000|    520|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    520|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    520|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 61, False: 459]
  ------------------
 1002|  46.1k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 46.0k, False: 33]
  ------------------
 1003|  46.0k|        TopologySplitEventData event_data;
 1004|  46.0k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 15, False: 46.0k]
  ------------------
 1005|     15|          return -1;
 1006|     15|        }
 1007|  46.0k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 12, False: 46.0k]
  ------------------
 1008|     12|          return -1;
 1009|     12|        }
 1010|  46.0k|        uint8_t edge_data;
 1011|  46.0k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 1, False: 46.0k]
  ------------------
 1012|      1|          return -1;
 1013|      1|        }
 1014|  46.0k|        event_data.source_edge = edge_data & 1;
 1015|  46.0k|        topology_split_data_.push_back(event_data);
 1016|  46.0k|      }
 1017|       |
 1018|     61|    } else
 1019|    459|#endif
 1020|    459|    {
 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|    459|      int last_source_symbol_id = 0;
 1024|  4.16k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 3.71k, False: 452]
  ------------------
 1025|  3.71k|        TopologySplitEventData event_data;
 1026|  3.71k|        uint32_t delta;
 1027|  3.71k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 3, False: 3.71k]
  ------------------
 1028|      3|          return -1;
 1029|      3|        }
 1030|  3.71k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  3.71k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 2, False: 3.71k]
  ------------------
 1032|      2|          return -1;
 1033|      2|        }
 1034|  3.71k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 2, False: 3.71k]
  ------------------
 1035|      2|          return -1;
 1036|      2|        }
 1037|  3.71k|        event_data.split_symbol_id =
 1038|  3.71k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  3.71k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  3.71k|        topology_split_data_.push_back(event_data);
 1041|  3.71k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    452|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.77k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 3.32k, False: 452]
  ------------------
 1045|  3.32k|        uint32_t edge_data;
 1046|  3.32k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.32k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 1.44k, False: 1.87k]
  ------------------
 1047|  1.44k|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  1.87k|        } else {
 1049|  1.87k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  1.87k|        }
 1051|  3.32k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  3.32k|        event_data.source_edge = edge_data & 1;
 1053|  3.32k|      }
 1054|    452|      decoder_buffer->EndBitDecoding();
 1055|    452|    }
 1056|    520|  }
 1057|  1.80k|  uint32_t num_hole_events = 0;
 1058|  1.80k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  1.80k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.80k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 80, False: 1.72k]
  ------------------
 1060|     80|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 2, False: 78]
  ------------------
 1061|      2|      return -1;
 1062|      2|    }
 1063|  1.72k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.72k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 32, False: 1.68k]
  ------------------
 1064|     32|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 1, False: 31]
  ------------------
 1065|      1|      return -1;
 1066|      1|    }
 1067|     32|  }
 1068|  1.79k|#endif
 1069|  1.79k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 83, False: 1.71k]
  ------------------
 1070|     83|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     83|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     83|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 61, False: 22]
  ------------------
 1072|  1.34M|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 1.34M, False: 1]
  ------------------
 1073|  1.34M|        HoleEventData event_data;
 1074|  1.34M|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 60, False: 1.34M]
  ------------------
 1075|     60|          return -1;
 1076|     60|        }
 1077|  1.34M|        hole_event_data_.push_back(event_data);
 1078|  1.34M|      }
 1079|       |
 1080|     61|    } else
 1081|     22|#endif
 1082|     22|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     22|      int last_symbol_id = 0;
 1085|   439k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 439k, False: 8]
  ------------------
 1086|   439k|        HoleEventData event_data;
 1087|   439k|        uint32_t delta;
 1088|   439k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 14, False: 439k]
  ------------------
 1089|     14|          return -1;
 1090|     14|        }
 1091|   439k|        event_data.symbol_id = delta + last_symbol_id;
 1092|   439k|        last_symbol_id = event_data.symbol_id;
 1093|   439k|        hole_event_data_.push_back(event_data);
 1094|   439k|      }
 1095|     22|    }
 1096|     83|  }
 1097|  1.72k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  1.79k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.60k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.60k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.60k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  6.43k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 4.82k, False: 1.60k]
  ------------------
 1109|  4.82k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  4.82k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 619, False: 4.20k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  1.37k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 760, False: 619]
  ------------------
 1114|    760|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|    760|      }
 1116|    619|      continue;
 1117|    619|    }
 1118|       |
 1119|  9.25k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 5.04k, False: 4.20k]
  ------------------
 1120|  5.04k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  5.04k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 3.73k, False: 1.30k]
  ------------------
 1122|  3.73k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  3.73k|      }
 1124|  5.04k|    }
 1125|  4.20k|  }
 1126|  1.60k|  return true;
 1127|  1.60k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  8.78M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  8.78M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  8.78M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  8.78M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  35.1M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 26.3M, False: 8.78M]
  ------------------
 1139|  26.3M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  26.3M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 126k, False: 26.2M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   283k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 156k, False: 126k]
  ------------------
 1144|   156k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   156k|      }
 1146|   126k|      continue;
 1147|   126k|    }
 1148|  26.2M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  26.2M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 13.1M, False: 13.1M]
  ------------------
 1151|  13.1M|      continue;
 1152|  13.1M|    }
 1153|       |
 1154|  31.6M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 18.4M, False: 13.1M]
  ------------------
 1155|  18.4M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  18.4M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 16.3M, False: 2.12M]
  ------------------
 1157|  16.3M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  16.3M|      }
 1159|  18.4M|    }
 1160|  13.1M|  }
 1161|  8.78M|  return true;
 1162|  8.78M|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|  1.56k|    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.56k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.56k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 28, False: 1.53k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|   115k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 115k, False: 28]
  ------------------
 1176|   115k|      Mesh::Face face;
 1177|   115k|      const CornerIndex start_corner(3 * f.value());
 1178|   461k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 345k, False: 115k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   345k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   345k|        face[c] = vert_id;
 1182|   345k|      }
 1183|   115k|      decoder_->mesh()->SetFace(f, face);
 1184|   115k|    }
 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|  1.53k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.53k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  4.46M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 4.45M, False: 1.53k]
  ------------------
 1197|  4.45M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  4.45M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 2.25k, False: 4.45M]
  ------------------
 1199|  2.25k|      continue;  // Isolated vertex.
 1200|  2.25k|    }
 1201|  4.45M|    CornerIndex deduplication_first_corner = c;
 1202|  4.45M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 126k, False: 4.32M]
  ------------------
 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|   126k|      deduplication_first_corner = c;
 1206|  4.32M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  4.60M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 4.33M, False: 264k]
  ------------------
 1210|  4.33M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 261k, False: 4.07M]
  ------------------
 1211|   261k|          continue;  // No seam for this attribute, ignore it.
 1212|   261k|        }
 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|  4.07M|        const VertexIndex vert_id =
 1217|  4.07M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  4.07M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  4.07M|        bool seam_found = false;
 1220|  4.17M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 4.16M, False: 11.0k]
  ------------------
 1221|  4.16M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 3, False: 4.16M]
  ------------------
 1222|      3|            return false;
 1223|      3|          }
 1224|  4.16M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 4.06M, False: 102k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  4.06M|            deduplication_first_corner = act_c;
 1227|  4.06M|            seam_found = true;
 1228|  4.06M|            break;
 1229|  4.06M|          }
 1230|   102k|          act_c = corner_table_->SwingRight(act_c);
 1231|   102k|        }
 1232|  4.07M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 4.06M, False: 11.0k]
  ------------------
 1233|  4.06M|          break;  // No reason to process other attributes if we found a seam.
 1234|  4.06M|        }
 1235|  4.07M|      }
 1236|  4.32M|    }
 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|  4.45M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  4.45M|    corner_to_point_map[c.value()] =
 1246|  4.45M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  4.45M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  4.45M|    CornerIndex prev_c = c;
 1250|  4.45M|    c = corner_table_->SwingRight(c);
 1251|  26.3M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 26.2M, False: 128k]
  |  Branch (1251:40): [True: 21.8M, False: 4.32M]
  ------------------
 1252|  21.8M|      bool attribute_seam = false;
 1253|  23.3M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 21.9M, False: 1.40M]
  ------------------
 1254|  21.9M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 20.4M, False: 1.44M]
  ------------------
 1255|  21.9M|            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|  20.4M|          attribute_seam = true;
 1259|  20.4M|          break;
 1260|  20.4M|        }
 1261|  21.9M|      }
 1262|  21.8M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 20.4M, False: 1.40M]
  ------------------
 1263|  20.4M|        corner_to_point_map[c.value()] =
 1264|  20.4M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  20.4M|        point_to_corner_map.push_back(c.value());
 1266|  20.4M|      } else {
 1267|  1.40M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  1.40M|      }
 1269|  21.8M|      prev_c = c;
 1270|  21.8M|      c = corner_table_->SwingRight(c);
 1271|  21.8M|    }
 1272|  4.45M|  }
 1273|       |  // Add faces.
 1274|  8.74M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 8.74M, False: 1.53k]
  ------------------
 1275|  8.74M|    Mesh::Face face;
 1276|  34.9M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 26.2M, False: 8.74M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  26.2M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  26.2M|    }
 1280|  8.74M|    decoder_->mesh()->SetFace(f, face);
 1281|  8.74M|  }
 1282|  1.53k|  decoder_->point_cloud()->set_num_points(
 1283|  1.53k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.53k|  return true;
 1285|  1.53k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  1.69k|    : decoder_(nullptr),
   49|  1.69k|      last_symbol_id_(-1),
   50|  1.69k|      last_vert_id_(-1),
   51|  1.69k|      last_face_id_(-1),
   52|  1.69k|      num_new_vertices_(0),
   53|  1.69k|      num_encoded_vertices_(0),
   54|  1.69k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  1.69k|    MeshEdgebreakerDecoder *decoder) {
   59|  1.69k|  decoder_ = decoder;
   60|  1.69k|  return true;
   61|  1.69k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    417|    int att_id) const {
   67|    625|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 563, False: 62]
  ------------------
   68|    563|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    563|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 194, False: 369]
  |  Branch (69:27): [True: 0, False: 369]
  ------------------
   70|    194|      continue;
   71|    194|    }
   72|    369|    const AttributesDecoderInterface *const dec =
   73|    369|        decoder_->attributes_decoder(decoder_id);
   74|  5.39k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 5.38k, False: 14]
  ------------------
   75|  5.38k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 355, False: 5.02k]
  ------------------
   76|    355|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 254, False: 101]
  ------------------
   77|    254|          return &attribute_data_[i].connectivity_data;
   78|    254|        }
   79|    101|        return nullptr;
   80|    355|      }
   81|  5.38k|    }
   82|    369|  }
   83|     62|  return nullptr;
   84|    417|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    417|    int att_id) const {
   90|    625|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 563, False: 62]
  ------------------
   91|    563|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    563|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 194, False: 369]
  |  Branch (92:27): [True: 0, False: 369]
  ------------------
   93|    194|      continue;
   94|    194|    }
   95|    369|    const AttributesDecoderInterface *const dec =
   96|    369|        decoder_->attributes_decoder(decoder_id);
   97|  5.39k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 5.38k, False: 14]
  ------------------
   98|  5.38k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 355, False: 5.02k]
  ------------------
   99|    355|        return &attribute_data_[i].encoding_data;
  100|    355|      }
  101|  5.38k|    }
  102|    369|  }
  103|     62|  return &pos_encoding_data_;
  104|    417|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    398|    int32_t att_decoder_id) {
  131|    398|  int8_t att_data_id;
  132|    398|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 10, False: 388]
  ------------------
  133|     10|    return false;
  134|     10|  }
  135|    388|  uint8_t decoder_type;
  136|    388|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 6, False: 382]
  ------------------
  137|      6|    return false;
  138|      6|  }
  139|       |
  140|    382|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 295, False: 87]
  ------------------
  141|    295|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 16, False: 279]
  ------------------
  142|     16|      return false;  // Unexpected attribute data.
  143|     16|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|    279|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 4, False: 275]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|       |
  151|    275|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|    275|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|     87|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 86]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|     86|    pos_data_decoder_id_ = att_decoder_id;
  158|     86|  }
  159|       |
  160|    361|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    361|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    361|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 361, False: 0]
  ------------------
  162|    361|    uint8_t traversal_method_encoded;
  163|    361|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 1, False: 360]
  ------------------
  164|      1|      return false;
  165|      1|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    360|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 21, False: 339]
  ------------------
  168|     21|      return false;
  169|     21|    }
  170|    339|    traversal_method =
  171|    339|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|    339|  }
  173|       |
  174|    339|  const Mesh *mesh = decoder_->mesh();
  175|    339|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|    339|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 172, False: 167]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    172|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    172|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 66, False: 106]
  ------------------
  182|     66|      encoding_data = &pos_encoding_data_;
  183|    106|    } else {
  184|    106|      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|    106|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    106|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    172|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 74, False: 98]
  ------------------
  191|     74|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     74|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     74|          AttTraverser;
  194|     74|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|     98|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 98, False: 0]
  ------------------
  196|     98|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|     98|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|     98|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|     98|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    172|  } else {
  203|    167|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 3, False: 164]
  ------------------
  204|      3|      return false;  // Unsupported method.
  205|      3|    }
  206|    164|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 162]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    162|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    162|        AttObserver;
  214|    162|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    162|        AttTraverser;
  216|       |
  217|    162|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    162|        &attribute_data_[att_data_id].encoding_data;
  219|    162|    const MeshAttributeCornerTable *const corner_table =
  220|    162|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    162|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    162|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    162|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    162|                             encoding_data);
  227|       |
  228|    162|    AttTraverser att_traverser;
  229|    162|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    162|    traversal_sequencer->SetTraverser(att_traverser);
  232|    162|    sequencer = std::move(traversal_sequencer);
  233|    162|  }
  234|       |
  235|    334|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 334]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|    334|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|    334|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|    334|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|    334|                                        std::move(att_controller));
  244|    334|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|  1.69k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  1.69k|  num_new_vertices_ = 0;
  249|  1.69k|  new_to_parent_vertex_map_.clear();
  250|  1.69k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  1.69k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.69k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 264, False: 1.42k]
  ------------------
  252|    264|    uint32_t num_new_verts;
  253|    264|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    264|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 212, False: 52]
  ------------------
  254|    212|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 212]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    212|    } else {
  258|     52|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 52]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|     52|    }
  262|    264|    num_new_vertices_ = num_new_verts;
  263|    264|  }
  264|  1.69k|#endif
  265|       |
  266|  1.69k|  uint32_t num_encoded_vertices;
  267|  1.69k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  1.69k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.69k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 212, False: 1.47k]
  ------------------
  269|    212|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 212]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    212|  } else
  274|  1.47k|#endif
  275|  1.47k|  {
  276|  1.47k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 1.47k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  1.47k|  }
  280|  1.69k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  1.69k|  uint32_t num_faces;
  283|  1.69k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  1.69k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.69k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 212, False: 1.47k]
  ------------------
  285|    212|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 212]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    212|  } else
  290|  1.47k|#endif
  291|  1.47k|  {
  292|  1.47k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 1.47k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  1.47k|  }
  296|  1.69k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 0, False: 1.69k]
  ------------------
  297|      0|    return false;  // Draco cannot handle this many faces.
  298|      0|  }
  299|       |
  300|  1.69k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 0, False: 1.69k]
  ------------------
  301|      0|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      0|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  1.69k|  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.69k|  const uint64_t num_encoded_vertices_64 =
  311|  1.69k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  1.69k|  const uint64_t max_num_vertex_edges =
  313|  1.69k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  1.69k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 1, False: 1.69k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      1|    return false;
  317|      1|  }
  318|       |
  319|  1.69k|  uint8_t num_attribute_data;
  320|  1.69k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 1.69k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  1.69k|  uint32_t num_encoded_symbols;
  325|  1.69k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  1.69k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.69k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 212, False: 1.47k]
  ------------------
  327|    212|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 212]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    212|  } else
  332|  1.47k|#endif
  333|  1.47k|  {
  334|  1.47k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 1.47k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  1.47k|  }
  338|       |
  339|  1.69k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 3, False: 1.68k]
  ------------------
  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|      3|    return false;
  344|      3|  }
  345|  1.68k|  const uint32_t max_encoded_faces =
  346|  1.68k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  1.68k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 1, False: 1.68k]
  ------------------
  348|       |    // Faces can only be 1 1/3 times bigger than number of encoded symbols. This
  349|       |    // could only happen if all new encoded components started with interior
  350|       |    // triangles. E.g. A mesh with multiple tetrahedrons.
  351|      1|    return false;
  352|      1|  }
  353|       |
  354|  1.68k|  uint32_t num_encoded_split_symbols;
  355|  1.68k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  1.68k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.68k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 208, False: 1.47k]
  ------------------
  357|    208|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 208]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    208|  } else
  362|  1.47k|#endif
  363|  1.47k|  {
  364|  1.47k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 1.47k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  1.47k|  }
  368|       |
  369|  1.68k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 6, False: 1.68k]
  ------------------
  370|      6|    return false;  // Split symbols are a sub-set of all symbols.
  371|      6|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  1.68k|  vertex_traversal_length_.clear();
  375|  1.68k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  1.68k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 1.68k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  1.68k|  processed_corner_ids_.clear();
  380|  1.68k|  processed_corner_ids_.reserve(num_faces);
  381|  1.68k|  processed_connectivity_corners_.clear();
  382|  1.68k|  processed_connectivity_corners_.reserve(num_faces);
  383|  1.68k|  topology_split_data_.clear();
  384|  1.68k|  hole_event_data_.clear();
  385|  1.68k|  init_face_configurations_.clear();
  386|  1.68k|  init_corners_.clear();
  387|       |
  388|  1.68k|  last_symbol_id_ = -1;
  389|  1.68k|  last_face_id_ = -1;
  390|  1.68k|  last_vert_id_ = -1;
  391|       |
  392|  1.68k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  1.68k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  1.68k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 1.68k]
  ------------------
  397|  1.68k|          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.68k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  1.68k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  1.68k|  int32_t topology_split_decoded_bytes = -1;
  410|  1.68k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.68k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 254, False: 1.42k]
  ------------------
  411|    254|    uint32_t encoded_connectivity_size;
  412|    254|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    254|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 202, False: 52]
  ------------------
  413|    202|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 0, False: 202]
  ------------------
  414|      0|        return false;
  415|      0|      }
  416|    202|    } else {
  417|     52|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 52]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|     52|    }
  421|    254|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 253]
  ------------------
  422|    253|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 5, False: 248]
  ------------------
  423|      6|      return false;
  424|      6|    }
  425|    248|    DecoderBuffer event_buffer;
  426|    248|    event_buffer.Init(
  427|    248|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    248|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    248|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    248|    topology_split_decoded_bytes =
  432|    248|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    248|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 61, False: 187]
  ------------------
  434|     61|      return false;
  435|     61|    }
  436|       |
  437|    248|  } else
  438|  1.42k|#endif
  439|  1.42k|  {
  440|  1.42k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 8, False: 1.41k]
  ------------------
  441|      8|      return false;
  442|      8|    }
  443|  1.42k|  }
  444|       |
  445|  1.60k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  1.60k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  1.60k|                                           num_encoded_split_symbols);
  449|  1.60k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  1.60k|  DecoderBuffer traversal_end_buffer;
  452|  1.60k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 617, False: 988]
  ------------------
  453|    617|    return false;
  454|    617|  }
  455|       |
  456|    988|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|    988|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 618, False: 370]
  ------------------
  458|    618|    return false;
  459|    618|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    370|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    370|                           traversal_end_buffer.remaining_size(),
  464|    370|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    370|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    370|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    370|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 5, False: 365]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      5|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      5|  }
  471|    370|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    370|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 336, False: 34]
  ------------------
  475|    336|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    336|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    336|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 5, False: 331]
  ------------------
  477|     15|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 10, False: 5]
  ------------------
  478|     10|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 10]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|     10|      }
  482|       |
  483|      5|    } else
  484|    331|#endif
  485|    331|    {
  486|   327k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 327k, False: 331]
  ------------------
  487|   327k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 327k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   327k|      }
  491|    331|    }
  492|    336|  }
  493|    370|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  1.28k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 919, False: 370]
  ------------------
  498|    919|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|   468k|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 468k, False: 919]
  ------------------
  501|   468k|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|   468k|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|    919|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 919]
  ------------------
  505|    919|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|    919|  }
  509|       |
  510|    370|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  1.28k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 919, False: 370]
  ------------------
  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|    919|    int32_t att_connectivity_verts =
  517|    919|        attribute_data_[i].connectivity_data.num_vertices();
  518|    919|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 4, False: 915]
  ------------------
  519|      4|      att_connectivity_verts = corner_table_->num_vertices();
  520|      4|    }
  521|    919|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|    919|  }
  523|    370|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 13, False: 357]
  ------------------
  524|     13|    return false;
  525|     13|  }
  526|    357|  return true;
  527|    370|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     58|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     58|  return true;
  532|     58|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|    988|    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|    988|  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|    988|  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|    988|  std::vector<VertexIndex> invalid_vertices;
  558|    988|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|    988|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|    988|  int num_faces = 0;
  562|  83.4M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 83.4M, False: 484]
  ------------------
  563|  83.4M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  83.4M|    bool check_topology_split = false;
  566|  83.4M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  83.4M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 2.54M, False: 80.9M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  2.54M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 70, False: 2.54M]
  ------------------
  588|     70|        return -1;
  589|     70|      }
  590|       |
  591|  2.54M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  2.54M|      const VertexIndex vertex_x =
  593|  2.54M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  2.54M|      const CornerIndex corner_b =
  595|  2.54M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  2.54M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 200, False: 2.54M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    200|        return -1;
  600|    200|      }
  601|  2.54M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 2.54M]
  |  Branch (601:11): [True: 0, False: 2.54M]
  ------------------
  602|  2.54M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 2.54M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  2.54M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  2.54M|      SetOppositeCorners(corner_a, corner + 1);
  612|  2.54M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  2.54M|      const VertexIndex vert_a_prev =
  616|  2.54M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  2.54M|      const VertexIndex vert_b_next =
  618|  2.54M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  2.54M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 2.54M]
  |  Branch (619:38): [True: 0, False: 2.54M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  2.54M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  2.54M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  2.54M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  2.54M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  2.54M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  2.54M|      active_corner_stack.back() = corner;
  631|  80.9M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 2.24k, False: 80.9M]
  |  Branch (631:40): [True: 75.9M, False: 5.00M]
  ------------------
  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|  75.9M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 75.9M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  75.9M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  75.9M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 75.9M]
  ------------------
  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|  75.9M|      const CornerIndex corner(3 * face.value());
  658|  75.9M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  75.9M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 2.24k, False: 75.9M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  2.24k|        opp_corner = corner + 2;
  662|  2.24k|        corner_l = corner + 1;
  663|  2.24k|        corner_r = corner;
  664|  75.9M|      } else {
  665|       |        // "l" is the new first corner.
  666|  75.9M|        opp_corner = corner + 1;
  667|  75.9M|        corner_l = corner;
  668|  75.9M|        corner_r = corner + 2;
  669|  75.9M|      }
  670|  75.9M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  75.9M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  75.9M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 10, False: 75.9M]
  ------------------
  675|     10|        return -1;  // Unexpected number of decoded vertices.
  676|     10|      }
  677|       |
  678|  75.9M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  75.9M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  75.9M|      const VertexIndex vertex_r =
  682|  75.9M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  75.9M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  75.9M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  75.9M|      corner_table_->MapCornerToVertex(
  688|  75.9M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  75.9M|      active_corner_stack.back() = corner;
  690|  75.9M|      check_topology_split = true;
  691|  75.9M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 32.6k, False: 4.97M]
  ------------------
  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|  32.6k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 32.6k]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  32.6k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  32.6k|      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|  32.6k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  32.6k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 62, False: 32.6k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     62|        active_corner_stack.push_back(it->second);
  714|     62|      }
  715|  32.6k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 63, False: 32.6k]
  ------------------
  716|     63|        return -1;
  717|     63|      }
  718|  32.6k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  32.6k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 32.6k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  32.6k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 1, False: 32.6k]
  |  Branch (724:11): [True: 1, False: 32.6k]
  ------------------
  725|  32.6k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 32.6k]
  ------------------
  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|  32.6k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  32.6k|      SetOppositeCorners(corner_a, corner + 2);
  735|  32.6k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  32.6k|      const VertexIndex vertex_p =
  739|  32.6k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  32.6k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  32.6k|      corner_table_->MapCornerToVertex(
  742|  32.6k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  32.6k|      const VertexIndex vert_b_prev =
  744|  32.6k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  32.6k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  32.6k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  32.6k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  32.6k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  32.6k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  32.6k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  32.6k|                                       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|  32.6k|      const CornerIndex first_corner = corner_n;
  757|   111k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 78.7k, False: 32.6k]
  ------------------
  758|  78.7k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  78.7k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  78.7k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 78.7k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  78.7k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  32.6k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  32.6k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 26.6k, False: 5.91k]
  ------------------
  770|  26.6k|        invalid_vertices.push_back(vertex_n);
  771|  26.6k|      }
  772|  32.6k|      active_corner_stack.back() = corner;
  773|  4.97M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 4.97M, False: 137]
  ------------------
  774|  4.97M|      const CornerIndex corner(3 * face.value());
  775|  4.97M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  4.97M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  4.97M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  4.97M|                                       corner_table_->AddNewVertex());
  780|  4.97M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  4.97M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  4.97M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 4, False: 4.97M]
  ------------------
  784|      4|        return -1;  // Unexpected number of decoded vertices.
  785|      4|      }
  786|       |
  787|  4.97M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  4.97M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  4.97M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  4.97M|      active_corner_stack.push_back(corner);
  792|  4.97M|      check_topology_split = true;
  793|  4.97M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    137|      return -1;
  796|    137|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  83.4M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  83.4M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 80.9M, False: 2.58M]
  ------------------
  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|  80.9M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  80.9M|      EdgeFaceName split_edge;
  812|  80.9M|      int encoder_split_symbol_id;
  813|  80.9M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.54k, False: 80.9M]
  ------------------
  814|  80.9M|                             &encoder_split_symbol_id)) {
  815|  1.54k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 17, False: 1.53k]
  ------------------
  816|     17|          return -1;  // Wrong split symbol id.
  817|     17|        }
  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.53k|        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.53k|        CornerIndex new_active_corner;
  831|  1.53k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 567, False: 963]
  ------------------
  832|    567|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    963|        } else {
  834|    963|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    963|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.53k|        const int decoder_split_symbol_id =
  839|  1.53k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.53k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.53k|            new_active_corner;
  842|  1.53k|      }
  843|  80.9M|    }
  844|  83.4M|  }
  845|    484|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 484]
  ------------------
  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.70M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 2.70M, False: 446]
  ------------------
  850|  2.70M|    const CornerIndex corner = active_corner_stack.back();
  851|  2.70M|    active_corner_stack.pop_back();
  852|  2.70M|    const bool interior_face =
  853|  2.70M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  2.70M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 1.23M, False: 1.47M]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  1.23M|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 26, False: 1.23M]
  ------------------
  877|     26|        return -1;  // More faces than expected added to the mesh.
  878|     26|      }
  879|       |
  880|  1.23M|      const CornerIndex corner_a = corner;
  881|  1.23M|      const VertexIndex vert_n =
  882|  1.23M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  1.23M|      const CornerIndex corner_b =
  884|  1.23M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  1.23M|      const VertexIndex vert_x =
  887|  1.23M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  1.23M|      const CornerIndex corner_c =
  889|  1.23M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  1.23M|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 3, False: 1.23M]
  |  Branch (891:33): [True: 4, False: 1.23M]
  |  Branch (891:55): [True: 0, False: 1.23M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      7|        return -1;
  894|      7|      }
  895|  1.23M|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 1.23M]
  |  Branch (895:11): [True: 5, False: 1.23M]
  ------------------
  896|  1.23M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 1, False: 1.23M]
  ------------------
  897|  1.23M|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 3, False: 1.23M]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      5|        return -1;
  901|      5|      }
  902|       |
  903|  1.23M|      const VertexIndex vert_p =
  904|  1.23M|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  1.23M|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  1.23M|      const CornerIndex new_corner(3 * face.value());
  909|  1.23M|      SetOppositeCorners(new_corner, corner);
  910|  1.23M|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  1.23M|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  1.23M|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  1.23M|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  1.23M|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  4.94M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 3.71M, False: 1.23M]
  ------------------
  920|  3.71M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  3.71M|      }
  922|       |
  923|  1.23M|      init_face_configurations_.push_back(true);
  924|  1.23M|      init_corners_.push_back(new_corner);
  925|  1.47M|    } 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|  1.47M|      init_face_configurations_.push_back(false);
  930|  1.47M|      init_corners_.push_back(corner);
  931|  1.47M|    }
  932|  2.70M|  }
  933|    446|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 76, False: 370]
  ------------------
  934|     76|    return -1;  // Unexpected number of decoded faces.
  935|     76|  }
  936|       |
  937|    370|  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|    370|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 41, False: 370]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|     41|    VertexIndex src_vert(num_vertices - 1);
  943|     44|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 3, False: 41]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|      3|      src_vert = VertexIndex(--num_vertices - 1);
  946|      3|    }
  947|     41|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 3, False: 38]
  ------------------
  948|      3|      continue;  // No need to swap anything.
  949|      3|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|     38|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|    254|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 216, False: 38]
  ------------------
  954|    216|      const CornerIndex cid = vcit.Corner();
  955|    216|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 0, False: 216]
  ------------------
  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|    216|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|    216|    }
  962|     38|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|     38|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|     38|    corner_table_->MakeVertexIsolated(src_vert);
  967|     38|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|     38|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|     38|    num_vertices--;
  972|     38|  }
  973|    370|  return num_vertices;
  974|    370|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  1.67k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  1.67k|  uint32_t num_topology_splits;
  982|  1.67k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  1.67k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.67k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 196, False: 1.47k]
  ------------------
  984|    196|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 196]
  ------------------
  985|      0|      return -1;
  986|      0|    }
  987|       |
  988|    196|  } else
  989|  1.47k|#endif
  990|  1.47k|  {
  991|  1.47k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 1.47k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  1.47k|  }
  995|  1.67k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 194, False: 1.48k]
  ------------------
  996|    194|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 8, False: 186]
  ------------------
  997|    194|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|      8|      return -1;
  999|      8|    }
 1000|    186|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    186|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    186|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 31, False: 155]
  ------------------
 1002|  39.0k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 39.0k, False: 9]
  ------------------
 1003|  39.0k|        TopologySplitEventData event_data;
 1004|  39.0k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 13, False: 39.0k]
  ------------------
 1005|     13|          return -1;
 1006|     13|        }
 1007|  39.0k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 5, False: 39.0k]
  ------------------
 1008|      5|          return -1;
 1009|      5|        }
 1010|  39.0k|        uint8_t edge_data;
 1011|  39.0k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 4, False: 39.0k]
  ------------------
 1012|      4|          return -1;
 1013|      4|        }
 1014|  39.0k|        event_data.source_edge = edge_data & 1;
 1015|  39.0k|        topology_split_data_.push_back(event_data);
 1016|  39.0k|      }
 1017|       |
 1018|     31|    } else
 1019|    155|#endif
 1020|    155|    {
 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|    155|      int last_source_symbol_id = 0;
 1024|  3.97k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 3.82k, False: 147]
  ------------------
 1025|  3.82k|        TopologySplitEventData event_data;
 1026|  3.82k|        uint32_t delta;
 1027|  3.82k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 1, False: 3.82k]
  ------------------
 1028|      1|          return -1;
 1029|      1|        }
 1030|  3.82k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  3.82k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 3, False: 3.82k]
  ------------------
 1032|      3|          return -1;
 1033|      3|        }
 1034|  3.82k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 4, False: 3.81k]
  ------------------
 1035|      4|          return -1;
 1036|      4|        }
 1037|  3.81k|        event_data.split_symbol_id =
 1038|  3.81k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  3.81k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  3.81k|        topology_split_data_.push_back(event_data);
 1041|  3.81k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    147|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.44k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 3.29k, False: 147]
  ------------------
 1045|  3.29k|        uint32_t edge_data;
 1046|  3.29k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 567, False: 2.73k]
  ------------------
 1047|    567|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.73k|        } else {
 1049|  2.73k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.73k|        }
 1051|  3.29k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  3.29k|        event_data.source_edge = edge_data & 1;
 1053|  3.29k|      }
 1054|    147|      decoder_buffer->EndBitDecoding();
 1055|    147|    }
 1056|    186|  }
 1057|  1.63k|  uint32_t num_hole_events = 0;
 1058|  1.63k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  1.63k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.63k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 167, False: 1.46k]
  ------------------
 1060|    167|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 4, False: 163]
  ------------------
 1061|      4|      return -1;
 1062|      4|    }
 1063|  1.46k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.46k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 46, False: 1.42k]
  ------------------
 1064|     46|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 3, False: 43]
  ------------------
 1065|      3|      return -1;
 1066|      3|    }
 1067|     46|  }
 1068|  1.62k|#endif
 1069|  1.62k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 33, False: 1.59k]
  ------------------
 1070|     33|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     33|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     33|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 20, False: 13]
  ------------------
 1072|  96.4k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 96.4k, False: 1]
  ------------------
 1073|  96.4k|        HoleEventData event_data;
 1074|  96.4k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 19, False: 96.3k]
  ------------------
 1075|     19|          return -1;
 1076|     19|        }
 1077|  96.3k|        hole_event_data_.push_back(event_data);
 1078|  96.3k|      }
 1079|       |
 1080|     20|    } else
 1081|     13|#endif
 1082|     13|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     13|      int last_symbol_id = 0;
 1085|  4.79k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 4.78k, False: 8]
  ------------------
 1086|  4.78k|        HoleEventData event_data;
 1087|  4.78k|        uint32_t delta;
 1088|  4.78k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 5, False: 4.78k]
  ------------------
 1089|      5|          return -1;
 1090|      5|        }
 1091|  4.78k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  4.78k|        last_symbol_id = event_data.symbol_id;
 1093|  4.78k|        hole_event_data_.push_back(event_data);
 1094|  4.78k|      }
 1095|     13|    }
 1096|     33|  }
 1097|  1.60k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  1.62k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|     10|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|     10|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|     10|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|     40|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 30, False: 10]
  ------------------
 1109|     30|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|     30|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 10, False: 20]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|     20|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 10, False: 10]
  ------------------
 1114|     10|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|     10|      }
 1116|     10|      continue;
 1117|     10|    }
 1118|       |
 1119|     40|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 20, False: 20]
  ------------------
 1120|     20|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|     20|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 10, False: 10]
  ------------------
 1122|     10|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|     10|      }
 1124|     20|    }
 1125|     20|  }
 1126|     10|  return true;
 1127|     10|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   327k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   327k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   327k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   327k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.30M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 982k, False: 327k]
  ------------------
 1139|   982k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   982k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 215k, False: 766k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   432k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 216k, False: 215k]
  ------------------
 1144|   216k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   216k|      }
 1146|   215k|      continue;
 1147|   215k|    }
 1148|   766k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   766k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 383k, False: 383k]
  ------------------
 1151|   383k|      continue;
 1152|   383k|    }
 1153|       |
 1154|   767k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 383k, False: 383k]
  ------------------
 1155|   383k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|   383k|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 251k, False: 132k]
  ------------------
 1157|   251k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   251k|      }
 1159|   383k|    }
 1160|   383k|  }
 1161|   327k|  return true;
 1162|   327k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    370|    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|    370|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    370|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 34, False: 336]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  16.2k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 16.1k, False: 34]
  ------------------
 1176|  16.1k|      Mesh::Face face;
 1177|  16.1k|      const CornerIndex start_corner(3 * f.value());
 1178|  64.7k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 48.5k, False: 16.1k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  48.5k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  48.5k|        face[c] = vert_id;
 1182|  48.5k|      }
 1183|  16.1k|      decoder_->mesh()->SetFace(f, face);
 1184|  16.1k|    }
 1185|     34|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     34|    return true;
 1187|     34|  }
 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|    336|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    336|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   345k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 345k, False: 323]
  ------------------
 1197|   345k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   345k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 1.54k, False: 343k]
  ------------------
 1199|  1.54k|      continue;  // Isolated vertex.
 1200|  1.54k|    }
 1201|   343k|    CornerIndex deduplication_first_corner = c;
 1202|   343k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 214k, False: 129k]
  ------------------
 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|   214k|      deduplication_first_corner = c;
 1206|   214k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   132k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 129k, False: 3.02k]
  ------------------
 1210|   129k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 2.64k, False: 126k]
  ------------------
 1211|  2.64k|          continue;  // No seam for this attribute, ignore it.
 1212|  2.64k|        }
 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|   126k|        const VertexIndex vert_id =
 1217|   126k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   126k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   126k|        bool seam_found = false;
 1220|   129k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 129k, False: 418]
  ------------------
 1221|   129k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 13, False: 129k]
  ------------------
 1222|     13|            return false;
 1223|     13|          }
 1224|   129k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 125k, False: 3.03k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   125k|            deduplication_first_corner = act_c;
 1227|   125k|            seam_found = true;
 1228|   125k|            break;
 1229|   125k|          }
 1230|  3.03k|          act_c = corner_table_->SwingRight(act_c);
 1231|  3.03k|        }
 1232|   126k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 125k, False: 418]
  ------------------
 1233|   125k|          break;  // No reason to process other attributes if we found a seam.
 1234|   125k|        }
 1235|   126k|      }
 1236|   129k|    }
 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|   343k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   343k|    corner_to_point_map[c.value()] =
 1246|   343k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   343k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   343k|    CornerIndex prev_c = c;
 1250|   343k|    c = corner_table_->SwingRight(c);
 1251|   999k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 784k, False: 215k]
  |  Branch (1251:40): [True: 655k, False: 128k]
  ------------------
 1252|   655k|      bool attribute_seam = false;
 1253|   969k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 656k, False: 313k]
  ------------------
 1254|   656k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 342k, False: 313k]
  ------------------
 1255|   656k|            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|   342k|          attribute_seam = true;
 1259|   342k|          break;
 1260|   342k|        }
 1261|   656k|      }
 1262|   655k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 342k, False: 313k]
  ------------------
 1263|   342k|        corner_to_point_map[c.value()] =
 1264|   342k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   342k|        point_to_corner_map.push_back(c.value());
 1266|   342k|      } else {
 1267|   313k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   313k|      }
 1269|   655k|      prev_c = c;
 1270|   655k|      c = corner_table_->SwingRight(c);
 1271|   655k|    }
 1272|   343k|  }
 1273|       |  // Add faces.
 1274|   203k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 203k, False: 323]
  ------------------
 1275|   203k|    Mesh::Face face;
 1276|   812k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 609k, False: 203k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   609k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   609k|    }
 1280|   203k|    decoder_->mesh()->SetFace(f, face);
 1281|   203k|  }
 1282|    323|  decoder_->point_cloud()->set_num_points(
 1283|    323|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    323|  return true;
 1285|    336|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    225|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    225|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    225|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    225|  const Mesh *mesh = decoder_->mesh();
  115|    225|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    225|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    225|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    225|                           encoding_data);
  120|       |
  121|    225|  TraverserT att_traverser;
  122|    225|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    225|  traversal_sequencer->SetTraverser(att_traverser);
  125|    225|  return std::move(traversal_sequencer);
  126|    225|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    495|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    495|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    495|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    495|  const Mesh *mesh = decoder_->mesh();
  115|    495|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    495|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    495|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    495|                           encoding_data);
  120|       |
  121|    495|  TraverserT att_traverser;
  122|    495|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    495|  traversal_sequencer->SetTraverser(att_traverser);
  125|    495|  return std::move(traversal_sequencer);
  126|    495|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    282|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    282|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    282|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    282|  const Mesh *mesh = decoder_->mesh();
  115|    282|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    282|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    282|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    282|                           encoding_data);
  120|       |
  121|    282|  TraverserT att_traverser;
  122|    282|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    282|  traversal_sequencer->SetTraverser(att_traverser);
  125|    282|  return std::move(traversal_sequencer);
  126|    282|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    501|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    501|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    501|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    501|  const Mesh *mesh = decoder_->mesh();
  115|    501|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    501|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    501|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    501|                           encoding_data);
  120|       |
  121|    501|  TraverserT att_traverser;
  122|    501|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    501|  traversal_sequencer->SetTraverser(att_traverser);
  125|    501|  return std::move(traversal_sequencer);
  126|    501|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     74|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     74|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     74|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     74|  const Mesh *mesh = decoder_->mesh();
  115|     74|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     74|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     74|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     74|                           encoding_data);
  120|       |
  121|     74|  TraverserT att_traverser;
  122|     74|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     74|  traversal_sequencer->SetTraverser(att_traverser);
  125|     74|  return std::move(traversal_sequencer);
  126|     74|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     98|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     98|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     98|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     98|  const Mesh *mesh = decoder_->mesh();
  115|     98|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     98|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     98|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     98|                           encoding_data);
  120|       |
  121|     98|  TraverserT att_traverser;
  122|     98|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     98|  traversal_sequencer->SetTraverser(att_traverser);
  125|     98|  return std::move(traversal_sequencer);
  126|     98|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  5.50k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  2.50k|  const CornerTable *GetCornerTable() const override {
   67|  2.50k|    return corner_table_.get();
   68|  2.50k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  13.3M|                       int *out_encoder_split_symbol_id) {
   87|  13.3M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 54.7k, False: 13.2M]
  ------------------
   88|  54.7k|      return false;
   89|  54.7k|    }
   90|  13.2M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 16, False: 13.2M]
  ------------------
   91|  13.2M|        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|     16|      *out_encoder_split_symbol_id = -1;
   98|     16|      return true;
   99|     16|    }
  100|  13.2M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 13.2M, False: 1.94k]
  ------------------
  101|  13.2M|      return false;
  102|  13.2M|    }
  103|  1.94k|    *out_face_edge =
  104|  1.94k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.94k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.94k|    topology_split_data_.pop_back();
  108|  1.94k|    return true;
  109|  13.2M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  43.5M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  43.5M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  43.5M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  43.5M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  11.8k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  5.17k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  3.88k|  const CornerTable *GetCornerTable() const override {
   67|  3.88k|    return corner_table_.get();
   68|  3.88k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  31.3M|                       int *out_encoder_split_symbol_id) {
   87|  31.3M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 31.2M, False: 34.3k]
  ------------------
   88|  31.2M|      return false;
   89|  31.2M|    }
   90|  34.3k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 13, False: 34.3k]
  ------------------
   91|  34.3k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     13|      *out_encoder_split_symbol_id = -1;
   98|     13|      return true;
   99|     13|    }
  100|  34.3k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 33.2k, False: 1.10k]
  ------------------
  101|  33.2k|      return false;
  102|  33.2k|    }
  103|  1.10k|    *out_face_edge =
  104|  1.10k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.10k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.10k|    topology_split_data_.pop_back();
  108|  1.10k|    return true;
  109|  34.3k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  91.0M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  91.0M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  91.0M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  91.0M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  11.6k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  9.10k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.02k|  const CornerTable *GetCornerTable() const override {
   67|  2.02k|    return corner_table_.get();
   68|  2.02k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  80.9M|                       int *out_encoder_split_symbol_id) {
   87|  80.9M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 67.6M, False: 13.2M]
  ------------------
   88|  67.6M|      return false;
   89|  67.6M|    }
   90|  13.2M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 17, False: 13.2M]
  ------------------
   91|  13.2M|        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|     17|      *out_encoder_split_symbol_id = -1;
   98|     17|      return true;
   99|     17|    }
  100|  13.2M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 13.2M, False: 1.53k]
  ------------------
  101|  13.2M|      return false;
  102|  13.2M|    }
  103|  1.53k|    *out_face_edge =
  104|  1.53k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.53k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.53k|    topology_split_data_.pop_back();
  108|  1.53k|    return true;
  109|  13.2M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  84.8M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  84.8M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  84.8M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  84.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  4.25k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

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

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.03k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.26M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.26M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 2.20M, False: 52.6k]
  ------------------
   61|  2.20M|      return true;  // Already traversed.
   62|  2.20M|    }
   63|       |
   64|  52.6k|    corner_traversal_stack_.clear();
   65|  52.6k|    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|  52.6k|    const VertexIndex next_vert =
   69|  52.6k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  52.6k|    const VertexIndex prev_vert =
   71|  52.6k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  52.6k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 52.6k]
  |  Branch (72:45): [True: 0, False: 52.6k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  52.6k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 52.0k, False: 586]
  ------------------
   76|  52.0k|      this->MarkVertexVisited(next_vert);
   77|  52.0k|      this->traversal_observer().OnNewVertexVisited(
   78|  52.0k|          next_vert, this->corner_table()->Next(corner_id));
   79|  52.0k|    }
   80|  52.6k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 25.8k, False: 26.7k]
  ------------------
   81|  25.8k|      this->MarkVertexVisited(prev_vert);
   82|  25.8k|      this->traversal_observer().OnNewVertexVisited(
   83|  25.8k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  25.8k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|   117k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 64.4k, False: 52.6k]
  ------------------
   88|       |      // Currently processed corner.
   89|  64.4k|      corner_id = corner_traversal_stack_.back();
   90|  64.4k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  64.4k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 64.4k]
  |  Branch (92:47): [True: 555, False: 63.8k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    555|        corner_traversal_stack_.pop_back();
   95|    555|        continue;
   96|    555|      }
   97|  2.26M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.26M, Folded]
  ------------------
   98|  2.26M|        this->MarkFaceVisited(face_id);
   99|  2.26M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.26M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.26M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.26M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.26M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.13M, False: 1.12M]
  ------------------
  105|  1.13M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.13M|          this->MarkVertexVisited(vert_id);
  107|  1.13M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.13M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.09M, False: 41.7k]
  ------------------
  109|  1.09M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.09M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.09M|            continue;
  112|  1.09M|          }
  113|  1.13M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  1.16M|        const CornerIndex right_corner_id =
  118|  1.16M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.16M|        const CornerIndex left_corner_id =
  120|  1.16M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.16M|        const FaceIndex right_face_id(
  122|  1.16M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 32.5k, False: 1.13M]
  ------------------
  123|  1.16M|                 ? kInvalidFaceIndex
  124|  1.16M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.16M|        const FaceIndex left_face_id(
  126|  1.16M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 48.5k, False: 1.11M]
  ------------------
  127|  1.16M|                 ? kInvalidFaceIndex
  128|  1.16M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.16M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.13M, False: 31.3k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.13M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 57.9k, False: 1.07M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  57.9k|            corner_traversal_stack_.pop_back();
  134|  57.9k|            break;  // Break from the while (true) loop.
  135|  1.07M|          } else {
  136|       |            // Go to the left face.
  137|  1.07M|            corner_id = left_corner_id;
  138|  1.07M|            face_id = left_face_id;
  139|  1.07M|          }
  140|  1.13M|        } else {
  141|       |          // Right face was not visited.
  142|  31.3k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 25.4k, False: 5.88k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  25.4k|            corner_id = right_corner_id;
  145|  25.4k|            face_id = right_face_id;
  146|  25.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|  5.88k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  5.88k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  5.88k|            break;
  159|  5.88k|          }
  160|  31.3k|        }
  161|  1.16M|      }
  162|  63.8k|    }
  163|  52.6k|    return true;
  164|  52.6k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.03k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.18k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.59k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.03M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.03M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 454k, False: 2.58M]
  ------------------
   61|   454k|      return true;  // Already traversed.
   62|   454k|    }
   63|       |
   64|  2.58M|    corner_traversal_stack_.clear();
   65|  2.58M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  2.58M|    const VertexIndex next_vert =
   69|  2.58M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.58M|    const VertexIndex prev_vert =
   71|  2.58M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.58M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.58M]
  |  Branch (72:45): [True: 0, False: 2.58M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.58M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.58M, False: 1.11k]
  ------------------
   76|  2.58M|      this->MarkVertexVisited(next_vert);
   77|  2.58M|      this->traversal_observer().OnNewVertexVisited(
   78|  2.58M|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.58M|    }
   80|  2.58M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.58M, False: 872]
  ------------------
   81|  2.58M|      this->MarkVertexVisited(prev_vert);
   82|  2.58M|      this->traversal_observer().OnNewVertexVisited(
   83|  2.58M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.58M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  5.21M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.62M, False: 2.58M]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.62M|      corner_id = corner_traversal_stack_.back();
   90|  2.62M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.62M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.62M]
  |  Branch (92:47): [True: 3.72k, False: 2.62M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  3.72k|        corner_traversal_stack_.pop_back();
   95|  3.72k|        continue;
   96|  3.72k|      }
   97|  3.03M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.03M, Folded]
  ------------------
   98|  3.03M|        this->MarkFaceVisited(face_id);
   99|  3.03M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.03M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.03M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.03M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.03M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 2.82M, False: 213k]
  ------------------
  105|  2.82M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  2.82M|          this->MarkVertexVisited(vert_id);
  107|  2.82M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  2.82M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 203k, False: 2.62M]
  ------------------
  109|   203k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   203k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   203k|            continue;
  112|   203k|          }
  113|  2.82M|        }
  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.83M|        const CornerIndex right_corner_id =
  118|  2.83M|            this->corner_table()->GetRightCorner(corner_id);
  119|  2.83M|        const CornerIndex left_corner_id =
  120|  2.83M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  2.83M|        const FaceIndex right_face_id(
  122|  2.83M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 2.60M, False: 230k]
  ------------------
  123|  2.83M|                 ? kInvalidFaceIndex
  124|  2.83M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  2.83M|        const FaceIndex left_face_id(
  126|  2.83M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.60M, False: 234k]
  ------------------
  127|  2.83M|                 ? kInvalidFaceIndex
  128|  2.83M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  2.83M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 2.80M, False: 33.8k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  2.80M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.60M, False: 199k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.60M|            corner_traversal_stack_.pop_back();
  134|  2.60M|            break;  // Break from the while (true) loop.
  135|  2.60M|          } else {
  136|       |            // Go to the left face.
  137|   199k|            corner_id = left_corner_id;
  138|   199k|            face_id = left_face_id;
  139|   199k|          }
  140|  2.80M|        } else {
  141|       |          // Right face was not visited.
  142|  33.8k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 12.7k, False: 21.0k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  12.7k|            corner_id = right_corner_id;
  145|  12.7k|            face_id = right_face_id;
  146|  21.0k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  21.0k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  21.0k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  21.0k|            break;
  159|  21.0k|          }
  160|  33.8k|        }
  161|  2.83M|      }
  162|  2.62M|    }
  163|  2.58M|    return true;
  164|  2.58M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.59k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.30k|  DepthFirstTraverser() {}

_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   58|    562|  void OnTraversalStart() {
   59|    562|    prediction_degree_.resize(this->corner_table()->num_vertices(), 0);
   60|    562|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  2.72M|  bool TraverseFromCorner(CornerIndex corner_id) {
   66|  2.72M|    if (prediction_degree_.size() == 0) {
  ------------------
  |  Branch (66:9): [True: 0, False: 2.72M]
  ------------------
   67|      0|      return true;
   68|      0|    }
   69|       |
   70|       |    // Traversal starts from the |corner_id|. It's going to follow either the
   71|       |    // right or the left neighboring faces to |corner_id| based on their
   72|       |    // prediction degree.
   73|  2.72M|    traversal_stacks_[0].push_back(corner_id);
   74|  2.72M|    best_priority_ = 0;
   75|       |    // For the first face, check the remaining corners as they may not be
   76|       |    // processed yet.
   77|  2.72M|    const VertexIndex next_vert =
   78|  2.72M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   79|  2.72M|    const VertexIndex prev_vert =
   80|  2.72M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   81|  2.72M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (81:9): [True: 13.8k, False: 2.70M]
  ------------------
   82|  13.8k|      this->MarkVertexVisited(next_vert);
   83|  13.8k|      this->traversal_observer().OnNewVertexVisited(
   84|  13.8k|          next_vert, this->corner_table()->Next(corner_id));
   85|  13.8k|    }
   86|  2.72M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (86:9): [True: 7.37k, False: 2.71M]
  ------------------
   87|  7.37k|      this->MarkVertexVisited(prev_vert);
   88|  7.37k|      this->traversal_observer().OnNewVertexVisited(
   89|  7.37k|          prev_vert, this->corner_table()->Previous(corner_id));
   90|  7.37k|    }
   91|  2.72M|    const VertexIndex tip_vertex = this->corner_table()->Vertex(corner_id);
   92|  2.72M|    if (!this->IsVertexVisited(tip_vertex)) {
  ------------------
  |  Branch (92:9): [True: 7.04k, False: 2.71M]
  ------------------
   93|  7.04k|      this->MarkVertexVisited(tip_vertex);
   94|  7.04k|      this->traversal_observer().OnNewVertexVisited(tip_vertex, corner_id);
   95|  7.04k|    }
   96|       |    // Start the actual traversal.
   97|  7.97M|    while ((corner_id = PopNextCornerToTraverse()) != kInvalidCornerIndex) {
  ------------------
  |  Branch (97:12): [True: 5.25M, False: 2.72M]
  ------------------
   98|  5.25M|      FaceIndex face_id(corner_id.value() / 3);
   99|       |      // Make sure the face hasn't been visited yet.
  100|  5.25M|      if (this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (100:11): [True: 4.04M, False: 1.21M]
  ------------------
  101|       |        // This face has been already traversed.
  102|  4.04M|        continue;
  103|  4.04M|      }
  104|       |
  105|  2.72M|      while (true) {
  ------------------
  |  Branch (105:14): [True: 2.72M, Folded]
  ------------------
  106|  2.72M|        face_id = FaceIndex(corner_id.value() / 3);
  107|  2.72M|        this->MarkFaceVisited(face_id);
  108|  2.72M|        this->traversal_observer().OnNewFaceVisited(face_id);
  109|       |
  110|       |        // If the newly reached vertex hasn't been visited, mark it and notify
  111|       |        // the observer.
  112|  2.72M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  113|  2.72M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (113:13): [True: 1.37M, False: 1.34M]
  ------------------
  114|  1.37M|          this->MarkVertexVisited(vert_id);
  115|  1.37M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  116|  1.37M|        }
  117|       |
  118|       |        // Check whether we can traverse to the right and left neighboring
  119|       |        // faces.
  120|  2.72M|        const CornerIndex right_corner_id =
  121|  2.72M|            this->corner_table()->GetRightCorner(corner_id);
  122|  2.72M|        const CornerIndex left_corner_id =
  123|  2.72M|            this->corner_table()->GetLeftCorner(corner_id);
  124|  2.72M|        const FaceIndex right_face_id(
  125|  2.72M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (125:14): [True: 23.6k, False: 2.69M]
  ------------------
  126|  2.72M|                 ? kInvalidFaceIndex
  127|  2.72M|                 : FaceIndex(right_corner_id.value() / 3)));
  128|  2.72M|        const FaceIndex left_face_id(
  129|  2.72M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (129:14): [True: 30.9k, False: 2.68M]
  ------------------
  130|  2.72M|                 ? kInvalidFaceIndex
  131|  2.72M|                 : FaceIndex(left_corner_id.value() / 3)));
  132|  2.72M|        const bool is_right_face_visited = this->IsFaceVisited(right_face_id);
  133|  2.72M|        const bool is_left_face_visited = this->IsFaceVisited(left_face_id);
  134|       |
  135|  2.72M|        if (!is_left_face_visited) {
  ------------------
  |  Branch (135:13): [True: 2.09M, False: 622k]
  ------------------
  136|       |          // We can go to the left face.
  137|  2.09M|          const int priority = ComputePriority(left_corner_id);
  138|  2.09M|          if (is_right_face_visited && priority <= best_priority_) {
  ------------------
  |  Branch (138:15): [True: 756k, False: 1.34M]
  |  Branch (138:40): [True: 710k, False: 45.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|   710k|            corner_id = left_corner_id;
  144|   710k|            continue;
  145|  1.38M|          } else {
  146|  1.38M|            AddCornerToTraversalStack(left_corner_id, priority);
  147|  1.38M|          }
  148|  2.09M|        }
  149|  2.00M|        if (!is_right_face_visited) {
  ------------------
  |  Branch (149:13): [True: 1.94M, False: 66.3k]
  ------------------
  150|       |          // Go to the right face.
  151|  1.94M|          const int priority = ComputePriority(right_corner_id);
  152|  1.94M|          if (priority <= best_priority_) {
  ------------------
  |  Branch (152:15): [True: 796k, False: 1.14M]
  ------------------
  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|   796k|            corner_id = right_corner_id;
  156|   796k|            continue;
  157|  1.14M|          } else {
  158|  1.14M|            AddCornerToTraversalStack(right_corner_id, priority);
  159|  1.14M|          }
  160|  1.94M|        }
  161|       |
  162|       |        // Couldn't proceed directly to the next corner
  163|  1.21M|        break;
  164|  2.00M|      }
  165|  1.21M|    }
  166|  2.72M|    return true;
  167|  2.72M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE23PopNextCornerToTraverseEv:
  173|  7.97M|  CornerIndex PopNextCornerToTraverse() {
  174|  16.7M|    for (int i = best_priority_; i < kMaxPriority; ++i) {
  ------------------
  |  Branch (174:34): [True: 14.0M, False: 2.72M]
  ------------------
  175|  14.0M|      if (!traversal_stacks_[i].empty()) {
  ------------------
  |  Branch (175:11): [True: 5.25M, False: 8.79M]
  ------------------
  176|  5.25M|        const CornerIndex ret = traversal_stacks_[i].back();
  177|  5.25M|        traversal_stacks_[i].pop_back();
  178|  5.25M|        best_priority_ = i;
  179|  5.25M|        return ret;
  180|  5.25M|      }
  181|  14.0M|    }
  182|  2.72M|    return kInvalidCornerIndex;
  183|  7.97M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15ComputePriorityENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  194|  4.04M|  inline int ComputePriority(CornerIndex corner_id) {
  195|  4.04M|    const VertexIndex v_tip = this->corner_table()->Vertex(corner_id);
  196|       |    // Priority 0 when traversing to already visited vertices.
  197|  4.04M|    int priority = 0;
  198|  4.04M|    if (!this->IsVertexVisited(v_tip)) {
  ------------------
  |  Branch (198:9): [True: 2.68M, False: 1.35M]
  ------------------
  199|  2.68M|      const int degree = ++prediction_degree_[v_tip];
  200|       |      // Priority 1 when prediction degree > 1, otherwise 2.
  201|  2.68M|      priority = (degree > 1 ? 1 : 2);
  ------------------
  |  Branch (201:19): [True: 1.31M, False: 1.37M]
  ------------------
  202|  2.68M|    }
  203|       |    // Clamp the priority to the maximum number of buckets.
  204|  4.04M|    if (priority >= kMaxPriority) {
  ------------------
  |  Branch (204:9): [True: 0, False: 4.04M]
  ------------------
  205|      0|      priority = kMaxPriority - 1;
  206|      0|    }
  207|  4.04M|    return priority;
  208|  4.04M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE25AddCornerToTraversalStackENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEi:
  185|  2.53M|  inline void AddCornerToTraversalStack(CornerIndex ci, int priority) {
  186|  2.53M|    traversal_stacks_[priority].push_back(ci);
  187|       |    // Make sure that the best available priority is up to date.
  188|  2.53M|    if (priority < best_priority_) {
  ------------------
  |  Branch (188:9): [True: 612k, False: 1.92M]
  ------------------
  189|   612k|      best_priority_ = priority;
  190|   612k|    }
  191|  2.53M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   63|    562|  void OnTraversalEnd() {}
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   55|  1.16k|  MaxPredictionDegreeTraverser() {}

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    581|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.23k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  1.23k|    const auto *corner_table = traverser_.corner_table();
   50|  1.23k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.23k|    const size_t num_faces = mesh_->num_faces();
   52|  1.23k|    const size_t num_points = mesh_->num_points();
   53|  4.42M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.42M, False: 1.23k]
  ------------------
   54|  4.42M|      const auto &face = mesh_->face(f);
   55|  17.7M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 13.2M, False: 4.42M]
  ------------------
   56|  13.2M|        const PointIndex point_id = face[p];
   57|  13.2M|        const VertexIndex vert_id =
   58|  13.2M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  13.2M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 13.2M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  13.2M|        const AttributeValueIndex att_entry_id(
   63|  13.2M|            encoding_data_
   64|  13.2M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  13.2M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 13.2M]
  |  Branch (65:13): [True: 0, False: 13.2M]
  |  Branch (65:39): [True: 0, False: 13.2M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  13.2M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  13.2M|      }
   71|  4.42M|    }
   72|  1.23k|    return true;
   73|  1.23k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    562|  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|    562|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    562|    traverser_.OnTraversalStart();
   82|    562|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 562]
  ------------------
   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|    562|    } else {
   89|    562|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.72M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.72M, False: 562]
  ------------------
   91|  2.72M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.72M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.72M|      }
   95|    562|    }
   96|    562|    traverser_.OnTraversalEnd();
   97|    562|    return true;
   98|    562|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.72M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.72M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.72M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    581|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.09k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  7.13k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  7.13k|    const auto *corner_table = traverser_.corner_table();
   50|  7.13k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  7.13k|    const size_t num_faces = mesh_->num_faces();
   52|  7.13k|    const size_t num_points = mesh_->num_points();
   53|  4.33M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.32M, False: 7.13k]
  ------------------
   54|  4.32M|      const auto &face = mesh_->face(f);
   55|  17.3M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 12.9M, False: 4.32M]
  ------------------
   56|  12.9M|        const PointIndex point_id = face[p];
   57|  12.9M|        const VertexIndex vert_id =
   58|  12.9M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  12.9M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 12.9M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  12.9M|        const AttributeValueIndex att_entry_id(
   63|  12.9M|            encoding_data_
   64|  12.9M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  12.9M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 12.9M]
  |  Branch (65:13): [True: 0, False: 12.9M]
  |  Branch (65:39): [True: 0, False: 12.9M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  12.9M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  12.9M|      }
   71|  4.32M|    }
   72|  7.13k|    return true;
   73|  7.13k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.03k|  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.03k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.03k|    traverser_.OnTraversalStart();
   82|  1.03k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.03k]
  ------------------
   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.03k|    } else {
   89|  1.03k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.26M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.26M, False: 1.03k]
  ------------------
   91|  2.26M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.26M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.26M|      }
   95|  1.03k|    }
   96|  1.03k|    traverser_.OnTraversalEnd();
   97|  1.03k|    return true;
   98|  1.03k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.26M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.26M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.26M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.09k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.65k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  9.38k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  9.38k|    const auto *corner_table = traverser_.corner_table();
   50|  9.38k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  9.38k|    const size_t num_faces = mesh_->num_faces();
   52|  9.38k|    const size_t num_points = mesh_->num_points();
   53|  5.19M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.18M, False: 9.38k]
  ------------------
   54|  5.18M|      const auto &face = mesh_->face(f);
   55|  20.7M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 15.5M, False: 5.18M]
  ------------------
   56|  15.5M|        const PointIndex point_id = face[p];
   57|  15.5M|        const VertexIndex vert_id =
   58|  15.5M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  15.5M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 15.5M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  15.5M|        const AttributeValueIndex att_entry_id(
   63|  15.5M|            encoding_data_
   64|  15.5M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  15.5M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 15.5M]
  |  Branch (65:13): [True: 1, False: 15.5M]
  |  Branch (65:39): [True: 1, False: 15.5M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      1|          return false;
   68|      1|        }
   69|  15.5M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  15.5M|      }
   71|  5.18M|    }
   72|  9.38k|    return true;
   73|  9.38k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.59k|  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.59k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.59k|    traverser_.OnTraversalStart();
   82|  1.59k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.59k]
  ------------------
   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.59k|    } else {
   89|  1.59k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.04M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.03M, False: 1.59k]
  ------------------
   91|  3.03M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.03M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.03M|      }
   95|  1.59k|    }
   96|  1.59k|    traverser_.OnTraversalEnd();
   97|  1.59k|    return true;
   98|  1.59k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.03M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.03M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.03M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.65k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.30k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  32.9M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  17.2M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  17.2M|    return is_vertex_visited_[vert_id.value()];
   65|  17.2M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.61M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.61M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.61M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  7.59M|  inline TraversalObserverT &traversal_observer() {
   75|  7.59M|    return traversal_observer_;
   76|  7.59M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  13.0M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  13.0M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 135k, False: 12.9M]
  ------------------
   47|   135k|      return true;  // Invalid faces are always considered as visited.
   48|   135k|    }
   49|  12.9M|    return is_face_visited_[face_id.value()];
   50|  13.0M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  4.98M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  4.98M|    is_face_visited_[face_id.value()] = true;
   62|  4.98M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.35k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.35k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.67k|                    TraversalObserver traversal_observer) {
   37|  1.67k|    corner_table_ = corner_table;
   38|  1.67k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.67k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.67k|    traversal_observer_ = traversal_observer;
   41|  1.67k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.26M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.26M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.26M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.26M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.26M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  27.2M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.03M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.03M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.03M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.03M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.03M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  8.20M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  8.20M|    return is_vertex_visited_[vert_id.value()];
   65|  8.20M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  7.99M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  7.99M|    is_vertex_visited_[vert_id.value()] = true;
   68|  7.99M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  11.0M|  inline TraversalObserverT &traversal_observer() {
   75|  11.0M|    return traversal_observer_;
   76|  11.0M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  8.29M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  8.29M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 5.20M, False: 3.09M]
  ------------------
   47|  5.20M|      return true;  // Invalid faces are always considered as visited.
   48|  5.20M|    }
   49|  3.09M|    return is_face_visited_[face_id.value()];
   50|  8.29M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.03M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.03M|    is_face_visited_[face_id.value()] = true;
   62|  3.03M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.30k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.65k|                    TraversalObserver traversal_observer) {
   37|  1.65k|    corner_table_ = corner_table;
   38|  1.65k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.65k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.65k|    traversal_observer_ = traversal_observer;
   41|  1.65k|  }

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  55.1M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  55.1M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 55.1M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  55.1M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  55.1M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   808M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   808M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 227, False: 808M]
  ------------------
   78|    227|      return false;  // Buffer overflow.
   79|    227|    }
   80|   808M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   808M|    pos_ += size_to_decode;
   82|   808M|    return true;
   83|   808M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  24.3k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  7.64k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  35.8k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   152k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  5.16k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  55.1M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  2.87M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  6.51k|    inline void reset(const void *b, size_t s) {
  131|  6.51k|      bit_offset_ = 0;
  132|  6.51k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  6.51k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  6.51k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  5.70k|    inline uint64_t BitsDecoded() const {
  138|  5.70k|      return static_cast<uint64_t>(bit_offset_);
  139|  5.70k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  55.1M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  55.1M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 2, False: 55.1M]
  ------------------
  162|      2|        return false;
  163|      2|      }
  164|  55.1M|      uint32_t value = 0;
  165|   125M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 70.4M, False: 55.1M]
  ------------------
  166|  70.4M|        value |= GetBit() << bit;
  167|  70.4M|      }
  168|  55.1M|      *x = value;
  169|  55.1M|      return true;
  170|  55.1M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  70.4M|    inline int GetBit() {
  176|  70.4M|      const size_t off = bit_offset_;
  177|  70.4M|      const size_t byte_offset = off >> 3;
  178|  70.4M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  70.4M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 65.3M, False: 5.11M]
  ------------------
  180|  65.3M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  65.3M|        bit_offset_ = off + 1;
  182|  65.3M|        return bit;
  183|  65.3M|      }
  184|  5.11M|      return 0;
  185|  70.4M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  17.9M|  bool Decode(T *out_val) {
   69|  17.9M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2.25k, False: 17.9M]
  ------------------
   70|  2.25k|      return false;
   71|  2.25k|    }
   72|  17.9M|    pos_ += sizeof(T);
   73|  17.9M|    return true;
   74|  17.9M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  17.9M|  bool Peek(T *out_val) {
   88|  17.9M|    const size_t size_to_decode = sizeof(T);
   89|  17.9M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2.25k, False: 17.9M]
  ------------------
   90|  2.25k|      return false;  // Buffer overflow.
   91|  2.25k|    }
   92|  17.9M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  17.9M|    return true;
   94|  17.9M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  11.9k|  bool Decode(T *out_val) {
   69|  11.9k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 114, False: 11.8k]
  ------------------
   70|    114|      return false;
   71|    114|    }
   72|  11.8k|    pos_ += sizeof(T);
   73|  11.8k|    return true;
   74|  11.9k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  11.9k|  bool Peek(T *out_val) {
   88|  11.9k|    const size_t size_to_decode = sizeof(T);
   89|  11.9k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 114, False: 11.8k]
  ------------------
   90|    114|      return false;  // Buffer overflow.
   91|    114|    }
   92|  11.8k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  11.8k|    return true;
   94|  11.9k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   355k|  bool Decode(T *out_val) {
   69|   355k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 113, False: 355k]
  ------------------
   70|    113|      return false;
   71|    113|    }
   72|   355k|    pos_ += sizeof(T);
   73|   355k|    return true;
   74|   355k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   355k|  bool Peek(T *out_val) {
   88|   355k|    const size_t size_to_decode = sizeof(T);
   89|   355k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 113, False: 355k]
  ------------------
   90|    113|      return false;  // Buffer overflow.
   91|    113|    }
   92|   355k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   355k|    return true;
   94|   355k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  23.0k|  bool Decode(T *out_val) {
   69|  23.0k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 86, False: 23.0k]
  ------------------
   70|     86|      return false;
   71|     86|    }
   72|  23.0k|    pos_ += sizeof(T);
   73|  23.0k|    return true;
   74|  23.0k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  23.0k|  bool Peek(T *out_val) {
   88|  23.0k|    const size_t size_to_decode = sizeof(T);
   89|  23.0k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 86, False: 23.0k]
  ------------------
   90|     86|      return false;  // Buffer overflow.
   91|     86|    }
   92|  23.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  23.0k|    return true;
   94|  23.0k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|  1.69M|  bool Decode(T *out_val) {
   69|  1.69M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 122, False: 1.69M]
  ------------------
   70|    122|      return false;
   71|    122|    }
   72|  1.69M|    pos_ += sizeof(T);
   73|  1.69M|    return true;
   74|  1.69M|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|  1.69M|  bool Peek(T *out_val) {
   88|  1.69M|    const size_t size_to_decode = sizeof(T);
   89|  1.69M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 122, False: 1.69M]
  ------------------
   90|    122|      return false;  // Buffer overflow.
   91|    122|    }
   92|  1.69M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.69M|    return true;
   94|  1.69M|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  88.5k|  bool Decode(T *out_val) {
   69|  88.5k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 9, False: 88.5k]
  ------------------
   70|      9|      return false;
   71|      9|    }
   72|  88.5k|    pos_ += sizeof(T);
   73|  88.5k|    return true;
   74|  88.5k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  88.5k|  bool Peek(T *out_val) {
   88|  88.5k|    const size_t size_to_decode = sizeof(T);
   89|  88.5k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 9, False: 88.5k]
  ------------------
   90|      9|      return false;  // Buffer overflow.
   91|      9|    }
   92|  88.5k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  88.5k|    return true;
   94|  88.5k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.60k|  bool Decode(T *out_val) {
   69|  1.60k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 16, False: 1.58k]
  ------------------
   70|     16|      return false;
   71|     16|    }
   72|  1.58k|    pos_ += sizeof(T);
   73|  1.58k|    return true;
   74|  1.60k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.60k|  bool Peek(T *out_val) {
   88|  1.60k|    const size_t size_to_decode = sizeof(T);
   89|  1.60k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 16, False: 1.58k]
  ------------------
   90|     16|      return false;  // Buffer overflow.
   91|     16|    }
   92|  1.58k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.58k|    return true;
   94|  1.60k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    109|  bool Decode(T *out_val) {
   69|    109|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 8, False: 101]
  ------------------
   70|      8|      return false;
   71|      8|    }
   72|    101|    pos_ += sizeof(T);
   73|    101|    return true;
   74|    109|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    109|  bool Peek(T *out_val) {
   88|    109|    const size_t size_to_decode = sizeof(T);
   89|    109|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 8, False: 101]
  ------------------
   90|      8|      return false;  // Buffer overflow.
   91|      8|    }
   92|    101|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    101|    return true;
   94|    109|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   104M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   106M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  9.41M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  9.41M|    return value_ >= val;
  100|  9.41M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   304M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  4.10G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  23.3M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   102M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   102M|    value_ = i.value_;
  153|   102M|    return *this;
  154|   102M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   193M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   193M|    value_ = i.value_;
  153|   193M|    return *this;
  154|   193M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  23.3M|  inline ThisIndexType &operator++() {
  103|  23.3M|    ++value_;
  104|  23.3M|    return *this;
  105|  23.3M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  2.99G|  constexpr bool operator==(const IndexType &i) const {
   76|  2.99G|    return value_ == i.value_;
   77|  2.99G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|  1.21G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  4.36k|  constexpr bool operator<(const IndexType &i) const {
   88|  4.36k|    return value_ < i.value_;
   89|  4.36k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   143M|  constexpr bool operator==(const IndexType &i) const {
   76|   143M|    return value_ == i.value_;
   77|   143M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   214M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   214M|    return ThisIndexType(value_ - val);
  133|   214M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   952M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   952M|    return ThisIndexType(value_ + val);
  127|   952M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  21.3M|  constexpr bool operator==(const IndexType &i) const {
   76|  21.3M|    return value_ == i.value_;
   77|  21.3M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   343M|  constexpr bool operator!=(const IndexType &i) const {
   82|   343M|    return value_ != i.value_;
   83|   343M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   443M|  constexpr bool operator!=(const IndexType &i) const {
   82|   443M|    return value_ != i.value_;
   83|   443M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   637M|  inline ThisIndexType &operator++() {
  103|   637M|    ++value_;
  104|   637M|    return *this;
  105|   637M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   589M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   589M|    value_ = i.value_;
  153|   589M|    return *this;
  154|   589M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|  1.44G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  1.44G|    value_ = i.value_;
  153|  1.44G|    return *this;
  154|  1.44G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  41.8M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  41.8M|    return value_ >= val;
  100|  41.8M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  9.36M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.41G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  17.3G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   244M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  11.0G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   360M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  20.1M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  20.1M|    return ThisIndexType(value_ + val);
  127|  20.1M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   219M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  27.7M|  constexpr bool operator<(const IndexType &i) const {
   88|  27.7M|    return value_ < i.value_;
   89|  27.7M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   226M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   194M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  66.1M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|  85.9M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   316M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  5.33M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  5.33M|    value_ = i.value_;
  153|  5.33M|    return *this;
  154|  5.33M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  9.36M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  9.36M|    value_ += val;
  141|  9.36M|    return *this;
  142|  9.36M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  29.2M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  29.2M|    value_ = val;
  157|  29.2M|    return *this;
  158|  29.2M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   164M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  8.57M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  8.57M|  inline ThisIndexType &operator++() {
  103|  8.57M|    ++value_;
  104|  8.57M|    return *this;
  105|  8.57M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  25.1M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  25.1M|  inline ThisIndexType &operator++() {
  103|  25.1M|    ++value_;
  104|  25.1M|    return *this;
  105|  25.1M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  39.9M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  39.9M|    return vector_[index.value()];
   75|  39.9M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  25.1M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  11.2k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  21.5k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  66.9M|  inline reference operator[](const IndexTypeT &index) {
   71|  66.9M|    return vector_[index.value()];
   72|  66.9M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|   326k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  18.8M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  3.52k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   70|  9.41M|  inline reference operator[](const IndexTypeT &index) {
   71|  9.41M|    return vector_[index.value()];
   72|  9.41M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  24.5M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  24.5M|    return vector_[index.value()];
   75|  24.5M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   284M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  10.7M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   390M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   390M|    return vector_[index.value()];
   75|   390M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|  1.10G|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  1.10G|    return vector_[index.value()];
   75|  1.10G|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   541M|  inline reference operator[](const IndexTypeT &index) {
   71|   541M|    return vector_[index.value()];
   72|   541M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  67.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  67.3M|    return vector_[index.value()];
   75|  67.3M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   438M|  inline reference operator[](const IndexTypeT &index) {
   71|   438M|    return vector_[index.value()];
   72|   438M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   145M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   320M|  inline reference operator[](const IndexTypeT &index) {
   71|   320M|    return vector_[index.value()];
   72|   320M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.11k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   334M|  inline reference operator[](const IndexTypeT &index) {
   71|   334M|    return vector_[index.value()];
   72|   334M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  49.2k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.72M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  46.4k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  5.47k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  5.47k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  5.47k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  5.47k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  13.2k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  13.2k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  13.2k|    vector_.swap(arg.vector_);
   57|  13.2k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  13.2k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  13.2k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  13.2k|    vector_.swap(arg.vector_);
   57|  13.2k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  5.47k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  5.47k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  5.47k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  7.64k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  41.5k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  70.6k|int32_t DataTypeLength(DataType dt) {
   20|  70.6k|  switch (dt) {
   21|  32.4k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 32.4k, False: 38.1k]
  ------------------
   22|  34.8k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 2.34k, False: 68.3k]
  ------------------
   23|  34.8k|      return 1;
   24|  1.42k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 1.42k, False: 69.2k]
  ------------------
   25|  1.91k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 497, False: 70.1k]
  ------------------
   26|  1.91k|      return 2;
   27|  29.1k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 29.1k, False: 41.4k]
  ------------------
   28|  29.6k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 439, False: 70.2k]
  ------------------
   29|  29.6k|      return 4;
   30|    687|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 687, False: 69.9k]
  ------------------
   31|  1.08k|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 393, False: 70.2k]
  ------------------
   32|  1.08k|      return 8;
   33|  2.86k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 2.86k, False: 67.7k]
  ------------------
   34|  2.86k|      return 4;
   35|    221|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 221, False: 70.4k]
  ------------------
   36|    221|      return 8;
   37|    139|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 139, False: 70.5k]
  ------------------
   38|    139|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 70.6k]
  ------------------
   40|      0|      return -1;
   41|  70.6k|  }
   42|  70.6k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  7.64k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_4MeshENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  6.80k|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_4MeshENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    844|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  7.64k|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  7.64k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   739k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   739k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 739k, Folded]
  ------------------
   65|   739k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 807, False: 739k]
  ------------------
   66|    807|      return false;
   67|    807|    }
   68|   739k|  } 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|   739k|  return true;
   77|   739k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   560k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   560k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   560k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 61, False: 560k]
  ------------------
   33|     61|    return false;
   34|     61|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   560k|  uint8_t in;
   39|   560k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 477, False: 559k]
  ------------------
   40|    477|    return false;
   41|    477|  }
   42|   559k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 55.2k, False: 504k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  55.2k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 355, False: 54.8k]
  ------------------
   45|    355|      return false;
   46|    355|    }
   47|       |    // Append decoded info from this byte.
   48|  54.8k|    *out_val <<= 7;
   49|  54.8k|    *out_val |= in & ((1 << 7) - 1);
   50|   504k|  } else {
   51|       |    // Last byte reached
   52|   504k|    *out_val = in;
   53|   504k|  }
   54|   559k|  return true;
   55|   559k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  5.10k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  5.10k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  5.10k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 5.10k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  5.10k|  uint8_t in;
   39|  5.10k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 6, False: 5.09k]
  ------------------
   40|      6|    return false;
   41|      6|  }
   42|  5.09k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 621, False: 4.47k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    621|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 14, False: 607]
  ------------------
   45|     14|      return false;
   46|     14|    }
   47|       |    // Append decoded info from this byte.
   48|    607|    *out_val <<= 7;
   49|    607|    *out_val |= in & ((1 << 7) - 1);
   50|  4.47k|  } else {
   51|       |    // Last byte reached
   52|  4.47k|    *out_val = in;
   53|  4.47k|  }
   54|  5.08k|  return true;
   55|  5.09k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  5.47k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  5.47k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 5.47k, Folded]
  ------------------
   65|  5.47k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 111, False: 5.36k]
  ------------------
   66|    111|      return false;
   67|    111|    }
   68|  5.47k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  5.36k|  return true;
   77|  5.47k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  3.17k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.17k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.17k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 3.17k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.17k|  uint8_t in;
   39|  3.17k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 10, False: 3.16k]
  ------------------
   40|     10|    return false;
   41|     10|  }
   42|  3.16k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 68, False: 3.09k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     68|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 68]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     68|    *out_val <<= 7;
   49|     68|    *out_val |= in & ((1 << 7) - 1);
   50|  3.09k|  } else {
   51|       |    // Last byte reached
   52|  3.09k|    *out_val = in;
   53|  3.09k|  }
   54|  3.16k|  return true;
   55|  3.16k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   166k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   166k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   166k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 9, False: 166k]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   166k|  uint8_t in;
   39|   166k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 58, False: 166k]
  ------------------
   40|     58|    return false;
   41|     58|  }
   42|   166k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 684, False: 166k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    684|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 53, False: 631]
  ------------------
   45|     53|      return false;
   46|     53|    }
   47|       |    // Append decoded info from this byte.
   48|    631|    *out_val <<= 7;
   49|    631|    *out_val |= in & ((1 << 7) - 1);
   50|   166k|  } else {
   51|       |    // Last byte reached
   52|   166k|    *out_val = in;
   53|   166k|  }
   54|   166k|  return true;
   55|   166k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  4.13k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.13k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.13k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 4.12k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.12k|  uint8_t in;
   39|  4.12k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 32, False: 4.09k]
  ------------------
   40|     32|    return false;
   41|     32|  }
   42|  4.09k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 686, False: 3.41k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    686|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 30, False: 656]
  ------------------
   45|     30|      return false;
   46|     30|    }
   47|       |    // Append decoded info from this byte.
   48|    656|    *out_val <<= 7;
   49|    656|    *out_val |= in & ((1 << 7) - 1);
   50|  3.41k|  } else {
   51|       |    // Last byte reached
   52|  3.41k|    *out_val = in;
   53|  3.41k|  }
   54|  4.06k|  return true;
   55|  4.09k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  17.1k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  17.1k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  17.1k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 17.1k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  17.1k|  uint8_t in;
   39|  17.1k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 16, False: 17.1k]
  ------------------
   40|     16|    return false;
   41|     16|  }
   42|  17.1k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 220, False: 16.9k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    220|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 19, False: 201]
  ------------------
   45|     19|      return false;
   46|     19|    }
   47|       |    // Append decoded info from this byte.
   48|    201|    *out_val <<= 7;
   49|    201|    *out_val |= in & ((1 << 7) - 1);
   50|  16.9k|  } else {
   51|       |    // Last byte reached
   52|  16.9k|    *out_val = in;
   53|  16.9k|  }
   54|  17.1k|  return true;
   55|  17.1k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  5.92k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  5.92k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  5.92k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 72, False: 5.85k]
  ------------------
   33|     72|    return false;
   34|     72|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  5.85k|  uint8_t in;
   39|  5.85k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 39, False: 5.81k]
  ------------------
   40|     39|    return false;
   41|     39|  }
   42|  5.81k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.55k, False: 4.26k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.55k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 377, False: 1.17k]
  ------------------
   45|    377|      return false;
   46|    377|    }
   47|       |    // Append decoded info from this byte.
   48|  1.17k|    *out_val <<= 7;
   49|  1.17k|    *out_val |= in & ((1 << 7) - 1);
   50|  4.26k|  } else {
   51|       |    // Last byte reached
   52|  4.26k|    *out_val = in;
   53|  4.26k|  }
   54|  5.43k|  return true;
   55|  5.81k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.03k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.03k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.03k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 70, False: 3.96k]
  ------------------
   33|     70|    return false;
   34|     70|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.96k|  uint8_t in;
   39|  3.96k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 31, False: 3.93k]
  ------------------
   40|     31|    return false;
   41|     31|  }
   42|  3.93k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.66k, False: 2.26k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.66k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 740, False: 923]
  ------------------
   45|    740|      return false;
   46|    740|    }
   47|       |    // Append decoded info from this byte.
   48|    923|    *out_val <<= 7;
   49|    923|    *out_val |= in & ((1 << 7) - 1);
   50|  2.26k|  } else {
   51|       |    // Last byte reached
   52|  2.26k|    *out_val = in;
   53|  2.26k|  }
   54|  3.19k|  return true;
   55|  3.93k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  41.4k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  41.4k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  41.4k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 8, False: 41.3k]
  ------------------
   33|      8|    return false;
   34|      8|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  41.3k|  uint8_t in;
   39|  41.3k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 20, False: 41.3k]
  ------------------
   40|     20|    return false;
   41|     20|  }
   42|  41.3k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.73k, False: 39.6k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.73k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 43, False: 1.68k]
  ------------------
   45|     43|      return false;
   46|     43|    }
   47|       |    // Append decoded info from this byte.
   48|  1.68k|    *out_val <<= 7;
   49|  1.68k|    *out_val |= in & ((1 << 7) - 1);
   50|  39.6k|  } else {
   51|       |    // Last byte reached
   52|  39.6k|    *out_val = in;
   53|  39.6k|  }
   54|  41.3k|  return true;
   55|  41.3k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|  57.5k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|  66.4k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  5.53k|  Self operator-(const Self &o) const {
  138|  5.53k|    Self ret;
  139|  22.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 16.6k, False: 5.53k]
  ------------------
  140|  16.6k|      ret[i] = (*this)[i] - o[i];
  141|  16.6k|    }
  142|  5.53k|    return ret;
  143|  5.53k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  13.5k|  VectorD() {
   41|  54.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 40.5k, False: 13.5k]
  ------------------
   42|  40.5k|      (*this)[i] = Scalar(0);
   43|  40.5k|    }
   44|  13.5k|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   143M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  11.8M|  Self operator-(const Self &o) const {
  138|  11.8M|    Self ret;
  139|  47.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 35.6M, False: 11.8M]
  ------------------
  140|  35.6M|      ret[i] = (*this)[i] - o[i];
  141|  35.6M|    }
  142|  11.8M|    return ret;
  143|  11.8M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  5.93M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  5.93M|  static_assert(std::is_signed<ScalarT>::value,
  321|  5.93M|                "ScalarT must be a signed type. ");
  322|  5.93M|  VectorD<ScalarT, 3> r;
  323|  5.93M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  5.93M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  5.93M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  5.93M|  return r;
  327|  5.93M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  5.93M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  5.93M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  2.88M|  Scalar AbsSum() const {
  238|  2.88M|    Scalar result(0);
  239|  11.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 8.65M, False: 2.87M]
  ------------------
  240|  8.65M|      Scalar next_value = std::abs(v_[i]);
  241|  8.65M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 9.28k, False: 8.64M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  9.28k|        return std::numeric_limits<Scalar>::max();
  244|  9.28k|      }
  245|  8.64M|      result += next_value;
  246|  8.64M|    }
  247|  2.87M|    return result;
  248|  2.88M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   216k|  Self operator/(const Scalar &o) const {
  183|   216k|    Self ret;
  184|   864k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 648k, False: 216k]
  ------------------
  185|   648k|      ret[i] = (*this)[i] / o;
  186|   648k|    }
  187|   216k|    return ret;
  188|   216k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   184M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  14.6M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  8.66M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  2.43M|  Self operator-() const {
  121|  2.43M|    Self ret;
  122|  9.73M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 7.30M, False: 2.43M]
  ------------------
  123|  7.30M|      ret[i] = -(*this)[i];
  124|  7.30M|    }
  125|  2.43M|    return ret;
  126|  2.43M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  7.30M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   718k|  Self operator-(const Self &o) const {
  138|   718k|    Self ret;
  139|  2.15M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.43M, False: 718k]
  ------------------
  140|  1.43M|      ret[i] = (*this)[i] - o[i];
  141|  1.43M|    }
  142|   718k|    return ret;
  143|   718k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  8.61M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  12.9M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  49.8M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  1.43M|  Self operator+(const Self &o) const {
  130|  1.43M|    Self ret;
  131|  4.30M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.87M, False: 1.43M]
  ------------------
  132|  2.87M|      ret[i] = (*this)[i] + o[i];
  133|  2.87M|    }
  134|  1.43M|    return ret;
  135|  1.43M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  41.4M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  1.64M|  Self operator-(const Self &o) const {
  138|  1.64M|    Self ret;
  139|  4.94M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.29M, False: 1.64M]
  ------------------
  140|  3.29M|      ret[i] = (*this)[i] - o[i];
  141|  3.29M|    }
  142|  1.64M|    return ret;
  143|  1.64M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  1.64M|  Self operator+(const Self &o) const {
  130|  1.64M|    Self ret;
  131|  4.94M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 3.29M, False: 1.64M]
  ------------------
  132|  3.29M|      ret[i] = (*this)[i] + o[i];
  133|  3.29M|    }
  134|  1.64M|    return ret;
  135|  1.64M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   219k|  bool operator==(const Self &o) const {
  207|   655k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 437k, False: 217k]
  ------------------
  208|   437k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 2.44k, False: 435k]
  ------------------
  209|  2.44k|        return false;
  210|  2.44k|      }
  211|   437k|    }
  212|   217k|    return true;
  213|   219k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  2.63M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  3.09k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  3.73k|  Scalar Dot(const Self &o) const {
  251|  3.73k|    Scalar ret(0);
  252|  14.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 11.2k, False: 3.73k]
  ------------------
  253|  11.2k|      ret += (*this)[i] * o[i];
  254|  11.2k|    }
  255|  3.73k|    return ret;
  256|  3.73k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    643|  Self operator*(const Scalar &o) const {
  175|    643|    Self ret;
  176|  2.57k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.92k, False: 643]
  ------------------
  177|  1.92k|      ret[i] = (*this)[i] * o;
  178|  1.92k|    }
  179|    643|    return ret;
  180|    643|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  2.44k|  Self operator-(const Self &o) const {
  138|  2.44k|    Self ret;
  139|  7.34k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.89k, False: 2.44k]
  ------------------
  140|  4.89k|      ret[i] = (*this)[i] - o[i];
  141|  4.89k|    }
  142|  2.44k|    return ret;
  143|  2.44k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  4.89k|  VectorD() {
   41|  14.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 9.79k, False: 4.89k]
  ------------------
   42|  9.79k|      (*this)[i] = Scalar(0);
   43|  9.79k|    }
   44|  4.89k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   442k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   442k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   442k|    v_[0] = c0;
   55|   442k|    v_[1] = c1;
   56|   442k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  19.5k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   227k|  bool operator==(const Self &o) const {
  207|   675k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 451k, False: 223k]
  ------------------
  208|   451k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 3.42k, False: 448k]
  ------------------
  209|  3.42k|        return false;
  210|  3.42k|      }
  211|   451k|    }
  212|   223k|    return true;
  213|   227k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.40M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  35.6M|  VectorD() {
   41|   142M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 107M, False: 35.6M]
  ------------------
   42|   107M|      (*this)[i] = Scalar(0);
   43|   107M|    }
   44|  35.6M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  5.32k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  7.31k|  Scalar Dot(const Self &o) const {
  251|  7.31k|    Scalar ret(0);
  252|  29.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 21.9k, False: 7.31k]
  ------------------
  253|  21.9k|      ret += (*this)[i] * o[i];
  254|  21.9k|    }
  255|  7.31k|    return ret;
  256|  7.31k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  1.99k|  Self operator-(const Self &o) const {
  138|  1.99k|    Self ret;
  139|  5.97k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.98k, False: 1.99k]
  ------------------
  140|  3.98k|      ret[i] = (*this)[i] - o[i];
  141|  3.98k|    }
  142|  1.99k|    return ret;
  143|  1.99k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  5.75k|  Self operator*(const Scalar &o) const {
  175|  5.75k|    Self ret;
  176|  17.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 11.5k, False: 5.75k]
  ------------------
  177|  11.5k|      ret[i] = (*this)[i] * o;
  178|  11.5k|    }
  179|  5.75k|    return ret;
  180|  5.75k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  1.92k|  Self operator+(const Self &o) const {
  130|  1.92k|    Self ret;
  131|  5.77k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 3.85k, False: 1.92k]
  ------------------
  132|  3.85k|      ret[i] = (*this)[i] + o[i];
  133|  3.85k|    }
  134|  1.92k|    return ret;
  135|  1.92k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  1.92k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  1.92k|  return v * o;
  294|  1.92k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  1.90k|  Self operator+(const Self &o) const {
  130|  1.90k|    Self ret;
  131|  7.60k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 5.70k, False: 1.90k]
  ------------------
  132|  5.70k|      ret[i] = (*this)[i] + o[i];
  133|  5.70k|    }
  134|  1.90k|    return ret;
  135|  1.90k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  1.90k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  1.90k|  return v * o;
  294|  1.90k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  1.90k|  Self operator*(const Scalar &o) const {
  175|  1.90k|    Self ret;
  176|  7.60k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 5.70k, False: 1.90k]
  ------------------
  177|  5.70k|      ret[i] = (*this)[i] * o;
  178|  5.70k|    }
  179|  1.90k|    return ret;
  180|  1.90k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   456k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   456k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   456k|    v_[0] = c0;
   55|   456k|    v_[1] = c1;
   56|   456k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  13.4k|  VectorD() {
   41|  40.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 26.9k, False: 13.4k]
  ------------------
   42|  26.9k|      (*this)[i] = Scalar(0);
   43|  26.9k|    }
   44|  13.4k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  3.79k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  11.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 7.58k, False: 3.79k]
  ------------------
  104|  7.58k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 7.58k, False: 0]
  ------------------
  105|  7.58k|        v_[i] = Scalar(src_vector[i]);
  106|  7.58k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  7.58k|    }
  110|  3.79k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|    745|  Self operator+(const Self &o) const {
  130|    745|    Self ret;
  131|  2.23k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.49k, False: 745]
  ------------------
  132|  1.49k|      ret[i] = (*this)[i] + o[i];
  133|  1.49k|    }
  134|    745|    return ret;
  135|    745|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  1.89k|  VectorD() {
   41|  5.69k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.79k, False: 1.89k]
  ------------------
   42|  3.79k|      (*this)[i] = Scalar(0);
   43|  3.79k|    }
   44|  1.89k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  11.3k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  7.58k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  1.89k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  5.69k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 3.79k, False: 1.89k]
  ------------------
  104|  3.79k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 3.79k, False: 0]
  ------------------
  105|  3.79k|        v_[i] = Scalar(src_vector[i]);
  106|  3.79k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  3.79k|    }
  110|  1.89k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  1.89k|  Self operator/(const Scalar &o) const {
  183|  1.89k|    Self ret;
  184|  5.69k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 3.79k, False: 1.89k]
  ------------------
  185|  3.79k|      ret[i] = (*this)[i] / o;
  186|  3.79k|    }
  187|  1.89k|    return ret;
  188|  1.89k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.15k|  Self operator-(const Self &o) const {
  138|  1.15k|    Self ret;
  139|  3.45k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.30k, False: 1.15k]
  ------------------
  140|  2.30k|      ret[i] = (*this)[i] - o[i];
  141|  2.30k|    }
  142|  1.15k|    return ret;
  143|  1.15k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  53.8k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  2.43M|  VectorD() {
   41|  9.74M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 7.30M, False: 2.43M]
  ------------------
   42|  7.30M|      (*this)[i] = Scalar(0);
   43|  7.30M|    }
   44|  2.43M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  8.88M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  8.88M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  8.88M|    v_[0] = c0;
   55|  8.88M|    v_[1] = c1;
   56|  8.88M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  4.30M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  12.9M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 8.61M, False: 4.30M]
  ------------------
  104|  8.61M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 8.61M, False: 0]
  ------------------
  105|  8.61M|        v_[i] = Scalar(src_vector[i]);
  106|  8.61M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  8.61M|    }
  110|  4.30M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  2.15M|  VectorD() {
   41|  6.46M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.30M, False: 2.15M]
  ------------------
   42|  4.30M|      (*this)[i] = Scalar(0);
   43|  4.30M|    }
   44|  2.15M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  2.15M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  6.46M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 4.30M, False: 2.15M]
  ------------------
  104|  4.30M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 4.30M, False: 0]
  ------------------
  105|  4.30M|        v_[i] = Scalar(src_vector[i]);
  106|  4.30M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  4.30M|    }
  110|  2.15M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  5.80M|  VectorD(const Self &o) {
   89|  17.4M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 11.6M, False: 5.80M]
  ------------------
   90|  11.6M|      (*this)[i] = o[i];
   91|  11.6M|    }
   92|  5.80M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  3.29M|  VectorD() {
   41|  9.89M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.59M, False: 3.29M]
  ------------------
   42|  6.59M|      (*this)[i] = Scalar(0);
   43|  6.59M|    }
   44|  3.29M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|   139M|  inline int num_vertices() const {
   74|   139M|    return static_cast<int>(vertex_corners_.size());
   75|   139M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  9.39M|  inline int num_corners() const {
   77|  9.39M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  9.39M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  1.36M|  inline int num_faces() const {
   80|  1.36M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  1.36M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   390M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   390M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 390M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   390M|    return opposite_corners_[corner];
   88|   390M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   655M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   655M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 18.1M, False: 637M]
  ------------------
   91|  18.1M|      return corner;
   92|  18.1M|    }
   93|   637M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 577M, False: 59.8M]
  ------------------
   94|   655M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   582M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   582M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 7.12M, False: 575M]
  ------------------
   97|  7.12M|      return corner;
   98|  7.12M|    }
   99|   575M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 154M, False: 420M]
  ------------------
  100|   582M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.10G|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|  1.10G|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1.10G]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|  1.10G|    return ConfidentVertex(corner);
  106|  1.10G|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  1.10G|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|  1.10G|    DRACO_DCHECK_GE(corner.value(), 0);
  109|  1.10G|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|  1.10G|    return corner_to_vertex_map_[corner];
  111|  1.10G|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  37.0M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  37.0M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 37.0M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  37.0M|    return FaceIndex(corner.value() / 3);
  117|  37.0M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|  1.21G|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  67.3M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  67.3M|    return vertex_corners_[v];
  152|  67.3M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.13M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.13M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.13M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 41.7k, False: 1.09M]
  ------------------
  188|  41.7k|      return true;
  189|  41.7k|    }
  190|  1.09M|    return false;
  191|  1.13M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  86.8M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  86.8M|    return Previous(Opposite(Previous(corner)));
  202|  86.8M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  15.9M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  15.9M|    return Next(Opposite(Next(corner)));
  207|  15.9M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  3.88M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  3.88M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 3.88M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  3.88M|    return Opposite(Previous(corner_id));
  222|  3.88M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  4.98M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  4.98M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 4.98M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  4.98M|    return Opposite(Next(corner_id));
  228|  4.98M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   438M|                                CornerIndex opp_corner_id) {
  249|   438M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   438M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   438M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   541M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   541M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   541M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   541M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|   145M|  VertexIndex AddNewVertex() {
  271|   145M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|   145M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|   145M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|   145M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   315M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   315M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   315M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 315M, False: 0]
  ------------------
  295|   315M|      vertex_corners_[vert] = corner;
  296|   315M|    }
  297|   315M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  4.60M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  4.60M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  4.60M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  4.60M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  4.07k|      : corner_table_(table),
  229|  4.07k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  4.07k|        corner_(start_corner_),
  231|  4.07k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  4.04M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  34.7k|  VertexCornersIterator &operator++() {
  268|  34.7k|    Next();
  269|  34.7k|    return *this;
  270|  34.7k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.45M|  void Next() {
  248|  3.45M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.40M, False: 45.7k]
  ------------------
  249|  3.40M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.40M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 24.6k, False: 3.38M]
  ------------------
  251|       |        // Open boundary reached.
  252|  24.6k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  24.6k|        left_traversal_ = false;
  254|  3.38M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 564k, False: 2.81M]
  ------------------
  255|       |        // End reached.
  256|   564k|        corner_ = kInvalidCornerIndex;
  257|   564k|      }
  258|  3.40M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  45.7k|      corner_ = corner_table_->SwingRight(corner_);
  262|  45.7k|    }
  263|  3.45M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  6.86M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  4.82M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  5.03M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  2.51M|  void Next() {
  248|  2.51M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.50M, False: 13.4k]
  ------------------
  249|  2.50M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.50M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 2.26M, False: 243k]
  ------------------
  251|       |        // Open boundary reached.
  252|  2.26M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  2.26M|        left_traversal_ = false;
  254|  2.26M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 39.1k, False: 204k]
  ------------------
  255|       |        // End reached.
  256|  39.1k|        corner_ = kInvalidCornerIndex;
  257|  39.1k|      }
  258|  2.50M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  13.4k|      corner_ = corner_table_->SwingRight(corner_);
  262|  13.4k|    }
  263|  2.51M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  2.30M|      : corner_table_(table),
  236|  2.30M|        start_corner_(corner_id),
  237|  2.30M|        corner_(start_corner_),
  238|  2.30M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   584k|      : corner_table_(table),
  236|   584k|        start_corner_(corner_id),
  237|   584k|        corner_(start_corner_),
  238|   584k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  72.9M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  72.9M|    return is_edge_on_seam_[corner.value()];
   47|  72.9M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  33.2M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  33.2M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 33.2M]
  |  Branch (50:42): [True: 30.5M, False: 2.65M]
  ------------------
   51|  30.5M|      return kInvalidCornerIndex;
   52|  30.5M|    }
   53|  2.65M|    return corner_table_->Opposite(corner);
   54|  33.2M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  40.1M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  40.1M|    return corner_table_->Next(corner);
   58|  40.1M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  24.2M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  24.2M|    return corner_table_->Previous(corner);
   62|  24.2M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  4.58M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  4.58M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  4.58M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.83M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  2.83M|    return Opposite(Previous(corner));
   73|  2.83M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  3.03M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  3.03M|    return Opposite(Next(corner));
   76|  3.03M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  6.37M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  6.37M|    return Previous(Opposite(Previous(corner)));
   81|  6.37M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  14.2M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  14.2M|    return Next(Opposite(Next(corner)));
   86|  14.2M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  10.9k|  int num_vertices() const {
   89|  10.9k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  10.9k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  3.24k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.86k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  89.0M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  89.0M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  89.0M|    return ConfidentVertex(corner);
   97|  89.0M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  89.0M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  89.0M|    return corner_to_vertex_map_[corner.value()];
  100|  89.0M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  2.82M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  2.82M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  2.82M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  2.82M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  2.82M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  2.82M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 2.82M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  2.82M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 2.62M, False: 203k]
  ------------------
  128|  2.62M|      return true;
  129|  2.62M|    }
  130|   203k|    return false;
  131|  2.82M|  }

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

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

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

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

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

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

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

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

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

