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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  1.77k|      : quantization_bits_(-1),
   54|  1.77k|        max_quantized_value_(-1),
   55|  1.77k|        max_value_(-1),
   56|  1.77k|        dequantization_scale_(1.f),
   57|  1.77k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  1.61k|  bool SetQuantizationBits(int32_t q) {
   60|  1.61k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 551, False: 1.06k]
  |  Branch (60:18): [True: 76, False: 991]
  ------------------
   61|    627|      return false;
   62|    627|    }
   63|    991|    quantization_bits_ = q;
   64|    991|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|    991|    max_value_ = max_quantized_value_ - 1;
   66|    991|    dequantization_scale_ = 2.f / max_value_;
   67|    991|    center_value_ = max_value_ / 2;
   68|    991|    return true;
   69|  1.61k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  1.27M|                                           int32_t *out_t) const {
   77|  1.27M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 2.21k, False: 1.27M]
  |  Branch (77:20): [True: 0, False: 2.21k]
  |  Branch (77:32): [True: 2.21k, False: 1.27M]
  |  Branch (77:42): [True: 0, False: 2.21k]
  ------------------
   78|  1.27M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.08M, False: 187k]
  |  Branch (78:29): [True: 6.78k, False: 1.08M]
  ------------------
   79|  6.78k|      s = max_value_;
   80|  6.78k|      t = max_value_;
   81|  1.26M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 2.21k, False: 1.26M]
  |  Branch (81:26): [True: 635, False: 1.58k]
  ------------------
   82|    635|      t = center_value_ - (t - center_value_);
   83|  1.26M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.08M, False: 186k]
  |  Branch (83:35): [True: 6.89k, False: 1.07M]
  ------------------
   84|  6.89k|      t = center_value_ + (center_value_ - t);
   85|  1.25M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.07M, False: 184k]
  |  Branch (85:35): [True: 307, False: 1.07M]
  ------------------
   86|    307|      s = center_value_ + (center_value_ - s);
   87|  1.25M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 2.98k, False: 1.25M]
  |  Branch (87:26): [True: 1.15k, False: 1.82k]
  ------------------
   88|  1.15k|      s = center_value_ - (s - center_value_);
   89|  1.15k|    }
   90|       |
   91|  1.27M|    *out_s = s;
   92|  1.27M|    *out_t = t;
   93|  1.27M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  1.27M|                                                       int32_t *out_t) const {
  100|  1.27M|    DRACO_DCHECK_EQ(
  101|  1.27M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  1.27M|        center_value_);
  103|  1.27M|    int32_t s, t;
  104|  1.27M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 293k, False: 980k]
  ------------------
  105|       |      // Right hemisphere.
  106|   293k|      s = (int_vec[1] + center_value_);
  107|   293k|      t = (int_vec[2] + center_value_);
  108|   980k|    } else {
  109|       |      // Left hemisphere.
  110|   980k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 35.8k, False: 944k]
  ------------------
  111|  35.8k|        s = std::abs(int_vec[2]);
  112|   944k|      } else {
  113|   944k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   944k|      }
  115|   980k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 37.2k, False: 942k]
  ------------------
  116|  37.2k|        t = std::abs(int_vec[1]);
  117|   942k|      } else {
  118|   942k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   942k|      }
  120|   980k|    }
  121|  1.27M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  1.27M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   151k|                                                    float *out_vector) const {
  199|   151k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   151k|                                 in_t * dequantization_scale_ - 1.f,
  201|   151k|                                 out_vector);
  202|   151k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  1.72M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  1.72M|    DRACO_DCHECK_LE(s, center_value_);
  208|  1.72M|    DRACO_DCHECK_LE(t, center_value_);
  209|  1.72M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  1.72M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  1.72M|    const uint32_t st =
  212|  1.72M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  1.72M|    return st <= center_value_;
  214|  1.72M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  1.83M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  1.83M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  1.83M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  1.83M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  1.83M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  1.83M|    int32_t sign_s = 0;
  223|  1.83M|    int32_t sign_t = 0;
  224|  1.83M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 1.75M, False: 76.2k]
  |  Branch (224:20): [True: 1.71M, False: 43.9k]
  ------------------
  225|  1.71M|      sign_s = 1;
  226|  1.71M|      sign_t = 1;
  227|  1.71M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 77.9k, False: 42.1k]
  |  Branch (227:27): [True: 36.8k, False: 41.1k]
  ------------------
  228|  36.8k|      sign_s = -1;
  229|  36.8k|      sign_t = -1;
  230|  83.2k|    } else {
  231|  83.2k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 42.1k, False: 41.1k]
  ------------------
  232|  83.2k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 41.1k, False: 42.1k]
  ------------------
  233|  83.2k|    }
  234|       |
  235|       |    // Perform the addition and subtraction using unsigned integers to avoid
  236|       |    // signed integer overflows for bad data. Note that the result will be
  237|       |    // unchanged for non-overflowing cases.
  238|  1.83M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  1.83M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  1.83M|    uint32_t us = *s;
  241|  1.83M|    uint32_t ut = *t;
  242|  1.83M|    us = us + us - corner_point_s;
  243|  1.83M|    ut = ut + ut - corner_point_t;
  244|  1.83M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 1.75M, False: 83.2k]
  ------------------
  245|  1.75M|      uint32_t temp = us;
  246|  1.75M|      us = -ut;
  247|  1.75M|      ut = -temp;
  248|  1.75M|    } else {
  249|  83.2k|      std::swap(us, ut);
  250|  83.2k|    }
  251|  1.83M|    us = us + corner_point_s;
  252|  1.83M|    ut = ut + corner_point_t;
  253|       |
  254|  1.83M|    *s = us;
  255|  1.83M|    *t = ut;
  256|  1.83M|    *s /= 2;
  257|  1.83M|    *t /= 2;
  258|  1.83M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  3.45M|  int32_t ModMax(int32_t x) const {
  273|  3.45M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 1.43k, False: 3.44M]
  ------------------
  274|  1.43k|      return x - this->max_quantized_value();
  275|  1.43k|    }
  276|  3.44M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 1.76k, False: 3.44M]
  ------------------
  277|  1.76k|      return x + this->max_quantized_value();
  278|  1.76k|    }
  279|  3.44M|    return x;
  280|  3.44M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|    946|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  3.19k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  10.3M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   151k|                                           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|   151k|    float y = in_s_scaled;
  329|   151k|    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|   151k|    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|   151k|    float x_offset = -x;
  342|   151k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 549, False: 150k]
  ------------------
  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|   151k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 46.4k, False: 104k]
  ------------------
  348|   151k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 46.4k, False: 104k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   151k|    const float norm_squared = x * x + y * y + z * z;
  352|   151k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 151k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   151k|    } else {
  357|   151k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   151k|      out_vector[0] = x * d;
  359|   151k|      out_vector[1] = y * d;
  360|   151k|      out_vector[2] = z * d;
  361|   151k|    }
  362|   151k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  1.27M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  1.27M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  1.27M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  1.27M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  1.27M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  1.27M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  1.27M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 1.08M, False: 188k]
  ------------------
  181|  1.08M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.08M|    } else {
  183|   188k|      vec[0] =
  184|   188k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   188k|          abs_sum;
  186|   188k|      vec[1] =
  187|   188k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   188k|          abs_sum;
  189|   188k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 100k, False: 88.4k]
  ------------------
  190|   100k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   100k|      } else {
  192|  88.4k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|  88.4k|      }
  194|   188k|    }
  195|  1.27M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    236|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    236|            attribute, transform, mesh_data),
   52|    236|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    231|                                                                *buffer) {
  194|    231|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    231|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    231|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 5, False: 226]
  ------------------
  196|       |    // Decode prediction mode.
  197|      5|    uint8_t mode;
  198|      5|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 5]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      5|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 3, False: 2]
  ------------------
  203|       |      // Unsupported mode.
  204|      3|      return false;
  205|      3|    }
  206|      5|  }
  207|    228|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.05k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 870, False: 187]
  ------------------
  211|    870|    uint32_t num_flags;
  212|    870|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 6, False: 864]
  ------------------
  213|      6|      return false;
  214|      6|    }
  215|    864|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 27, False: 837]
  ------------------
  216|     27|      return false;
  217|     27|    }
  218|    837|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 442, False: 395]
  ------------------
  219|    442|      is_crease_edge_[i].resize(num_flags);
  220|    442|      RAnsBitDecoder decoder;
  221|    442|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 8, False: 434]
  ------------------
  222|      8|        return false;
  223|      8|      }
  224|   919k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 919k, False: 434]
  ------------------
  225|   919k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   919k|      }
  227|    434|      decoder.EndDecoding();
  228|    434|    }
  229|    837|  }
  230|    187|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    187|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    228|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    181|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    181|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    181|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    905|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 724, False: 181]
  ------------------
   93|    724|    pred_vals[i].resize(num_components, 0);
   94|    724|  }
   95|    181|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    181|                                         out_data);
   97|       |
   98|    181|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    181|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    181|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    181|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    181|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    181|  const int corner_map_size =
  109|    181|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   388k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 388k, False: 103]
  ------------------
  111|   388k|    const CornerIndex start_corner_id =
  112|   388k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   388k|    CornerIndex corner_id(start_corner_id);
  115|   388k|    int num_parallelograms = 0;
  116|   388k|    bool first_pass = true;
  117|   955k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 605k, False: 349k]
  ------------------
  118|   605k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 82.3k, False: 523k]
  ------------------
  119|   605k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   605k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  82.3k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  82.3k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 845, False: 81.4k]
  ------------------
  127|    845|          break;
  128|    845|        }
  129|  82.3k|      }
  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|   605k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 593k, False: 11.6k]
  ------------------
  134|   593k|        corner_id = table->SwingLeft(corner_id);
  135|   593k|      } else {
  136|  11.6k|        corner_id = table->SwingRight(corner_id);
  137|  11.6k|      }
  138|   605k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 37.4k, False: 567k]
  ------------------
  139|  37.4k|        break;
  140|  37.4k|      }
  141|   567k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 355k, False: 212k]
  |  Branch (141:47): [True: 349k, False: 5.41k]
  ------------------
  142|   349k|        first_pass = false;
  143|   349k|        corner_id = table->SwingRight(start_corner_id);
  144|   349k|      }
  145|   567k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   388k|    int num_used_parallelograms = 0;
  150|   388k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 46.0k, False: 342k]
  ------------------
  151|  2.32M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 2.27M, False: 46.0k]
  ------------------
  152|  2.27M|        multi_pred_vals[i] = 0;
  153|  2.27M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   128k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 82.2k, False: 45.9k]
  ------------------
  156|  82.2k|        const int context = num_parallelograms - 1;
  157|  82.2k|        const int pos = is_crease_edge_pos[context]++;
  158|  82.2k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 78, False: 82.1k]
  ------------------
  159|     78|          return false;
  160|     78|        }
  161|  82.1k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  82.1k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 7.69k, False: 74.4k]
  ------------------
  163|  7.69k|          ++num_used_parallelograms;
  164|   426k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 418k, False: 7.69k]
  ------------------
  165|   418k|            multi_pred_vals[j] =
  166|   418k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   418k|          }
  168|  7.69k|        }
  169|  82.1k|      }
  170|  46.0k|    }
  171|   388k|    const int dst_offset = p * num_components;
  172|   388k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 384k, False: 3.82k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   384k|      const int src_offset = (p - 1) * num_components;
  176|   384k|      this->transform().ComputeOriginalValue(
  177|   384k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   384k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   212k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 209k, False: 3.82k]
  ------------------
  181|   209k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   209k|      }
  183|  3.82k|      this->transform().ComputeOriginalValue(
  184|  3.82k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  3.82k|    }
  186|   388k|  }
  187|    103|  return true;
  188|    181|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    194|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    194|            attribute, transform, mesh_data),
   52|    194|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    190|                                                                *buffer) {
  194|    190|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    190|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    190|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 0, False: 190]
  ------------------
  196|       |    // Decode prediction mode.
  197|      0|    uint8_t mode;
  198|      0|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 0]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      0|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 0, False: 0]
  ------------------
  203|       |      // Unsupported mode.
  204|      0|      return false;
  205|      0|    }
  206|      0|  }
  207|    190|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    890|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 725, False: 165]
  ------------------
  211|    725|    uint32_t num_flags;
  212|    725|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 0, False: 725]
  ------------------
  213|      0|      return false;
  214|      0|    }
  215|    725|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 18, False: 707]
  ------------------
  216|     18|      return false;
  217|     18|    }
  218|    707|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 347, False: 360]
  ------------------
  219|    347|      is_crease_edge_[i].resize(num_flags);
  220|    347|      RAnsBitDecoder decoder;
  221|    347|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 7, False: 340]
  ------------------
  222|      7|        return false;
  223|      7|      }
  224|   505k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 505k, False: 340]
  ------------------
  225|   505k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   505k|      }
  227|    340|      decoder.EndDecoding();
  228|    340|    }
  229|    707|  }
  230|    165|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    165|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    190|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    148|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    148|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    148|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    740|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 592, False: 148]
  ------------------
   93|    592|    pred_vals[i].resize(num_components, 0);
   94|    592|  }
   95|    148|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    148|                                         out_data);
   97|       |
   98|    148|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    148|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    148|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    148|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    148|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    148|  const int corner_map_size =
  109|    148|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  57.0k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 56.9k, False: 97]
  ------------------
  111|  56.9k|    const CornerIndex start_corner_id =
  112|  56.9k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  56.9k|    CornerIndex corner_id(start_corner_id);
  115|  56.9k|    int num_parallelograms = 0;
  116|  56.9k|    bool first_pass = true;
  117|   332k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 330k, False: 2.54k]
  ------------------
  118|   330k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 108k, False: 221k]
  ------------------
  119|   330k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   330k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   108k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   108k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 359, False: 107k]
  ------------------
  127|    359|          break;
  128|    359|        }
  129|   108k|      }
  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|   329k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 327k, False: 2.42k]
  ------------------
  134|   327k|        corner_id = table->SwingLeft(corner_id);
  135|   327k|      } else {
  136|  2.42k|        corner_id = table->SwingRight(corner_id);
  137|  2.42k|      }
  138|   329k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 54.0k, False: 275k]
  ------------------
  139|  54.0k|        break;
  140|  54.0k|      }
  141|   275k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 3.65k, False: 271k]
  |  Branch (141:47): [True: 2.55k, False: 1.10k]
  ------------------
  142|  2.55k|        first_pass = false;
  143|  2.55k|        corner_id = table->SwingRight(start_corner_id);
  144|  2.55k|      }
  145|   275k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  56.9k|    int num_used_parallelograms = 0;
  150|  56.9k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 54.9k, False: 1.97k]
  ------------------
  151|  6.49M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 6.43M, False: 54.9k]
  ------------------
  152|  6.43M|        multi_pred_vals[i] = 0;
  153|  6.43M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   163k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 108k, False: 54.9k]
  ------------------
  156|   108k|        const int context = num_parallelograms - 1;
  157|   108k|        const int pos = is_crease_edge_pos[context]++;
  158|   108k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 51, False: 108k]
  ------------------
  159|     51|          return false;
  160|     51|        }
  161|   108k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   108k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 13.8k, False: 94.2k]
  ------------------
  163|  13.8k|          ++num_used_parallelograms;
  164|   877k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 863k, False: 13.8k]
  ------------------
  165|   863k|            multi_pred_vals[j] =
  166|   863k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   863k|          }
  168|  13.8k|        }
  169|   108k|      }
  170|  54.9k|    }
  171|  56.8k|    const int dst_offset = p * num_components;
  172|  56.8k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 50.4k, False: 6.42k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  50.4k|      const int src_offset = (p - 1) * num_components;
  176|  50.4k|      this->transform().ComputeOriginalValue(
  177|  50.4k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  50.4k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   316k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 309k, False: 6.42k]
  ------------------
  181|   309k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   309k|      }
  183|  6.42k|      this->transform().ComputeOriginalValue(
  184|  6.42k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  6.42k|    }
  186|  56.8k|  }
  187|     97|  return true;
  188|    148|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.29k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.29k|    mesh_ = mesh;
   39|  1.29k|    corner_table_ = table;
   40|  1.29k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.29k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.29k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  7.92M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  5.13M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  5.13M|    return vertex_to_data_map_;
   48|  5.13M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  2.66M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  2.66M|    return data_to_corner_map_;
   51|  2.66M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.60k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.60k|    mesh_ = mesh;
   39|  1.60k|    corner_table_ = table;
   40|  1.60k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.60k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.60k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  7.56M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  6.55M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  6.55M|    return vertex_to_data_map_;
   48|  6.55M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  1.38M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  1.38M|    return data_to_corner_map_;
   51|  1.38M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  1.29k|      : mesh_(nullptr),
   31|  1.29k|        corner_table_(nullptr),
   32|  1.29k|        vertex_to_data_map_(nullptr),
   33|  1.29k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  1.60k|      : mesh_(nullptr),
   31|  1.60k|        corner_table_(nullptr),
   32|  1.60k|        vertex_to_data_map_(nullptr),
   33|  1.60k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   504k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  85.0k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   214k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   215k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.01k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.01k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  5.89M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.39k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.39k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  1.54M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    149|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    149|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    106|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    106|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    124|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    124|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    105|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    105|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    298|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    149|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    149|    DRACO_DCHECK_EQ(i, 0);
   70|    149|    (void)i;
   71|    149|    return GeometryAttribute::POSITION;
   72|    149|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    149|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    149|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 149]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    149|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 149]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|    149|    predictor_.SetPositionAttribute(*att);
   82|    149|    return true;
   83|    149|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    148|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    148|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 143]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    143|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    143|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    143|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 46, False: 97]
  ------------------
  150|     46|    uint8_t prediction_mode;
  151|     46|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 46]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     46|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 44]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|     44|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 44]
  ------------------
  160|     44|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     44|  }
  164|    141|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    141|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 2, False: 139]
  ------------------
  168|      2|    return false;
  169|      2|  }
  170|       |
  171|    139|  return true;
  172|    141|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    139|                                      const PointIndex *entry_to_point_id_map) {
  103|    139|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    139|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    139|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    139|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    139|  const int corner_map_size =
  111|    139|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    139|  VectorD<int32_t, 3> pred_normal_3d;
  114|    139|  int32_t pred_normal_oct[2];
  115|       |
  116|   504k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 504k, False: 139]
  ------------------
  117|   504k|    const CornerIndex corner_id =
  118|   504k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   504k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   504k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   504k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   504k|                    octahedron_tool_box_.center_value());
  125|   504k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 502k, False: 1.67k]
  ------------------
  126|   502k|      pred_normal_3d = -pred_normal_3d;
  127|   502k|    }
  128|   504k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   504k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   504k|    const int data_offset = data_id * 2;
  132|   504k|    this->transform().ComputeOriginalValue(
  133|   504k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   504k|  }
  135|    139|  flip_normal_bit_decoder_.EndDecoding();
  136|    139|  return true;
  137|    139|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    139|  void SetQuantizationBits(int q) {
   85|    139|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    139|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    212|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    106|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    106|    DRACO_DCHECK_EQ(i, 0);
   70|    106|    (void)i;
   71|    106|    return GeometryAttribute::POSITION;
   72|    106|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    106|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    106|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 106]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    106|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 106]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|    106|    predictor_.SetPositionAttribute(*att);
   82|    106|    return true;
   83|    106|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    105|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    105|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 2, False: 103]
  ------------------
  145|      2|    return false;
  146|      2|  }
  147|       |
  148|    103|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    103|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    103|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 15, False: 88]
  ------------------
  150|     15|    uint8_t prediction_mode;
  151|     15|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 15]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     15|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 14]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     14|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 14]
  ------------------
  160|     14|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     14|  }
  164|    102|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    102|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 99]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|     99|  return true;
  172|    102|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     99|                                      const PointIndex *entry_to_point_id_map) {
  103|     99|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     99|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     99|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     99|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     99|  const int corner_map_size =
  111|     99|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     99|  VectorD<int32_t, 3> pred_normal_3d;
  114|     99|  int32_t pred_normal_oct[2];
  115|       |
  116|  85.0k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 84.9k, False: 99]
  ------------------
  117|  84.9k|    const CornerIndex corner_id =
  118|  84.9k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|  84.9k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|  84.9k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|  84.9k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|  84.9k|                    octahedron_tool_box_.center_value());
  125|  84.9k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 84.2k, False: 719]
  ------------------
  126|  84.2k|      pred_normal_3d = -pred_normal_3d;
  127|  84.2k|    }
  128|  84.9k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|  84.9k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|  84.9k|    const int data_offset = data_id * 2;
  132|  84.9k|    this->transform().ComputeOriginalValue(
  133|  84.9k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|  84.9k|  }
  135|     99|  flip_normal_bit_decoder_.EndDecoding();
  136|     99|  return true;
  137|     99|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     99|  void SetQuantizationBits(int q) {
   85|     99|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     99|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    245|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    124|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    124|    DRACO_DCHECK_EQ(i, 0);
   70|    124|    (void)i;
   71|    124|    return GeometryAttribute::POSITION;
   72|    124|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    124|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    124|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 124]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    124|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 121]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    121|    predictor_.SetPositionAttribute(*att);
   82|    121|    return true;
   83|    124|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    121|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    121|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 4, False: 117]
  ------------------
  145|      4|    return false;
  146|      4|  }
  147|       |
  148|    117|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    117|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    117|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 49, False: 68]
  ------------------
  150|     49|    uint8_t prediction_mode;
  151|     49|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 48]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     48|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 8, False: 40]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      8|      return false;
  157|      8|    }
  158|       |
  159|     40|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 40]
  ------------------
  160|     40|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     40|  }
  164|    108|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    108|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 4, False: 104]
  ------------------
  168|      4|    return false;
  169|      4|  }
  170|       |
  171|    104|  return true;
  172|    108|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    104|                                      const PointIndex *entry_to_point_id_map) {
  103|    104|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    104|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    104|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    104|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    104|  const int corner_map_size =
  111|    104|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    104|  VectorD<int32_t, 3> pred_normal_3d;
  114|    104|  int32_t pred_normal_oct[2];
  115|       |
  116|   214k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 214k, False: 104]
  ------------------
  117|   214k|    const CornerIndex corner_id =
  118|   214k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   214k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   214k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   214k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   214k|                    octahedron_tool_box_.center_value());
  125|   214k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 213k, False: 1.41k]
  ------------------
  126|   213k|      pred_normal_3d = -pred_normal_3d;
  127|   213k|    }
  128|   214k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   214k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   214k|    const int data_offset = data_id * 2;
  132|   214k|    this->transform().ComputeOriginalValue(
  133|   214k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   214k|  }
  135|    104|  flip_normal_bit_decoder_.EndDecoding();
  136|    104|  return true;
  137|    104|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    104|  void SetQuantizationBits(int q) {
   85|    104|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    104|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    210|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    105|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    105|    DRACO_DCHECK_EQ(i, 0);
   70|    105|    (void)i;
   71|    105|    return GeometryAttribute::POSITION;
   72|    105|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    105|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    105|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 105]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    105|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 105]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|    105|    predictor_.SetPositionAttribute(*att);
   82|    105|    return true;
   83|    105|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    105|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    105|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 1, False: 104]
  ------------------
  145|      1|    return false;
  146|      1|  }
  147|       |
  148|    104|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    104|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    104|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 26, False: 78]
  ------------------
  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: 1, False: 25]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     25|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 25]
  ------------------
  160|     25|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     25|  }
  164|    103|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    103|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 100]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|    100|  return true;
  172|    103|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    100|                                      const PointIndex *entry_to_point_id_map) {
  103|    100|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    100|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    100|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    100|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    100|  const int corner_map_size =
  111|    100|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    100|  VectorD<int32_t, 3> pred_normal_3d;
  114|    100|  int32_t pred_normal_oct[2];
  115|       |
  116|   215k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 215k, False: 100]
  ------------------
  117|   215k|    const CornerIndex corner_id =
  118|   215k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   215k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   215k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   215k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   215k|                    octahedron_tool_box_.center_value());
  125|   215k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 200k, False: 14.7k]
  ------------------
  126|   200k|      pred_normal_3d = -pred_normal_3d;
  127|   200k|    }
  128|   215k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   215k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   215k|    const int data_offset = data_id * 2;
  132|   215k|    this->transform().ComputeOriginalValue(
  133|   215k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   215k|  }
  135|    100|  flip_normal_bit_decoder_.EndDecoding();
  136|    100|  return true;
  137|    100|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    100|  void SetQuantizationBits(int q) {
   85|    100|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    100|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    119|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    119|            attribute, transform, mesh_data),
   37|    119|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    237|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    119|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    119|    DRACO_DCHECK_EQ(i, 0);
   70|    119|    (void)i;
   71|    119|    return GeometryAttribute::POSITION;
   72|    119|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    119|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    119|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 119]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    119|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 118]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    118|    predictor_.SetPositionAttribute(*att);
   82|    118|    return true;
   83|    119|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    118|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    118|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 8, False: 110]
  ------------------
  145|      8|    return false;
  146|      8|  }
  147|       |
  148|    110|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    110|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    110|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 59, False: 51]
  ------------------
  150|     59|    uint8_t prediction_mode;
  151|     59|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 59]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     59|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 5, False: 54]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      5|      return false;
  157|      5|    }
  158|       |
  159|     54|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 54]
  ------------------
  160|     54|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     54|  }
  164|    105|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    105|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 7, False: 98]
  ------------------
  168|      7|    return false;
  169|      7|  }
  170|       |
  171|     98|  return true;
  172|    105|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     98|                                      const PointIndex *entry_to_point_id_map) {
  103|     98|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     98|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     98|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     98|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     98|  const int corner_map_size =
  111|     98|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     98|  VectorD<int32_t, 3> pred_normal_3d;
  114|     98|  int32_t pred_normal_oct[2];
  115|       |
  116|  80.3k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 80.2k, False: 98]
  ------------------
  117|  80.2k|    const CornerIndex corner_id =
  118|  80.2k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|  80.2k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|  80.2k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|  80.2k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|  80.2k|                    octahedron_tool_box_.center_value());
  125|  80.2k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 43.7k, False: 36.5k]
  ------------------
  126|  43.7k|      pred_normal_3d = -pred_normal_3d;
  127|  43.7k|    }
  128|  80.2k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|  80.2k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|  80.2k|    const int data_offset = data_id * 2;
  132|  80.2k|    this->transform().ComputeOriginalValue(
  133|  80.2k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|  80.2k|  }
  135|     98|  flip_normal_bit_decoder_.EndDecoding();
  136|     98|  return true;
  137|     98|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|     98|  void SetQuantizationBits(int q) {
   85|     98|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     98|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    422|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    422|            attribute, transform, mesh_data),
   37|    422|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    844|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    422|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    422|    DRACO_DCHECK_EQ(i, 0);
   70|    422|    (void)i;
   71|    422|    return GeometryAttribute::POSITION;
   72|    422|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    422|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    422|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 422]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    422|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 422]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|    422|    predictor_.SetPositionAttribute(*att);
   82|    422|    return true;
   83|    422|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    422|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    422|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 24, False: 398]
  ------------------
  145|     24|    return false;
  146|     24|  }
  147|       |
  148|    398|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    398|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    398|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 115, False: 283]
  ------------------
  150|    115|    uint8_t prediction_mode;
  151|    115|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 114]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    114|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 113]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|    113|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 113]
  ------------------
  160|    113|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    113|  }
  164|    396|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    396|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 13, False: 383]
  ------------------
  168|     13|    return false;
  169|     13|  }
  170|       |
  171|    383|  return true;
  172|    396|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    383|                                      const PointIndex *entry_to_point_id_map) {
  103|    383|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    383|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    383|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    383|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    383|  const int corner_map_size =
  111|    383|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    383|  VectorD<int32_t, 3> pred_normal_3d;
  114|    383|  int32_t pred_normal_oct[2];
  115|       |
  116|   174k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 173k, False: 383]
  ------------------
  117|   173k|    const CornerIndex corner_id =
  118|   173k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   173k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   173k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   173k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   173k|                    octahedron_tool_box_.center_value());
  125|   173k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 139k, False: 34.0k]
  ------------------
  126|   139k|      pred_normal_3d = -pred_normal_3d;
  127|   139k|    }
  128|   173k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   173k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   173k|    const int data_offset = data_id * 2;
  132|   173k|    this->transform().ComputeOriginalValue(
  133|   173k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   173k|  }
  135|    383|  flip_normal_bit_decoder_.EndDecoding();
  136|    383|  return true;
  137|    383|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    383|  void SetQuantizationBits(int q) {
   85|    383|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    383|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    149|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    149|            attribute, transform, mesh_data),
   37|    149|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    106|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    106|            attribute, transform, mesh_data),
   37|    106|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    124|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    124|            attribute, transform, mesh_data),
   37|    124|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    105|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    105|            attribute, transform, mesh_data),
   37|    105|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    193|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    193|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 41, False: 152]
  ------------------
  105|     41|      this->normal_prediction_mode_ = mode;
  106|     41|      return true;
  107|    152|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 152, False: 0]
  ------------------
  108|    152|      this->normal_prediction_mode_ = mode;
  109|    152|      return true;
  110|    152|    }
  111|      0|    return false;
  112|    193|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   504k|                             DataTypeT *prediction) override {
   42|   504k|    DRACO_DCHECK(this->IsInitialized());
   43|   504k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   504k|    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|   504k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   504k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   504k|    VectorD<int64_t, 3> normal;
   53|   504k|    CornerIndex c_next, c_prev;
   54|  1.09M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 592k, False: 504k]
  ------------------
   55|       |      // Getting corners.
   56|   592k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 240, False: 592k]
  ------------------
   57|    240|        c_next = corner_table->Next(corner_id);
   58|    240|        c_prev = corner_table->Previous(corner_id);
   59|   592k|      } else {
   60|   592k|        c_next = corner_table->Next(cit.Corner());
   61|   592k|        c_prev = corner_table->Previous(cit.Corner());
   62|   592k|      }
   63|   592k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   592k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   592k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   592k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   592k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   592k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   592k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   592k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   592k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   592k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   592k|      cit.Next();
   81|   592k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   504k|    constexpr int64_t upper_bound = 1 << 29;
   85|   504k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 180, False: 504k]
  ------------------
   86|    180|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    180|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 51, False: 129]
  ------------------
   88|     51|        const int64_t quotient = abs_sum / upper_bound;
   89|     51|        normal = normal / quotient;
   90|     51|      }
   91|   504k|    } else {
   92|   504k|      const int64_t abs_sum = normal.AbsSum();
   93|   504k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.29k, False: 501k]
  ------------------
   94|  2.29k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.29k|        normal = normal / quotient;
   96|  2.29k|      }
   97|   504k|    }
   98|   504k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   504k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   504k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   504k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   504k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    120|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    120|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 13, False: 107]
  ------------------
  105|     13|      this->normal_prediction_mode_ = mode;
  106|     13|      return true;
  107|    107|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 107, False: 0]
  ------------------
  108|    107|      this->normal_prediction_mode_ = mode;
  109|    107|      return true;
  110|    107|    }
  111|      0|    return false;
  112|    120|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  84.9k|                             DataTypeT *prediction) override {
   42|  84.9k|    DRACO_DCHECK(this->IsInitialized());
   43|  84.9k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  84.9k|    const CornerTable *const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|  84.9k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  84.9k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  84.9k|    VectorD<int64_t, 3> normal;
   53|  84.9k|    CornerIndex c_next, c_prev;
   54|   590k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 505k, False: 84.9k]
  ------------------
   55|       |      // Getting corners.
   56|   505k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 72, False: 505k]
  ------------------
   57|     72|        c_next = corner_table->Next(corner_id);
   58|     72|        c_prev = corner_table->Previous(corner_id);
   59|   505k|      } else {
   60|   505k|        c_next = corner_table->Next(cit.Corner());
   61|   505k|        c_prev = corner_table->Previous(cit.Corner());
   62|   505k|      }
   63|   505k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   505k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   505k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   505k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   505k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   505k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   505k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   505k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   505k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   505k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   505k|      cit.Next();
   81|   505k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  84.9k|    constexpr int64_t upper_bound = 1 << 29;
   85|  84.9k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 48, False: 84.8k]
  ------------------
   86|     48|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     48|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 12, False: 36]
  ------------------
   88|     12|        const int64_t quotient = abs_sum / upper_bound;
   89|     12|        normal = normal / quotient;
   90|     12|      }
   91|  84.8k|    } else {
   92|  84.8k|      const int64_t abs_sum = normal.AbsSum();
   93|  84.8k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 54.8k, False: 29.9k]
  ------------------
   94|  54.8k|        const int64_t quotient = abs_sum / upper_bound;
   95|  54.8k|        normal = normal / quotient;
   96|  54.8k|      }
   97|  84.8k|    }
   98|  84.9k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  84.9k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  84.9k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  84.9k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  84.9k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    164|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    164|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 38, False: 126]
  ------------------
  105|     38|      this->normal_prediction_mode_ = mode;
  106|     38|      return true;
  107|    126|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 126, False: 0]
  ------------------
  108|    126|      this->normal_prediction_mode_ = mode;
  109|    126|      return true;
  110|    126|    }
  111|      0|    return false;
  112|    164|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   214k|                             DataTypeT *prediction) override {
   42|   214k|    DRACO_DCHECK(this->IsInitialized());
   43|   214k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   214k|    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|   214k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   214k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   214k|    VectorD<int64_t, 3> normal;
   53|   214k|    CornerIndex c_next, c_prev;
   54|   510k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 296k, False: 214k]
  ------------------
   55|       |      // Getting corners.
   56|   296k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 222, False: 295k]
  ------------------
   57|    222|        c_next = corner_table->Next(corner_id);
   58|    222|        c_prev = corner_table->Previous(corner_id);
   59|   295k|      } else {
   60|   295k|        c_next = corner_table->Next(cit.Corner());
   61|   295k|        c_prev = corner_table->Previous(cit.Corner());
   62|   295k|      }
   63|   296k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   296k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   296k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   296k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   296k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   296k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   296k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   296k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   296k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   296k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   296k|      cit.Next();
   81|   296k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   214k|    constexpr int64_t upper_bound = 1 << 29;
   85|   214k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 148, False: 214k]
  ------------------
   86|    148|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    148|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 39, False: 109]
  ------------------
   88|     39|        const int64_t quotient = abs_sum / upper_bound;
   89|     39|        normal = normal / quotient;
   90|     39|      }
   91|   214k|    } else {
   92|   214k|      const int64_t abs_sum = normal.AbsSum();
   93|   214k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.04k, False: 213k]
  ------------------
   94|  1.04k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.04k|        normal = normal / quotient;
   96|  1.04k|      }
   97|   214k|    }
   98|   214k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   214k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   214k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   214k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   214k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    130|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    130|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 24, False: 106]
  ------------------
  105|     24|      this->normal_prediction_mode_ = mode;
  106|     24|      return true;
  107|    106|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 106, False: 0]
  ------------------
  108|    106|      this->normal_prediction_mode_ = mode;
  109|    106|      return true;
  110|    106|    }
  111|      0|    return false;
  112|    130|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   215k|                             DataTypeT *prediction) override {
   42|   215k|    DRACO_DCHECK(this->IsInitialized());
   43|   215k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   215k|    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|   215k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   215k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   215k|    VectorD<int64_t, 3> normal;
   53|   215k|    CornerIndex c_next, c_prev;
   54|  1.50M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.28M, False: 215k]
  ------------------
   55|       |      // Getting corners.
   56|  1.28M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 132, False: 1.28M]
  ------------------
   57|    132|        c_next = corner_table->Next(corner_id);
   58|    132|        c_prev = corner_table->Previous(corner_id);
   59|  1.28M|      } else {
   60|  1.28M|        c_next = corner_table->Next(cit.Corner());
   61|  1.28M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.28M|      }
   63|  1.28M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.28M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.28M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.28M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.28M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.28M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.28M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.28M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.28M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.28M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.28M|      cit.Next();
   81|  1.28M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   215k|    constexpr int64_t upper_bound = 1 << 29;
   85|   215k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 88, False: 215k]
  ------------------
   86|     88|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     88|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 37, False: 51]
  ------------------
   88|     37|        const int64_t quotient = abs_sum / upper_bound;
   89|     37|        normal = normal / quotient;
   90|     37|      }
   91|   215k|    } else {
   92|   215k|      const int64_t abs_sum = normal.AbsSum();
   93|   215k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 107k, False: 108k]
  ------------------
   94|   107k|        const int64_t quotient = abs_sum / upper_bound;
   95|   107k|        normal = normal / quotient;
   96|   107k|      }
   97|   215k|    }
   98|   215k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   215k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   215k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   215k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   215k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    119|      : Base(md) {
   35|    119|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    119|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    173|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    173|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 51, False: 122]
  ------------------
  105|     51|      this->normal_prediction_mode_ = mode;
  106|     51|      return true;
  107|    122|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 122, False: 0]
  ------------------
  108|    122|      this->normal_prediction_mode_ = mode;
  109|    122|      return true;
  110|    122|    }
  111|      0|    return false;
  112|    173|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  80.2k|                             DataTypeT *prediction) override {
   42|  80.2k|    DRACO_DCHECK(this->IsInitialized());
   43|  80.2k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  80.2k|    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|  80.2k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  80.2k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  80.2k|    VectorD<int64_t, 3> normal;
   53|  80.2k|    CornerIndex c_next, c_prev;
   54|   359k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 279k, False: 80.2k]
  ------------------
   55|       |      // Getting corners.
   56|   279k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 204k, False: 74.7k]
  ------------------
   57|   204k|        c_next = corner_table->Next(corner_id);
   58|   204k|        c_prev = corner_table->Previous(corner_id);
   59|   204k|      } else {
   60|  74.7k|        c_next = corner_table->Next(cit.Corner());
   61|  74.7k|        c_prev = corner_table->Previous(cit.Corner());
   62|  74.7k|      }
   63|   279k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   279k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   279k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   279k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   279k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   279k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   279k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   279k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   279k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   279k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   279k|      cit.Next();
   81|   279k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  80.2k|    constexpr int64_t upper_bound = 1 << 29;
   85|  80.2k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 34.5k, False: 45.7k]
  ------------------
   86|  34.5k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  34.5k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 91, False: 34.4k]
  ------------------
   88|     91|        const int64_t quotient = abs_sum / upper_bound;
   89|     91|        normal = normal / quotient;
   90|     91|      }
   91|  45.7k|    } else {
   92|  45.7k|      const int64_t abs_sum = normal.AbsSum();
   93|  45.7k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.02k, False: 44.7k]
  ------------------
   94|  1.02k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.02k|        normal = normal / quotient;
   96|  1.02k|      }
   97|  45.7k|    }
   98|  80.2k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  80.2k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  80.2k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  80.2k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  80.2k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    422|      : Base(md) {
   35|    422|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    422|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    535|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    535|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 111, False: 424]
  ------------------
  105|    111|      this->normal_prediction_mode_ = mode;
  106|    111|      return true;
  107|    424|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 424, False: 0]
  ------------------
  108|    424|      this->normal_prediction_mode_ = mode;
  109|    424|      return true;
  110|    424|    }
  111|      0|    return false;
  112|    535|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   173k|                             DataTypeT *prediction) override {
   42|   173k|    DRACO_DCHECK(this->IsInitialized());
   43|   173k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   173k|    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|   173k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   173k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   173k|    VectorD<int64_t, 3> normal;
   53|   173k|    CornerIndex c_next, c_prev;
   54|  1.15M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 984k, False: 173k]
  ------------------
   55|       |      // Getting corners.
   56|   984k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 333k, False: 651k]
  ------------------
   57|   333k|        c_next = corner_table->Next(corner_id);
   58|   333k|        c_prev = corner_table->Previous(corner_id);
   59|   651k|      } else {
   60|   651k|        c_next = corner_table->Next(cit.Corner());
   61|   651k|        c_prev = corner_table->Previous(cit.Corner());
   62|   651k|      }
   63|   984k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   984k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   984k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   984k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   984k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   984k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   984k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   984k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   984k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   984k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   984k|      cit.Next();
   81|   984k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   173k|    constexpr int64_t upper_bound = 1 << 29;
   85|   173k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 57.2k, False: 116k]
  ------------------
   86|  57.2k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  57.2k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 282, False: 56.9k]
  ------------------
   88|    282|        const int64_t quotient = abs_sum / upper_bound;
   89|    282|        normal = normal / quotient;
   90|    282|      }
   91|   116k|    } else {
   92|   116k|      const int64_t abs_sum = normal.AbsSum();
   93|   116k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 10.2k, False: 106k]
  ------------------
   94|  10.2k|        const int64_t quotient = abs_sum / upper_bound;
   95|  10.2k|        normal = normal / quotient;
   96|  10.2k|      }
   97|   116k|    }
   98|   173k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   173k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   173k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   173k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   173k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    149|      : Base(md) {
   35|    149|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    149|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    106|      : Base(md) {
   35|    106|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    106|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    124|      : Base(md) {
   35|    124|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    124|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    105|      : Base(md) {
   35|    105|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    105|  };

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

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    140|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    140|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    125|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    125|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    125|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    125|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    125|      new DataTypeT[num_components]());
   70|       |
   71|    125|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    125|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    125|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    125|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    125|  const int corner_map_size =
   78|    125|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  38.5k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 38.4k, False: 125]
  ------------------
   80|  38.4k|    const CornerIndex start_corner_id =
   81|  38.4k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  38.4k|    CornerIndex corner_id(start_corner_id);
   84|  38.4k|    int num_parallelograms = 0;
   85|  1.71M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 1.67M, False: 38.4k]
  ------------------
   86|  1.67M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  1.67M|    }
   88|  91.4k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 53.0k, False: 38.4k]
  ------------------
   89|  53.0k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 6.19k, False: 46.8k]
  ------------------
   90|  53.0k|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  53.0k|              num_components, parallelogram_pred_vals.get())) {
   92|   209k|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 203k, False: 6.19k]
  ------------------
   93|   203k|          pred_vals[c] =
   94|   203k|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|   203k|        }
   96|  6.19k|        ++num_parallelograms;
   97|  6.19k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  53.0k|      corner_id = table->SwingRight(corner_id);
  101|  53.0k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 2.96k, False: 50.0k]
  ------------------
  102|  2.96k|        corner_id = kInvalidCornerIndex;
  103|  2.96k|      }
  104|  53.0k|    }
  105|       |
  106|  38.4k|    const int dst_offset = p * num_components;
  107|  38.4k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 34.8k, False: 3.59k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  34.8k|      const int src_offset = (p - 1) * num_components;
  111|  34.8k|      this->transform().ComputeOriginalValue(
  112|  34.8k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  34.8k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|   111k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 107k, False: 3.59k]
  ------------------
  116|   107k|        pred_vals[c] /= num_parallelograms;
  117|   107k|      }
  118|  3.59k|      this->transform().ComputeOriginalValue(
  119|  3.59k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  3.59k|    }
  121|  38.4k|  }
  122|    125|  return true;
  123|    125|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    204|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    204|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    199|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    199|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    199|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    199|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    199|      new DataTypeT[num_components]());
   70|       |
   71|    199|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    199|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    199|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    199|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    199|  const int corner_map_size =
   78|    199|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   320k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 320k, False: 199]
  ------------------
   80|   320k|    const CornerIndex start_corner_id =
   81|   320k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   320k|    CornerIndex corner_id(start_corner_id);
   84|   320k|    int num_parallelograms = 0;
   85|  1.47M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 1.14M, False: 320k]
  ------------------
   86|  1.14M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  1.14M|    }
   88|  2.22M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.90M, False: 320k]
  ------------------
   89|  1.90M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 622k, False: 1.28M]
  ------------------
   90|  1.90M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.90M|              num_components, parallelogram_pred_vals.get())) {
   92|  2.84M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 2.22M, False: 622k]
  ------------------
   93|  2.22M|          pred_vals[c] =
   94|  2.22M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  2.22M|        }
   96|   622k|        ++num_parallelograms;
   97|   622k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.90M|      corner_id = table->SwingRight(corner_id);
  101|  1.90M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 316k, False: 1.58M]
  ------------------
  102|   316k|        corner_id = kInvalidCornerIndex;
  103|   316k|      }
  104|  1.90M|    }
  105|       |
  106|   320k|    const int dst_offset = p * num_components;
  107|   320k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 597, False: 320k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|    597|      const int src_offset = (p - 1) * num_components;
  111|    597|      this->transform().ComputeOriginalValue(
  112|    597|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   320k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  1.46M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 1.14M, False: 320k]
  ------------------
  116|  1.14M|        pred_vals[c] /= num_parallelograms;
  117|  1.14M|      }
  118|   320k|      this->transform().ComputeOriginalValue(
  119|   320k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   320k|    }
  121|   320k|  }
  122|    199|  return true;
  123|    199|}

_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|    306|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|    306|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|    295|                          const PointIndex * /* entry_to_point_id_map */) {
   61|    295|  this->transform().Init(num_components);
   62|       |
   63|    295|  const CornerTable *const table = this->mesh_data().corner_table();
   64|    295|  const std::vector<int32_t> *const vertex_to_data_map =
   65|    295|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|    295|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|    295|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    295|  const int corner_map_size =
   74|    295|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|   440k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (75:19): [True: 439k, False: 295]
  ------------------
   76|   439k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   77|   439k|    const int dst_offset = p * num_components;
   78|   439k|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (78:9): [True: 398k, False: 41.0k]
  ------------------
   79|   439k|                                        *vertex_to_data_map, out_data,
   80|   439k|                                        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|   398k|      const int src_offset = (p - 1) * num_components;
   85|   398k|      this->transform().ComputeOriginalValue(
   86|   398k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   87|   398k|    } else {
   88|       |      // Apply the parallelogram prediction.
   89|  41.0k|      this->transform().ComputeOriginalValue(
   90|  41.0k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   91|  41.0k|    }
   92|   439k|  }
   93|    295|  return true;
   94|    295|}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|    343|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|    343|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|    308|                          const PointIndex * /* entry_to_point_id_map */) {
   61|    308|  this->transform().Init(num_components);
   62|       |
   63|    308|  const CornerTable *const table = this->mesh_data().corner_table();
   64|    308|  const std::vector<int32_t> *const vertex_to_data_map =
   65|    308|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|    308|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|    308|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    308|  const int corner_map_size =
   74|    308|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|   266k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (75:19): [True: 266k, False: 308]
  ------------------
   76|   266k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   77|   266k|    const int dst_offset = p * num_components;
   78|   266k|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (78:9): [True: 11.2k, False: 254k]
  ------------------
   79|   266k|                                        *vertex_to_data_map, out_data,
   80|   266k|                                        num_components, pred_vals.get())) {
   81|       |      // Parallelogram could not be computed, Possible because some of the
   82|       |      // vertices are not valid (not encoded yet).
   83|       |      // We use the last encoded point as a reference (delta coding).
   84|  11.2k|      const int src_offset = (p - 1) * num_components;
   85|  11.2k|      this->transform().ComputeOriginalValue(
   86|  11.2k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   87|   254k|    } else {
   88|       |      // Apply the parallelogram prediction.
   89|   254k|      this->transform().ComputeOriginalValue(
   90|   254k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   91|   254k|    }
   92|   266k|  }
   93|    308|  return true;
   94|    308|}

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  1.09M|    int num_components, DataTypeT *out_prediction) {
   49|  1.09M|  const CornerIndex oci = table->Opposite(ci);
   50|  1.09M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 788k, False: 309k]
  ------------------
   51|   788k|    return false;
   52|   788k|  }
   53|   309k|  int vert_opp, vert_next, vert_prev;
   54|   309k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   309k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   309k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 169k, False: 140k]
  |  Branch (56:35): [True: 136k, False: 32.8k]
  ------------------
   57|   136k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 129k, False: 6.64k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   129k|    const int v_opp_off = vert_opp * num_components;
   60|   129k|    const int v_next_off = vert_next * num_components;
   61|   129k|    const int v_prev_off = vert_prev * num_components;
   62|  4.92M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 4.79M, False: 129k]
  ------------------
   63|  4.79M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  4.79M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  4.79M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  4.79M|      const int64_t result =
   67|  4.79M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  4.79M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  4.79M|    }
   71|   129k|    return true;
   72|   129k|  }
   73|   180k|  return false;  // Not all data is available for prediction
   74|   309k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   309k|    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|   309k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   309k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   309k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   309k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  2.50M|    int num_components, DataTypeT *out_prediction) {
   49|  2.50M|  const CornerIndex oci = table->Opposite(ci);
   50|  2.50M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 7.80k, False: 2.49M]
  ------------------
   51|  7.80k|    return false;
   52|  7.80k|  }
   53|  2.49M|  int vert_opp, vert_next, vert_prev;
   54|  2.49M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  2.49M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  2.49M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 1.36M, False: 1.12M]
  |  Branch (56:35): [True: 1.05M, False: 314k]
  ------------------
   57|  1.05M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 985k, False: 65.9k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   985k|    const int v_opp_off = vert_opp * num_components;
   60|   985k|    const int v_next_off = vert_next * num_components;
   61|   985k|    const int v_prev_off = vert_prev * num_components;
   62|  27.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 26.6M, False: 985k]
  ------------------
   63|  26.6M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  26.6M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  26.6M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  26.6M|      const int64_t result =
   67|  26.6M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  26.6M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  26.6M|    }
   71|   985k|    return true;
   72|   985k|  }
   73|  1.50M|  return false;  // Not all data is available for prediction
   74|  2.49M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  2.49M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  2.49M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  2.49M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  2.49M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  2.49M|}

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

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    111|      : pos_attribute_(nullptr),
   39|    111|        entry_to_point_id_map_(nullptr),
   40|    111|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    110|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    110|    pos_attribute_ = &position_attribute;
   43|    110|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    106|  void ResizeOrientations(int num_orientations) {
   74|    106|    orientations_.resize(num_orientations);
   75|    106|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  4.04G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     97|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     97|    entry_to_point_id_map_ = map;
   46|     97|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   340k|                                                 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|   340k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   340k|  const CornerIndex prev_corner_id =
   99|   340k|      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|   340k|  int next_data_id, prev_data_id;
  103|       |
  104|   340k|  int next_vert_id, prev_vert_id;
  105|   340k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   340k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   340k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   340k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   340k|  typedef VectorD<int64_t, 2> Vec2;
  112|   340k|  typedef VectorD<int64_t, 3> Vec3;
  113|   340k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   340k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 246k, False: 94.0k]
  |  Branch (115:33): [True: 152k, False: 94.0k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   152k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   152k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   152k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 150k, False: 2.23k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   150k|      predicted_value_[0] = p_uv[0];
  122|   150k|      predicted_value_[1] = p_uv[1];
  123|   150k|      return true;
  124|   150k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  2.23k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  2.23k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  2.23k|    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.23k|    const Vec3 pn = prev_pos - next_pos;
  146|  2.23k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  2.23k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.39k, False: 840]
  ------------------
  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.39k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.39k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.39k|      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.39k|      const int64_t n_uv_absmax_element =
  164|  1.39k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.39k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 12, False: 1.38k]
  ------------------
  166|  1.39k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     12|        return false;
  169|     12|      }
  170|  1.38k|      const int64_t pn_uv_absmax_element =
  171|  1.38k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.38k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 2, False: 1.38k]
  ------------------
  173|  1.38k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      2|        return false;
  176|      2|      }
  177|  1.38k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.38k|      const int64_t pn_absmax_element =
  179|  1.38k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.38k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 3, False: 1.38k]
  ------------------
  181|  1.38k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      3|        return false;
  184|      3|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.38k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.38k|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  189|       |
  190|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  191|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  192|       |      //
  193|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  194|       |      //
  195|       |      // To preserve precision, we perform all operations in scaled space as
  196|       |      // explained above, so we want the final vector to be:
  197|       |      //
  198|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  199|       |      //
  200|       |      // We can then rewrite the formula as:
  201|       |      //
  202|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  203|       |      //
  204|  1.38k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.38k|      const uint64_t norm_squared =
  207|  1.38k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.38k|      cx_uv = cx_uv * norm_squared;
  210|       |
  211|       |      // Predicted uv coordinate is then computed by either adding or
  212|       |      // subtracting CX_UV to/from X_UV.
  213|  1.38k|      Vec2 predicted_uv;
  214|  1.38k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.38k]
  ------------------
  215|       |        // When encoding, compute both possible vectors and determine which one
  216|       |        // results in a better prediction.
  217|       |        // Both vectors need to be transformed back from the scaled space to
  218|       |        // the real UV coordinate space.
  219|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  220|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  221|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  222|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  224|      0|          predicted_uv = predicted_uv_0;
  225|      0|          orientations_.push_back(true);
  226|      0|        } else {
  227|      0|          predicted_uv = predicted_uv_1;
  228|      0|          orientations_.push_back(false);
  229|      0|        }
  230|  1.38k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.38k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 14, False: 1.36k]
  ------------------
  233|     14|          return false;
  234|     14|        }
  235|  1.36k|        const bool orientation = orientations_.back();
  236|  1.36k|        orientations_.pop_back();
  237|       |        // Perform operations in unsigned type to avoid signed integer overflow.
  238|       |        // Note that the result will be the same (for non-overflowing values).
  239|  1.36k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 696, False: 672]
  ------------------
  240|    696|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    696|        } else {
  242|    672|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    672|        }
  244|  1.36k|      }
  245|  1.36k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.36k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.36k|      return true;
  248|  1.38k|    }
  249|  2.23k|  }
  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|   188k|  int data_offset = 0;
  254|   188k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 94.8k, False: 94.0k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  94.8k|    data_offset = prev_data_id * kNumComponents;
  257|  94.8k|  }
  258|   188k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 853, False: 188k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|    853|    data_offset = next_data_id * kNumComponents;
  261|   188k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   188k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 187k, False: 97]
  ------------------
  265|   187k|      data_offset = (data_id - 1) * kNumComponents;
  266|   187k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    291|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 194, False: 97]
  ------------------
  269|    194|        predicted_value_[i] = 0;
  270|    194|      }
  271|     97|      return true;
  272|     97|    }
  273|   188k|  }
  274|   566k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 377k, False: 188k]
  ------------------
  275|   377k|    predicted_value_[i] = data[data_offset + i];
  276|   377k|  }
  277|   188k|  return true;
  278|   188k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   305k|                                            const DataTypeT *data) const {
   59|   305k|    const int data_offset = entry_id * kNumComponents;
   60|   305k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   305k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  6.71k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  6.71k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  6.71k|    VectorD<int64_t, 3> pos;
   52|  6.71k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  6.71k|                                 &pos[0]);
   54|  6.71k|    return pos;
   55|  6.71k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   340k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    136|      : pos_attribute_(nullptr),
   39|    136|        entry_to_point_id_map_(nullptr),
   40|    136|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    135|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    135|    pos_attribute_ = &position_attribute;
   43|    135|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    132|  void ResizeOrientations(int num_orientations) {
   74|    132|    orientations_.resize(num_orientations);
   75|    132|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  6.20G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    110|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    110|    entry_to_point_id_map_ = map;
   46|    110|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   188k|                                                 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|   188k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   188k|  const CornerIndex prev_corner_id =
   99|   188k|      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|   188k|  int next_data_id, prev_data_id;
  103|       |
  104|   188k|  int next_vert_id, prev_vert_id;
  105|   188k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   188k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   188k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   188k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   188k|  typedef VectorD<int64_t, 2> Vec2;
  112|   188k|  typedef VectorD<int64_t, 3> Vec3;
  113|   188k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   188k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 188k, False: 225]
  |  Branch (115:33): [True: 187k, False: 216]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   187k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   187k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   187k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 157k, False: 30.6k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   157k|      predicted_value_[0] = p_uv[0];
  122|   157k|      predicted_value_[1] = p_uv[1];
  123|   157k|      return true;
  124|   157k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  30.6k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  30.6k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  30.6k|    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|  30.6k|    const Vec3 pn = prev_pos - next_pos;
  146|  30.6k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  30.6k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.48k, False: 29.2k]
  ------------------
  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.48k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.48k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.48k|      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.48k|      const int64_t n_uv_absmax_element =
  164|  1.48k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.48k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 11, False: 1.47k]
  ------------------
  166|  1.48k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     11|        return false;
  169|     11|      }
  170|  1.47k|      const int64_t pn_uv_absmax_element =
  171|  1.47k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.47k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 7, False: 1.46k]
  ------------------
  173|  1.47k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      7|        return false;
  176|      7|      }
  177|  1.46k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.46k|      const int64_t pn_absmax_element =
  179|  1.46k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.46k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 4, False: 1.46k]
  ------------------
  181|  1.46k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      4|        return false;
  184|      4|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.46k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.46k|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  189|       |
  190|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  191|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  192|       |      //
  193|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  194|       |      //
  195|       |      // To preserve precision, we perform all operations in scaled space as
  196|       |      // explained above, so we want the final vector to be:
  197|       |      //
  198|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  199|       |      //
  200|       |      // We can then rewrite the formula as:
  201|       |      //
  202|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  203|       |      //
  204|  1.46k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.46k|      const uint64_t norm_squared =
  207|  1.46k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.46k|      cx_uv = cx_uv * norm_squared;
  210|       |
  211|       |      // Predicted uv coordinate is then computed by either adding or
  212|       |      // subtracting CX_UV to/from X_UV.
  213|  1.46k|      Vec2 predicted_uv;
  214|  1.46k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.46k]
  ------------------
  215|       |        // When encoding, compute both possible vectors and determine which one
  216|       |        // results in a better prediction.
  217|       |        // Both vectors need to be transformed back from the scaled space to
  218|       |        // the real UV coordinate space.
  219|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  220|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  221|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  222|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  224|      0|          predicted_uv = predicted_uv_0;
  225|      0|          orientations_.push_back(true);
  226|      0|        } else {
  227|      0|          predicted_uv = predicted_uv_1;
  228|      0|          orientations_.push_back(false);
  229|      0|        }
  230|  1.46k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.46k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 12, False: 1.44k]
  ------------------
  233|     12|          return false;
  234|     12|        }
  235|  1.44k|        const bool orientation = orientations_.back();
  236|  1.44k|        orientations_.pop_back();
  237|       |        // Perform operations in unsigned type to avoid signed integer overflow.
  238|       |        // Note that the result will be the same (for non-overflowing values).
  239|  1.44k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 725, False: 724]
  ------------------
  240|    725|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    725|        } else {
  242|    724|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    724|        }
  244|  1.44k|      }
  245|  1.44k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.44k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.44k|      return true;
  248|  1.46k|    }
  249|  30.6k|  }
  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|  29.6k|  int data_offset = 0;
  254|  29.6k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 29.4k, False: 225]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  29.4k|    data_offset = prev_data_id * kNumComponents;
  257|  29.4k|  }
  258|  29.6k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 29.2k, False: 428]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  29.2k|    data_offset = next_data_id * kNumComponents;
  261|  29.2k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    428|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 318, False: 110]
  ------------------
  265|    318|      data_offset = (data_id - 1) * kNumComponents;
  266|    318|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    330|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 220, False: 110]
  ------------------
  269|    220|        predicted_value_[i] = 0;
  270|    220|      }
  271|    110|      return true;
  272|    110|    }
  273|    428|  }
  274|  88.6k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 59.0k, False: 29.5k]
  ------------------
  275|  59.0k|    predicted_value_[i] = data[data_offset + i];
  276|  59.0k|  }
  277|  29.5k|  return true;
  278|  29.6k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   375k|                                            const DataTypeT *data) const {
   59|   375k|    const int data_offset = entry_id * kNumComponents;
   60|   375k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   375k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  92.0k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  92.0k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  92.0k|    VectorD<int64_t, 3> pos;
   52|  92.0k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  92.0k|                                 &pos[0]);
   54|  92.0k|    return pos;
   55|  92.0k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   188k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     26|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    269|  bool AreCorrectionsPositive() override {
   71|    269|    return transform_.AreCorrectionsPositive();
   72|    269|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     16|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     16|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 5, False: 11]
  ------------------
   50|      5|      return false;
   51|      5|    }
   52|     11|    return true;
   53|     16|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   590k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     59|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    269|  bool AreCorrectionsPositive() override {
   71|    269|    return transform_.AreCorrectionsPositive();
   72|    269|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     43|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     43|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 12, False: 31]
  ------------------
   50|     12|      return false;
   51|     12|    }
   52|     31|    return true;
   53|     43|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  1.13M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  2.55k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  1.56k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  2.46k|  bool AreCorrectionsPositive() override {
   71|  2.46k|    return transform_.AreCorrectionsPositive();
   72|  2.46k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  1.82k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  1.82k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 95, False: 1.72k]
  ------------------
   50|     95|      return false;
   51|     95|    }
   52|  1.72k|    return true;
   53|  1.82k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  3.64M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    281|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    288|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    281|                                 const PointCloudDecoder *decoder) {
  188|    281|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    281|      method, att_id, decoder, TransformT());
  190|    281|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    281|                                 const TransformT &transform) {
  156|    281|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 281]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    281|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    281|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 280, False: 1]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|    280|    const MeshDecoder *const mesh_decoder =
  167|    280|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    280|    auto ret = CreateMeshPredictionScheme<
  170|    280|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    280|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    280|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    280|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 255, False: 25]
  ------------------
  174|    255|      return ret;
  175|    255|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    280|  }
  178|       |  // Create delta decoder.
  179|     26|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     26|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    281|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    151|      uint16_t bitstream_version) {
  143|    151|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    151|        method, attribute, transform, mesh_data, bitstream_version);
  145|    151|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    151|        uint16_t bitstream_version) {
  127|    151|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 149, False: 2]
  ------------------
  128|    149|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    149|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    149|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    149|                                                  mesh_data));
  132|    149|      }
  133|      2|      return nullptr;
  134|    151|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    107|      uint16_t bitstream_version) {
  143|    107|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    107|        method, attribute, transform, mesh_data, bitstream_version);
  145|    107|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    107|        uint16_t bitstream_version) {
  127|    107|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 106, False: 1]
  ------------------
  128|    106|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    106|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    106|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    106|                                                  mesh_data));
  132|    106|      }
  133|      1|      return nullptr;
  134|    107|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    288|                                 const PointCloudDecoder *decoder) {
  188|    288|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    288|      method, att_id, decoder, TransformT());
  190|    288|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    288|                                 const TransformT &transform) {
  156|    288|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 288]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    288|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    288|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 288, 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|    288|    const MeshDecoder *const mesh_decoder =
  167|    288|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    288|    auto ret = CreateMeshPredictionScheme<
  170|    288|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    288|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    288|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    288|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 229, False: 59]
  ------------------
  174|    229|      return ret;
  175|    229|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    288|  }
  178|       |  // Create delta decoder.
  179|     59|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     59|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    288|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    127|      uint16_t bitstream_version) {
  143|    127|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    127|        method, attribute, transform, mesh_data, bitstream_version);
  145|    127|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    127|        uint16_t bitstream_version) {
  111|    127|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 124, False: 3]
  ------------------
  112|    124|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    124|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    124|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    124|                                                  mesh_data));
  116|    124|      }
  117|      3|      return nullptr;
  118|    127|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    107|      uint16_t bitstream_version) {
  143|    107|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    107|        method, attribute, transform, mesh_data, bitstream_version);
  145|    107|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    107|        uint16_t bitstream_version) {
  111|    107|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 105, False: 2]
  ------------------
  112|    105|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    105|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    105|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    105|                                                  mesh_data));
  116|    105|      }
  117|      2|      return nullptr;
  118|    107|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  2.55k|                                 const PointCloudDecoder *decoder) {
  188|  2.55k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  2.55k|      method, att_id, decoder, TransformT());
  190|  2.55k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  2.55k|                                 const TransformT &transform) {
  156|  2.55k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 2.55k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  2.55k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  2.55k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 2.54k, False: 5]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|  2.54k|    const MeshDecoder *const mesh_decoder =
  167|  2.54k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  2.54k|    auto ret = CreateMeshPredictionScheme<
  170|  2.54k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  2.54k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  2.54k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  2.54k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 2.40k, False: 140]
  ------------------
  174|  2.40k|      return ret;
  175|  2.40k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  2.54k|  }
  178|       |  // Create delta decoder.
  179|    145|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    145|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  2.55k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.01k|      uint16_t bitstream_version) {
  143|  1.01k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.01k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.01k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.01k|        uint16_t bitstream_version) {
   53|  1.01k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 306, False: 712]
  ------------------
   54|    306|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    306|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    306|                                                         MeshDataT>(
   57|    306|                attribute, transform, mesh_data));
   58|    306|      }
   59|    712|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|    712|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 140, False: 572]
  ------------------
   61|    140|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    140|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    140|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    140|                                                  mesh_data));
   65|    140|      }
   66|    572|#endif
   67|    572|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 236, False: 336]
  ------------------
   68|    236|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    236|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    236|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    236|                                                  mesh_data));
   72|    236|      }
   73|    336|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    336|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 106, False: 230]
  ------------------
   75|    106|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    106|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    106|                                                     MeshDataT>(
   78|    106|                attribute, transform, mesh_data, bitstream_version));
   79|    106|      }
   80|    230|#endif
   81|    230|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 111, False: 119]
  ------------------
   82|    111|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    111|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    111|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    111|                                                  mesh_data));
   86|    111|      }
   87|    119|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    119|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 119, False: 0]
  ------------------
   89|    119|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    119|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    119|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    119|                                                  mesh_data));
   93|    119|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.01k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.39k|      uint16_t bitstream_version) {
  143|  1.39k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.39k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.39k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.39k|        uint16_t bitstream_version) {
   53|  1.39k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 343, False: 1.04k]
  ------------------
   54|    343|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    343|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    343|                                                         MeshDataT>(
   57|    343|                attribute, transform, mesh_data));
   58|    343|      }
   59|  1.04k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.04k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 204, False: 843]
  ------------------
   61|    204|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    204|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    204|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    204|                                                  mesh_data));
   65|    204|      }
   66|    843|#endif
   67|    843|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 194, False: 649]
  ------------------
   68|    194|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    194|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    194|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    194|                                                  mesh_data));
   72|    194|      }
   73|    649|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    649|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 91, False: 558]
  ------------------
   75|     91|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|     91|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|     91|                                                     MeshDataT>(
   78|     91|                attribute, transform, mesh_data, bitstream_version));
   79|     91|      }
   80|    558|#endif
   81|    558|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 136, False: 422]
  ------------------
   82|    136|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    136|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    136|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    136|                                                  mesh_data));
   86|    136|      }
   87|    422|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    422|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 422, False: 0]
  ------------------
   89|    422|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    422|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    422|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    422|                                                  mesh_data));
   93|    422|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.39k|    }

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    280|    uint16_t bitstream_version) {
   38|    280|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    280|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 280, False: 0]
  ------------------
   40|    280|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 2, False: 278]
  ------------------
   41|    278|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 3, False: 275]
  ------------------
   42|    275|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 275]
  ------------------
   43|    275|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 4, False: 271]
  ------------------
   44|    271|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 255, False: 16]
  ------------------
   45|    264|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 0, False: 16]
  ------------------
   46|    264|    const CornerTable *const ct = source->GetCornerTable();
   47|    264|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    264|        source->GetAttributeEncodingData(att_id);
   49|    264|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 6, False: 258]
  |  Branch (49:26): [True: 0, False: 258]
  ------------------
   50|       |      // No connectivity data found.
   51|      6|      return nullptr;
   52|      6|    }
   53|       |    // Connectivity data exists.
   54|    258|    const MeshAttributeCornerTable *const att_ct =
   55|    258|        source->GetAttributeCornerTable(att_id);
   56|    258|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 151, False: 107]
  ------------------
   57|    151|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    151|      MeshData md;
   59|    151|      md.Set(source->mesh(), att_ct,
   60|    151|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    151|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    151|      MeshPredictionSchemeFactoryT factory;
   63|    151|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    151|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 149, False: 2]
  ------------------
   65|    149|        return ret;
   66|    149|      }
   67|    151|    } else {
   68|    107|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    107|      MeshData md;
   70|    107|      md.Set(source->mesh(), ct,
   71|    107|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    107|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    107|      MeshPredictionSchemeFactoryT factory;
   74|    107|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    107|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 106, False: 1]
  ------------------
   76|    106|        return ret;
   77|    106|      }
   78|    107|    }
   79|    258|  }
   80|     19|  return nullptr;
   81|    280|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    288|    uint16_t bitstream_version) {
   38|    288|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    288|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 288, False: 0]
  ------------------
   40|    288|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 15, False: 273]
  ------------------
   41|    273|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 4, False: 269]
  ------------------
   42|    269|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 7, False: 262]
  ------------------
   43|    262|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 262]
  ------------------
   44|    262|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 229, False: 33]
  ------------------
   45|    255|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 0, False: 33]
  ------------------
   46|    255|    const CornerTable *const ct = source->GetCornerTable();
   47|    255|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    255|        source->GetAttributeEncodingData(att_id);
   49|    255|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 21, False: 234]
  |  Branch (49:26): [True: 0, False: 234]
  ------------------
   50|       |      // No connectivity data found.
   51|     21|      return nullptr;
   52|     21|    }
   53|       |    // Connectivity data exists.
   54|    234|    const MeshAttributeCornerTable *const att_ct =
   55|    234|        source->GetAttributeCornerTable(att_id);
   56|    234|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 127, False: 107]
  ------------------
   57|    127|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    127|      MeshData md;
   59|    127|      md.Set(source->mesh(), att_ct,
   60|    127|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    127|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    127|      MeshPredictionSchemeFactoryT factory;
   63|    127|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    127|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 124, False: 3]
  ------------------
   65|    124|        return ret;
   66|    124|      }
   67|    127|    } else {
   68|    107|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    107|      MeshData md;
   70|    107|      md.Set(source->mesh(), ct,
   71|    107|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    107|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    107|      MeshPredictionSchemeFactoryT factory;
   74|    107|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    107|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 105, False: 2]
  ------------------
   76|    105|        return ret;
   77|    105|      }
   78|    107|    }
   79|    234|  }
   80|     38|  return nullptr;
   81|    288|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  2.54k|    uint16_t bitstream_version) {
   38|  2.54k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  2.54k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 2.54k, False: 0]
  ------------------
   40|  2.54k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 656, False: 1.89k]
  ------------------
   41|  1.89k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 348, False: 1.54k]
  ------------------
   42|  1.54k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 434, False: 1.11k]
  ------------------
   43|  1.11k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 247, False: 863]
  ------------------
   44|    863|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 541, False: 322]
  ------------------
   45|  2.42k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 200, False: 122]
  ------------------
   46|  2.42k|    const CornerTable *const ct = source->GetCornerTable();
   47|  2.42k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  2.42k|        source->GetAttributeEncodingData(att_id);
   49|  2.42k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 18, False: 2.40k]
  |  Branch (49:26): [True: 0, False: 2.40k]
  ------------------
   50|       |      // No connectivity data found.
   51|     18|      return nullptr;
   52|     18|    }
   53|       |    // Connectivity data exists.
   54|  2.40k|    const MeshAttributeCornerTable *const att_ct =
   55|  2.40k|        source->GetAttributeCornerTable(att_id);
   56|  2.40k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.01k, False: 1.39k]
  ------------------
   57|  1.01k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.01k|      MeshData md;
   59|  1.01k|      md.Set(source->mesh(), att_ct,
   60|  1.01k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.01k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.01k|      MeshPredictionSchemeFactoryT factory;
   63|  1.01k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.01k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.01k, False: 0]
  ------------------
   65|  1.01k|        return ret;
   66|  1.01k|      }
   67|  1.39k|    } else {
   68|  1.39k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  1.39k|      MeshData md;
   70|  1.39k|      md.Set(source->mesh(), ct,
   71|  1.39k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  1.39k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  1.39k|      MeshPredictionSchemeFactoryT factory;
   74|  1.39k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  1.39k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 1.39k, False: 0]
  ------------------
   76|  1.39k|        return ret;
   77|  1.39k|      }
   78|  1.39k|    }
   79|  2.40k|  }
   80|    122|  return nullptr;
   81|  2.54k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  1.13M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  1.13M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 1.01M, False: 116k]
  |  Branch (93:22): [True: 668k, False: 351k]
  ------------------
   94|   668k|      return true;
   95|   668k|    }
   96|   467k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 59.6k, False: 407k]
  |  Branch (96:25): [True: 27.5k, False: 32.0k]
  ------------------
   97|  1.13M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  1.13M|  int32_t GetRotationCount(Point2 pred) const {
   51|  1.13M|    const DataType sign_x = pred[0];
   52|  1.13M|    const DataType sign_y = pred[1];
   53|       |
   54|  1.13M|    int32_t rotation_count = 0;
   55|  1.13M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 1.01M, False: 116k]
  ------------------
   56|  1.01M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 668k, False: 351k]
  ------------------
   57|   668k|        rotation_count = 0;
   58|   668k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 348k, False: 2.38k]
  ------------------
   59|   348k|        rotation_count = 3;
   60|   348k|      } else {
   61|  2.38k|        rotation_count = 1;
   62|  2.38k|      }
   63|  1.01M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 56.4k, False: 59.6k]
  ------------------
   64|  56.4k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 27.8k, False: 28.5k]
  ------------------
   65|  27.8k|        rotation_count = 2;
   66|  28.5k|      } else {
   67|  28.5k|        rotation_count = 1;
   68|  28.5k|      }
   69|  59.6k|    } else {
   70|  59.6k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 27.5k, False: 32.0k]
  ------------------
   71|  27.5k|        rotation_count = 0;
   72|  32.0k|      } else {
   73|  32.0k|        rotation_count = 3;
   74|  32.0k|      }
   75|  59.6k|    }
   76|  1.13M|    return rotation_count;
   77|  1.13M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   879k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   879k|    switch (rotation_count) {
   81|   411k|      case 1:
  ------------------
  |  Branch (81:7): [True: 411k, False: 467k]
  ------------------
   82|   411k|        return Point2(p[1], -p[0]);
   83|  55.7k|      case 2:
  ------------------
  |  Branch (83:7): [True: 55.7k, False: 823k]
  ------------------
   84|  55.7k|        return Point2(-p[0], -p[1]);
   85|   411k|      case 3:
  ------------------
  |  Branch (85:7): [True: 411k, False: 467k]
  ------------------
   86|   411k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 879k]
  ------------------
   88|      0|        return p;
   89|   879k|    }
   90|   879k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    288|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  2.46k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  2.23k|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  2.23k|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  2.23k|  bool InitCorrectionBounds() {
   84|  2.23k|    const int64_t dif =
   85|  2.23k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  2.23k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 2.23k]
  |  Branch (86:20): [True: 3, False: 2.23k]
  ------------------
   87|      3|      return false;
   88|      3|    }
   89|  2.23k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  2.23k|    max_correction_ = max_dif_ / 2;
   91|  2.23k|    min_correction_ = -max_correction_;
   92|  2.23k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 946, False: 1.28k]
  ------------------
   93|    946|      max_correction_ -= 1;
   94|    946|    }
   95|  2.23k|    return true;
   96|  2.23k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  1.72k|  void Init(int num_components) {
   56|  1.72k|    num_components_ = num_components;
   57|  1.72k|    clamped_value_.resize(num_components);
   58|  1.72k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  3.64M|      const DataTypeT *predicted_val) const {
   64|  59.6M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 56.0M, False: 3.64M]
  ------------------
   65|  56.0M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 182k, False: 55.8M]
  ------------------
   66|   182k|        clamped_value_[i] = max_value_;
   67|  55.8M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 611k, False: 55.2M]
  ------------------
   68|   611k|        clamped_value_[i] = min_value_;
   69|  55.2M|      } else {
   70|  55.2M|        clamped_value_[i] = predicted_val[i];
   71|  55.2M|      }
   72|  56.0M|    }
   73|  3.64M|    return clamped_value_.data();
   74|  3.64M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|   119M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|  56.0M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|   398k|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|  55.9M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    481|  int quantization_bits() const {
   78|    481|    DRACO_DCHECK(false);
   79|    481|    return -1;
   80|    481|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  2.55k|      : num_components_(0),
   45|  2.55k|        min_value_(0),
   46|  2.55k|        max_value_(0),
   47|  2.55k|        max_dif_(0),
   48|  2.55k|        max_correction_(0),
   49|  2.55k|        min_correction_(0) {}

_ZN5draco26SequentialAttributeDecoderC2Ev:
   20|  11.6k|    : decoder_(nullptr), attribute_(nullptr), attribute_id_(-1) {}
_ZN5draco26SequentialAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   23|  11.6k|                                      int attribute_id) {
   24|  11.6k|  decoder_ = decoder;
   25|  11.6k|  attribute_ = decoder->point_cloud()->attribute(attribute_id);
   26|  11.6k|  attribute_id_ = attribute_id;
   27|  11.6k|  return true;
   28|  11.6k|}
_ZN5draco26SequentialAttributeDecoder23DecodePortableAttributeERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   38|  6.52k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   39|  6.52k|  if (attribute_->num_components() <= 0 ||
  ------------------
  |  Branch (39:7): [True: 0, False: 6.52k]
  ------------------
   40|  6.52k|      !attribute_->Reset(point_ids.size())) {
  ------------------
  |  Branch (40:7): [True: 0, False: 6.52k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  6.52k|  if (!DecodeValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (43:7): [True: 1.13k, False: 5.38k]
  ------------------
   44|  1.13k|    return false;
   45|  1.13k|  }
   46|  5.38k|  return true;
   47|  6.52k|}
_ZN5draco26SequentialAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   50|  2.18k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   51|       |  // Default implementation does not apply any transform.
   52|  2.18k|  return true;
   53|  2.18k|}
_ZN5draco26SequentialAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   56|    321|    const std::vector<PointIndex> &point_ids) {
   57|       |  // Default implementation does not apply any transform.
   58|    321|  return true;
   59|    321|}
_ZN5draco26SequentialAttributeDecoder20GetPortableAttributeEv:
   61|  4.10k|const PointAttribute *SequentialAttributeDecoder::GetPortableAttribute() {
   62|       |  // If needed, copy point to attribute value index mapping from the final
   63|       |  // attribute to the portable attribute.
   64|  4.10k|  if (!attribute_->is_mapping_identity() && portable_attribute_ &&
  ------------------
  |  Branch (64:7): [True: 3.51k, False: 588]
  |  Branch (64:45): [True: 3.19k, False: 315]
  ------------------
   65|  3.19k|      portable_attribute_->is_mapping_identity()) {
  ------------------
  |  Branch (65:7): [True: 2.25k, False: 942]
  ------------------
   66|  2.25k|    portable_attribute_->SetExplicitMapping(attribute_->indices_map_size());
   67|  2.25k|    for (PointIndex i(0);
   68|  13.0M|         i < static_cast<uint32_t>(attribute_->indices_map_size()); ++i) {
  ------------------
  |  Branch (68:10): [True: 13.0M, False: 2.25k]
  ------------------
   69|  13.0M|      portable_attribute_->SetPointMapEntry(i, attribute_->mapped_index(i));
   70|  13.0M|    }
   71|  2.25k|  }
   72|  4.10k|  return portable_attribute_.get();
   73|  4.10k|}
_ZN5draco26SequentialAttributeDecoder20InitPredictionSchemeEPNS_25PredictionSchemeInterfaceE:
   76|  3.12k|    PredictionSchemeInterface *ps) {
   77|  4.58k|  for (int i = 0; i < ps->GetNumParentAttributes(); ++i) {
  ------------------
  |  Branch (77:19): [True: 1.46k, False: 3.11k]
  ------------------
   78|  1.46k|    const int att_id = decoder_->point_cloud()->GetNamedAttributeId(
   79|  1.46k|        ps->GetParentAttributeType(i));
   80|  1.46k|    if (att_id == -1) {
  ------------------
  |  Branch (80:9): [True: 0, False: 1.46k]
  ------------------
   81|      0|      return false;  // Requested attribute does not exist.
   82|      0|    }
   83|  1.46k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   84|  1.46k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.46k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:9): [True: 0, False: 1.46k]
  ------------------
   85|      0|      if (!ps->SetParentAttribute(decoder_->point_cloud()->attribute(att_id))) {
  ------------------
  |  Branch (85:11): [True: 0, False: 0]
  ------------------
   86|      0|        return false;
   87|      0|      }
   88|      0|    } else
   89|  1.46k|#endif
   90|  1.46k|    {
   91|  1.46k|      const PointAttribute *const pa = decoder_->GetPortableAttribute(att_id);
   92|  1.46k|      if (pa == nullptr || !ps->SetParentAttribute(pa)) {
  ------------------
  |  Branch (92:11): [True: 2, False: 1.46k]
  |  Branch (92:28): [True: 7, False: 1.46k]
  ------------------
   93|      9|        return false;
   94|      9|      }
   95|  1.46k|    }
   96|  1.46k|  }
   97|  3.11k|  return true;
   98|  3.12k|}
_ZN5draco26SequentialAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  101|    815|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  102|    815|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
  103|    815|  const int entry_size = static_cast<int>(attribute_->byte_stride());
  104|    815|  std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
  105|    815|  uint8_t *const value_data = value_data_ptr.get();
  106|    815|  int out_byte_pos = 0;
  107|       |  // Decode raw attribute values in their original format.
  108|  5.47k|  for (int i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (108:19): [True: 4.77k, False: 705]
  ------------------
  109|  4.77k|    if (!in_buffer->Decode(value_data, entry_size)) {
  ------------------
  |  Branch (109:9): [True: 110, False: 4.66k]
  ------------------
  110|    110|      return false;
  111|    110|    }
  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|    705|  return true;
  116|    815|}

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  4.81k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  2.56M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  3.12k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  17.1k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  5.41k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  5.41k|    portable_attribute_ = std::move(att);
   71|  5.41k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  18.7k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  11.6k|  virtual ~SequentialAttributeDecoder() = default;

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

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

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

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

_ZN5draco32SequentialNormalAttributeDecoderC2Ev:
   21|    772|SequentialNormalAttributeDecoder::SequentialNormalAttributeDecoder() {}
_ZN5draco32SequentialNormalAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   24|    772|                                            int attribute_id) {
   25|    772|  if (!SequentialIntegerAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (25:7): [True: 0, False: 772]
  ------------------
   26|      0|    return false;
   27|      0|  }
   28|       |  // Currently, this encoder works only for 3-component normal vectors.
   29|    772|  if (attribute()->num_components() != 3) {
  ------------------
  |  Branch (29:7): [True: 0, False: 772]
  ------------------
   30|      0|    return false;
   31|      0|  }
   32|       |  // Also the data type must be DT_FLOAT32.
   33|    772|  if (attribute()->data_type() != DT_FLOAT32) {
  ------------------
  |  Branch (33:7): [True: 2, False: 770]
  ------------------
   34|      2|    return false;
   35|      2|  }
   36|    770|  return true;
   37|    772|}
_ZN5draco32SequentialNormalAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   40|    604|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   41|    604|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   42|    604|  if (decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    604|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (42:7): [True: 0, False: 604]
  ------------------
   43|       |    // Note: in older bitstreams, we do not have a PortableAttribute() decoded
   44|       |    // at this stage so we cannot pass it down to the DecodeParameters() call.
   45|       |    // It still works fine for octahedral transform because it does not need to
   46|       |    // use any data from the attribute.
   47|      0|    if (!octahedral_transform_.DecodeParameters(*attribute(), in_buffer)) {
  ------------------
  |  Branch (47:9): [True: 0, False: 0]
  ------------------
   48|      0|      return false;
   49|      0|    }
   50|      0|  }
   51|    604|#endif
   52|    604|  return SequentialIntegerAttributeDecoder::DecodeIntegerValues(point_ids,
   53|    604|                                                                in_buffer);
   54|    604|}
_ZN5draco32SequentialNormalAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   57|    370|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   58|    370|  if (decoder()->bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    370|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (58:7): [True: 370, False: 0]
  ------------------
   59|       |    // For newer file version, decode attribute transform data here.
   60|    370|    if (!octahedral_transform_.DecodeParameters(*GetPortableAttribute(),
  ------------------
  |  Branch (60:9): [True: 192, False: 178]
  ------------------
   61|    370|                                                in_buffer)) {
   62|    192|      return false;
   63|    192|    }
   64|    370|  }
   65|       |
   66|       |  // Store the decoded transform data in portable attribute.
   67|    178|  return octahedral_transform_.TransferToAttribute(portable_attribute());
   68|    370|}
_ZN5draco32SequentialNormalAttributeDecoder11StoreValuesEj:
   70|    176|bool SequentialNormalAttributeDecoder::StoreValues(uint32_t num_points) {
   71|       |  // Convert all quantized values back to floats.
   72|    176|  return octahedral_transform_.InverseTransformAttribute(
   73|    176|      *GetPortableAttribute(), attribute());
   74|    176|}

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  5.56M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  5.56M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  5.56M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  5.56M|    const int remaining = 32 - num_used_bits_;
   54|  5.56M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 5.20M, False: 357k]
  ------------------
   55|  5.20M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 4.77M, False: 428k]
  ------------------
   56|  4.77M|        return false;
   57|  4.77M|      }
   58|   428k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   428k|      num_used_bits_ += nbits;
   60|   428k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 14.3k, False: 413k]
  ------------------
   61|  14.3k|        ++pos_;
   62|  14.3k|        num_used_bits_ = 0;
   63|  14.3k|      }
   64|   428k|    } else {
   65|   357k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 346k, False: 11.2k]
  ------------------
   66|   346k|        return false;
   67|   346k|      }
   68|  11.2k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  11.2k|      num_used_bits_ = nbits - remaining;
   70|  11.2k|      ++pos_;
   71|  11.2k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  11.2k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  11.2k|    }
   74|   439k|    return true;
   75|  5.56M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  6.40M|  bool DecodeNextBit() {
   35|  6.40M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  6.40M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 6.02M, False: 379k]
  ------------------
   37|  6.02M|      return false;
   38|  6.02M|    }
   39|   379k|    const bool bit = *pos_ & selector;
   40|   379k|    ++num_used_bits_;
   41|   379k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 11.7k, False: 368k]
  ------------------
   42|  11.7k|      ++pos_;
   43|  11.7k|      num_used_bits_ = 0;
   44|  11.7k|    }
   45|   379k|    return bit;
   46|  6.40M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    395|  void EndDecoding() {}

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

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  28.7k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  20.5k|                                const uint8_t *const buf, int offset) {
  301|  20.5k|  unsigned x;
  302|  20.5k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 32, False: 20.4k]
  ------------------
  303|     32|    return 1;
  304|     32|  }
  305|  20.4k|  ans->buf = buf;
  306|  20.4k|  x = buf[offset - 1] >> 6;
  307|  20.4k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 18.1k, False: 2.34k]
  ------------------
  308|  18.1k|    ans->buf_offset = offset - 1;
  309|  18.1k|    ans->state = buf[offset - 1] & 0x3F;
  310|  18.1k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.10k, False: 240]
  ------------------
  311|  2.10k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 2, False: 2.09k]
  ------------------
  312|      2|      return 1;
  313|      2|    }
  314|  2.09k|    ans->buf_offset = offset - 2;
  315|  2.09k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.09k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 235, False: 5]
  ------------------
  317|    235|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 2, False: 233]
  ------------------
  318|      2|      return 1;
  319|      2|    }
  320|    233|    ans->buf_offset = offset - 3;
  321|    233|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    233|  } else {
  323|      5|    return 1;
  324|      5|  }
  325|  20.4k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  20.4k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  20.4k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  20.4k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  20.4k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 3, False: 20.4k]
  ------------------
  327|      3|    return 1;
  328|      3|  }
  329|  20.4k|  return 0;
  330|  20.4k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.09k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.09k|  uint32_t val;
   69|  2.09k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.09k|  val = mem[1] << 8;
   72|  2.09k|  val |= mem[0];
   73|  2.09k|  return val;
   74|  2.09k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    233|static uint32_t mem_get_le24(const void *vmem) {
   77|    233|  uint32_t val;
   78|    233|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    233|  val = mem[2] << 16;
   81|    233|  val |= mem[1] << 8;
   82|    233|  val |= mem[0];
   83|    233|  return val;
   84|    233|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  10.3G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  10.3G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  10.3G|  unsigned quot, rem, x, xn;
  172|  10.3G|#endif
  173|  10.3G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  10.3G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  10.3G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  20.6G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 9.63G, False: 683M]
  |  Branch (174:40): [True: 80.3k, False: 9.63G]
  ------------------
  175|  80.3k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  80.3k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  80.3k|  }
  177|       |#if DRACO_ANS_IMPL1
  178|       |  val = ans->state % DRACO_ANS_P8_PRECISION < p;
  179|       |  l_s = val ? p : p0;
  180|       |  ans->state = (ans->state / DRACO_ANS_P8_PRECISION) * l_s +
  181|       |               ans->state % DRACO_ANS_P8_PRECISION - (!val * p);
  182|       |#else
  183|  10.3G|  x = ans->state;
  184|  10.3G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  10.3G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  10.3G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  10.3G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  10.3G|  xn = quot * p;
  187|  10.3G|  val = rem < p;
  188|  10.3G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  20.6G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 9.63G, False: 678M]
  |  |  ------------------
  ------------------
  189|  9.63G|    ans->state = xn + rem;
  190|  9.63G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   678M|    ans->state = x - xn - p;
  193|   678M|  }
  194|  10.3G|#endif
  195|  10.3G|  return val;
  196|  10.3G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  46.5k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  46.5k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  46.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  46.5k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  1.71k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|    928|                                       uint32_t num_symbols) {
  482|    928|    lut_table_.resize(rans_precision);
  483|    928|    probability_table_.resize(num_symbols);
  484|    928|    uint32_t cum_prob = 0;
  485|    928|    uint32_t act_prob = 0;
  486|  6.84k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.03k, False: 815]
  ------------------
  487|  6.03k|      probability_table_[i].prob = token_probs[i];
  488|  6.03k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.03k|      cum_prob += token_probs[i];
  490|  6.03k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 113, False: 5.91k]
  ------------------
  491|    113|        return false;
  492|    113|      }
  493|  3.10M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 3.09M, False: 5.91k]
  ------------------
  494|  3.09M|        lut_table_[j] = i;
  495|  3.09M|      }
  496|  5.91k|      act_prob = cum_prob;
  497|  5.91k|    }
  498|    815|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 82, False: 733]
  ------------------
  499|     82|      return false;
  500|     82|    }
  501|    733|    return true;
  502|    815|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|    680|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    680|    unsigned x;
  423|    680|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 48, False: 632]
  ------------------
  424|     48|      return 1;
  425|     48|    }
  426|    632|    ans_.buf = buf;
  427|    632|    x = buf[offset - 1] >> 6;
  428|    632|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 386, False: 246]
  ------------------
  429|    386|      ans_.buf_offset = offset - 1;
  430|    386|      ans_.state = buf[offset - 1] & 0x3F;
  431|    386|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 87, False: 159]
  ------------------
  432|     87|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 87]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     87|      ans_.buf_offset = offset - 2;
  436|     87|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    159|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 89, False: 70]
  ------------------
  438|     89|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 86]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     86|      ans_.buf_offset = offset - 3;
  442|     86|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     86|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 70, False: 0]
  ------------------
  444|     70|      ans_.buf_offset = offset - 4;
  445|     70|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     70|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    629|    ans_.state += l_rans_base;
  450|    629|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    629|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 67, False: 562]
  ------------------
  451|     67|      return 1;
  452|     67|    }
  453|    562|    return 0;
  454|    629|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    138|static uint32_t mem_get_le16(const void *vmem) {
   68|    138|  uint32_t val;
   69|    138|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    138|  val = mem[1] << 8;
   72|    138|  val |= mem[0];
   73|    138|  return val;
   74|    138|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    133|static uint32_t mem_get_le24(const void *vmem) {
   77|    133|  uint32_t val;
   78|    133|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    133|  val = mem[2] << 16;
   81|    133|  val |= mem[1] << 8;
   82|    133|  val |= mem[0];
   83|    133|  return val;
   84|    133|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    148|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    148|  uint32_t val;
   88|    148|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    148|  val = mem[3] << 24;
   91|    148|  val |= mem[2] << 16;
   92|    148|  val |= mem[1] << 8;
   93|    148|  val |= mem[0];
   94|    148|  return val;
   95|    148|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  23.3M|  inline int rans_read() {
  463|  23.3M|    unsigned rem;
  464|  23.3M|    unsigned quo;
  465|  23.3M|    struct rans_dec_sym sym;
  466|  23.3M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 17.2M, False: 6.08M]
  |  Branch (466:40): [True: 15.0k, False: 17.2M]
  ------------------
  467|  15.0k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  15.0k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  15.0k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  23.3M|    quo = ans_.state / rans_precision;
  472|  23.3M|    rem = ans_.state % rans_precision;
  473|  23.3M|    fetch_sym(&sym, rem);
  474|  23.3M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  23.3M|    return sym.val;
  476|  23.3M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  23.3M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  23.3M|    uint32_t symbol = lut_table_[rem];
  507|  23.3M|    out->val = symbol;
  508|  23.3M|    out->prob = probability_table_[symbol].prob;
  509|  23.3M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  23.3M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|    530|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    123|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|     67|                                       uint32_t num_symbols) {
  482|     67|    lut_table_.resize(rans_precision);
  483|     67|    probability_table_.resize(num_symbols);
  484|     67|    uint32_t cum_prob = 0;
  485|     67|    uint32_t act_prob = 0;
  486|  12.0k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 11.9k, False: 58]
  ------------------
  487|  11.9k|      probability_table_[i].prob = token_probs[i];
  488|  11.9k|      probability_table_[i].cum_prob = cum_prob;
  489|  11.9k|      cum_prob += token_probs[i];
  490|  11.9k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 9, False: 11.9k]
  ------------------
  491|      9|        return false;
  492|      9|      }
  493|   514k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 502k, False: 11.9k]
  ------------------
  494|   502k|        lut_table_[j] = i;
  495|   502k|      }
  496|  11.9k|      act_prob = cum_prob;
  497|  11.9k|    }
  498|     58|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 3, False: 55]
  ------------------
  499|      3|      return false;
  500|      3|    }
  501|     55|    return true;
  502|     58|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     37|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     37|    unsigned x;
  423|     37|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 5, False: 32]
  ------------------
  424|      5|      return 1;
  425|      5|    }
  426|     32|    ans_.buf = buf;
  427|     32|    x = buf[offset - 1] >> 6;
  428|     32|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 14, False: 18]
  ------------------
  429|     14|      ans_.buf_offset = offset - 1;
  430|     14|      ans_.state = buf[offset - 1] & 0x3F;
  431|     18|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 3, False: 15]
  ------------------
  432|      3|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 3]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     15|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 7, False: 8]
  ------------------
  438|      7|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 7]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      7|      ans_.buf_offset = offset - 3;
  442|      7|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      8|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 8, False: 0]
  ------------------
  444|      8|      ans_.buf_offset = offset - 4;
  445|      8|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      8|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     32|    ans_.state += l_rans_base;
  450|     32|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     32|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 8, False: 24]
  ------------------
  451|      8|      return 1;
  452|      8|    }
  453|     24|    return 0;
  454|     32|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  85.0k|  inline int rans_read() {
  463|  85.0k|    unsigned rem;
  464|  85.0k|    unsigned quo;
  465|  85.0k|    struct rans_dec_sym sym;
  466|  85.9k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 82.6k, False: 3.34k]
  |  Branch (466:40): [True: 892, False: 81.7k]
  ------------------
  467|    892|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    892|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    892|    }
  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|  85.0k|    quo = ans_.state / rans_precision;
  472|  85.0k|    rem = ans_.state % rans_precision;
  473|  85.0k|    fetch_sym(&sym, rem);
  474|  85.0k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  85.0k|    return sym.val;
  476|  85.0k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  85.0k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  85.0k|    uint32_t symbol = lut_table_[rem];
  507|  85.0k|    out->val = symbol;
  508|  85.0k|    out->prob = probability_table_[symbol].prob;
  509|  85.0k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  85.0k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     24|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|     94|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|     53|                                       uint32_t num_symbols) {
  482|     53|    lut_table_.resize(rans_precision);
  483|     53|    probability_table_.resize(num_symbols);
  484|     53|    uint32_t cum_prob = 0;
  485|     53|    uint32_t act_prob = 0;
  486|  5.38k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 5.33k, False: 47]
  ------------------
  487|  5.33k|      probability_table_[i].prob = token_probs[i];
  488|  5.33k|      probability_table_[i].cum_prob = cum_prob;
  489|  5.33k|      cum_prob += token_probs[i];
  490|  5.33k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 6, False: 5.33k]
  ------------------
  491|      6|        return false;
  492|      6|      }
  493|  1.51M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.50M, False: 5.33k]
  ------------------
  494|  1.50M|        lut_table_[j] = i;
  495|  1.50M|      }
  496|  5.33k|      act_prob = cum_prob;
  497|  5.33k|    }
  498|     47|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 6, False: 41]
  ------------------
  499|      6|      return false;
  500|      6|    }
  501|     41|    return true;
  502|     47|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     24|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     24|    unsigned x;
  423|     24|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 24]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     24|    ans_.buf = buf;
  427|     24|    x = buf[offset - 1] >> 6;
  428|     24|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 7, False: 17]
  ------------------
  429|      7|      ans_.buf_offset = offset - 1;
  430|      7|      ans_.state = buf[offset - 1] & 0x3F;
  431|     17|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 9, False: 8]
  ------------------
  432|      9|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 9]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      9|      ans_.buf_offset = offset - 2;
  436|      9|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      9|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 1, False: 7]
  ------------------
  438|      1|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 1]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      1|      ans_.buf_offset = offset - 3;
  442|      1|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      7|    } 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|     24|    ans_.state += l_rans_base;
  450|     24|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     24|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 7, False: 17]
  ------------------
  451|      7|      return 1;
  452|      7|    }
  453|     17|    return 0;
  454|     24|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|  78.9k|  inline int rans_read() {
  463|  78.9k|    unsigned rem;
  464|  78.9k|    unsigned quo;
  465|  78.9k|    struct rans_dec_sym sym;
  466|  81.8k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 59.2k, False: 22.5k]
  |  Branch (466:40): [True: 2.88k, False: 56.3k]
  ------------------
  467|  2.88k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.88k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.88k|    }
  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.9k|    quo = ans_.state / rans_precision;
  472|  78.9k|    rem = ans_.state % rans_precision;
  473|  78.9k|    fetch_sym(&sym, rem);
  474|  78.9k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  78.9k|    return sym.val;
  476|  78.9k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|  78.9k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  78.9k|    uint32_t symbol = lut_table_[rem];
  507|  78.9k|    out->val = symbol;
  508|  78.9k|    out->prob = probability_table_[symbol].prob;
  509|  78.9k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  78.9k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     17|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|     77|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|     25|                                       uint32_t num_symbols) {
  482|     25|    lut_table_.resize(rans_precision);
  483|     25|    probability_table_.resize(num_symbols);
  484|     25|    uint32_t cum_prob = 0;
  485|     25|    uint32_t act_prob = 0;
  486|  7.15k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 7.14k, False: 16]
  ------------------
  487|  7.14k|      probability_table_[i].prob = token_probs[i];
  488|  7.14k|      probability_table_[i].cum_prob = cum_prob;
  489|  7.14k|      cum_prob += token_probs[i];
  490|  7.14k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 9, False: 7.13k]
  ------------------
  491|      9|        return false;
  492|      9|      }
  493|  1.37M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.36M, False: 7.13k]
  ------------------
  494|  1.36M|        lut_table_[j] = i;
  495|  1.36M|      }
  496|  7.13k|      act_prob = cum_prob;
  497|  7.13k|    }
  498|     16|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 1, False: 15]
  ------------------
  499|      1|      return false;
  500|      1|    }
  501|     15|    return true;
  502|     16|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|      8|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      8|    unsigned x;
  423|      8|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 8]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      8|    ans_.buf = buf;
  427|      8|    x = buf[offset - 1] >> 6;
  428|      8|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 7, False: 1]
  ------------------
  429|      7|      ans_.buf_offset = offset - 1;
  430|      7|      ans_.state = buf[offset - 1] & 0x3F;
  431|      7|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 1, False: 0]
  ------------------
  432|      1|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 1]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      1|      ans_.buf_offset = offset - 2;
  436|      1|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      1|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 0]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      0|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      8|    ans_.state += l_rans_base;
  450|      8|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      8|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 8]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      8|    return 0;
  454|      8|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|  57.7k|  inline int rans_read() {
  463|  57.7k|    unsigned rem;
  464|  57.7k|    unsigned quo;
  465|  57.7k|    struct rans_dec_sym sym;
  466|  58.2k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 30.9k, False: 27.3k]
  |  Branch (466:40): [True: 524, False: 30.4k]
  ------------------
  467|    524|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    524|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    524|    }
  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|  57.7k|    quo = ans_.state / rans_precision;
  472|  57.7k|    rem = ans_.state % rans_precision;
  473|  57.7k|    fetch_sym(&sym, rem);
  474|  57.7k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  57.7k|    return sym.val;
  476|  57.7k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|  57.7k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  57.7k|    uint32_t symbol = lut_table_[rem];
  507|  57.7k|    out->val = symbol;
  508|  57.7k|    out->prob = probability_table_[symbol].prob;
  509|  57.7k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  57.7k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|      8|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|     99|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|     56|                                       uint32_t num_symbols) {
  482|     56|    lut_table_.resize(rans_precision);
  483|     56|    probability_table_.resize(num_symbols);
  484|     56|    uint32_t cum_prob = 0;
  485|     56|    uint32_t act_prob = 0;
  486|  4.87k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.82k, False: 49]
  ------------------
  487|  4.82k|      probability_table_[i].prob = token_probs[i];
  488|  4.82k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.82k|      cum_prob += token_probs[i];
  490|  4.82k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 7, False: 4.82k]
  ------------------
  491|      7|        return false;
  492|      7|      }
  493|  11.5M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 11.5M, False: 4.82k]
  ------------------
  494|  11.5M|        lut_table_[j] = i;
  495|  11.5M|      }
  496|  4.82k|      act_prob = cum_prob;
  497|  4.82k|    }
  498|     49|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 8, False: 41]
  ------------------
  499|      8|      return false;
  500|      8|    }
  501|     41|    return true;
  502|     49|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     18|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     18|    unsigned x;
  423|     18|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 18]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     18|    ans_.buf = buf;
  427|     18|    x = buf[offset - 1] >> 6;
  428|     18|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 3, False: 15]
  ------------------
  429|      3|      ans_.buf_offset = offset - 1;
  430|      3|      ans_.state = buf[offset - 1] & 0x3F;
  431|     15|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 6, False: 9]
  ------------------
  432|      6|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 6]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      6|      ans_.buf_offset = offset - 2;
  436|      6|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      9|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 9, False: 0]
  ------------------
  438|      9|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 9]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      9|      ans_.buf_offset = offset - 3;
  442|      9|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      9|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     18|    ans_.state += l_rans_base;
  450|     18|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     18|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 18]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|     18|    return 0;
  454|     18|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  24.4k|  inline int rans_read() {
  463|  24.4k|    unsigned rem;
  464|  24.4k|    unsigned quo;
  465|  24.4k|    struct rans_dec_sym sym;
  466|  24.5k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 22.7k, False: 1.75k]
  |  Branch (466:40): [True: 35, False: 22.7k]
  ------------------
  467|     35|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|     35|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|     35|    }
  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|  24.4k|    quo = ans_.state / rans_precision;
  472|  24.4k|    rem = ans_.state % rans_precision;
  473|  24.4k|    fetch_sym(&sym, rem);
  474|  24.4k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  24.4k|    return sym.val;
  476|  24.4k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  24.4k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  24.4k|    uint32_t symbol = lut_table_[rem];
  507|  24.4k|    out->val = symbol;
  508|  24.4k|    out->prob = probability_table_[symbol].prob;
  509|  24.4k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  24.4k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     18|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    132|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|     60|                                       uint32_t num_symbols) {
  482|     60|    lut_table_.resize(rans_precision);
  483|     60|    probability_table_.resize(num_symbols);
  484|     60|    uint32_t cum_prob = 0;
  485|     60|    uint32_t act_prob = 0;
  486|  4.95k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.90k, False: 45]
  ------------------
  487|  4.90k|      probability_table_[i].prob = token_probs[i];
  488|  4.90k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.90k|      cum_prob += token_probs[i];
  490|  4.90k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 15, False: 4.89k]
  ------------------
  491|     15|        return false;
  492|     15|      }
  493|  22.2M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 22.2M, False: 4.89k]
  ------------------
  494|  22.2M|        lut_table_[j] = i;
  495|  22.2M|      }
  496|  4.89k|      act_prob = cum_prob;
  497|  4.89k|    }
  498|     45|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 9, False: 36]
  ------------------
  499|      9|      return false;
  500|      9|    }
  501|     36|    return true;
  502|     45|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     36|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     36|    unsigned x;
  423|     36|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 36]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     36|    ans_.buf = buf;
  427|     36|    x = buf[offset - 1] >> 6;
  428|     36|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 12, False: 24]
  ------------------
  429|     12|      ans_.buf_offset = offset - 1;
  430|     12|      ans_.state = buf[offset - 1] & 0x3F;
  431|     24|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 8, False: 16]
  ------------------
  432|      8|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 2, False: 6]
  ------------------
  433|      2|        return 1;
  434|      2|      }
  435|      6|      ans_.buf_offset = offset - 2;
  436|      6|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     16|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 10, False: 6]
  ------------------
  438|     10|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 9]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|      9|      ans_.buf_offset = offset - 3;
  442|      9|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      9|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 6, False: 0]
  ------------------
  444|      6|      ans_.buf_offset = offset - 4;
  445|      6|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      6|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     33|    ans_.state += l_rans_base;
  450|     33|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     33|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 5, False: 28]
  ------------------
  451|      5|      return 1;
  452|      5|    }
  453|     28|    return 0;
  454|     33|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   127k|  inline int rans_read() {
  463|   127k|    unsigned rem;
  464|   127k|    unsigned quo;
  465|   127k|    struct rans_dec_sym sym;
  466|   127k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 69.5k, False: 57.9k]
  |  Branch (466:40): [True: 263, False: 69.3k]
  ------------------
  467|    263|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    263|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    263|    }
  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|   127k|    quo = ans_.state / rans_precision;
  472|   127k|    rem = ans_.state % rans_precision;
  473|   127k|    fetch_sym(&sym, rem);
  474|   127k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   127k|    return sym.val;
  476|   127k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   127k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   127k|    uint32_t symbol = lut_table_[rem];
  507|   127k|    out->val = symbol;
  508|   127k|    out->prob = probability_table_[symbol].prob;
  509|   127k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   127k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     28|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|    583|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    343|                                       uint32_t num_symbols) {
  482|    343|    lut_table_.resize(rans_precision);
  483|    343|    probability_table_.resize(num_symbols);
  484|    343|    uint32_t cum_prob = 0;
  485|    343|    uint32_t act_prob = 0;
  486|  9.65k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 9.32k, False: 332]
  ------------------
  487|  9.32k|      probability_table_[i].prob = token_probs[i];
  488|  9.32k|      probability_table_[i].cum_prob = cum_prob;
  489|  9.32k|      cum_prob += token_probs[i];
  490|  9.32k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 11, False: 9.31k]
  ------------------
  491|     11|        return false;
  492|     11|      }
  493|   332M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 332M, False: 9.31k]
  ------------------
  494|   332M|        lut_table_[j] = i;
  495|   332M|      }
  496|  9.31k|      act_prob = cum_prob;
  497|  9.31k|    }
  498|    332|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 24, False: 308]
  ------------------
  499|     24|      return false;
  500|     24|    }
  501|    308|    return true;
  502|    332|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    158|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    158|    unsigned x;
  423|    158|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 158]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|    158|    ans_.buf = buf;
  427|    158|    x = buf[offset - 1] >> 6;
  428|    158|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 52, False: 106]
  ------------------
  429|     52|      ans_.buf_offset = offset - 1;
  430|     52|      ans_.state = buf[offset - 1] & 0x3F;
  431|    106|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 26, False: 80]
  ------------------
  432|     26|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 26]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     26|      ans_.buf_offset = offset - 2;
  436|     26|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     80|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 23, False: 57]
  ------------------
  438|     23|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 2, False: 21]
  ------------------
  439|      2|        return 1;
  440|      2|      }
  441|     21|      ans_.buf_offset = offset - 3;
  442|     21|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     57|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 57, False: 0]
  ------------------
  444|     57|      ans_.buf_offset = offset - 4;
  445|     57|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     57|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    156|    ans_.state += l_rans_base;
  450|    156|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    156|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 34, False: 122]
  ------------------
  451|     34|      return 1;
  452|     34|    }
  453|    122|    return 0;
  454|    156|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  19.2M|  inline int rans_read() {
  463|  19.2M|    unsigned rem;
  464|  19.2M|    unsigned quo;
  465|  19.2M|    struct rans_dec_sym sym;
  466|  19.2M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 14.3M, False: 4.85M]
  |  Branch (466:40): [True: 4.24k, False: 14.3M]
  ------------------
  467|  4.24k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.24k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  4.24k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  19.2M|    quo = ans_.state / rans_precision;
  472|  19.2M|    rem = ans_.state % rans_precision;
  473|  19.2M|    fetch_sym(&sym, rem);
  474|  19.2M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  19.2M|    return sym.val;
  476|  19.2M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  19.2M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  19.2M|    uint32_t symbol = lut_table_[rem];
  507|  19.2M|    out->val = symbol;
  508|  19.2M|    out->prob = probability_table_[symbol].prob;
  509|  19.2M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  19.2M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    122|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    519|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    519|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    519|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 519]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    519|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    519|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    519|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 38, False: 481]
  ------------------
   67|     38|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 37]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     38|  } else
   72|    481|#endif
   73|    481|  {
   74|    481|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 477]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    481|  }
   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|    514|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 26, False: 488]
  ------------------
   83|     26|    return false;
   84|     26|  }
   85|    488|  probability_table_.resize(num_symbols_);
   86|    488|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 200, False: 288]
  ------------------
   87|    200|    return true;
   88|    200|  }
   89|       |  // Decode the table.
   90|  21.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 21.6k, False: 160]
  ------------------
   91|  21.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|  21.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 21.6k]
  ------------------
   95|     14|      return false;
   96|     14|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  21.6k|    const int token = prob_data & 3;
  102|  21.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.07k, False: 15.5k]
  ------------------
  103|  6.07k|      const uint32_t offset = prob_data >> 2;
  104|  6.07k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 102, False: 5.97k]
  ------------------
  105|    102|        return false;
  106|    102|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   231k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 225k, False: 5.97k]
  ------------------
  109|   225k|        probability_table_[i + j] = 0;
  110|   225k|      }
  111|  5.97k|      i += offset;
  112|  15.5k|    } else {
  113|  15.5k|      const int extra_bytes = token;
  114|  15.5k|      uint32_t prob = prob_data >> 2;
  115|  23.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 7.95k, False: 15.5k]
  ------------------
  116|  7.95k|        uint8_t eb;
  117|  7.95k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 7.94k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  7.94k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  7.94k|      }
  124|  15.5k|      probability_table_[i] = prob;
  125|  15.5k|    }
  126|  21.6k|  }
  127|    160|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 85, False: 75]
  ------------------
  128|     85|    return false;
  129|     85|  }
  130|     75|  return true;
  131|    160|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    191|    DecoderBuffer *buffer) {
  136|    191|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    191|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    191|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    191|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 175]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 15]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     16|  } else
  145|    175|#endif
  146|    175|  {
  147|    175|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 174]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    175|  }
  151|    189|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 30, False: 159]
  ------------------
  152|     30|    return false;
  153|     30|  }
  154|    159|  const uint8_t *const data_head =
  155|    159|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    159|  buffer->Advance(bytes_encoded);
  158|    159|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 55, False: 104]
  ------------------
  159|     55|    return false;
  160|     55|  }
  161|    104|  return true;
  162|    159|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    188|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  5.00M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|     72|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     72|  ans_.read_end();
  167|     72|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    278|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    278|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    278|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 278]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    278|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    278|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    278|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 32, False: 246]
  ------------------
   67|     32|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 32]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     32|  } else
   72|    246|#endif
   73|    246|  {
   74|    246|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 245]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    246|  }
   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|    277|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 23, False: 254]
  ------------------
   83|     23|    return false;
   84|     23|  }
   85|    254|  probability_table_.resize(num_symbols_);
   86|    254|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 251]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   125k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 125k, False: 179]
  ------------------
   91|   125k|    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|   125k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 125k]
  ------------------
   95|     16|      return false;
   96|     16|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   125k|    const int token = prob_data & 3;
  102|   125k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 16.2k, False: 109k]
  ------------------
  103|  16.2k|      const uint32_t offset = prob_data >> 2;
  104|  16.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 42, False: 16.2k]
  ------------------
  105|     42|        return false;
  106|     42|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   665k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 649k, False: 16.2k]
  ------------------
  109|   649k|        probability_table_[i + j] = 0;
  110|   649k|      }
  111|  16.2k|      i += offset;
  112|   109k|    } else {
  113|   109k|      const int extra_bytes = token;
  114|   109k|      uint32_t prob = prob_data >> 2;
  115|   135k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 25.5k, False: 109k]
  ------------------
  116|  25.5k|        uint8_t eb;
  117|  25.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 25.5k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  25.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  25.5k|      }
  124|   109k|      probability_table_[i] = prob;
  125|   109k|    }
  126|   125k|  }
  127|    179|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 67, False: 112]
  ------------------
  128|     67|    return false;
  129|     67|  }
  130|    112|  return true;
  131|    179|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    115|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    112|    DecoderBuffer *buffer) {
  136|    112|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    112|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    112|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    112|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 111]
  ------------------
  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|    111|#endif
  146|    111|  {
  147|    111|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 111]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    111|  }
  151|    112|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 5, False: 107]
  ------------------
  152|      5|    return false;
  153|      5|  }
  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: 9, False: 98]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|     98|  return true;
  162|    107|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  2.36M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|     98|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     98|  ans_.read_end();
  167|     98|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    199|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    199|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    199|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 199]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    199|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    199|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    199|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 40, False: 159]
  ------------------
   67|     40|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 40]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     40|  } else
   72|    159|#endif
   73|    159|  {
   74|    159|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 159]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    159|  }
   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|    199|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 191]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|    191|  probability_table_.resize(num_symbols_);
   86|    191|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 190]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   427k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 427k, False: 115]
  ------------------
   91|   427k|    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|   427k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 427k]
  ------------------
   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|   427k|    const int token = prob_data & 3;
  102|   427k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 59.4k, False: 368k]
  ------------------
  103|  59.4k|      const uint32_t offset = prob_data >> 2;
  104|  59.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 59.3k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.21M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.15M, False: 59.3k]
  ------------------
  109|  1.15M|        probability_table_[i + j] = 0;
  110|  1.15M|      }
  111|  59.3k|      i += offset;
  112|   368k|    } else {
  113|   368k|      const int extra_bytes = token;
  114|   368k|      uint32_t prob = prob_data >> 2;
  115|   690k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 322k, False: 368k]
  ------------------
  116|   322k|        uint8_t eb;
  117|   322k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 322k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   322k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   322k|      }
  124|   368k|      probability_table_[i] = prob;
  125|   368k|    }
  126|   427k|  }
  127|    115|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 95]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|     95|  return true;
  131|    115|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|     96|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|     95|    DecoderBuffer *buffer) {
  136|     95|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     95|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     95|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     95|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 24, False: 71]
  ------------------
  140|     24|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 24]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     24|  } else
  145|     71|#endif
  146|     71|  {
  147|     71|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 71]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     71|  }
  151|     95|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 29, False: 66]
  ------------------
  152|     29|    return false;
  153|     29|  }
  154|     66|  const uint8_t *const data_head =
  155|     66|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     66|  buffer->Advance(bytes_encoded);
  158|     66|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 13, False: 53]
  ------------------
  159|     13|    return false;
  160|     13|  }
  161|     53|  return true;
  162|     66|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  2.19M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|     53|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     53|  ans_.read_end();
  167|     53|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    176|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    176|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    176|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 176]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    176|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    176|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    176|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 34, False: 142]
  ------------------
   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|    142|#endif
   73|    142|  {
   74|    142|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 142]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    142|  }
   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|    176|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 172]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|    172|  probability_table_.resize(num_symbols_);
   86|    172|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 171]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  5.87k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 5.73k, False: 137]
  ------------------
   91|  5.73k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  5.73k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 5.71k]
  ------------------
   95|     16|      return false;
   96|     16|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  5.71k|    const int token = prob_data & 3;
  102|  5.71k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.03k, False: 2.68k]
  ------------------
  103|  3.03k|      const uint32_t offset = prob_data >> 2;
  104|  3.03k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 3.02k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   109k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 106k, False: 3.02k]
  ------------------
  109|   106k|        probability_table_[i + j] = 0;
  110|   106k|      }
  111|  3.02k|      i += offset;
  112|  3.02k|    } else {
  113|  2.68k|      const int extra_bytes = token;
  114|  2.68k|      uint32_t prob = prob_data >> 2;
  115|  4.35k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.67k, False: 2.68k]
  ------------------
  116|  1.67k|        uint8_t eb;
  117|  1.67k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 5, False: 1.66k]
  ------------------
  118|      5|          return false;
  119|      5|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.66k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.66k|      }
  124|  2.68k|      probability_table_[i] = prob;
  125|  2.68k|    }
  126|  5.71k|  }
  127|    137|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 132]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|    132|  return true;
  131|    137|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    133|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    132|    DecoderBuffer *buffer) {
  136|    132|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    132|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    132|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    132|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 105]
  ------------------
  140|     27|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 26]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     27|  } else
  145|    105|#endif
  146|    105|  {
  147|    105|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 105]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    105|  }
  151|    131|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 30, False: 101]
  ------------------
  152|     30|    return false;
  153|     30|  }
  154|    101|  const uint8_t *const data_head =
  155|    101|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    101|  buffer->Advance(bytes_encoded);
  158|    101|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 12, False: 89]
  ------------------
  159|     12|    return false;
  160|     12|  }
  161|     89|  return true;
  162|    101|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  7.08M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|     89|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     89|  ans_.read_end();
  167|     89|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    139|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    139|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    139|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 139]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    139|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    139|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    139|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 8, False: 131]
  ------------------
   67|      8|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 8]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      8|  } else
   72|    131|#endif
   73|    131|  {
   74|    131|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 131]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    131|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    139|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 131]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|    131|  probability_table_.resize(num_symbols_);
   86|    131|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 131]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  11.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 11.2k, False: 105]
  ------------------
   91|  11.2k|    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.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 15, False: 11.2k]
  ------------------
   95|     15|      return false;
   96|     15|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  11.2k|    const int token = prob_data & 3;
  102|  11.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.65k, False: 6.56k]
  ------------------
  103|  4.65k|      const uint32_t offset = prob_data >> 2;
  104|  4.65k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 4.65k]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   180k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 175k, False: 4.65k]
  ------------------
  109|   175k|        probability_table_[i + j] = 0;
  110|   175k|      }
  111|  4.65k|      i += offset;
  112|  6.56k|    } else {
  113|  6.56k|      const int extra_bytes = token;
  114|  6.56k|      uint32_t prob = prob_data >> 2;
  115|  10.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.04k, False: 6.55k]
  ------------------
  116|  4.04k|        uint8_t eb;
  117|  4.04k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 4.04k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.04k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.04k|      }
  124|  6.55k|      probability_table_[i] = prob;
  125|  6.55k|    }
  126|  11.2k|  }
  127|    105|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 103]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|    103|  return true;
  131|    105|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    103|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    103|    DecoderBuffer *buffer) {
  136|    103|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    103|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    103|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    103|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 103]
  ------------------
  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|    103|#endif
  146|    103|  {
  147|    103|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 103]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    103|  }
  151|    103|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 103]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|    103|  const uint8_t *const data_head =
  155|    103|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    103|  buffer->Advance(bytes_encoded);
  158|    103|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 9, False: 94]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|     94|  return true;
  162|    103|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  1.08M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     94|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     94|  ans_.read_end();
  167|     94|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|     93|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|     93|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     93|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 93]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     93|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     93|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     93|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 64]
  ------------------
   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|     64|#endif
   73|     64|  {
   74|     64|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 64]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     64|  }
   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|     93|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 78]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|     78|  probability_table_.resize(num_symbols_);
   86|     78|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 77]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  10.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 10.3k, False: 41]
  ------------------
   91|  10.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  10.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 21, False: 10.2k]
  ------------------
   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|  10.2k|    const int token = prob_data & 3;
  102|  10.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.75k, False: 6.52k]
  ------------------
  103|  3.75k|      const uint32_t offset = prob_data >> 2;
  104|  3.75k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 12, False: 3.74k]
  ------------------
  105|     12|        return false;
  106|     12|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   117k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 113k, False: 3.74k]
  ------------------
  109|   113k|        probability_table_[i + j] = 0;
  110|   113k|      }
  111|  3.74k|      i += offset;
  112|  6.52k|    } else {
  113|  6.52k|      const int extra_bytes = token;
  114|  6.52k|      uint32_t prob = prob_data >> 2;
  115|  9.98k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.45k, False: 6.52k]
  ------------------
  116|  3.45k|        uint8_t eb;
  117|  3.45k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 3.45k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.45k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.45k|      }
  124|  6.52k|      probability_table_[i] = prob;
  125|  6.52k|    }
  126|  10.2k|  }
  127|     41|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 39]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|     39|  return true;
  131|     41|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|     40|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|     39|    DecoderBuffer *buffer) {
  136|     39|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     39|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     39|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     39|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 14, False: 25]
  ------------------
  140|     14|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 14]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     14|  } else
  145|     25|#endif
  146|     25|  {
  147|     25|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 25]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     25|  }
  151|     39|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 16, False: 23]
  ------------------
  152|     16|    return false;
  153|     16|  }
  154|     23|  const uint8_t *const data_head =
  155|     23|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     23|  buffer->Advance(bytes_encoded);
  158|     23|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 8, False: 15]
  ------------------
  159|      8|    return false;
  160|      8|  }
  161|     15|  return true;
  162|     23|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  3.37M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|     15|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     15|  ans_.read_end();
  167|     15|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    170|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    170|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    170|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 170]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    170|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    170|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    170|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 37, False: 133]
  ------------------
   67|     37|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 37]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     37|  } else
   72|    133|#endif
   73|    133|  {
   74|    133|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 133]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    133|  }
   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|    170|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 169]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|    169|  probability_table_.resize(num_symbols_);
   86|    169|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 169]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   603k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 603k, False: 101]
  ------------------
   91|   603k|    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|   603k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 37, False: 603k]
  ------------------
   95|     37|      return false;
   96|     37|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   603k|    const int token = prob_data & 3;
  102|   603k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 324k, False: 279k]
  ------------------
  103|   324k|      const uint32_t offset = prob_data >> 2;
  104|   324k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 324k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  13.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 13.5M, False: 324k]
  ------------------
  109|  13.5M|        probability_table_[i + j] = 0;
  110|  13.5M|      }
  111|   324k|      i += offset;
  112|   324k|    } else {
  113|   279k|      const int extra_bytes = token;
  114|   279k|      uint32_t prob = prob_data >> 2;
  115|   571k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 292k, False: 279k]
  ------------------
  116|   292k|        uint8_t eb;
  117|   292k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 292k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   292k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   292k|      }
  124|   279k|      probability_table_[i] = prob;
  125|   279k|    }
  126|   603k|  }
  127|    101|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 7, False: 94]
  ------------------
  128|      7|    return false;
  129|      7|  }
  130|     94|  return true;
  131|    101|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|     94|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|     94|    DecoderBuffer *buffer) {
  136|     94|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     94|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     94|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     94|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 13, False: 81]
  ------------------
  140|     13|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 12]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     13|  } else
  145|     81|#endif
  146|     81|  {
  147|     81|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 80]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     81|  }
  151|     92|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 13, False: 79]
  ------------------
  152|     13|    return false;
  153|     13|  }
  154|     79|  const uint8_t *const data_head =
  155|     79|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     79|  buffer->Advance(bytes_encoded);
  158|     79|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 3, False: 76]
  ------------------
  159|      3|    return false;
  160|      3|  }
  161|     76|  return true;
  162|     79|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|   428k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     76|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     76|  ans_.read_end();
  167|     76|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    145|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    145|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    145|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 145]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    145|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    145|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    145|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 35, False: 110]
  ------------------
   67|     35|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 35]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     35|  } else
   72|    110|#endif
   73|    110|  {
   74|    110|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 110]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    110|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    145|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 142]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    142|  probability_table_.resize(num_symbols_);
   86|    142|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 142]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   419k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 419k, False: 90]
  ------------------
   91|   419k|    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|   419k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 21, False: 419k]
  ------------------
   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|   419k|    const int token = prob_data & 3;
  102|   419k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 68.6k, False: 350k]
  ------------------
  103|  68.6k|      const uint32_t offset = prob_data >> 2;
  104|  68.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 17, False: 68.6k]
  ------------------
  105|     17|        return false;
  106|     17|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.68M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.61M, False: 68.6k]
  ------------------
  109|  2.61M|        probability_table_[i + j] = 0;
  110|  2.61M|      }
  111|  68.6k|      i += offset;
  112|   350k|    } else {
  113|   350k|      const int extra_bytes = token;
  114|   350k|      uint32_t prob = prob_data >> 2;
  115|   692k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 342k, False: 350k]
  ------------------
  116|   342k|        uint8_t eb;
  117|   342k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 342k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   342k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   342k|      }
  124|   350k|      probability_table_[i] = prob;
  125|   350k|    }
  126|   419k|  }
  127|     90|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 7, False: 83]
  ------------------
  128|      7|    return false;
  129|      7|  }
  130|     83|  return true;
  131|     90|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|     83|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|     83|    DecoderBuffer *buffer) {
  136|     83|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     83|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     83|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     83|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 31, False: 52]
  ------------------
  140|     31|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 30]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     31|  } else
  145|     52|#endif
  146|     52|  {
  147|     52|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 52]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     52|  }
  151|     82|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 40, False: 42]
  ------------------
  152|     40|    return false;
  153|     40|  }
  154|     42|  const uint8_t *const data_head =
  155|     42|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     42|  buffer->Advance(bytes_encoded);
  158|     42|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 9, False: 33]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|     33|  return true;
  162|     42|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  1.81M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     33|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     33|  ans_.read_end();
  167|     33|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    123|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    123|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    123|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 123]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    123|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    123|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    123|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 21, False: 102]
  ------------------
   67|     21|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 21]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     21|  } else
   72|    102|#endif
   73|    102|  {
   74|    102|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 102]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    102|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    123|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 121]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    121|  probability_table_.resize(num_symbols_);
   86|    121|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 121]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  97.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 97.2k, False: 67]
  ------------------
   91|  97.2k|    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|  97.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 17, False: 97.2k]
  ------------------
   95|     17|      return false;
   96|     17|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  97.2k|    const int token = prob_data & 3;
  102|  97.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 12.5k, False: 84.6k]
  ------------------
  103|  12.5k|      const uint32_t offset = prob_data >> 2;
  104|  12.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 34, False: 12.5k]
  ------------------
  105|     34|        return false;
  106|     34|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   304k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 291k, False: 12.5k]
  ------------------
  109|   291k|        probability_table_[i + j] = 0;
  110|   291k|      }
  111|  12.5k|      i += offset;
  112|  84.6k|    } else {
  113|  84.6k|      const int extra_bytes = token;
  114|  84.6k|      uint32_t prob = prob_data >> 2;
  115|   159k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 74.6k, False: 84.6k]
  ------------------
  116|  74.6k|        uint8_t eb;
  117|  74.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 74.6k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  74.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  74.6k|      }
  124|  84.6k|      probability_table_[i] = prob;
  125|  84.6k|    }
  126|  97.2k|  }
  127|     67|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 55]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|     55|  return true;
  131|     67|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|     55|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|     55|    DecoderBuffer *buffer) {
  136|     55|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     55|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     55|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     55|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 6, False: 49]
  ------------------
  140|      6|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 6]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      6|  } else
  145|     49|#endif
  146|     49|  {
  147|     49|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 49]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     49|  }
  151|     55|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 18, False: 37]
  ------------------
  152|     18|    return false;
  153|     18|  }
  154|     37|  const uint8_t *const data_head =
  155|     37|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     37|  buffer->Advance(bytes_encoded);
  158|     37|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 13, False: 24]
  ------------------
  159|     13|    return false;
  160|     13|  }
  161|     24|  return true;
  162|     37|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  85.0k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     24|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     24|  ans_.read_end();
  167|     24|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|     94|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|     94|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     94|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 94]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     94|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     94|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     94|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 22, False: 72]
  ------------------
   67|     22|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 19]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     22|  } else
   72|     72|#endif
   73|     72|  {
   74|     72|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 72]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     72|  }
   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|     91|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 91]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     91|  probability_table_.resize(num_symbols_);
   86|     91|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 91]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   369k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 369k, False: 53]
  ------------------
   91|   369k|    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|   369k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 15, False: 369k]
  ------------------
   95|     15|      return false;
   96|     15|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   369k|    const int token = prob_data & 3;
  102|   369k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 42.5k, False: 327k]
  ------------------
  103|  42.5k|      const uint32_t offset = prob_data >> 2;
  104|  42.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 42.5k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   770k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 727k, False: 42.5k]
  ------------------
  109|   727k|        probability_table_[i + j] = 0;
  110|   727k|      }
  111|  42.5k|      i += offset;
  112|   327k|    } else {
  113|   327k|      const int extra_bytes = token;
  114|   327k|      uint32_t prob = prob_data >> 2;
  115|   632k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 305k, False: 327k]
  ------------------
  116|   305k|        uint8_t eb;
  117|   305k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 305k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   305k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   305k|      }
  124|   327k|      probability_table_[i] = prob;
  125|   327k|    }
  126|   369k|  }
  127|     53|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 41]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|     41|  return true;
  131|     53|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|     41|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|     41|    DecoderBuffer *buffer) {
  136|     41|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     41|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     41|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     41|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 11, False: 30]
  ------------------
  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|     30|#endif
  146|     30|  {
  147|     30|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 30]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     30|  }
  151|     41|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 17, False: 24]
  ------------------
  152|     17|    return false;
  153|     17|  }
  154|     24|  const uint8_t *const data_head =
  155|     24|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     24|  buffer->Advance(bytes_encoded);
  158|     24|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 7, False: 17]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|     17|  return true;
  162|     24|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|  78.9k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     17|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     17|  ans_.read_end();
  167|     17|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|     77|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|     77|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     77|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 77]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     77|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     77|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     77|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 62]
  ------------------
   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|     62|#endif
   73|     62|  {
   74|     62|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 62]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     62|  }
   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|     77|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 76]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|     76|  probability_table_.resize(num_symbols_);
   86|     76|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 73]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|  87.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 87.0k, False: 25]
  ------------------
   91|  87.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  87.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 86.9k]
  ------------------
   95|     16|      return false;
   96|     16|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  86.9k|    const int token = prob_data & 3;
  102|  86.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 13.3k, False: 73.6k]
  ------------------
  103|  13.3k|      const uint32_t offset = prob_data >> 2;
  104|  13.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 13.3k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   439k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 425k, False: 13.3k]
  ------------------
  109|   425k|        probability_table_[i + j] = 0;
  110|   425k|      }
  111|  13.3k|      i += offset;
  112|  73.6k|    } else {
  113|  73.6k|      const int extra_bytes = token;
  114|  73.6k|      uint32_t prob = prob_data >> 2;
  115|   139k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 65.9k, False: 73.6k]
  ------------------
  116|  65.9k|        uint8_t eb;
  117|  65.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 65.9k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  65.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  65.9k|      }
  124|  73.6k|      probability_table_[i] = prob;
  125|  73.6k|    }
  126|  86.9k|  }
  127|     25|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 10, False: 15]
  ------------------
  128|     10|    return false;
  129|     10|  }
  130|     15|  return true;
  131|     25|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|     18|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|     15|    DecoderBuffer *buffer) {
  136|     15|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     15|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     15|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     15|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 15]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|     15|#endif
  146|     15|  {
  147|     15|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 15]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     15|  }
  151|     15|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 7, False: 8]
  ------------------
  152|      7|    return false;
  153|      7|  }
  154|      8|  const uint8_t *const data_head =
  155|      8|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      8|  buffer->Advance(bytes_encoded);
  158|      8|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 8]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      8|  return true;
  162|      8|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  57.7k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|      8|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      8|  ans_.read_end();
  167|      8|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|     99|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|     99|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     99|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 99]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     99|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     99|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     99|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 13, False: 86]
  ------------------
   67|     13|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 13]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     13|  } else
   72|     86|#endif
   73|     86|  {
   74|     86|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 86]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     86|  }
   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|     99|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 98]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|     98|  probability_table_.resize(num_symbols_);
   86|     98|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 98]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   249k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 248k, False: 56]
  ------------------
   91|   248k|    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|   248k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 24, False: 248k]
  ------------------
   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|   248k|    const int token = prob_data & 3;
  102|   248k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 38.9k, False: 210k]
  ------------------
  103|  38.9k|      const uint32_t offset = prob_data >> 2;
  104|  38.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 7, False: 38.9k]
  ------------------
  105|      7|        return false;
  106|      7|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.24M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.20M, False: 38.9k]
  ------------------
  109|  1.20M|        probability_table_[i + j] = 0;
  110|  1.20M|      }
  111|  38.9k|      i += offset;
  112|   210k|    } else {
  113|   210k|      const int extra_bytes = token;
  114|   210k|      uint32_t prob = prob_data >> 2;
  115|   424k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 214k, False: 210k]
  ------------------
  116|   214k|        uint8_t eb;
  117|   214k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 214k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   214k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   214k|      }
  124|   210k|      probability_table_[i] = prob;
  125|   210k|    }
  126|   248k|  }
  127|     56|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 15, False: 41]
  ------------------
  128|     15|    return false;
  129|     15|  }
  130|     41|  return true;
  131|     56|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|     41|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|     41|    DecoderBuffer *buffer) {
  136|     41|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     41|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     41|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     41|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 13, False: 28]
  ------------------
  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|     28|#endif
  146|     28|  {
  147|     28|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 28]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     28|  }
  151|     41|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 23, False: 18]
  ------------------
  152|     23|    return false;
  153|     23|  }
  154|     18|  const uint8_t *const data_head =
  155|     18|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     18|  buffer->Advance(bytes_encoded);
  158|     18|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 18]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|     18|  return true;
  162|     18|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  24.4k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     18|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     18|  ans_.read_end();
  167|     18|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    132|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    132|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    132|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 132]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    132|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    132|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    132|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 3, False: 129]
  ------------------
   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|    129|#endif
   73|    129|  {
   74|    129|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 125]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    129|  }
   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|    128|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 118]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    118|  probability_table_.resize(num_symbols_);
   86|    118|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 117]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   780k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 780k, False: 60]
  ------------------
   91|   780k|    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|   780k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 25, False: 780k]
  ------------------
   95|     25|      return false;
   96|     25|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   780k|    const int token = prob_data & 3;
  102|   780k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 445k, False: 334k]
  ------------------
  103|   445k|      const uint32_t offset = prob_data >> 2;
  104|   445k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 445k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  15.0M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 14.5M, False: 445k]
  ------------------
  109|  14.5M|        probability_table_[i + j] = 0;
  110|  14.5M|      }
  111|   445k|      i += offset;
  112|   445k|    } else {
  113|   334k|      const int extra_bytes = token;
  114|   334k|      uint32_t prob = prob_data >> 2;
  115|   558k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 223k, False: 334k]
  ------------------
  116|   223k|        uint8_t eb;
  117|   223k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 223k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   223k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   223k|      }
  124|   334k|      probability_table_[i] = prob;
  125|   334k|    }
  126|   780k|  }
  127|     60|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 24, False: 36]
  ------------------
  128|     24|    return false;
  129|     24|  }
  130|     36|  return true;
  131|     60|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|     37|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|     36|    DecoderBuffer *buffer) {
  136|     36|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     36|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     36|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     36|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 36]
  ------------------
  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|     36|#endif
  146|     36|  {
  147|     36|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 36]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     36|  }
  151|     36|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 36]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|     36|  const uint8_t *const data_head =
  155|     36|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     36|  buffer->Advance(bytes_encoded);
  158|     36|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 8, False: 28]
  ------------------
  159|      8|    return false;
  160|      8|  }
  161|     28|  return true;
  162|     36|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   127k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     28|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     28|  ans_.read_end();
  167|     28|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    132|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    132|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    132|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 132]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    132|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    132|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    132|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 28, False: 104]
  ------------------
   67|     28|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 28]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     28|  } else
   72|    104|#endif
   73|    104|  {
   74|    104|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 103]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    104|  }
   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|    131|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 126]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    126|  probability_table_.resize(num_symbols_);
   86|    126|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 126]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   213k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 213k, False: 71]
  ------------------
   91|   213k|    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|   213k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 21, False: 213k]
  ------------------
   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|   213k|    const int token = prob_data & 3;
  102|   213k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 130k, False: 83.4k]
  ------------------
  103|   130k|      const uint32_t offset = prob_data >> 2;
  104|   130k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 130k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.62M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.49M, False: 130k]
  ------------------
  109|  3.49M|        probability_table_[i + j] = 0;
  110|  3.49M|      }
  111|   130k|      i += offset;
  112|   130k|    } else {
  113|  83.4k|      const int extra_bytes = token;
  114|  83.4k|      uint32_t prob = prob_data >> 2;
  115|   189k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 106k, False: 83.4k]
  ------------------
  116|   106k|        uint8_t eb;
  117|   106k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 106k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   106k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   106k|      }
  124|  83.4k|      probability_table_[i] = prob;
  125|  83.4k|    }
  126|   213k|  }
  127|     71|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 9, False: 62]
  ------------------
  128|      9|    return false;
  129|      9|  }
  130|     62|  return true;
  131|     71|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|     62|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|     62|    DecoderBuffer *buffer) {
  136|     62|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     62|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     62|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     62|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 53]
  ------------------
  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|     53|#endif
  146|     53|  {
  147|     53|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 53]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     53|  }
  151|     62|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 25, False: 37]
  ------------------
  152|     25|    return false;
  153|     25|  }
  154|     37|  const uint8_t *const data_head =
  155|     37|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     37|  buffer->Advance(bytes_encoded);
  158|     37|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 10, False: 27]
  ------------------
  159|     10|    return false;
  160|     10|  }
  161|     27|  return true;
  162|     37|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  94.0k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     27|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     27|  ans_.read_end();
  167|     27|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|     77|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|     77|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     77|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 77]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     77|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     77|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     77|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 25, False: 52]
  ------------------
   67|     25|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 25]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     25|  } else
   72|     52|#endif
   73|     52|  {
   74|     52|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 52]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     52|  }
   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|     77|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 77]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     77|  probability_table_.resize(num_symbols_);
   86|     77|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 77]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  90.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 90.1k, False: 37]
  ------------------
   91|  90.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  90.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 21, False: 90.1k]
  ------------------
   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|  90.1k|    const int token = prob_data & 3;
  102|  90.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 19.0k, False: 71.0k]
  ------------------
  103|  19.0k|      const uint32_t offset = prob_data >> 2;
  104|  19.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 6, False: 19.0k]
  ------------------
  105|      6|        return false;
  106|      6|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   699k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 680k, False: 19.0k]
  ------------------
  109|   680k|        probability_table_[i + j] = 0;
  110|   680k|      }
  111|  19.0k|      i += offset;
  112|  71.0k|    } else {
  113|  71.0k|      const int extra_bytes = token;
  114|  71.0k|      uint32_t prob = prob_data >> 2;
  115|   114k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 43.3k, False: 71.0k]
  ------------------
  116|  43.3k|        uint8_t eb;
  117|  43.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 43.3k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  43.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  43.3k|      }
  124|  71.0k|      probability_table_[i] = prob;
  125|  71.0k|    }
  126|  90.1k|  }
  127|     37|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 34]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|     34|  return true;
  131|     37|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|     34|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|     34|    DecoderBuffer *buffer) {
  136|     34|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     34|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     34|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     34|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 15, False: 19]
  ------------------
  140|     15|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 15]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     15|  } else
  145|     19|#endif
  146|     19|  {
  147|     19|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 19]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     19|  }
  151|     34|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 17, False: 17]
  ------------------
  152|     17|    return false;
  153|     17|  }
  154|     17|  const uint8_t *const data_head =
  155|     17|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     17|  buffer->Advance(bytes_encoded);
  158|     17|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 11, False: 6]
  ------------------
  159|     11|    return false;
  160|     11|  }
  161|      6|  return true;
  162|     17|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  1.58M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|      6|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      6|  ans_.read_end();
  167|      6|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|     75|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|     75|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     75|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 75]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     75|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     75|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     75|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 3, False: 72]
  ------------------
   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|     72|#endif
   73|     72|  {
   74|     72|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 72]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     72|  }
   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|     75|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 75]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     75|  probability_table_.resize(num_symbols_);
   86|     75|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 75]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  7.23k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 7.19k, False: 39]
  ------------------
   91|  7.19k|    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|  7.19k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 7.17k]
  ------------------
   95|     16|      return false;
   96|     16|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  7.17k|    const int token = prob_data & 3;
  102|  7.17k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.22k, False: 3.94k]
  ------------------
  103|  3.22k|      const uint32_t offset = prob_data >> 2;
  104|  3.22k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 3.21k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   121k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 118k, False: 3.21k]
  ------------------
  109|   118k|        probability_table_[i + j] = 0;
  110|   118k|      }
  111|  3.21k|      i += offset;
  112|  3.94k|    } else {
  113|  3.94k|      const int extra_bytes = token;
  114|  3.94k|      uint32_t prob = prob_data >> 2;
  115|  6.75k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.81k, False: 3.94k]
  ------------------
  116|  2.81k|        uint8_t eb;
  117|  2.81k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 5, False: 2.80k]
  ------------------
  118|      5|          return false;
  119|      5|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.80k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.80k|      }
  124|  3.94k|      probability_table_[i] = prob;
  125|  3.94k|    }
  126|  7.17k|  }
  127|     39|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 34]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|     34|  return true;
  131|     39|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|     34|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|     34|    DecoderBuffer *buffer) {
  136|     34|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     34|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     34|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     34|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 34]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|     34|#endif
  146|     34|  {
  147|     34|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 31]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|     34|  }
  151|     31|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 11, False: 20]
  ------------------
  152|     11|    return false;
  153|     11|  }
  154|     20|  const uint8_t *const data_head =
  155|     20|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     20|  buffer->Advance(bytes_encoded);
  158|     20|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 3, False: 17]
  ------------------
  159|      3|    return false;
  160|      3|  }
  161|     17|  return true;
  162|     20|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  12.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     17|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     17|  ans_.read_end();
  167|     17|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    145|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    145|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    145|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 145]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    145|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    145|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    145|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 21, False: 124]
  ------------------
   67|     21|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 21]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     21|  } else
   72|    124|#endif
   73|    124|  {
   74|    124|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 123]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    124|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    144|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 133]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    133|  probability_table_.resize(num_symbols_);
   86|    133|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 133]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   122k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 122k, False: 82]
  ------------------
   91|   122k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   122k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 28, False: 122k]
  ------------------
   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|   122k|    const int token = prob_data & 3;
  102|   122k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 95.6k, False: 26.6k]
  ------------------
  103|  95.6k|      const uint32_t offset = prob_data >> 2;
  104|  95.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 20, False: 95.6k]
  ------------------
  105|     20|        return false;
  106|     20|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.66M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.57M, False: 95.6k]
  ------------------
  109|  4.57M|        probability_table_[i + j] = 0;
  110|  4.57M|      }
  111|  95.6k|      i += offset;
  112|  95.6k|    } else {
  113|  26.6k|      const int extra_bytes = token;
  114|  26.6k|      uint32_t prob = prob_data >> 2;
  115|  37.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.8k, False: 26.6k]
  ------------------
  116|  10.8k|        uint8_t eb;
  117|  10.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 10.8k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.8k|      }
  124|  26.6k|      probability_table_[i] = prob;
  125|  26.6k|    }
  126|   122k|  }
  127|     82|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 79]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|     79|  return true;
  131|     82|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|     79|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|     79|    DecoderBuffer *buffer) {
  136|     79|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     79|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     79|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     79|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 8, False: 71]
  ------------------
  140|      8|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 8]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      8|  } else
  145|     71|#endif
  146|     71|  {
  147|     71|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 66]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|     71|  }
  151|     74|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 28, False: 46]
  ------------------
  152|     28|    return false;
  153|     28|  }
  154|     46|  const uint8_t *const data_head =
  155|     46|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     46|  buffer->Advance(bytes_encoded);
  158|     46|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 4, False: 42]
  ------------------
  159|      4|    return false;
  160|      4|  }
  161|     42|  return true;
  162|     46|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  4.85M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     42|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     42|  ans_.read_end();
  167|     42|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    154|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    154|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    154|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 154]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    154|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    154|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    154|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 45, False: 109]
  ------------------
   67|     45|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 45]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     45|  } else
   72|    109|#endif
   73|    109|  {
   74|    109|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 109]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    109|  }
   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: 3, False: 151]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    151|  probability_table_.resize(num_symbols_);
   86|    151|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 151]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  6.56k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 6.45k, False: 114]
  ------------------
   91|  6.45k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  6.45k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 22, False: 6.43k]
  ------------------
   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|  6.43k|    const int token = prob_data & 3;
  102|  6.43k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.04k, False: 3.39k]
  ------------------
  103|  3.04k|      const uint32_t offset = prob_data >> 2;
  104|  3.04k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 3.03k]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   120k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 117k, False: 3.03k]
  ------------------
  109|   117k|        probability_table_[i + j] = 0;
  110|   117k|      }
  111|  3.03k|      i += offset;
  112|  3.39k|    } else {
  113|  3.39k|      const int extra_bytes = token;
  114|  3.39k|      uint32_t prob = prob_data >> 2;
  115|  5.81k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.43k, False: 3.38k]
  ------------------
  116|  2.43k|        uint8_t eb;
  117|  2.43k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 2.42k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.42k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.42k|      }
  124|  3.38k|      probability_table_[i] = prob;
  125|  3.38k|    }
  126|  6.43k|  }
  127|    114|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 15, False: 99]
  ------------------
  128|     15|    return false;
  129|     15|  }
  130|     99|  return true;
  131|    114|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|     99|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|     99|    DecoderBuffer *buffer) {
  136|     99|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     99|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     99|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     99|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 33, False: 66]
  ------------------
  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|     66|#endif
  146|     66|  {
  147|     66|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 13, False: 53]
  ------------------
  148|     13|      return false;
  149|     13|    }
  150|     66|  }
  151|     86|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 48, False: 38]
  ------------------
  152|     48|    return false;
  153|     48|  }
  154|     38|  const uint8_t *const data_head =
  155|     38|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     38|  buffer->Advance(bytes_encoded);
  158|     38|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 8, False: 30]
  ------------------
  159|      8|    return false;
  160|      8|  }
  161|     30|  return true;
  162|     38|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  71.0k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     30|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     30|  ans_.read_end();
  167|     30|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  4.11k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  4.11k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 0, False: 4.11k]
  ------------------
   35|      0|    return true;
   36|      0|  }
   37|       |  // Decode which scheme to use.
   38|  4.11k|  uint8_t scheme;
   39|  4.11k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 20, False: 4.09k]
  ------------------
   40|     20|    return false;
   41|     20|  }
   42|  4.09k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 403, False: 3.68k]
  ------------------
   43|    403|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    403|                                                  src_buffer, out_values);
   45|  3.68k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 2.55k, False: 1.13k]
  ------------------
   46|  2.55k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  2.55k|                                               out_values);
   48|  2.55k|  }
   49|  1.13k|  return false;
   50|  4.09k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    403|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    403|  SymbolDecoderT<5> tag_decoder;
   57|    403|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 231, False: 172]
  ------------------
   58|    231|    return false;
   59|    231|  }
   60|       |
   61|    172|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 87, False: 85]
  ------------------
   62|     87|    return false;
   63|     87|  }
   64|       |
   65|     85|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 85, False: 0]
  |  Branch (65:25): [True: 32, False: 53]
  ------------------
   66|     32|    return false;  // Wrong number of symbols.
   67|     32|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|     53|  src_buffer->StartBitDecoding(false, nullptr);
   72|     53|  int value_id = 0;
   73|  11.4k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 11.4k, False: 53]
  ------------------
   74|       |    // Decode the tag.
   75|  11.4k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  42.9k|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 31.4k, False: 11.4k]
  ------------------
   78|  31.4k|      uint32_t val;
   79|  31.4k|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 31.4k]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|  31.4k|      out_values[value_id++] = val;
   83|  31.4k|    }
   84|  11.4k|  }
   85|     53|  tag_decoder.EndDecoding();
   86|     53|  src_buffer->EndBitDecoding();
   87|     53|  return true;
   88|     53|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  2.55k|                      uint32_t *out_values) {
  117|  2.55k|  uint8_t max_bit_length;
  118|  2.55k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 2, False: 2.55k]
  ------------------
  119|      2|    return false;
  120|      2|  }
  121|  2.55k|  switch (max_bit_length) {
  122|    278|    case 1:
  ------------------
  |  Branch (122:5): [True: 278, False: 2.27k]
  ------------------
  123|    278|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    278|                                                         out_values);
  125|    199|    case 2:
  ------------------
  |  Branch (125:5): [True: 199, False: 2.35k]
  ------------------
  126|    199|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    199|                                                         out_values);
  128|    176|    case 3:
  ------------------
  |  Branch (128:5): [True: 176, False: 2.37k]
  ------------------
  129|    176|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    176|                                                         out_values);
  131|    139|    case 4:
  ------------------
  |  Branch (131:5): [True: 139, False: 2.41k]
  ------------------
  132|    139|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    139|                                                         out_values);
  134|    116|    case 5:
  ------------------
  |  Branch (134:5): [True: 116, False: 2.43k]
  ------------------
  135|    116|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    116|                                                         out_values);
  137|     93|    case 6:
  ------------------
  |  Branch (137:5): [True: 93, False: 2.46k]
  ------------------
  138|     93|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|     93|                                                         out_values);
  140|    170|    case 7:
  ------------------
  |  Branch (140:5): [True: 170, False: 2.38k]
  ------------------
  141|    170|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    170|                                                         out_values);
  143|    145|    case 8:
  ------------------
  |  Branch (143:5): [True: 145, False: 2.40k]
  ------------------
  144|    145|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    145|                                                         out_values);
  146|    123|    case 9:
  ------------------
  |  Branch (146:5): [True: 123, False: 2.43k]
  ------------------
  147|    123|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    123|                                                         out_values);
  149|     94|    case 10:
  ------------------
  |  Branch (149:5): [True: 94, False: 2.45k]
  ------------------
  150|     94|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|     94|          num_values, src_buffer, out_values);
  152|     77|    case 11:
  ------------------
  |  Branch (152:5): [True: 77, False: 2.47k]
  ------------------
  153|     77|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|     77|          num_values, src_buffer, out_values);
  155|     99|    case 12:
  ------------------
  |  Branch (155:5): [True: 99, False: 2.45k]
  ------------------
  156|     99|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|     99|          num_values, src_buffer, out_values);
  158|    132|    case 13:
  ------------------
  |  Branch (158:5): [True: 132, False: 2.42k]
  ------------------
  159|    132|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    132|          num_values, src_buffer, out_values);
  161|    132|    case 14:
  ------------------
  |  Branch (161:5): [True: 132, False: 2.42k]
  ------------------
  162|    132|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    132|          num_values, src_buffer, out_values);
  164|     77|    case 15:
  ------------------
  |  Branch (164:5): [True: 77, False: 2.47k]
  ------------------
  165|     77|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|     77|          num_values, src_buffer, out_values);
  167|     75|    case 16:
  ------------------
  |  Branch (167:5): [True: 75, False: 2.47k]
  ------------------
  168|     75|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|     75|          num_values, src_buffer, out_values);
  170|    145|    case 17:
  ------------------
  |  Branch (170:5): [True: 145, False: 2.40k]
  ------------------
  171|    145|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    145|          num_values, src_buffer, out_values);
  173|    154|    case 18:
  ------------------
  |  Branch (173:5): [True: 154, False: 2.39k]
  ------------------
  174|    154|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    154|          num_values, src_buffer, out_values);
  176|    129|    default:
  ------------------
  |  Branch (176:5): [True: 129, False: 2.42k]
  ------------------
  177|    129|      return false;
  178|  2.55k|  }
  179|  2.55k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    278|                              uint32_t *out_values) {
   93|    278|  SymbolDecoderT decoder;
   94|    278|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 163, False: 115]
  ------------------
   95|    163|    return false;
   96|    163|  }
   97|       |
   98|    115|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 115, False: 0]
  |  Branch (98:25): [True: 3, False: 112]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    112|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 14, False: 98]
  ------------------
  103|     14|    return false;
  104|     14|  }
  105|  2.36M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.36M, False: 98]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.36M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.36M|    out_values[i] = value;
  109|  2.36M|  }
  110|     98|  decoder.EndDecoding();
  111|     98|  return true;
  112|    112|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    199|                              uint32_t *out_values) {
   93|    199|  SymbolDecoderT decoder;
   94|    199|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 103, False: 96]
  ------------------
   95|    103|    return false;
   96|    103|  }
   97|       |
   98|     96|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 96, False: 0]
  |  Branch (98:25): [True: 1, False: 95]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     95|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 42, False: 53]
  ------------------
  103|     42|    return false;
  104|     42|  }
  105|  2.19M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.19M, False: 53]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.19M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.19M|    out_values[i] = value;
  109|  2.19M|  }
  110|     53|  decoder.EndDecoding();
  111|     53|  return true;
  112|     95|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    176|                              uint32_t *out_values) {
   93|    176|  SymbolDecoderT decoder;
   94|    176|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 43, False: 133]
  ------------------
   95|     43|    return false;
   96|     43|  }
   97|       |
   98|    133|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 133, False: 0]
  |  Branch (98:25): [True: 1, False: 132]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    132|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 43, False: 89]
  ------------------
  103|     43|    return false;
  104|     43|  }
  105|  7.08M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.08M, False: 89]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.08M|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.08M|    out_values[i] = value;
  109|  7.08M|  }
  110|     89|  decoder.EndDecoding();
  111|     89|  return true;
  112|    132|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    139|                              uint32_t *out_values) {
   93|    139|  SymbolDecoderT decoder;
   94|    139|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 36, False: 103]
  ------------------
   95|     36|    return false;
   96|     36|  }
   97|       |
   98|    103|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 103, False: 0]
  |  Branch (98:25): [True: 0, False: 103]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    103|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 9, False: 94]
  ------------------
  103|      9|    return false;
  104|      9|  }
  105|  1.08M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.08M, False: 94]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.08M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.08M|    out_values[i] = value;
  109|  1.08M|  }
  110|     94|  decoder.EndDecoding();
  111|     94|  return true;
  112|    103|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    116|                              uint32_t *out_values) {
   93|    116|  SymbolDecoderT decoder;
   94|    116|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 13, False: 103]
  ------------------
   95|     13|    return false;
   96|     13|  }
   97|       |
   98|    103|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 103, False: 0]
  |  Branch (98:25): [True: 84, False: 19]
  ------------------
   99|     84|    return false;  // Wrong number of symbols.
  100|     84|  }
  101|       |
  102|     19|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 19]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  4.99M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.99M, False: 19]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.99M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.99M|    out_values[i] = value;
  109|  4.99M|  }
  110|     19|  decoder.EndDecoding();
  111|     19|  return true;
  112|     19|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|     93|                              uint32_t *out_values) {
   93|     93|  SymbolDecoderT decoder;
   94|     93|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 53, False: 40]
  ------------------
   95|     53|    return false;
   96|     53|  }
   97|       |
   98|     40|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 40, False: 0]
  |  Branch (98:25): [True: 1, False: 39]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     39|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 24, False: 15]
  ------------------
  103|     24|    return false;
  104|     24|  }
  105|  3.37M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.37M, False: 15]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.37M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.37M|    out_values[i] = value;
  109|  3.37M|  }
  110|     15|  decoder.EndDecoding();
  111|     15|  return true;
  112|     39|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    170|                              uint32_t *out_values) {
   93|    170|  SymbolDecoderT decoder;
   94|    170|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 76, False: 94]
  ------------------
   95|     76|    return false;
   96|     76|  }
   97|       |
   98|     94|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 94, False: 0]
  |  Branch (98:25): [True: 0, False: 94]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     94|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 18, False: 76]
  ------------------
  103|     18|    return false;
  104|     18|  }
  105|   428k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 428k, False: 76]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   428k|    const uint32_t value = decoder.DecodeSymbol();
  108|   428k|    out_values[i] = value;
  109|   428k|  }
  110|     76|  decoder.EndDecoding();
  111|     76|  return true;
  112|     94|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    145|                              uint32_t *out_values) {
   93|    145|  SymbolDecoderT decoder;
   94|    145|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 62, False: 83]
  ------------------
   95|     62|    return false;
   96|     62|  }
   97|       |
   98|     83|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 83, False: 0]
  |  Branch (98:25): [True: 0, False: 83]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     83|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 50, False: 33]
  ------------------
  103|     50|    return false;
  104|     50|  }
  105|  1.81M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.81M, False: 33]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.81M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.81M|    out_values[i] = value;
  109|  1.81M|  }
  110|     33|  decoder.EndDecoding();
  111|     33|  return true;
  112|     83|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    123|                              uint32_t *out_values) {
   93|    123|  SymbolDecoderT decoder;
   94|    123|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 68, False: 55]
  ------------------
   95|     68|    return false;
   96|     68|  }
   97|       |
   98|     55|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 55, False: 0]
  |  Branch (98:25): [True: 0, False: 55]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     55|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 31, False: 24]
  ------------------
  103|     31|    return false;
  104|     31|  }
  105|  85.0k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 85.0k, False: 24]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  85.0k|    const uint32_t value = decoder.DecodeSymbol();
  108|  85.0k|    out_values[i] = value;
  109|  85.0k|  }
  110|     24|  decoder.EndDecoding();
  111|     24|  return true;
  112|     55|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|     94|                              uint32_t *out_values) {
   93|     94|  SymbolDecoderT decoder;
   94|     94|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 53, False: 41]
  ------------------
   95|     53|    return false;
   96|     53|  }
   97|       |
   98|     41|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 41, False: 0]
  |  Branch (98:25): [True: 0, False: 41]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     41|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 24, False: 17]
  ------------------
  103|     24|    return false;
  104|     24|  }
  105|  78.9k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 78.9k, False: 17]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  78.9k|    const uint32_t value = decoder.DecodeSymbol();
  108|  78.9k|    out_values[i] = value;
  109|  78.9k|  }
  110|     17|  decoder.EndDecoding();
  111|     17|  return true;
  112|     41|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|     77|                              uint32_t *out_values) {
   93|     77|  SymbolDecoderT decoder;
   94|     77|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 59, False: 18]
  ------------------
   95|     59|    return false;
   96|     59|  }
   97|       |
   98|     18|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 18, False: 0]
  |  Branch (98:25): [True: 3, False: 15]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|     15|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 7, False: 8]
  ------------------
  103|      7|    return false;
  104|      7|  }
  105|  57.7k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 57.7k, False: 8]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  57.7k|    const uint32_t value = decoder.DecodeSymbol();
  108|  57.7k|    out_values[i] = value;
  109|  57.7k|  }
  110|      8|  decoder.EndDecoding();
  111|      8|  return true;
  112|     15|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|     99|                              uint32_t *out_values) {
   93|     99|  SymbolDecoderT decoder;
   94|     99|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 58, False: 41]
  ------------------
   95|     58|    return false;
   96|     58|  }
   97|       |
   98|     41|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 41, False: 0]
  |  Branch (98:25): [True: 0, False: 41]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     41|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 23, False: 18]
  ------------------
  103|     23|    return false;
  104|     23|  }
  105|  24.4k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 24.4k, False: 18]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  24.4k|    const uint32_t value = decoder.DecodeSymbol();
  108|  24.4k|    out_values[i] = value;
  109|  24.4k|  }
  110|     18|  decoder.EndDecoding();
  111|     18|  return true;
  112|     41|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    132|                              uint32_t *out_values) {
   93|    132|  SymbolDecoderT decoder;
   94|    132|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 95, False: 37]
  ------------------
   95|     95|    return false;
   96|     95|  }
   97|       |
   98|     37|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 37, False: 0]
  |  Branch (98:25): [True: 1, False: 36]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     36|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 8, False: 28]
  ------------------
  103|      8|    return false;
  104|      8|  }
  105|   127k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 127k, False: 28]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   127k|    const uint32_t value = decoder.DecodeSymbol();
  108|   127k|    out_values[i] = value;
  109|   127k|  }
  110|     28|  decoder.EndDecoding();
  111|     28|  return true;
  112|     36|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    132|                              uint32_t *out_values) {
   93|    132|  SymbolDecoderT decoder;
   94|    132|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 70, False: 62]
  ------------------
   95|     70|    return false;
   96|     70|  }
   97|       |
   98|     62|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 62, False: 0]
  |  Branch (98:25): [True: 0, False: 62]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     62|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 35, False: 27]
  ------------------
  103|     35|    return false;
  104|     35|  }
  105|  94.0k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 94.0k, False: 27]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  94.0k|    const uint32_t value = decoder.DecodeSymbol();
  108|  94.0k|    out_values[i] = value;
  109|  94.0k|  }
  110|     27|  decoder.EndDecoding();
  111|     27|  return true;
  112|     62|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|     77|                              uint32_t *out_values) {
   93|     77|  SymbolDecoderT decoder;
   94|     77|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 43, False: 34]
  ------------------
   95|     43|    return false;
   96|     43|  }
   97|       |
   98|     34|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 34, False: 0]
  |  Branch (98:25): [True: 0, False: 34]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     34|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 28, False: 6]
  ------------------
  103|     28|    return false;
  104|     28|  }
  105|  1.58M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.58M, False: 6]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.58M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.58M|    out_values[i] = value;
  109|  1.58M|  }
  110|      6|  decoder.EndDecoding();
  111|      6|  return true;
  112|     34|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|     75|                              uint32_t *out_values) {
   93|     75|  SymbolDecoderT decoder;
   94|     75|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 41, False: 34]
  ------------------
   95|     41|    return false;
   96|     41|  }
   97|       |
   98|     34|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 34, False: 0]
  |  Branch (98:25): [True: 0, False: 34]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     34|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 17, False: 17]
  ------------------
  103|     17|    return false;
  104|     17|  }
  105|  12.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.6M, False: 17]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.6M|    out_values[i] = value;
  109|  12.6M|  }
  110|     17|  decoder.EndDecoding();
  111|     17|  return true;
  112|     34|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    145|                              uint32_t *out_values) {
   93|    145|  SymbolDecoderT decoder;
   94|    145|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 66, False: 79]
  ------------------
   95|     66|    return false;
   96|     66|  }
   97|       |
   98|     79|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 79, False: 0]
  |  Branch (98:25): [True: 0, False: 79]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     79|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 37, False: 42]
  ------------------
  103|     37|    return false;
  104|     37|  }
  105|  4.85M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.85M, False: 42]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.85M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.85M|    out_values[i] = value;
  109|  4.85M|  }
  110|     42|  decoder.EndDecoding();
  111|     42|  return true;
  112|     79|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    154|                              uint32_t *out_values) {
   93|    154|  SymbolDecoderT decoder;
   94|    154|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 55, False: 99]
  ------------------
   95|     55|    return false;
   96|     55|  }
   97|       |
   98|     99|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 99, False: 0]
  |  Branch (98:25): [True: 0, False: 99]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     99|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 69, False: 30]
  ------------------
  103|     69|    return false;
  104|     69|  }
  105|  71.1k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 71.0k, False: 30]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  71.0k|    const uint32_t value = decoder.DecodeSymbol();
  108|  71.0k|    out_values[i] = value;
  109|  71.0k|  }
  110|     30|  decoder.EndDecoding();
  111|     30|  return true;
  112|     99|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  3.48k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  1.42k|  const CornerTable *GetCornerTable() const override {
   67|  1.42k|    return corner_table_.get();
   68|  1.42k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  2.82M|                       int *out_encoder_split_symbol_id) {
   87|  2.82M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 2.54M, False: 273k]
  ------------------
   88|  2.54M|      return false;
   89|  2.54M|    }
   90|   273k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 5, False: 273k]
  ------------------
   91|   273k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|      5|      *out_encoder_split_symbol_id = -1;
   98|      5|      return true;
   99|      5|    }
  100|   273k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 273k, False: 711]
  ------------------
  101|   273k|      return false;
  102|   273k|    }
  103|    711|    *out_face_edge =
  104|    711|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    711|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    711|    topology_split_data_.pop_back();
  108|    711|    return true;
  109|   273k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  11.3M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  11.3M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  11.3M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  11.3M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  5.94k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  2.89k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  2.23k|  const CornerTable *GetCornerTable() const override {
   67|  2.23k|    return corner_table_.get();
   68|  2.23k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  15.6M|                       int *out_encoder_split_symbol_id) {
   87|  15.6M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 14.6M, False: 1.00M]
  ------------------
   88|  14.6M|      return false;
   89|  14.6M|    }
   90|  1.00M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 28, False: 1.00M]
  ------------------
   91|  1.00M|        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|     28|      *out_encoder_split_symbol_id = -1;
   98|     28|      return true;
   99|     28|    }
  100|  1.00M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 1.00M, False: 1.03k]
  ------------------
  101|  1.00M|      return false;
  102|  1.00M|    }
  103|  1.03k|    *out_face_edge =
  104|  1.03k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.03k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.03k|    topology_split_data_.pop_back();
  108|  1.03k|    return true;
  109|  1.00M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  46.4M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  46.4M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  46.4M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  46.4M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  2.45k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  4.53k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  1.01k|  const CornerTable *GetCornerTable() const override {
   67|  1.01k|    return corner_table_.get();
   68|  1.01k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  13.1M|                       int *out_encoder_split_symbol_id) {
   87|  13.1M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 12.7M, False: 386k]
  ------------------
   88|  12.7M|      return false;
   89|  12.7M|    }
   90|   386k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 18, False: 386k]
  ------------------
   91|   386k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     18|      *out_encoder_split_symbol_id = -1;
   98|     18|      return true;
   99|     18|    }
  100|   386k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 385k, False: 698]
  ------------------
  101|   385k|      return false;
  102|   385k|    }
  103|    698|    *out_face_edge =
  104|    698|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    698|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    698|    topology_split_data_.pop_back();
  108|    698|    return true;
  109|   386k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  13.1M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  13.1M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  13.1M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  13.1M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|    711|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

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

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    645|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.17M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.17M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.16M, False: 7.60k]
  ------------------
   61|  1.16M|      return true;  // Already traversed.
   62|  1.16M|    }
   63|       |
   64|  7.60k|    corner_traversal_stack_.clear();
   65|  7.60k|    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|  7.60k|    const VertexIndex next_vert =
   69|  7.60k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  7.60k|    const VertexIndex prev_vert =
   71|  7.60k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  7.60k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 7.60k]
  |  Branch (72:45): [True: 0, False: 7.60k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  7.60k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 7.54k, False: 59]
  ------------------
   76|  7.54k|      this->MarkVertexVisited(next_vert);
   77|  7.54k|      this->traversal_observer().OnNewVertexVisited(
   78|  7.54k|          next_vert, this->corner_table()->Next(corner_id));
   79|  7.54k|    }
   80|  7.60k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.10k, False: 5.49k]
  ------------------
   81|  2.10k|      this->MarkVertexVisited(prev_vert);
   82|  2.10k|      this->traversal_observer().OnNewVertexVisited(
   83|  2.10k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.10k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  25.6k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 18.0k, False: 7.60k]
  ------------------
   88|       |      // Currently processed corner.
   89|  18.0k|      corner_id = corner_traversal_stack_.back();
   90|  18.0k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  18.0k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 18.0k]
  |  Branch (92:47): [True: 501, False: 17.5k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    501|        corner_traversal_stack_.pop_back();
   95|    501|        continue;
   96|    501|      }
   97|  1.17M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.17M, Folded]
  ------------------
   98|  1.17M|        this->MarkFaceVisited(face_id);
   99|  1.17M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.17M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.17M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.17M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.17M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 590k, False: 579k]
  ------------------
  105|   590k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   590k|          this->MarkVertexVisited(vert_id);
  107|   590k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   590k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 572k, False: 18.2k]
  ------------------
  109|   572k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   572k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   572k|            continue;
  112|   572k|          }
  113|   590k|        }
  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|   597k|        const CornerIndex right_corner_id =
  118|   597k|            this->corner_table()->GetRightCorner(corner_id);
  119|   597k|        const CornerIndex left_corner_id =
  120|   597k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   597k|        const FaceIndex right_face_id(
  122|   597k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 13.1k, False: 584k]
  ------------------
  123|   597k|                 ? kInvalidFaceIndex
  124|   597k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   597k|        const FaceIndex left_face_id(
  126|   597k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 12.0k, False: 585k]
  ------------------
  127|   597k|                 ? kInvalidFaceIndex
  128|   597k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   597k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 575k, False: 22.5k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   575k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 12.3k, False: 563k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  12.3k|            corner_traversal_stack_.pop_back();
  134|  12.3k|            break;  // Break from the while (true) loop.
  135|   563k|          } else {
  136|       |            // Go to the left face.
  137|   563k|            corner_id = left_corner_id;
  138|   563k|            face_id = left_face_id;
  139|   563k|          }
  140|   575k|        } else {
  141|       |          // Right face was not visited.
  142|  22.5k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 17.3k, False: 5.21k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  17.3k|            corner_id = right_corner_id;
  145|  17.3k|            face_id = right_face_id;
  146|  17.3k|          } 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.21k|            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.21k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  5.21k|            break;
  159|  5.21k|          }
  160|  22.5k|        }
  161|   597k|      }
  162|  17.5k|    }
  163|  7.60k|    return true;
  164|  7.60k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    645|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  1.32k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    929|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.04M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.04M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 699k, False: 1.34M]
  ------------------
   61|   699k|      return true;  // Already traversed.
   62|   699k|    }
   63|       |
   64|  1.34M|    corner_traversal_stack_.clear();
   65|  1.34M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  1.34M|    const VertexIndex next_vert =
   69|  1.34M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  1.34M|    const VertexIndex prev_vert =
   71|  1.34M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  1.34M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 1.34M]
  |  Branch (72:45): [True: 0, False: 1.34M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  1.34M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 1.34M, False: 807]
  ------------------
   76|  1.34M|      this->MarkVertexVisited(next_vert);
   77|  1.34M|      this->traversal_observer().OnNewVertexVisited(
   78|  1.34M|          next_vert, this->corner_table()->Next(corner_id));
   79|  1.34M|    }
   80|  1.34M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 1.32M, False: 12.7k]
  ------------------
   81|  1.32M|      this->MarkVertexVisited(prev_vert);
   82|  1.32M|      this->traversal_observer().OnNewVertexVisited(
   83|  1.32M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  1.32M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  2.72M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 1.38M, False: 1.34M]
  ------------------
   88|       |      // Currently processed corner.
   89|  1.38M|      corner_id = corner_traversal_stack_.back();
   90|  1.38M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  1.38M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 1.38M]
  |  Branch (92:47): [True: 2.72k, False: 1.38M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  2.72k|        corner_traversal_stack_.pop_back();
   95|  2.72k|        continue;
   96|  2.72k|      }
   97|  2.04M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.04M, Folded]
  ------------------
   98|  2.04M|        this->MarkFaceVisited(face_id);
   99|  2.04M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.04M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.04M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.04M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.04M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.69M, False: 347k]
  ------------------
  105|  1.69M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.69M|          this->MarkVertexVisited(vert_id);
  107|  1.69M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.69M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 328k, False: 1.36M]
  ------------------
  109|   328k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   328k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   328k|            continue;
  112|   328k|          }
  113|  1.69M|        }
  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.71M|        const CornerIndex right_corner_id =
  118|  1.71M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.71M|        const CornerIndex left_corner_id =
  120|  1.71M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.71M|        const FaceIndex right_face_id(
  122|  1.71M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 1.35M, False: 363k]
  ------------------
  123|  1.71M|                 ? kInvalidFaceIndex
  124|  1.71M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.71M|        const FaceIndex left_face_id(
  126|  1.71M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 1.35M, False: 355k]
  ------------------
  127|  1.71M|                 ? kInvalidFaceIndex
  128|  1.71M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.71M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.67M, False: 43.0k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.67M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 1.36M, False: 309k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  1.36M|            corner_traversal_stack_.pop_back();
  134|  1.36M|            break;  // Break from the while (true) loop.
  135|  1.36M|          } else {
  136|       |            // Go to the left face.
  137|   309k|            corner_id = left_corner_id;
  138|   309k|            face_id = left_face_id;
  139|   309k|          }
  140|  1.67M|        } else {
  141|       |          // Right face was not visited.
  142|  43.0k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 21.5k, False: 21.5k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  21.5k|            corner_id = right_corner_id;
  145|  21.5k|            face_id = right_face_id;
  146|  21.5k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  21.5k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  21.5k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  21.5k|            break;
  159|  21.5k|          }
  160|  43.0k|        }
  161|  1.71M|      }
  162|  1.38M|    }
  163|  1.34M|    return true;
  164|  1.34M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    929|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  1.87k|  DepthFirstTraverser() {}

_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   58|    242|  void OnTraversalStart() {
   59|    242|    prediction_degree_.resize(this->corner_table()->num_vertices(), 0);
   60|    242|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  1.17M|  bool TraverseFromCorner(CornerIndex corner_id) {
   66|  1.17M|    if (prediction_degree_.size() == 0) {
  ------------------
  |  Branch (66:9): [True: 0, False: 1.17M]
  ------------------
   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|  1.17M|    traversal_stacks_[0].push_back(corner_id);
   74|  1.17M|    best_priority_ = 0;
   75|       |    // For the first face, check the remaining corners as they may not be
   76|       |    // processed yet.
   77|  1.17M|    const VertexIndex next_vert =
   78|  1.17M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   79|  1.17M|    const VertexIndex prev_vert =
   80|  1.17M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   81|  1.17M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (81:9): [True: 60.0k, False: 1.11M]
  ------------------
   82|  60.0k|      this->MarkVertexVisited(next_vert);
   83|  60.0k|      this->traversal_observer().OnNewVertexVisited(
   84|  60.0k|          next_vert, this->corner_table()->Next(corner_id));
   85|  60.0k|    }
   86|  1.17M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (86:9): [True: 6.67k, False: 1.17M]
  ------------------
   87|  6.67k|      this->MarkVertexVisited(prev_vert);
   88|  6.67k|      this->traversal_observer().OnNewVertexVisited(
   89|  6.67k|          prev_vert, this->corner_table()->Previous(corner_id));
   90|  6.67k|    }
   91|  1.17M|    const VertexIndex tip_vertex = this->corner_table()->Vertex(corner_id);
   92|  1.17M|    if (!this->IsVertexVisited(tip_vertex)) {
  ------------------
  |  Branch (92:9): [True: 6.50k, False: 1.17M]
  ------------------
   93|  6.50k|      this->MarkVertexVisited(tip_vertex);
   94|  6.50k|      this->traversal_observer().OnNewVertexVisited(tip_vertex, corner_id);
   95|  6.50k|    }
   96|       |    // Start the actual traversal.
   97|  3.45M|    while ((corner_id = PopNextCornerToTraverse()) != kInvalidCornerIndex) {
  ------------------
  |  Branch (97:12): [True: 2.27M, False: 1.17M]
  ------------------
   98|  2.27M|      FaceIndex face_id(corner_id.value() / 3);
   99|       |      // Make sure the face hasn't been visited yet.
  100|  2.27M|      if (this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (100:11): [True: 1.66M, False: 607k]
  ------------------
  101|       |        // This face has been already traversed.
  102|  1.66M|        continue;
  103|  1.66M|      }
  104|       |
  105|  1.17M|      while (true) {
  ------------------
  |  Branch (105:14): [True: 1.17M, Folded]
  ------------------
  106|  1.17M|        face_id = FaceIndex(corner_id.value() / 3);
  107|  1.17M|        this->MarkFaceVisited(face_id);
  108|  1.17M|        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|  1.17M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  113|  1.17M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (113:13): [True: 563k, False: 616k]
  ------------------
  114|   563k|          this->MarkVertexVisited(vert_id);
  115|   563k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  116|   563k|        }
  117|       |
  118|       |        // Check whether we can traverse to the right and left neighboring
  119|       |        // faces.
  120|  1.17M|        const CornerIndex right_corner_id =
  121|  1.17M|            this->corner_table()->GetRightCorner(corner_id);
  122|  1.17M|        const CornerIndex left_corner_id =
  123|  1.17M|            this->corner_table()->GetLeftCorner(corner_id);
  124|  1.17M|        const FaceIndex right_face_id(
  125|  1.17M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (125:14): [True: 9.77k, False: 1.16M]
  ------------------
  126|  1.17M|                 ? kInvalidFaceIndex
  127|  1.17M|                 : FaceIndex(right_corner_id.value() / 3)));
  128|  1.17M|        const FaceIndex left_face_id(
  129|  1.17M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (129:14): [True: 65.1k, False: 1.11M]
  ------------------
  130|  1.17M|                 ? kInvalidFaceIndex
  131|  1.17M|                 : FaceIndex(left_corner_id.value() / 3)));
  132|  1.17M|        const bool is_right_face_visited = this->IsFaceVisited(right_face_id);
  133|  1.17M|        const bool is_left_face_visited = this->IsFaceVisited(left_face_id);
  134|       |
  135|  1.17M|        if (!is_left_face_visited) {
  ------------------
  |  Branch (135:13): [True: 848k, False: 331k]
  ------------------
  136|       |          // We can go to the left face.
  137|   848k|          const int priority = ComputePriority(left_corner_id);
  138|   848k|          if (is_right_face_visited && priority <= best_priority_) {
  ------------------
  |  Branch (138:15): [True: 292k, False: 555k]
  |  Branch (138:40): [True: 261k, False: 31.3k]
  ------------------
  139|       |            // Right face has been already visited and the priority is equal or
  140|       |            // better than the best priority. We are sure that the left face
  141|       |            // would be traversed next so there is no need to put it onto the
  142|       |            // stack.
  143|   261k|            corner_id = left_corner_id;
  144|   261k|            continue;
  145|   586k|          } else {
  146|   586k|            AddCornerToTraversalStack(left_corner_id, priority);
  147|   586k|          }
  148|   848k|        }
  149|   917k|        if (!is_right_face_visited) {
  ------------------
  |  Branch (149:13): [True: 820k, False: 97.6k]
  ------------------
  150|       |          // Go to the right face.
  151|   820k|          const int priority = ComputePriority(right_corner_id);
  152|   820k|          if (priority <= best_priority_) {
  ------------------
  |  Branch (152:15): [True: 310k, False: 509k]
  ------------------
  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|   310k|            corner_id = right_corner_id;
  156|   310k|            continue;
  157|   509k|          } else {
  158|   509k|            AddCornerToTraversalStack(right_corner_id, priority);
  159|   509k|          }
  160|   820k|        }
  161|       |
  162|       |        // Couldn't proceed directly to the next corner
  163|   607k|        break;
  164|   917k|      }
  165|   607k|    }
  166|  1.17M|    return true;
  167|  1.17M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE23PopNextCornerToTraverseEv:
  173|  3.45M|  CornerIndex PopNextCornerToTraverse() {
  174|  7.26M|    for (int i = best_priority_; i < kMaxPriority; ++i) {
  ------------------
  |  Branch (174:34): [True: 6.08M, False: 1.17M]
  ------------------
  175|  6.08M|      if (!traversal_stacks_[i].empty()) {
  ------------------
  |  Branch (175:11): [True: 2.27M, False: 3.81M]
  ------------------
  176|  2.27M|        const CornerIndex ret = traversal_stacks_[i].back();
  177|  2.27M|        traversal_stacks_[i].pop_back();
  178|  2.27M|        best_priority_ = i;
  179|  2.27M|        return ret;
  180|  2.27M|      }
  181|  6.08M|    }
  182|  1.17M|    return kInvalidCornerIndex;
  183|  3.45M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15ComputePriorityENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  194|  1.66M|  inline int ComputePriority(CornerIndex corner_id) {
  195|  1.66M|    const VertexIndex v_tip = this->corner_table()->Vertex(corner_id);
  196|       |    // Priority 0 when traversing to already visited vertices.
  197|  1.66M|    int priority = 0;
  198|  1.66M|    if (!this->IsVertexVisited(v_tip)) {
  ------------------
  |  Branch (198:9): [True: 1.10M, False: 563k]
  ------------------
  199|  1.10M|      const int degree = ++prediction_degree_[v_tip];
  200|       |      // Priority 1 when prediction degree > 1, otherwise 2.
  201|  1.10M|      priority = (degree > 1 ? 1 : 2);
  ------------------
  |  Branch (201:19): [True: 541k, False: 563k]
  ------------------
  202|  1.10M|    }
  203|       |    // Clamp the priority to the maximum number of buckets.
  204|  1.66M|    if (priority >= kMaxPriority) {
  ------------------
  |  Branch (204:9): [True: 0, False: 1.66M]
  ------------------
  205|      0|      priority = kMaxPriority - 1;
  206|      0|    }
  207|  1.66M|    return priority;
  208|  1.66M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE25AddCornerToTraversalStackENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEi:
  185|  1.09M|  inline void AddCornerToTraversalStack(CornerIndex ci, int priority) {
  186|  1.09M|    traversal_stacks_[priority].push_back(ci);
  187|       |    // Make sure that the best available priority is up to date.
  188|  1.09M|    if (priority < best_priority_) {
  ------------------
  |  Branch (188:9): [True: 265k, False: 830k]
  ------------------
  189|   265k|      best_priority_ = priority;
  190|   265k|    }
  191|  1.09M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   63|    242|  void OnTraversalEnd() {}
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   55|    500|  MaxPredictionDegreeTraverser() {}

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

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

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  1.87k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  14.7M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  7.57M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  7.57M|    return is_vertex_visited_[vert_id.value()];
   65|  7.57M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  1.23M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  1.23M|    is_vertex_visited_[vert_id.value()] = true;
   68|  1.23M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  3.58M|  inline TraversalObserverT &traversal_observer() {
   75|  3.58M|    return traversal_observer_;
   76|  3.58M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  5.84M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  5.84M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 100k, False: 5.74M]
  ------------------
   47|   100k|      return true;  // Invalid faces are always considered as visited.
   48|   100k|    }
   49|  5.74M|    return is_face_visited_[face_id.value()];
   50|  5.84M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.34M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.34M|    is_face_visited_[face_id.value()] = true;
   62|  2.34M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  1.82k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  1.82k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    910|                    TraversalObserver traversal_observer) {
   37|    910|    corner_table_ = corner_table;
   38|    910|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    910|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    910|    traversal_observer_ = traversal_observer;
   41|    910|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.17M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.17M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.17M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.17M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.17M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  15.5M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.04M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.04M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.04M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.04M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.04M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  4.72M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  4.72M|    return is_vertex_visited_[vert_id.value()];
   65|  4.72M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  4.36M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  4.36M|    is_vertex_visited_[vert_id.value()] = true;
   68|  4.36M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  6.40M|  inline TraversalObserverT &traversal_observer() {
   75|  6.40M|    return traversal_observer_;
   76|  6.40M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  4.81M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  4.81M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 2.70M, False: 2.10M]
  ------------------
   47|  2.70M|      return true;  // Invalid faces are always considered as visited.
   48|  2.70M|    }
   49|  2.10M|    return is_face_visited_[face_id.value()];
   50|  4.81M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.04M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.04M|    is_face_visited_[face_id.value()] = true;
   62|  2.04M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  1.87k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    935|                    TraversalObserver traversal_observer) {
   37|    935|    corner_table_ = corner_table;
   38|    935|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    935|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    935|    traversal_observer_ = traversal_observer;
   41|    935|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     89|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     89|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 86]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|     86|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 83]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     83|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 81]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|     81|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 34, False: 47]
  ------------------
  196|     34|    return true;
  197|     34|  }
  198|     47|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 5, False: 42]
  ------------------
  199|      5|    return false;
  200|      5|  }
  201|     42|  num_decoded_points_ = 0;
  202|       |
  203|     42|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 6, False: 36]
  ------------------
  204|      6|    return false;
  205|      6|  }
  206|     36|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 34]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     34|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 34]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     34|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 34]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     34|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 24, False: 10]
  ------------------
  217|     24|    return false;
  218|     24|  }
  219|       |
  220|     10|  numbers_decoder_.EndDecoding();
  221|     10|  remaining_bits_decoder_.EndDecoding();
  222|     10|  axis_decoder_.EndDecoding();
  223|     10|  half_decoder_.EndDecoding();
  224|       |
  225|     10|  return true;
  226|     34|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     34|    uint32_t num_points, OutputIteratorT &oit) {
  254|     34|  typedef DecodingStatus Status;
  255|     34|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     34|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     34|  DecodingStatus init_status(num_points, 0, 0);
  258|     34|  std::stack<Status> status_stack;
  259|     34|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  75.6k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 75.6k, False: 10]
  ------------------
  263|  75.6k|    const DecodingStatus status = status_stack.top();
  264|  75.6k|    status_stack.pop();
  265|       |
  266|  75.6k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  75.6k|    const uint32_t last_axis = status.last_axis;
  268|  75.6k|    const uint32_t stack_pos = status.stack_pos;
  269|  75.6k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  75.6k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  75.6k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 75.6k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  75.6k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  75.6k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 75.6k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  75.6k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  75.6k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 33.5k, False: 42.1k]
  ------------------
  285|  8.13M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 8.10M, False: 33.5k]
  ------------------
  286|  8.10M|        *oit = old_base;
  287|  8.10M|        ++oit;
  288|  8.10M|        ++num_decoded_points_;
  289|  8.10M|      }
  290|  33.5k|      continue;
  291|  33.5k|    }
  292|       |
  293|  42.1k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  42.1k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 3.91k, False: 38.2k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  3.91k|      axes_[0] = axis;
  300|  12.4k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 8.57k, False: 3.91k]
  ------------------
  301|  8.57k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  8.57k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.48k, False: 6.08k]
  |  |  ------------------
  ------------------
  302|  8.57k|      }
  303|  10.3k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 6.47k, False: 3.90k]
  ------------------
  304|  26.7k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 20.3k, False: 6.46k]
  ------------------
  305|  20.3k|          p_[axes_[j]] = 0;
  306|  20.3k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  20.3k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 17.6k, False: 2.65k]
  ------------------
  308|  17.6k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 8, False: 17.6k]
  ------------------
  309|  17.6k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      8|              return false;
  311|      8|            }
  312|  17.6k|          }
  313|  20.3k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  20.3k|        }
  315|  6.46k|        *oit = p_;
  316|  6.46k|        ++oit;
  317|  6.46k|        ++num_decoded_points_;
  318|  6.46k|      }
  319|  3.90k|      continue;
  320|  3.91k|    }
  321|       |
  322|  38.2k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 38.2k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  38.2k|    const int num_remaining_bits = bit_length_ - level;
  327|  38.2k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  38.2k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  38.2k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  38.2k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  38.2k|    uint32_t number = 0;
  334|  38.2k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  38.2k|    uint32_t first_half = num_remaining_points / 2;
  337|  38.2k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 16, False: 38.2k]
  ------------------
  338|       |      // Invalid |number|.
  339|     16|      return false;
  340|     16|    }
  341|  38.2k|    first_half -= number;
  342|  38.2k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  38.2k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 21.0k, False: 17.1k]
  ------------------
  345|  21.0k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 18.3k, False: 2.76k]
  ------------------
  346|  18.3k|        std::swap(first_half, second_half);
  347|  18.3k|      }
  348|  21.0k|    }
  349|       |
  350|  38.2k|    levels_stack_[stack_pos][axis] += 1;
  351|  38.2k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  38.2k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 38.1k, False: 83]
  ------------------
  353|  38.1k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  38.1k|    }
  355|  38.2k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 37.8k, False: 341]
  ------------------
  356|  37.8k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  37.8k|    }
  358|  38.2k|  }
  359|     10|  return true;
  360|     34|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  1.60M|        : num_remaining_points(num_remaining_points_),
  135|  1.60M|          last_axis(last_axis_),
  136|  1.60M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|   801k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   801k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   801k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     34|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    143|      : bit_length_(0),
   87|    143|        num_points_(0),
   88|    143|        num_decoded_points_(0),
   89|    143|        dimension_(dimension),
   90|    143|        p_(dimension, 0),
   91|    143|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    143|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    143|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     44|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     44|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 41]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|     41|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 39]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|     39|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 39]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     39|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 6, False: 33]
  ------------------
  196|      6|    return true;
  197|      6|  }
  198|     33|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 33]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     33|  num_decoded_points_ = 0;
  202|       |
  203|     33|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 32]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|     32|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 6, False: 26]
  ------------------
  207|      6|    return false;
  208|      6|  }
  209|     26|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 26]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     26|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 24]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     24|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 21, False: 3]
  ------------------
  217|     21|    return false;
  218|     21|  }
  219|       |
  220|      3|  numbers_decoder_.EndDecoding();
  221|      3|  remaining_bits_decoder_.EndDecoding();
  222|      3|  axis_decoder_.EndDecoding();
  223|      3|  half_decoder_.EndDecoding();
  224|       |
  225|      3|  return true;
  226|     24|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     24|    uint32_t num_points, OutputIteratorT &oit) {
  254|     24|  typedef DecodingStatus Status;
  255|     24|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     24|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     24|  DecodingStatus init_status(num_points, 0, 0);
  258|     24|  std::stack<Status> status_stack;
  259|     24|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.24M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.24M, False: 3]
  ------------------
  263|  2.24M|    const DecodingStatus status = status_stack.top();
  264|  2.24M|    status_stack.pop();
  265|       |
  266|  2.24M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.24M|    const uint32_t last_axis = status.last_axis;
  268|  2.24M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.24M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.24M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.24M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.24M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.24M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.24M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.24M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.24M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.24M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.12M, False: 1.12M]
  ------------------
  285|  11.6M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 10.5M, False: 1.12M]
  ------------------
  286|  10.5M|        *oit = old_base;
  287|  10.5M|        ++oit;
  288|  10.5M|        ++num_decoded_points_;
  289|  10.5M|      }
  290|  1.12M|      continue;
  291|  1.12M|    }
  292|       |
  293|  1.12M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  1.12M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.12k, False: 1.12M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.12k|      axes_[0] = axis;
  300|  7.70k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 6.57k, False: 1.12k]
  ------------------
  301|  6.57k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  6.57k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 311, False: 6.26k]
  |  |  ------------------
  ------------------
  302|  6.57k|      }
  303|  3.10k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.98k, False: 1.12k]
  ------------------
  304|  15.3k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 13.3k, False: 1.97k]
  ------------------
  305|  13.3k|          p_[axes_[j]] = 0;
  306|  13.3k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  13.3k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.97k, False: 9.36k]
  ------------------
  308|  3.97k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 9, False: 3.96k]
  ------------------
  309|  3.97k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      9|              return false;
  311|      9|            }
  312|  3.97k|          }
  313|  13.3k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  13.3k|        }
  315|  1.97k|        *oit = p_;
  316|  1.97k|        ++oit;
  317|  1.97k|        ++num_decoded_points_;
  318|  1.97k|      }
  319|  1.12k|      continue;
  320|  1.12k|    }
  321|       |
  322|  1.12M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.12M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.12M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.12M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.12M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.12M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.12M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.12M|    uint32_t number = 0;
  334|  1.12M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.12M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.12M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 12, False: 1.12M]
  ------------------
  338|       |      // Invalid |number|.
  339|     12|      return false;
  340|     12|    }
  341|  1.12M|    first_half -= number;
  342|  1.12M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.12M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 595k, False: 526k]
  ------------------
  345|   595k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 590k, False: 4.16k]
  ------------------
  346|   590k|        std::swap(first_half, second_half);
  347|   590k|      }
  348|   595k|    }
  349|       |
  350|  1.12M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.12M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.12M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.12M, False: 90]
  ------------------
  353|  1.12M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.12M|    }
  355|  1.12M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.12M, False: 111]
  ------------------
  356|  1.12M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.12M|    }
  358|  1.12M|  }
  359|      3|  return true;
  360|     24|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  8.65M|        : num_remaining_points(num_remaining_points_),
  135|  8.65M|          last_axis(last_axis_),
  136|  8.65M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  8.65M|    uint32_t last_axis) {
  232|  8.65M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 8.65M, Folded]
  ------------------
  233|  8.65M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  8.65M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.96M, False: 4.69M]
  |  |  ------------------
  ------------------
  234|  8.65M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  8.65M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  4.33M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  4.33M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  4.33M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|      6|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     39|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     39|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 39]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     39|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 4, False: 35]
  ------------------
  190|      4|    return false;
  191|      4|  }
  192|     35|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 35]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     35|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 6, False: 29]
  ------------------
  196|      6|    return true;
  197|      6|  }
  198|     29|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 5, False: 24]
  ------------------
  199|      5|    return false;
  200|      5|  }
  201|     24|  num_decoded_points_ = 0;
  202|       |
  203|     24|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 21]
  ------------------
  204|      3|    return false;
  205|      3|  }
  206|     21|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 19]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     19|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 4, False: 15]
  ------------------
  210|      4|    return false;
  211|      4|  }
  212|     15|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 15]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     15|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 15, False: 0]
  ------------------
  217|     15|    return false;
  218|     15|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     15|    uint32_t num_points, OutputIteratorT &oit) {
  254|     15|  typedef DecodingStatus Status;
  255|     15|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     15|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     15|  DecodingStatus init_status(num_points, 0, 0);
  258|     15|  std::stack<Status> status_stack;
  259|     15|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  22.8k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 22.8k, False: 0]
  ------------------
  263|  22.8k|    const DecodingStatus status = status_stack.top();
  264|  22.8k|    status_stack.pop();
  265|       |
  266|  22.8k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  22.8k|    const uint32_t last_axis = status.last_axis;
  268|  22.8k|    const uint32_t stack_pos = status.stack_pos;
  269|  22.8k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  22.8k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  22.8k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 22.8k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  22.8k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  22.8k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 22.8k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  22.8k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  22.8k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.95k, False: 19.9k]
  ------------------
  285|   663k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 660k, False: 2.95k]
  ------------------
  286|   660k|        *oit = old_base;
  287|   660k|        ++oit;
  288|   660k|        ++num_decoded_points_;
  289|   660k|      }
  290|  2.95k|      continue;
  291|  2.95k|    }
  292|       |
  293|  19.9k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  19.9k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 91, False: 19.8k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     91|      axes_[0] = axis;
  300|    372|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 281, False: 91]
  ------------------
  301|    281|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    281|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 42, False: 239]
  |  |  ------------------
  ------------------
  302|    281|      }
  303|    242|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 156, False: 86]
  ------------------
  304|    770|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 619, False: 151]
  ------------------
  305|    619|          p_[axes_[j]] = 0;
  306|    619|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|    619|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 517, False: 102]
  ------------------
  308|    517|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 5, False: 512]
  ------------------
  309|    517|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      5|              return false;
  311|      5|            }
  312|    517|          }
  313|    614|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|    614|        }
  315|    151|        *oit = p_;
  316|    151|        ++oit;
  317|    151|        ++num_decoded_points_;
  318|    151|      }
  319|     86|      continue;
  320|     91|    }
  321|       |
  322|  19.8k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 19.8k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  19.8k|    const int num_remaining_bits = bit_length_ - level;
  327|  19.8k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  19.8k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  19.8k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  19.8k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  19.8k|    uint32_t number = 0;
  334|  19.8k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  19.8k|    uint32_t first_half = num_remaining_points / 2;
  337|  19.8k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 10, False: 19.8k]
  ------------------
  338|       |      // Invalid |number|.
  339|     10|      return false;
  340|     10|    }
  341|  19.8k|    first_half -= number;
  342|  19.8k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  19.8k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 18.3k, False: 1.52k]
  ------------------
  345|  18.3k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 15.2k, False: 3.02k]
  ------------------
  346|  15.2k|        std::swap(first_half, second_half);
  347|  15.2k|      }
  348|  18.3k|    }
  349|       |
  350|  19.8k|    levels_stack_[stack_pos][axis] += 1;
  351|  19.8k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  19.8k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 17.0k, False: 2.76k]
  ------------------
  353|  17.0k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  17.0k|    }
  355|  19.8k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 5.93k, False: 13.9k]
  ------------------
  356|  5.93k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  5.93k|    }
  358|  19.8k|  }
  359|      0|  return true;
  360|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|   118k|        : num_remaining_points(num_remaining_points_),
  135|   118k|          last_axis(last_axis_),
  136|   118k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  67.8k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  67.8k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  67.8k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|      6|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|     88|      : bit_length_(0),
   87|     88|        num_points_(0),
   88|     88|        num_decoded_points_(0),
   89|     88|        dimension_(dimension),
   90|     88|        p_(dimension, 0),
   91|     88|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     88|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     88|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     35|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     35|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 35]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     35|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 33]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|     33|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 33]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     33|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 9, False: 24]
  ------------------
  196|      9|    return true;
  197|      9|  }
  198|     24|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 1, False: 23]
  ------------------
  199|      1|    return false;
  200|      1|  }
  201|     23|  num_decoded_points_ = 0;
  202|       |
  203|     23|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 23]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|     23|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 5, False: 18]
  ------------------
  207|      5|    return false;
  208|      5|  }
  209|     18|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 18]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     18|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 18]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     18|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 18, False: 0]
  ------------------
  217|     18|    return false;
  218|     18|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|     18|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     18|    uint32_t num_points, OutputIteratorT &oit) {
  254|     18|  typedef DecodingStatus Status;
  255|     18|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     18|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     18|  DecodingStatus init_status(num_points, 0, 0);
  258|     18|  std::stack<Status> status_stack;
  259|     18|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  15.0k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 15.0k, False: 0]
  ------------------
  263|  15.0k|    const DecodingStatus status = status_stack.top();
  264|  15.0k|    status_stack.pop();
  265|       |
  266|  15.0k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  15.0k|    const uint32_t last_axis = status.last_axis;
  268|  15.0k|    const uint32_t stack_pos = status.stack_pos;
  269|  15.0k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  15.0k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  15.0k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 15.0k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  15.0k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  15.0k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 15.0k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  15.0k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  15.0k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 9, False: 15.0k]
  ------------------
  285|  3.08k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 3.07k, False: 9]
  ------------------
  286|  3.07k|        *oit = old_base;
  287|  3.07k|        ++oit;
  288|  3.07k|        ++num_decoded_points_;
  289|  3.07k|      }
  290|      9|      continue;
  291|      9|    }
  292|       |
  293|  15.0k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  15.0k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.17k, False: 13.8k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.17k|      axes_[0] = axis;
  300|  2.41k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.24k, False: 1.17k]
  ------------------
  301|  1.24k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.24k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 619, False: 622]
  |  |  ------------------
  ------------------
  302|  1.24k|      }
  303|  3.05k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.87k, False: 1.17k]
  ------------------
  304|  5.73k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.85k, False: 1.87k]
  ------------------
  305|  3.85k|          p_[axes_[j]] = 0;
  306|  3.85k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.85k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.81k, False: 48]
  ------------------
  308|  3.81k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 1, False: 3.80k]
  ------------------
  309|  3.81k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      1|              return false;
  311|      1|            }
  312|  3.81k|          }
  313|  3.85k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  3.85k|        }
  315|  1.87k|        *oit = p_;
  316|  1.87k|        ++oit;
  317|  1.87k|        ++num_decoded_points_;
  318|  1.87k|      }
  319|  1.17k|      continue;
  320|  1.17k|    }
  321|       |
  322|  13.8k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 13.8k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  13.8k|    const int num_remaining_bits = bit_length_ - level;
  327|  13.8k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  13.8k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  13.8k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  13.8k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  13.8k|    uint32_t number = 0;
  334|  13.8k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  13.8k|    uint32_t first_half = num_remaining_points / 2;
  337|  13.8k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 17, False: 13.8k]
  ------------------
  338|       |      // Invalid |number|.
  339|     17|      return false;
  340|     17|    }
  341|  13.8k|    first_half -= number;
  342|  13.8k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  13.8k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 13.4k, False: 411]
  ------------------
  345|  13.4k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 11.3k, False: 2.03k]
  ------------------
  346|  11.3k|        std::swap(first_half, second_half);
  347|  11.3k|      }
  348|  13.4k|    }
  349|       |
  350|  13.8k|    levels_stack_[stack_pos][axis] += 1;
  351|  13.8k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  13.8k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 11.8k, False: 1.97k]
  ------------------
  353|  11.8k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  11.8k|    }
  355|  13.8k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 3.33k, False: 10.4k]
  ------------------
  356|  3.33k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  3.33k|    }
  358|  13.8k|  }
  359|      0|  return true;
  360|     18|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  73.3k|        : num_remaining_points(num_remaining_points_),
  135|  73.3k|          last_axis(last_axis_),
  136|  73.3k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  72.1k|    uint32_t last_axis) {
  232|  72.1k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 72.1k, Folded]
  ------------------
  233|  72.1k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  72.1k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 18.2k, False: 53.9k]
  |  |  ------------------
  ------------------
  234|  72.1k|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  72.1k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  43.0k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  43.0k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  43.0k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|      9|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    122|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    122|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 121]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    121|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 118]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|    118|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 118]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    118|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 20, False: 98]
  ------------------
  196|     20|    return true;
  197|     20|  }
  198|     98|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 7, False: 91]
  ------------------
  199|      7|    return false;
  200|      7|  }
  201|     91|  num_decoded_points_ = 0;
  202|       |
  203|     91|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 90]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|     90|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 89]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     89|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 6, False: 83]
  ------------------
  210|      6|    return false;
  211|      6|  }
  212|     83|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 82]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     82|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 55, False: 27]
  ------------------
  217|     55|    return false;
  218|     55|  }
  219|       |
  220|     27|  numbers_decoder_.EndDecoding();
  221|     27|  remaining_bits_decoder_.EndDecoding();
  222|     27|  axis_decoder_.EndDecoding();
  223|     27|  half_decoder_.EndDecoding();
  224|       |
  225|     27|  return true;
  226|     82|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     82|    uint32_t num_points, OutputIteratorT &oit) {
  254|     82|  typedef DecodingStatus Status;
  255|     82|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     82|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     82|  DecodingStatus init_status(num_points, 0, 0);
  258|     82|  std::stack<Status> status_stack;
  259|     82|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  4.01M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.01M, False: 27]
  ------------------
  263|  4.01M|    const DecodingStatus status = status_stack.top();
  264|  4.01M|    status_stack.pop();
  265|       |
  266|  4.01M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.01M|    const uint32_t last_axis = status.last_axis;
  268|  4.01M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.01M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.01M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.01M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.01M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.01M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.01M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.01M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.01M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.01M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.90M, False: 2.10M]
  ------------------
  285|  84.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 82.8M, False: 1.90M]
  ------------------
  286|  82.8M|        *oit = old_base;
  287|  82.8M|        ++oit;
  288|  82.8M|        ++num_decoded_points_;
  289|  82.8M|      }
  290|  1.90M|      continue;
  291|  1.90M|    }
  292|       |
  293|  2.10M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  2.10M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 92.9k, False: 2.01M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  92.9k|      axes_[0] = axis;
  300|   134k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 41.8k, False: 92.9k]
  ------------------
  301|  41.8k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  41.8k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 15.1k, False: 26.6k]
  |  |  ------------------
  ------------------
  302|  41.8k|      }
  303|   239k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 146k, False: 92.9k]
  ------------------
  304|   350k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 203k, False: 146k]
  ------------------
  305|   203k|          p_[axes_[j]] = 0;
  306|   203k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   203k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 185k, False: 18.4k]
  ------------------
  308|   185k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 50, False: 185k]
  ------------------
  309|   185k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     50|              return false;
  311|     50|            }
  312|   185k|          }
  313|   203k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   203k|        }
  315|   146k|        *oit = p_;
  316|   146k|        ++oit;
  317|   146k|        ++num_decoded_points_;
  318|   146k|      }
  319|  92.9k|      continue;
  320|  92.9k|    }
  321|       |
  322|  2.01M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.01M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.01M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.01M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.01M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.01M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.01M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.01M|    uint32_t number = 0;
  334|  2.01M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.01M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.01M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 5, False: 2.01M]
  ------------------
  338|       |      // Invalid |number|.
  339|      5|      return false;
  340|      5|    }
  341|  2.01M|    first_half -= number;
  342|  2.01M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.01M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.94M, False: 70.0k]
  ------------------
  345|  1.94M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.92M, False: 26.3k]
  ------------------
  346|  1.92M|        std::swap(first_half, second_half);
  347|  1.92M|      }
  348|  1.94M|    }
  349|       |
  350|  2.01M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.01M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.01M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.00M, False: 8.14k]
  ------------------
  353|  2.00M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.00M|    }
  355|  2.01M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.00M, False: 11.7k]
  ------------------
  356|  2.00M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.00M|    }
  358|  2.01M|  }
  359|     27|  return true;
  360|     82|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  4.01M|        : num_remaining_points(num_remaining_points_),
  135|  4.01M|          last_axis(last_axis_),
  136|  4.01M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  2.01M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.01M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.01M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     47|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    154|      : bit_length_(0),
   87|    154|        num_points_(0),
   88|    154|        num_decoded_points_(0),
   89|    154|        dimension_(dimension),
   90|    154|        p_(dimension, 0),
   91|    154|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    154|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    154|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    135|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    135|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 135]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    135|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 134]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|    134|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 134]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    134|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 7, False: 127]
  ------------------
  196|      7|    return true;
  197|      7|  }
  198|    127|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 7, False: 120]
  ------------------
  199|      7|    return false;
  200|      7|  }
  201|    120|  num_decoded_points_ = 0;
  202|       |
  203|    120|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 19, False: 101]
  ------------------
  204|     19|    return false;
  205|     19|  }
  206|    101|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 98]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     98|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 6, False: 92]
  ------------------
  210|      6|    return false;
  211|      6|  }
  212|     92|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 6, False: 86]
  ------------------
  213|      6|    return false;
  214|      6|  }
  215|       |
  216|     86|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 45, False: 41]
  ------------------
  217|     45|    return false;
  218|     45|  }
  219|       |
  220|     41|  numbers_decoder_.EndDecoding();
  221|     41|  remaining_bits_decoder_.EndDecoding();
  222|     41|  axis_decoder_.EndDecoding();
  223|     41|  half_decoder_.EndDecoding();
  224|       |
  225|     41|  return true;
  226|     86|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     86|    uint32_t num_points, OutputIteratorT &oit) {
  254|     86|  typedef DecodingStatus Status;
  255|     86|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     86|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     86|  DecodingStatus init_status(num_points, 0, 0);
  258|     86|  std::stack<Status> status_stack;
  259|     86|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.46M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.46M, False: 41]
  ------------------
  263|  2.46M|    const DecodingStatus status = status_stack.top();
  264|  2.46M|    status_stack.pop();
  265|       |
  266|  2.46M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.46M|    const uint32_t last_axis = status.last_axis;
  268|  2.46M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.46M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.46M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.46M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.46M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.46M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.46M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.46M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.46M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.46M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.14M, False: 1.31M]
  ------------------
  285|   108M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 107M, False: 1.14M]
  ------------------
  286|   107M|        *oit = old_base;
  287|   107M|        ++oit;
  288|   107M|        ++num_decoded_points_;
  289|   107M|      }
  290|  1.14M|      continue;
  291|  1.14M|    }
  292|       |
  293|  1.31M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  1.31M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 66.6k, False: 1.24M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  66.6k|      axes_[0] = axis;
  300|   229k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 162k, False: 66.6k]
  ------------------
  301|   162k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   162k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 20.3k, False: 142k]
  |  |  ------------------
  ------------------
  302|   162k|      }
  303|   165k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 98.4k, False: 66.6k]
  ------------------
  304|   463k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 365k, False: 98.3k]
  ------------------
  305|   365k|          p_[axes_[j]] = 0;
  306|   365k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   365k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 154k, False: 211k]
  ------------------
  308|   154k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 44, False: 154k]
  ------------------
  309|   154k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     44|              return false;
  311|     44|            }
  312|   154k|          }
  313|   365k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   365k|        }
  315|  98.3k|        *oit = p_;
  316|  98.3k|        ++oit;
  317|  98.3k|        ++num_decoded_points_;
  318|  98.3k|      }
  319|  66.6k|      continue;
  320|  66.6k|    }
  321|       |
  322|  1.24M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.24M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.24M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.24M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.24M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.24M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.24M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.24M|    uint32_t number = 0;
  334|  1.24M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.24M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.24M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 1.24M]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|  1.24M|    first_half -= number;
  342|  1.24M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.24M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.21M, False: 32.1k]
  ------------------
  345|  1.21M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.17M, False: 43.7k]
  ------------------
  346|  1.17M|        std::swap(first_half, second_half);
  347|  1.17M|      }
  348|  1.21M|    }
  349|       |
  350|  1.24M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.24M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.24M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.23M, False: 14.5k]
  ------------------
  353|  1.23M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.23M|    }
  355|  1.24M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.22M, False: 20.9k]
  ------------------
  356|  1.22M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.22M|    }
  358|  1.24M|  }
  359|     41|  return true;
  360|     86|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  2.46M|        : num_remaining_points(num_remaining_points_),
  135|  2.46M|          last_axis(last_axis_),
  136|  2.46M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.46M|    uint32_t last_axis) {
  232|  2.46M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.46M, Folded]
  ------------------
  233|  2.46M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.46M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 940k, False: 1.52M]
  |  |  ------------------
  ------------------
  234|  2.46M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  2.46M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.24M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.24M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.24M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     47|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    110|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    110|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 109]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    109|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 108]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|    108|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 108]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    108|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 13, False: 95]
  ------------------
  196|     13|    return true;
  197|     13|  }
  198|     95|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 93]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|     93|  num_decoded_points_ = 0;
  202|       |
  203|     93|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 6, False: 87]
  ------------------
  204|      6|    return false;
  205|      6|  }
  206|     87|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 85]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     85|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 84]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     84|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 82]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     82|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 68, False: 14]
  ------------------
  217|     68|    return false;
  218|     68|  }
  219|       |
  220|     14|  numbers_decoder_.EndDecoding();
  221|     14|  remaining_bits_decoder_.EndDecoding();
  222|     14|  axis_decoder_.EndDecoding();
  223|     14|  half_decoder_.EndDecoding();
  224|       |
  225|     14|  return true;
  226|     82|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     82|    uint32_t num_points, OutputIteratorT &oit) {
  254|     82|  typedef DecodingStatus Status;
  255|     82|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     82|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     82|  DecodingStatus init_status(num_points, 0, 0);
  258|     82|  std::stack<Status> status_stack;
  259|     82|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   172k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 172k, False: 14]
  ------------------
  263|   172k|    const DecodingStatus status = status_stack.top();
  264|   172k|    status_stack.pop();
  265|       |
  266|   172k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   172k|    const uint32_t last_axis = status.last_axis;
  268|   172k|    const uint32_t stack_pos = status.stack_pos;
  269|   172k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   172k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   172k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 172k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   172k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   172k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 7, False: 172k]
  ------------------
  278|      7|      return false;
  279|      7|    }
  280|       |
  281|   172k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   172k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 485, False: 172k]
  ------------------
  285|  60.6k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 60.1k, False: 485]
  ------------------
  286|  60.1k|        *oit = old_base;
  287|  60.1k|        ++oit;
  288|  60.1k|        ++num_decoded_points_;
  289|  60.1k|      }
  290|    485|      continue;
  291|    485|    }
  292|       |
  293|   172k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   172k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 638, False: 171k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    638|      axes_[0] = axis;
  300|  40.0k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 39.4k, False: 638]
  ------------------
  301|  39.4k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  39.4k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 618, False: 38.8k]
  |  |  ------------------
  ------------------
  302|  39.4k|      }
  303|  1.46k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 856, False: 606]
  ------------------
  304|  51.5k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 50.7k, False: 824]
  ------------------
  305|  50.7k|          p_[axes_[j]] = 0;
  306|  50.7k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  50.7k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 50.5k, False: 227]
  ------------------
  308|  50.5k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 32, False: 50.5k]
  ------------------
  309|  50.5k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     32|              return false;
  311|     32|            }
  312|  50.5k|          }
  313|  50.7k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  50.7k|        }
  315|    824|        *oit = p_;
  316|    824|        ++oit;
  317|    824|        ++num_decoded_points_;
  318|    824|      }
  319|    606|      continue;
  320|    638|    }
  321|       |
  322|   171k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 171k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   171k|    const int num_remaining_bits = bit_length_ - level;
  327|   171k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   171k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   171k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   171k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   171k|    uint32_t number = 0;
  334|   171k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   171k|    uint32_t first_half = num_remaining_points / 2;
  337|   171k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 29, False: 171k]
  ------------------
  338|       |      // Invalid |number|.
  339|     29|      return false;
  340|     29|    }
  341|   171k|    first_half -= number;
  342|   171k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   171k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 171k, False: 77]
  ------------------
  345|   171k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 129k, False: 42.0k]
  ------------------
  346|   129k|        std::swap(first_half, second_half);
  347|   129k|      }
  348|   171k|    }
  349|       |
  350|   171k|    levels_stack_[stack_pos][axis] += 1;
  351|   171k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   171k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 129k, False: 41.6k]
  ------------------
  353|   129k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   129k|    }
  355|   171k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 42.8k, False: 128k]
  ------------------
  356|  42.8k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  42.8k|    }
  358|   171k|  }
  359|     14|  return true;
  360|     82|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   172k|        : num_remaining_points(num_remaining_points_),
  135|   172k|          last_axis(last_axis_),
  136|   172k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   171k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   171k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   171k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     27|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    115|      : bit_length_(0),
   87|    115|        num_points_(0),
   88|    115|        num_decoded_points_(0),
   89|    115|        dimension_(dimension),
   90|    115|        p_(dimension, 0),
   91|    115|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    115|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    115|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     39|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     39|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     39|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|     82|      : bit_length_(0),
   87|     82|        num_points_(0),
   88|     82|        num_decoded_points_(0),
   89|     82|        dimension_(dimension),
   90|     82|        p_(dimension, 0),
   91|     82|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     82|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     82|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     34|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     34|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     34|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      6|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      6|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      6|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    109|      : bit_length_(0),
   87|    109|        num_points_(0),
   88|    109|        num_decoded_points_(0),
   89|    109|        dimension_(dimension),
   90|    109|        p_(dimension, 0),
   91|    109|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    109|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    109|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     14|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     14|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     14|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    139|      : bit_length_(0),
   87|    139|        num_points_(0),
   88|    139|        num_decoded_points_(0),
   89|    139|        dimension_(dimension),
   90|    139|        p_(dimension, 0),
   91|    139|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    139|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    139|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      1|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      1|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.60M|    uint32_t last_axis) {
  232|  1.60M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.60M, Folded]
  ------------------
  233|  1.60M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.60M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 459k, False: 1.14M]
  |  |  ------------------
  ------------------
  234|  1.60M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  1.60M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   117k|    uint32_t last_axis) {
  232|   117k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 117k, Folded]
  ------------------
  233|   117k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|   117k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 29.3k, False: 88.5k]
  |  |  ------------------
  ------------------
  234|   117k|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|   117k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.01M|    uint32_t last_axis) {
  232|  4.01M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.01M, Folded]
  ------------------
  233|  4.01M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.01M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.90M, False: 106k]
  |  |  ------------------
  ------------------
  234|  4.01M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  4.01M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   172k|    uint32_t last_axis) {
  232|   172k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 172k]
  ------------------
  233|      0|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|      0|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  234|      0|  }
  235|       |
  236|   172k|  uint32_t best_axis = 0;
  237|   172k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 172k, False: 736]
  ------------------
  238|  19.0M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 18.8M, False: 172k]
  ------------------
  239|  18.8M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 204k, False: 18.6M]
  ------------------
  240|   204k|        best_axis = axis;
  241|   204k|      }
  242|  18.8M|    }
  243|   172k|  } else {
  244|    736|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|    736|  }
  246|       |
  247|   172k|  return best_axis;
  248|   172k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     54|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     54|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     54|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     54|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     54|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 54]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     54|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 4, False: 50]
  ------------------
  190|      4|    return false;
  191|      4|  }
  192|     50|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 50]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     50|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 49]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     49|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 49]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     49|  num_decoded_points_ = 0;
  202|       |
  203|     49|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 45]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|     45|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 44]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     44|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 44]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     44|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 44]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     44|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 33, False: 11]
  ------------------
  217|     33|    return false;
  218|     33|  }
  219|       |
  220|     11|  numbers_decoder_.EndDecoding();
  221|     11|  remaining_bits_decoder_.EndDecoding();
  222|     11|  axis_decoder_.EndDecoding();
  223|     11|  half_decoder_.EndDecoding();
  224|       |
  225|     11|  return true;
  226|     44|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     44|    uint32_t num_points, OutputIteratorT &oit) {
  254|     44|  typedef DecodingStatus Status;
  255|     44|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     44|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     44|  DecodingStatus init_status(num_points, 0, 0);
  258|     44|  std::stack<Status> status_stack;
  259|     44|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.52M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.52M, False: 11]
  ------------------
  263|  1.52M|    const DecodingStatus status = status_stack.top();
  264|  1.52M|    status_stack.pop();
  265|       |
  266|  1.52M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.52M|    const uint32_t last_axis = status.last_axis;
  268|  1.52M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.52M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.52M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.52M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.52M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.52M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.52M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.52M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.52M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.52M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 762k, False: 764k]
  ------------------
  285|  93.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 92.3M, False: 762k]
  ------------------
  286|  92.3M|        *oit = old_base;
  287|  92.3M|        ++oit;
  288|  92.3M|        ++num_decoded_points_;
  289|  92.3M|      }
  290|   762k|      continue;
  291|   762k|    }
  292|       |
  293|   764k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   764k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.12k, False: 763k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.12k|      axes_[0] = axis;
  300|  3.37k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.24k, False: 1.12k]
  ------------------
  301|  2.24k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.24k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 342, False: 1.90k]
  |  |  ------------------
  ------------------
  302|  2.24k|      }
  303|  3.06k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.95k, False: 1.10k]
  ------------------
  304|  7.78k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 5.84k, False: 1.93k]
  ------------------
  305|  5.84k|          p_[axes_[j]] = 0;
  306|  5.84k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  5.84k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.97k, False: 2.86k]
  ------------------
  308|  2.97k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 18, False: 2.95k]
  ------------------
  309|  2.97k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     18|              return false;
  311|     18|            }
  312|  2.97k|          }
  313|  5.82k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  5.82k|        }
  315|  1.93k|        *oit = p_;
  316|  1.93k|        ++oit;
  317|  1.93k|        ++num_decoded_points_;
  318|  1.93k|      }
  319|  1.10k|      continue;
  320|  1.12k|    }
  321|       |
  322|   763k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 763k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   763k|    const int num_remaining_bits = bit_length_ - level;
  327|   763k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   763k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   763k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   763k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   763k|    uint32_t number = 0;
  334|   763k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   763k|    uint32_t first_half = num_remaining_points / 2;
  337|   763k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 15, False: 763k]
  ------------------
  338|       |      // Invalid |number|.
  339|     15|      return false;
  340|     15|    }
  341|   763k|    first_half -= number;
  342|   763k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   763k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 359k, False: 404k]
  ------------------
  345|   359k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 338k, False: 21.1k]
  ------------------
  346|   338k|        std::swap(first_half, second_half);
  347|   338k|      }
  348|   359k|    }
  349|       |
  350|   763k|    levels_stack_[stack_pos][axis] += 1;
  351|   763k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   763k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 763k, False: 97]
  ------------------
  353|   763k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   763k|    }
  355|   763k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 763k, False: 117]
  ------------------
  356|   763k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   763k|    }
  358|   763k|  }
  359|     11|  return true;
  360|     44|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     38|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     38|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     38|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     38|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     38|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 38]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     38|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 4, False: 34]
  ------------------
  190|      4|    return false;
  191|      4|  }
  192|     34|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 34]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     34|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 34]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     34|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 34]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     34|  num_decoded_points_ = 0;
  202|       |
  203|     34|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 30]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|     30|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 30]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     30|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 28]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     28|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 28]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     28|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 20, False: 8]
  ------------------
  217|     20|    return false;
  218|     20|  }
  219|       |
  220|      8|  numbers_decoder_.EndDecoding();
  221|      8|  remaining_bits_decoder_.EndDecoding();
  222|      8|  axis_decoder_.EndDecoding();
  223|      8|  half_decoder_.EndDecoding();
  224|       |
  225|      8|  return true;
  226|     28|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     28|    uint32_t num_points, OutputIteratorT &oit) {
  254|     28|  typedef DecodingStatus Status;
  255|     28|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     28|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     28|  DecodingStatus init_status(num_points, 0, 0);
  258|     28|  std::stack<Status> status_stack;
  259|     28|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  6.41M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 6.41M, False: 8]
  ------------------
  263|  6.41M|    const DecodingStatus status = status_stack.top();
  264|  6.41M|    status_stack.pop();
  265|       |
  266|  6.41M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  6.41M|    const uint32_t last_axis = status.last_axis;
  268|  6.41M|    const uint32_t stack_pos = status.stack_pos;
  269|  6.41M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  6.41M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  6.41M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 6.41M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  6.41M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  6.41M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 6.41M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  6.41M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  6.41M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 3.20M, False: 3.20M]
  ------------------
  285|  59.6M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 56.4M, False: 3.20M]
  ------------------
  286|  56.4M|        *oit = old_base;
  287|  56.4M|        ++oit;
  288|  56.4M|        ++num_decoded_points_;
  289|  56.4M|      }
  290|  3.20M|      continue;
  291|  3.20M|    }
  292|       |
  293|  3.20M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  3.20M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 991, False: 3.20M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    991|      axes_[0] = axis;
  300|  2.97k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.98k, False: 991]
  ------------------
  301|  1.98k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.98k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 310, False: 1.67k]
  |  |  ------------------
  ------------------
  302|  1.98k|      }
  303|  2.67k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.69k, False: 978]
  ------------------
  304|  6.74k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 5.06k, False: 1.68k]
  ------------------
  305|  5.06k|          p_[axes_[j]] = 0;
  306|  5.06k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  5.06k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.52k, False: 2.54k]
  ------------------
  308|  2.52k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 13, False: 2.50k]
  ------------------
  309|  2.52k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     13|              return false;
  311|     13|            }
  312|  2.52k|          }
  313|  5.04k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  5.04k|        }
  315|  1.68k|        *oit = p_;
  316|  1.68k|        ++oit;
  317|  1.68k|        ++num_decoded_points_;
  318|  1.68k|      }
  319|    978|      continue;
  320|    991|    }
  321|       |
  322|  3.20M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 3.20M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  3.20M|    const int num_remaining_bits = bit_length_ - level;
  327|  3.20M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  3.20M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  3.20M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  3.20M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  3.20M|    uint32_t number = 0;
  334|  3.20M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  3.20M|    uint32_t first_half = num_remaining_points / 2;
  337|  3.20M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 7, False: 3.20M]
  ------------------
  338|       |      // Invalid |number|.
  339|      7|      return false;
  340|      7|    }
  341|  3.20M|    first_half -= number;
  342|  3.20M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  3.20M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 2.03M, False: 1.17M]
  ------------------
  345|  2.03M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 2.02M, False: 2.19k]
  ------------------
  346|  2.02M|        std::swap(first_half, second_half);
  347|  2.02M|      }
  348|  2.03M|    }
  349|       |
  350|  3.20M|    levels_stack_[stack_pos][axis] += 1;
  351|  3.20M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  3.20M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 3.20M, False: 91]
  ------------------
  353|  3.20M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  3.20M|    }
  355|  3.20M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 3.20M, False: 35]
  ------------------
  356|  3.20M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  3.20M|    }
  358|  3.20M|  }
  359|      8|  return true;
  360|     28|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     49|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     49|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     49|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     49|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     49|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 49]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     49|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 49]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     49|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 49]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     49|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 49]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     49|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 49]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     49|  num_decoded_points_ = 0;
  202|       |
  203|     49|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 45]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|     45|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 43]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     43|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 42]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     42|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 41]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     41|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 36, False: 5]
  ------------------
  217|     36|    return false;
  218|     36|  }
  219|       |
  220|      5|  numbers_decoder_.EndDecoding();
  221|      5|  remaining_bits_decoder_.EndDecoding();
  222|      5|  axis_decoder_.EndDecoding();
  223|      5|  half_decoder_.EndDecoding();
  224|       |
  225|      5|  return true;
  226|     41|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     41|    uint32_t num_points, OutputIteratorT &oit) {
  254|     41|  typedef DecodingStatus Status;
  255|     41|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     41|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     41|  DecodingStatus init_status(num_points, 0, 0);
  258|     41|  std::stack<Status> status_stack;
  259|     41|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  95.0k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 95.0k, False: 5]
  ------------------
  263|  95.0k|    const DecodingStatus status = status_stack.top();
  264|  95.0k|    status_stack.pop();
  265|       |
  266|  95.0k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  95.0k|    const uint32_t last_axis = status.last_axis;
  268|  95.0k|    const uint32_t stack_pos = status.stack_pos;
  269|  95.0k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  95.0k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  95.0k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 95.0k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  95.0k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  95.0k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 95.0k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  95.0k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  95.0k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 46.3k, False: 48.6k]
  ------------------
  285|  11.4M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 11.4M, False: 46.3k]
  ------------------
  286|  11.4M|        *oit = old_base;
  287|  11.4M|        ++oit;
  288|  11.4M|        ++num_decoded_points_;
  289|  11.4M|      }
  290|  46.3k|      continue;
  291|  46.3k|    }
  292|       |
  293|  48.6k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  48.6k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 659, False: 47.9k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    659|      axes_[0] = axis;
  300|  1.97k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.31k, False: 659]
  ------------------
  301|  1.31k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.31k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 160, False: 1.15k]
  |  |  ------------------
  ------------------
  302|  1.31k|      }
  303|  1.77k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.12k, False: 656]
  ------------------
  304|  4.47k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.36k, False: 1.11k]
  ------------------
  305|  3.36k|          p_[axes_[j]] = 0;
  306|  3.36k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.36k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.72k, False: 1.63k]
  ------------------
  308|  1.72k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 3, False: 1.71k]
  ------------------
  309|  1.72k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      3|              return false;
  311|      3|            }
  312|  1.72k|          }
  313|  3.35k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  3.35k|        }
  315|  1.11k|        *oit = p_;
  316|  1.11k|        ++oit;
  317|  1.11k|        ++num_decoded_points_;
  318|  1.11k|      }
  319|    656|      continue;
  320|    659|    }
  321|       |
  322|  47.9k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 47.9k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  47.9k|    const int num_remaining_bits = bit_length_ - level;
  327|  47.9k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  47.9k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  47.9k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  47.9k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  47.9k|    uint32_t number = 0;
  334|  47.9k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  47.9k|    uint32_t first_half = num_remaining_points / 2;
  337|  47.9k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 33, False: 47.9k]
  ------------------
  338|       |      // Invalid |number|.
  339|     33|      return false;
  340|     33|    }
  341|  47.9k|    first_half -= number;
  342|  47.9k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  47.9k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 9.15k, False: 38.8k]
  ------------------
  345|  9.15k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 5.97k, False: 3.17k]
  ------------------
  346|  5.97k|        std::swap(first_half, second_half);
  347|  5.97k|      }
  348|  9.15k|    }
  349|       |
  350|  47.9k|    levels_stack_[stack_pos][axis] += 1;
  351|  47.9k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  47.9k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 47.8k, False: 95]
  ------------------
  353|  47.8k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  47.8k|    }
  355|  47.9k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 47.8k, False: 143]
  ------------------
  356|  47.8k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  47.8k|    }
  358|  47.9k|  }
  359|      5|  return true;
  360|     41|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     74|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     74|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     74|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     74|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     74|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 74]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     74|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 73]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     73|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 73]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     73|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 73]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     73|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 73]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     73|  num_decoded_points_ = 0;
  202|       |
  203|     73|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 13, False: 60]
  ------------------
  204|     13|    return false;
  205|     13|  }
  206|     60|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 57]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     57|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 54]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     54|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 53]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     53|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 51, False: 2]
  ------------------
  217|     51|    return false;
  218|     51|  }
  219|       |
  220|      2|  numbers_decoder_.EndDecoding();
  221|      2|  remaining_bits_decoder_.EndDecoding();
  222|      2|  axis_decoder_.EndDecoding();
  223|      2|  half_decoder_.EndDecoding();
  224|       |
  225|      2|  return true;
  226|     53|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     53|    uint32_t num_points, OutputIteratorT &oit) {
  254|     53|  typedef DecodingStatus Status;
  255|     53|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     53|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     53|  DecodingStatus init_status(num_points, 0, 0);
  258|     53|  std::stack<Status> status_stack;
  259|     53|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  57.1k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 57.1k, False: 2]
  ------------------
  263|  57.1k|    const DecodingStatus status = status_stack.top();
  264|  57.1k|    status_stack.pop();
  265|       |
  266|  57.1k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  57.1k|    const uint32_t last_axis = status.last_axis;
  268|  57.1k|    const uint32_t stack_pos = status.stack_pos;
  269|  57.1k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  57.1k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  57.1k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 57.1k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  57.1k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  57.1k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 57.1k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  57.1k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  57.1k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 25.9k, False: 31.1k]
  ------------------
  285|  9.10M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 9.07M, False: 25.9k]
  ------------------
  286|  9.07M|        *oit = old_base;
  287|  9.07M|        ++oit;
  288|  9.07M|        ++num_decoded_points_;
  289|  9.07M|      }
  290|  25.9k|      continue;
  291|  25.9k|    }
  292|       |
  293|  31.1k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  31.1k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.95k, False: 29.1k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.95k|      axes_[0] = axis;
  300|  5.85k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 3.90k, False: 1.95k]
  ------------------
  301|  3.90k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  3.90k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 672, False: 3.23k]
  |  |  ------------------
  ------------------
  302|  3.90k|      }
  303|  5.42k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.48k, False: 1.94k]
  ------------------
  304|  13.9k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 10.4k, False: 3.47k]
  ------------------
  305|  10.4k|          p_[axes_[j]] = 0;
  306|  10.4k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  10.4k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 6.53k, False: 3.91k]
  ------------------
  308|  6.53k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 12, False: 6.52k]
  ------------------
  309|  6.53k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     12|              return false;
  311|     12|            }
  312|  6.53k|          }
  313|  10.4k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  10.4k|        }
  315|  3.47k|        *oit = p_;
  316|  3.47k|        ++oit;
  317|  3.47k|        ++num_decoded_points_;
  318|  3.47k|      }
  319|  1.94k|      continue;
  320|  1.95k|    }
  321|       |
  322|  29.1k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 29.1k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  29.1k|    const int num_remaining_bits = bit_length_ - level;
  327|  29.1k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  29.1k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  29.1k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  29.1k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  29.1k|    uint32_t number = 0;
  334|  29.1k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  29.1k|    uint32_t first_half = num_remaining_points / 2;
  337|  29.1k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 39, False: 29.1k]
  ------------------
  338|       |      // Invalid |number|.
  339|     39|      return false;
  340|     39|    }
  341|  29.1k|    first_half -= number;
  342|  29.1k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  29.1k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 17.7k, False: 11.4k]
  ------------------
  345|  17.7k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 12.2k, False: 5.48k]
  ------------------
  346|  12.2k|        std::swap(first_half, second_half);
  347|  12.2k|      }
  348|  17.7k|    }
  349|       |
  350|  29.1k|    levels_stack_[stack_pos][axis] += 1;
  351|  29.1k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  29.1k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 29.0k, False: 67]
  ------------------
  353|  29.0k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  29.0k|    }
  355|  29.1k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 29.0k, False: 138]
  ------------------
  356|  29.0k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  29.0k|    }
  358|  29.1k|  }
  359|      2|  return true;
  360|     53|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     32|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     32|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     32|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     32|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     32|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 32]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     32|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 5, False: 27]
  ------------------
  190|      5|    return false;
  191|      5|  }
  192|     27|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 27]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     27|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 27]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     27|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 27]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     27|  num_decoded_points_ = 0;
  202|       |
  203|     27|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 27, False: 0]
  ------------------
  204|     27|    return false;
  205|     27|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      4|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      4|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 4]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      4|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 4]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      4|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 4]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      4|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 4]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      4|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 4]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      4|  num_decoded_points_ = 0;
  202|       |
  203|      4|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 0]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      5|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      5|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      5|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      5|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      5|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 5]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      5|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 4]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|      4|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 4]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      4|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 4]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      4|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 4]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      4|  num_decoded_points_ = 0;
  202|       |
  203|      4|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 0]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}

_ZN5draco22FloatPointsTreeDecoderC2Ev:
   65|    267|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    267|  qinfo_.quantization_bits = 0;
   67|    267|  qinfo_.range = 0;
   68|    267|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    261|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    261|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 261]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|    261|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 0, False: 261]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|    261|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 261]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|    261|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 261]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|    261|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 8, False: 253]
  |  Branch (84:38): [True: 2, False: 6]
  ------------------
   85|      2|    return false;
   86|      2|  }
   87|    259|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 259]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    259|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 1, False: 258]
  ------------------
   93|      1|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      1|#define DRACO_LOGE printf
  ------------------
   94|      1|               compression_level_);
   95|      1|    return false;
   96|      1|  }
   97|       |
   98|    258|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    258|      std::back_inserter(*qpoints);
  100|    258|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    258|                           Converter>
  102|    258|      oit(oit_qpoints);
  103|    258|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 256, False: 2]
  ------------------
  104|    256|    qpoints->reserve(num_points_);
  105|    256|    switch (compression_level_) {
  106|     54|      case 0: {
  ------------------
  |  Branch (106:7): [True: 54, False: 202]
  ------------------
  107|     54|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|     54|        qpoints_decoder.DecodePoints(buffer, oit);
  109|     54|        break;
  110|      0|      }
  111|     38|      case 1: {
  ------------------
  |  Branch (111:7): [True: 38, False: 218]
  ------------------
  112|     38|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     38|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     38|        break;
  115|      0|      }
  116|     49|      case 2: {
  ------------------
  |  Branch (116:7): [True: 49, False: 207]
  ------------------
  117|     49|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     49|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     49|        break;
  120|      0|      }
  121|     74|      case 3: {
  ------------------
  |  Branch (121:7): [True: 74, False: 182]
  ------------------
  122|     74|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|     74|        qpoints_decoder.DecodePoints(buffer, oit);
  124|     74|        break;
  125|      0|      }
  126|     32|      case 4: {
  ------------------
  |  Branch (126:7): [True: 32, False: 224]
  ------------------
  127|     32|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     32|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     32|        break;
  130|      0|      }
  131|      4|      case 5: {
  ------------------
  |  Branch (131:7): [True: 4, False: 252]
  ------------------
  132|      4|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|      4|        qpoints_decoder.DecodePoints(buffer, oit);
  134|      4|        break;
  135|      0|      }
  136|      5|      case 6: {
  ------------------
  |  Branch (136:7): [True: 5, False: 251]
  ------------------
  137|      5|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|      5|        qpoints_decoder.DecodePoints(buffer, oit);
  139|      5|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 256]
  ------------------
  142|      0|        return false;
  143|    256|    }
  144|    256|  }
  145|       |
  146|    258|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 252, False: 6]
  ------------------
  147|    252|    return false;
  148|    252|  }
  149|      6|  return true;
  150|    258|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    258|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   169M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   169M|  const Self &operator=(const SourceType &source) {
   56|   169M|    *oit_ = Converter()(source);
   57|   169M|    return *this;
   58|   169M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   169M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   169M|    return Point3ui(v[0], v[1], v[2]);
   31|   169M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   169M|  const Self &operator++() {
   46|   169M|    ++oit_;
   47|   169M|    return *this;
   48|   169M|  }

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  11.9M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  11.9M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 11.9M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  11.9M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  11.9M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   272M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   272M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 255, False: 272M]
  ------------------
   78|    255|      return false;  // Buffer overflow.
   79|    255|    }
   80|   272M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   272M|    pos_ += size_to_decode;
   82|   272M|    return true;
   83|   272M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  24.2k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  5.40k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  30.7k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   236k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  2.93k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  11.9M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  1.46M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  3.74k|    inline void reset(const void *b, size_t s) {
  131|  3.74k|      bit_offset_ = 0;
  132|  3.74k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  3.74k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  3.74k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  3.26k|    inline uint64_t BitsDecoded() const {
  138|  3.26k|      return static_cast<uint64_t>(bit_offset_);
  139|  3.26k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  11.9M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  11.9M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 11.9M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  11.9M|      uint32_t value = 0;
  165|  27.9M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 16.0M, False: 11.9M]
  ------------------
  166|  16.0M|        value |= GetBit() << bit;
  167|  16.0M|      }
  168|  11.9M|      *x = value;
  169|  11.9M|      return true;
  170|  11.9M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  16.0M|    inline int GetBit() {
  176|  16.0M|      const size_t off = bit_offset_;
  177|  16.0M|      const size_t byte_offset = off >> 3;
  178|  16.0M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  16.0M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 15.9M, False: 128k]
  ------------------
  180|  15.9M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  15.9M|        bit_offset_ = off + 1;
  182|  15.9M|        return bit;
  183|  15.9M|      }
  184|   128k|      return 0;
  185|  16.0M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  6.72M|  bool Decode(T *out_val) {
   69|  6.72M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 1.19k, False: 6.72M]
  ------------------
   70|  1.19k|      return false;
   71|  1.19k|    }
   72|  6.72M|    pos_ += sizeof(T);
   73|  6.72M|    return true;
   74|  6.72M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  6.72M|  bool Peek(T *out_val) {
   88|  6.72M|    const size_t size_to_decode = sizeof(T);
   89|  6.72M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 1.19k, False: 6.72M]
  ------------------
   90|  1.19k|      return false;  // Buffer overflow.
   91|  1.19k|    }
   92|  6.72M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  6.72M|    return true;
   94|  6.72M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  7.61k|  bool Decode(T *out_val) {
   69|  7.61k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 36, False: 7.57k]
  ------------------
   70|     36|      return false;
   71|     36|    }
   72|  7.57k|    pos_ += sizeof(T);
   73|  7.57k|    return true;
   74|  7.61k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  7.61k|  bool Peek(T *out_val) {
   88|  7.61k|    const size_t size_to_decode = sizeof(T);
   89|  7.61k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 36, False: 7.57k]
  ------------------
   90|     36|      return false;  // Buffer overflow.
   91|     36|    }
   92|  7.57k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  7.57k|    return true;
   94|  7.61k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   315k|  bool Decode(T *out_val) {
   69|   315k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 83, False: 315k]
  ------------------
   70|     83|      return false;
   71|     83|    }
   72|   315k|    pos_ += sizeof(T);
   73|   315k|    return true;
   74|   315k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   315k|  bool Peek(T *out_val) {
   88|   315k|    const size_t size_to_decode = sizeof(T);
   89|   315k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 83, False: 315k]
  ------------------
   90|     83|      return false;  // Buffer overflow.
   91|     83|    }
   92|   315k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   315k|    return true;
   94|   315k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  13.1k|  bool Decode(T *out_val) {
   69|  13.1k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 118, False: 13.0k]
  ------------------
   70|    118|      return false;
   71|    118|    }
   72|  13.0k|    pos_ += sizeof(T);
   73|  13.0k|    return true;
   74|  13.1k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  13.1k|  bool Peek(T *out_val) {
   88|  13.1k|    const size_t size_to_decode = sizeof(T);
   89|  13.1k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 118, False: 13.0k]
  ------------------
   90|    118|      return false;  // Buffer overflow.
   91|    118|    }
   92|  13.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  13.0k|    return true;
   94|  13.1k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   921k|  bool Decode(T *out_val) {
   69|   921k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 68, False: 921k]
  ------------------
   70|     68|      return false;
   71|     68|    }
   72|   921k|    pos_ += sizeof(T);
   73|   921k|    return true;
   74|   921k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   921k|  bool Peek(T *out_val) {
   88|   921k|    const size_t size_to_decode = sizeof(T);
   89|   921k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 68, False: 921k]
  ------------------
   90|     68|      return false;  // Buffer overflow.
   91|     68|    }
   92|   921k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   921k|    return true;
   94|   921k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  18.5k|  bool Decode(T *out_val) {
   69|  18.5k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 5, False: 18.5k]
  ------------------
   70|      5|      return false;
   71|      5|    }
   72|  18.5k|    pos_ += sizeof(T);
   73|  18.5k|    return true;
   74|  18.5k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  18.5k|  bool Peek(T *out_val) {
   88|  18.5k|    const size_t size_to_decode = sizeof(T);
   89|  18.5k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 5, False: 18.5k]
  ------------------
   90|      5|      return false;  // Buffer overflow.
   91|      5|    }
   92|  18.5k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  18.5k|    return true;
   94|  18.5k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.09k|  bool Decode(T *out_val) {
   69|  1.09k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 4, False: 1.08k]
  ------------------
   70|      4|      return false;
   71|      4|    }
   72|  1.08k|    pos_ += sizeof(T);
   73|  1.08k|    return true;
   74|  1.09k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.09k|  bool Peek(T *out_val) {
   88|  1.09k|    const size_t size_to_decode = sizeof(T);
   89|  1.09k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 4, False: 1.08k]
  ------------------
   90|      4|      return false;  // Buffer overflow.
   91|      4|    }
   92|  1.08k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.08k|    return true;
   94|  1.09k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    436|  bool Decode(T *out_val) {
   69|    436|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2, False: 434]
  ------------------
   70|      2|      return false;
   71|      2|    }
   72|    434|    pos_ += sizeof(T);
   73|    434|    return true;
   74|    436|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    436|  bool Peek(T *out_val) {
   88|    436|    const size_t size_to_decode = sizeof(T);
   89|    436|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2, False: 434]
  ------------------
   90|      2|      return false;  // Buffer overflow.
   91|      2|    }
   92|    434|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    434|    return true;
   94|    436|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   304M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   310M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  5.26M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  5.26M|    return value_ >= val;
  100|  5.26M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   125M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  1.45G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  13.9M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  51.3M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  51.3M|    value_ = i.value_;
  153|  51.3M|    return *this;
  154|  51.3M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   393M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   393M|    value_ = i.value_;
  153|   393M|    return *this;
  154|   393M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  13.9M|  inline ThisIndexType &operator++() {
  103|  13.9M|    ++value_;
  104|  13.9M|    return *this;
  105|  13.9M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  1.08G|  constexpr bool operator==(const IndexType &i) const {
   76|  1.08G|    return value_ == i.value_;
   77|  1.08G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   417M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  8.12k|  constexpr bool operator<(const IndexType &i) const {
   88|  8.12k|    return value_ < i.value_;
   89|  8.12k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|  70.7M|  constexpr bool operator==(const IndexType &i) const {
   76|  70.7M|    return value_ == i.value_;
   77|  70.7M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|  92.4M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|  92.4M|    return ThisIndexType(value_ - val);
  133|  92.4M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   326M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   326M|    return ThisIndexType(value_ + val);
  127|   326M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  10.6M|  constexpr bool operator==(const IndexType &i) const {
   76|  10.6M|    return value_ == i.value_;
   77|  10.6M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   105M|  constexpr bool operator!=(const IndexType &i) const {
   82|   105M|    return value_ != i.value_;
   83|   105M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   165M|  constexpr bool operator!=(const IndexType &i) const {
   82|   165M|    return value_ != i.value_;
   83|   165M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   245M|  inline ThisIndexType &operator++() {
  103|   245M|    ++value_;
  104|   245M|    return *this;
  105|   245M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   186M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   186M|    value_ = i.value_;
  153|   186M|    return *this;
  154|   186M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   442M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   442M|    value_ = i.value_;
  153|   442M|    return *this;
  154|   442M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  26.1M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  26.1M|    return value_ >= val;
  100|  26.1M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  4.75M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   511M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  7.04G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|  86.4M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  4.84G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|  84.3M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  11.1M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  11.1M|    return ThisIndexType(value_ + val);
  127|  11.1M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|  76.5M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  12.9M|  constexpr bool operator<(const IndexType &i) const {
   88|  12.9M|    return value_ < i.value_;
   89|  12.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   378M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   393M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  36.2M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   291M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   411M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  2.99M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  2.99M|    value_ = i.value_;
  153|  2.99M|    return *this;
  154|  2.99M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  4.74M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  4.74M|    value_ += val;
  141|  4.74M|    return *this;
  142|  4.74M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  15.8M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  15.8M|    value_ = val;
  157|  15.8M|    return *this;
  158|  15.8M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   377M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  3.71M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  3.70M|  inline ThisIndexType &operator++() {
  103|  3.70M|    ++value_;
  104|  3.70M|    return *this;
  105|  3.70M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  13.0M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|    186|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   222M|  inline ThisIndexType &operator++() {
  103|   222M|    ++value_;
  104|   222M|    return *this;
  105|   222M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|     97|  inline ThisIndexType &operator++() {
  103|     97|    ++value_;
  104|     97|    return *this;
  105|     97|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   249M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   249M|    return value_ >= val;
  100|   249M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  22.2M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  22.2M|    return vector_[index.value()];
   75|  22.2M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  13.0M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  7.87k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  10.8k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  39.1M|  inline reference operator[](const IndexTypeT &index) {
   71|  39.1M|    return vector_[index.value()];
   72|  39.1M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  4.93k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  10.5M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  1.99k|  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|  5.26M|  inline reference operator[](const IndexTypeT &index) {
   71|  5.26M|    return vector_[index.value()];
   72|  5.26M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  14.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  14.3M|    return vector_[index.value()];
   75|  14.3M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|  80.6M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  6.07M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   149M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   149M|    return vector_[index.value()];
   75|   149M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   356M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   356M|    return vector_[index.value()];
   75|   356M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   166M|  inline reference operator[](const IndexTypeT &index) {
   71|   166M|    return vector_[index.value()];
   72|   166M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  29.9M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  29.9M|    return vector_[index.value()];
   75|  29.9M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   142M|  inline reference operator[](const IndexTypeT &index) {
   71|   142M|    return vector_[index.value()];
   72|   142M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  42.7M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|  91.7M|  inline reference operator[](const IndexTypeT &index) {
   71|  91.7M|    return vector_[index.value()];
   72|  91.7M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  1.01k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|  54.1M|  inline reference operator[](const IndexTypeT &index) {
   71|  54.1M|    return vector_[index.value()];
   72|  54.1M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  21.4k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  1.17M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  20.0k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  3.12k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  3.12k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  3.12k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  3.12k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  7.83k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  7.83k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  7.83k|    vector_.swap(arg.vector_);
   57|  7.83k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  7.83k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  7.83k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  7.83k|    vector_.swap(arg.vector_);
   57|  7.83k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  3.12k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  3.12k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  3.12k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  4.46k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  34.8k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  55.1k|int32_t DataTypeLength(DataType dt) {
   20|  55.1k|  switch (dt) {
   21|  13.9k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 13.9k, False: 41.1k]
  ------------------
   22|  18.1k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 4.22k, False: 50.8k]
  ------------------
   23|  18.1k|      return 1;
   24|  2.71k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 2.71k, False: 52.3k]
  ------------------
   25|  15.2k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 12.5k, False: 42.5k]
  ------------------
   26|  15.2k|      return 2;
   27|  16.7k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 16.7k, False: 38.3k]
  ------------------
   28|  17.7k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.02k, False: 54.0k]
  ------------------
   29|  17.7k|      return 4;
   30|    365|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 365, False: 54.7k]
  ------------------
   31|    635|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 270, False: 54.8k]
  ------------------
   32|    635|      return 8;
   33|  2.92k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 2.92k, False: 52.1k]
  ------------------
   34|  2.92k|      return 4;
   35|     54|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 54, False: 55.0k]
  ------------------
   36|     54|      return 8;
   37|    283|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 283, False: 54.8k]
  ------------------
   38|    283|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 55.1k]
  ------------------
   40|      0|      return -1;
   41|  55.1k|  }
   42|  55.1k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    940|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  4.46k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|      2|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  5.40k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  5.40k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|      2|  const Status &status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  5.05k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  5.40k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    356|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|    940|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|    940|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  4.46k|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  4.46k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   407k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   407k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 407k, Folded]
  ------------------
   65|   407k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 400, False: 407k]
  ------------------
   66|    400|      return false;
   67|    400|    }
   68|   407k|  } 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|   407k|  return true;
   77|   407k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  94.8k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  94.8k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  94.8k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 80, False: 94.7k]
  ------------------
   33|     80|    return false;
   34|     80|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  94.7k|  uint8_t in;
   39|  94.7k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 218, False: 94.5k]
  ------------------
   40|    218|    return false;
   41|    218|  }
   42|  94.5k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 12.0k, False: 82.4k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  12.0k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 419, False: 11.6k]
  ------------------
   45|    419|      return false;
   46|    419|    }
   47|       |    // Append decoded info from this byte.
   48|  11.6k|    *out_val <<= 7;
   49|  11.6k|    *out_val |= in & ((1 << 7) - 1);
   50|  82.4k|  } else {
   51|       |    // Last byte reached
   52|  82.4k|    *out_val = in;
   53|  82.4k|  }
   54|  94.1k|  return true;
   55|  94.5k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.04k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.04k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.04k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 2.04k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.04k|  uint8_t in;
   39|  2.04k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 2, False: 2.04k]
  ------------------
   40|      2|    return false;
   41|      2|  }
   42|  2.04k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 182, False: 1.85k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    182|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 182]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    182|    *out_val <<= 7;
   49|    182|    *out_val |= in & ((1 << 7) - 1);
   50|  1.85k|  } else {
   51|       |    // Last byte reached
   52|  1.85k|    *out_val = in;
   53|  1.85k|  }
   54|  2.04k|  return true;
   55|  2.04k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  2.88k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.88k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 2.88k, Folded]
  ------------------
   65|  2.88k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 26, False: 2.86k]
  ------------------
   66|     26|      return false;
   67|     26|    }
   68|  2.88k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  2.86k|  return true;
   77|  2.88k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  1.77k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.77k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.77k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 1.77k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.77k|  uint8_t in;
   39|  1.77k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 3, False: 1.77k]
  ------------------
   40|      3|    return false;
   41|      3|  }
   42|  1.77k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 14, False: 1.75k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     14|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 3, False: 11]
  ------------------
   45|      3|      return false;
   46|      3|    }
   47|       |    // Append decoded info from this byte.
   48|     11|    *out_val <<= 7;
   49|     11|    *out_val |= in & ((1 << 7) - 1);
   50|  1.75k|  } else {
   51|       |    // Last byte reached
   52|  1.75k|    *out_val = in;
   53|  1.75k|  }
   54|  1.77k|  return true;
   55|  1.77k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   263k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   263k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   263k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 13, False: 263k]
  ------------------
   33|     13|    return false;
   34|     13|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   263k|  uint8_t in;
   39|   263k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 45, False: 263k]
  ------------------
   40|     45|    return false;
   41|     45|  }
   42|   263k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 983, False: 262k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    983|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 81, False: 902]
  ------------------
   45|     81|      return false;
   46|     81|    }
   47|       |    // Append decoded info from this byte.
   48|    902|    *out_val <<= 7;
   49|    902|    *out_val |= in & ((1 << 7) - 1);
   50|   262k|  } else {
   51|       |    // Last byte reached
   52|   262k|    *out_val = in;
   53|   262k|  }
   54|   263k|  return true;
   55|   263k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  2.53k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.53k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 2.53k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  2.53k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  2.53k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  2.53k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 14, False: 2.52k]
  ------------------
   72|     14|      return false;
   73|     14|    }
   74|  2.52k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  2.52k|  }
   76|  2.52k|  return true;
   77|  2.53k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.91k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.91k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.91k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 2.91k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.91k|  uint8_t in;
   39|  2.91k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 12, False: 2.90k]
  ------------------
   40|     12|    return false;
   41|     12|  }
   42|  2.90k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 380, False: 2.52k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    380|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 21, False: 359]
  ------------------
   45|     21|      return false;
   46|     21|    }
   47|       |    // Append decoded info from this byte.
   48|    359|    *out_val <<= 7;
   49|    359|    *out_val |= in & ((1 << 7) - 1);
   50|  2.52k|  } else {
   51|       |    // Last byte reached
   52|  2.52k|    *out_val = in;
   53|  2.52k|  }
   54|  2.87k|  return true;
   55|  2.90k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.23k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.23k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.23k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 2.23k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.23k|  uint8_t in;
   39|  2.23k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 6, False: 2.22k]
  ------------------
   40|      6|    return false;
   41|      6|  }
   42|  2.22k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 454, False: 1.77k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    454|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 4, False: 450]
  ------------------
   45|      4|      return false;
   46|      4|    }
   47|       |    // Append decoded info from this byte.
   48|    450|    *out_val <<= 7;
   49|    450|    *out_val |= in & ((1 << 7) - 1);
   50|  1.77k|  } else {
   51|       |    // Last byte reached
   52|  1.77k|    *out_val = in;
   53|  1.77k|  }
   54|  2.22k|  return true;
   55|  2.22k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  20.2k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  20.2k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  20.2k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 20.2k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  20.2k|  uint8_t in;
   39|  20.2k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 2, False: 20.2k]
  ------------------
   40|      2|    return false;
   41|      2|  }
   42|  20.2k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 526, False: 19.6k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    526|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 15, False: 511]
  ------------------
   45|     15|      return false;
   46|     15|    }
   47|       |    // Append decoded info from this byte.
   48|    511|    *out_val <<= 7;
   49|    511|    *out_val |= in & ((1 << 7) - 1);
   50|  19.6k|  } else {
   51|       |    // Last byte reached
   52|  19.6k|    *out_val = in;
   53|  19.6k|  }
   54|  20.1k|  return true;
   55|  20.2k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.28k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.28k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.28k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 3.28k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.28k|  uint8_t in;
   39|  3.28k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 5, False: 3.27k]
  ------------------
   40|      5|    return false;
   41|      5|  }
   42|  3.27k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 908, False: 2.36k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    908|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 30, False: 878]
  ------------------
   45|     30|      return false;
   46|     30|    }
   47|       |    // Append decoded info from this byte.
   48|    878|    *out_val <<= 7;
   49|    878|    *out_val |= in & ((1 << 7) - 1);
   50|  2.36k|  } else {
   51|       |    // Last byte reached
   52|  2.36k|    *out_val = in;
   53|  2.36k|  }
   54|  3.24k|  return true;
   55|  3.27k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  2.29k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.29k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.29k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 22, False: 2.26k]
  ------------------
   33|     22|    return false;
   34|     22|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.26k|  uint8_t in;
   39|  2.26k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 1, False: 2.26k]
  ------------------
   40|      1|    return false;
   41|      1|  }
   42|  2.26k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.16k, False: 1.10k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.16k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 220, False: 946]
  ------------------
   45|    220|      return false;
   46|    220|    }
   47|       |    // Append decoded info from this byte.
   48|    946|    *out_val <<= 7;
   49|    946|    *out_val |= in & ((1 << 7) - 1);
   50|  1.10k|  } else {
   51|       |    // Last byte reached
   52|  1.10k|    *out_val = in;
   53|  1.10k|  }
   54|  2.04k|  return true;
   55|  2.26k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  39.0k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  39.0k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  39.0k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 39.0k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  39.0k|  uint8_t in;
   39|  39.0k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 16, False: 39.0k]
  ------------------
   40|     16|    return false;
   41|     16|  }
   42|  39.0k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.49k, False: 36.5k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.49k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 30, False: 2.46k]
  ------------------
   45|     30|      return false;
   46|     30|    }
   47|       |    // Append decoded info from this byte.
   48|  2.46k|    *out_val <<= 7;
   49|  2.46k|    *out_val |= in & ((1 << 7) - 1);
   50|  36.5k|  } else {
   51|       |    // Last byte reached
   52|  36.5k|    *out_val = in;
   53|  36.5k|  }
   54|  38.9k|  return true;
   55|  39.0k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|  72.9k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|  90.7k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  7.56k|  Self operator-(const Self &o) const {
  138|  7.56k|    Self ret;
  139|  30.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 22.6k, False: 7.56k]
  ------------------
  140|  22.6k|      ret[i] = (*this)[i] - o[i];
  141|  22.6k|    }
  142|  7.56k|    return ret;
  143|  7.56k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  18.6k|  VectorD() {
   41|  74.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 56.0k, False: 18.6k]
  ------------------
   42|  56.0k|      (*this)[i] = Scalar(0);
   43|  56.0k|    }
   44|  18.6k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  1.16G|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|     10|      : v_({{c0, c1, c2}}) {
   60|     10|    DRACO_DCHECK_EQ(dimension, 3);
   61|     10|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|  95.6M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  7.92M|  Self operator-(const Self &o) const {
  138|  7.92M|    Self ret;
  139|  31.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 23.7M, False: 7.92M]
  ------------------
  140|  23.7M|      ret[i] = (*this)[i] - o[i];
  141|  23.7M|    }
  142|  7.92M|    return ret;
  143|  7.92M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  3.94M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  3.94M|  static_assert(std::is_signed<ScalarT>::value,
  321|  3.94M|                "ScalarT must be a signed type. ");
  322|  3.94M|  VectorD<ScalarT, 3> r;
  323|  3.94M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  3.94M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  3.94M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  3.94M|  return r;
  327|  3.94M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  3.94M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  3.94M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  1.27M|  Scalar AbsSum() const {
  238|  1.27M|    Scalar result(0);
  239|  5.08M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 3.81M, False: 1.26M]
  ------------------
  240|  3.81M|      Scalar next_value = std::abs(v_[i]);
  241|  3.81M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 10.0k, False: 3.80M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  10.0k|        return std::numeric_limits<Scalar>::max();
  244|  10.0k|      }
  245|  3.80M|      result += next_value;
  246|  3.80M|    }
  247|  1.26M|    return result;
  248|  1.27M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   180k|  Self operator/(const Scalar &o) const {
  183|   180k|    Self ret;
  184|   720k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 540k, False: 180k]
  ------------------
  185|   540k|      ret[i] = (*this)[i] / o;
  186|   540k|    }
  187|   180k|    return ret;
  188|   180k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   117M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  7.11M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  3.82M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.18M|  Self operator-() const {
  121|  1.18M|    Self ret;
  122|  4.73M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 3.55M, False: 1.18M]
  ------------------
  123|  3.55M|      ret[i] = -(*this)[i];
  124|  3.55M|    }
  125|  1.18M|    return ret;
  126|  1.18M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  3.55M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   590k|  Self operator-(const Self &o) const {
  138|   590k|    Self ret;
  139|  1.77M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.18M, False: 590k]
  ------------------
  140|  1.18M|      ret[i] = (*this)[i] - o[i];
  141|  1.18M|    }
  142|   590k|    return ret;
  143|   590k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  7.08M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  10.6M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  36.8M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  1.18M|  Self operator+(const Self &o) const {
  130|  1.18M|    Self ret;
  131|  3.54M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.36M, False: 1.18M]
  ------------------
  132|  2.36M|      ret[i] = (*this)[i] + o[i];
  133|  2.36M|    }
  134|  1.18M|    return ret;
  135|  1.18M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  32.0M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  1.13M|  Self operator-(const Self &o) const {
  138|  1.13M|    Self ret;
  139|  3.40M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.27M, False: 1.13M]
  ------------------
  140|  2.27M|      ret[i] = (*this)[i] - o[i];
  141|  2.27M|    }
  142|  1.13M|    return ret;
  143|  1.13M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  1.13M|  Self operator+(const Self &o) const {
  130|  1.13M|    Self ret;
  131|  3.40M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.27M, False: 1.13M]
  ------------------
  132|  2.27M|      ret[i] = (*this)[i] + o[i];
  133|  2.27M|    }
  134|  1.13M|    return ret;
  135|  1.13M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   316k|  bool operator==(const Self &o) const {
  207|   943k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 630k, False: 313k]
  ------------------
  208|   630k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 3.57k, False: 626k]
  ------------------
  209|  3.57k|        return false;
  210|  3.57k|      }
  211|   630k|    }
  212|   313k|    return true;
  213|   316k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  3.80M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  3.98k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  4.39k|  Scalar Dot(const Self &o) const {
  251|  4.39k|    Scalar ret(0);
  252|  17.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 13.1k, False: 4.39k]
  ------------------
  253|  13.1k|      ret += (*this)[i] * o[i];
  254|  13.1k|    }
  255|  4.39k|    return ret;
  256|  4.39k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    411|  Self operator*(const Scalar &o) const {
  175|    411|    Self ret;
  176|  1.64k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.23k, False: 411]
  ------------------
  177|  1.23k|      ret[i] = (*this)[i] * o;
  178|  1.23k|    }
  179|    411|    return ret;
  180|    411|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  3.57k|  Self operator-(const Self &o) const {
  138|  3.57k|    Self ret;
  139|  10.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 7.15k, False: 3.57k]
  ------------------
  140|  7.15k|      ret[i] = (*this)[i] - o[i];
  141|  7.15k|    }
  142|  3.57k|    return ret;
  143|  3.57k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  7.15k|  VectorD() {
   41|  21.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 14.3k, False: 7.15k]
  ------------------
   42|  14.3k|      (*this)[i] = Scalar(0);
   43|  14.3k|    }
   44|  7.15k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   636k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   636k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   636k|    v_[0] = c0;
   55|   636k|    v_[1] = c1;
   56|   636k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  28.5k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   340k|  bool operator==(const Self &o) const {
  207|   957k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 650k, False: 307k]
  ------------------
  208|   650k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 32.9k, False: 617k]
  ------------------
  209|  32.9k|        return false;
  210|  32.9k|      }
  211|   650k|    }
  212|   307k|    return true;
  213|   340k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.98M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  22.5M|  VectorD() {
   41|  90.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 67.7M, False: 22.5M]
  ------------------
   42|  67.7M|      (*this)[i] = Scalar(0);
   43|  67.7M|    }
   44|  22.5M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  35.7k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  38.6k|  Scalar Dot(const Self &o) const {
  251|  38.6k|    Scalar ret(0);
  252|   154k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 115k, False: 38.6k]
  ------------------
  253|   115k|      ret += (*this)[i] * o[i];
  254|   115k|    }
  255|  38.6k|    return ret;
  256|  38.6k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  2.88k|  Self operator-(const Self &o) const {
  138|  2.88k|    Self ret;
  139|  8.64k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 5.76k, False: 2.88k]
  ------------------
  140|  5.76k|      ret[i] = (*this)[i] - o[i];
  141|  5.76k|    }
  142|  2.88k|    return ret;
  143|  2.88k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  8.54k|  Self operator*(const Scalar &o) const {
  175|  8.54k|    Self ret;
  176|  25.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 17.0k, False: 8.54k]
  ------------------
  177|  17.0k|      ret[i] = (*this)[i] * o;
  178|  17.0k|    }
  179|  8.54k|    return ret;
  180|  8.54k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  2.85k|  Self operator+(const Self &o) const {
  130|  2.85k|    Self ret;
  131|  8.55k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 5.70k, False: 2.85k]
  ------------------
  132|  5.70k|      ret[i] = (*this)[i] + o[i];
  133|  5.70k|    }
  134|  2.85k|    return ret;
  135|  2.85k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.85k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.85k|  return v * o;
  294|  2.85k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  2.84k|  Self operator+(const Self &o) const {
  130|  2.84k|    Self ret;
  131|  11.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 8.52k, False: 2.84k]
  ------------------
  132|  8.52k|      ret[i] = (*this)[i] + o[i];
  133|  8.52k|    }
  134|  2.84k|    return ret;
  135|  2.84k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.84k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.84k|  return v * o;
  294|  2.84k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  2.84k|  Self operator*(const Scalar &o) const {
  175|  2.84k|    Self ret;
  176|  11.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 8.52k, False: 2.84k]
  ------------------
  177|  8.52k|      ret[i] = (*this)[i] * o;
  178|  8.52k|    }
  179|  2.84k|    return ret;
  180|  2.84k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   683k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   683k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   683k|    v_[0] = c0;
   55|   683k|    v_[1] = c1;
   56|   683k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  19.9k|  VectorD() {
   41|  59.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 39.8k, False: 19.9k]
  ------------------
   42|  39.8k|      (*this)[i] = Scalar(0);
   43|  39.8k|    }
   44|  19.9k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  5.63k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  16.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 11.2k, False: 5.63k]
  ------------------
  104|  11.2k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 11.2k, False: 0]
  ------------------
  105|  11.2k|        v_[i] = Scalar(src_vector[i]);
  106|  11.2k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  11.2k|    }
  110|  5.63k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|  1.42k|  Self operator+(const Self &o) const {
  130|  1.42k|    Self ret;
  131|  4.26k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.84k, False: 1.42k]
  ------------------
  132|  2.84k|      ret[i] = (*this)[i] + o[i];
  133|  2.84k|    }
  134|  1.42k|    return ret;
  135|  1.42k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  2.81k|  VectorD() {
   41|  8.45k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.63k, False: 2.81k]
  ------------------
   42|  5.63k|      (*this)[i] = Scalar(0);
   43|  5.63k|    }
   44|  2.81k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  16.9k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  11.2k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  2.81k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  8.45k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 5.63k, False: 2.81k]
  ------------------
  104|  5.63k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 5.63k, False: 0]
  ------------------
  105|  5.63k|        v_[i] = Scalar(src_vector[i]);
  106|  5.63k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  5.63k|    }
  110|  2.81k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  2.81k|  Self operator/(const Scalar &o) const {
  183|  2.81k|    Self ret;
  184|  8.45k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 5.63k, False: 2.81k]
  ------------------
  185|  5.63k|      ret[i] = (*this)[i] / o;
  186|  5.63k|    }
  187|  2.81k|    return ret;
  188|  2.81k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.39k|  Self operator-(const Self &o) const {
  138|  1.39k|    Self ret;
  139|  4.18k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.79k, False: 1.39k]
  ------------------
  140|  2.79k|      ret[i] = (*this)[i] - o[i];
  141|  2.79k|    }
  142|  1.39k|    return ret;
  143|  1.39k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  79.6k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.18M|  VectorD() {
   41|  4.74M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.55M, False: 1.18M]
  ------------------
   42|  3.55M|      (*this)[i] = Scalar(0);
   43|  3.55M|    }
   44|  1.18M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  7.19M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  7.19M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  7.19M|    v_[0] = c0;
   55|  7.19M|    v_[1] = c1;
   56|  7.19M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  3.54M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  10.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 7.08M, False: 3.54M]
  ------------------
  104|  7.08M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 7.08M, False: 0]
  ------------------
  105|  7.08M|        v_[i] = Scalar(src_vector[i]);
  106|  7.08M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  7.08M|    }
  110|  3.54M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  1.77M|  VectorD() {
   41|  5.31M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.54M, False: 1.77M]
  ------------------
   42|  3.54M|      (*this)[i] = Scalar(0);
   43|  3.54M|    }
   44|  1.77M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  1.77M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  5.31M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 3.54M, False: 1.77M]
  ------------------
  104|  3.54M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 3.54M, False: 0]
  ------------------
  105|  3.54M|        v_[i] = Scalar(src_vector[i]);
  106|  3.54M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  3.54M|    }
  110|  1.77M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  4.87M|  VectorD(const Self &o) {
   89|  14.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 9.75M, False: 4.87M]
  ------------------
   90|  9.75M|      (*this)[i] = o[i];
   91|  9.75M|    }
   92|  4.87M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  2.27M|  VectorD() {
   41|  6.81M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.54M, False: 2.27M]
  ------------------
   42|  4.54M|      (*this)[i] = Scalar(0);
   43|  4.54M|    }
   44|  2.27M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   386M|  VectorD(const Self &o) {
   89|  1.54G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 1.16G, False: 386M]
  ------------------
   90|  1.16G|      (*this)[i] = o[i];
   91|  1.16G|    }
   92|   386M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  1.16G|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   169M|      : v_({{c0, c1, c2}}) {
   60|   169M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   169M|  }

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

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

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  7.54k|      : corner_table_(table),
  229|  7.54k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  7.54k|        corner_(start_corner_),
  231|  7.54k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  3.28M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  24.0k|  VertexCornersIterator &operator++() {
  268|  24.0k|    Next();
  269|  24.0k|    return *this;
  270|  24.0k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  2.79M|  void Next() {
  248|  2.79M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.76M, False: 30.5k]
  ------------------
  249|  2.76M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.76M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 24.4k, False: 2.74M]
  ------------------
  251|       |        // Open boundary reached.
  252|  24.4k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  24.4k|        left_traversal_ = false;
  254|  2.74M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 457k, False: 2.28M]
  ------------------
  255|       |        // End reached.
  256|   457k|        corner_ = kInvalidCornerIndex;
  257|   457k|      }
  258|  2.76M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  30.5k|      corner_ = corner_table_->SwingRight(corner_);
  262|  30.5k|    }
  263|  2.79M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  4.90M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  1.96M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  1.92M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  1.16M|  void Next() {
  248|  1.16M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 1.15M, False: 11.8k]
  ------------------
  249|  1.15M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  1.15M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 729k, False: 426k]
  ------------------
  251|       |        // Open boundary reached.
  252|   729k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|   729k|        left_traversal_ = false;
  254|   729k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 70.0k, False: 356k]
  ------------------
  255|       |        // End reached.
  256|  70.0k|        corner_ = kInvalidCornerIndex;
  257|  70.0k|      }
  258|  1.15M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  11.8k|      corner_ = corner_table_->SwingRight(corner_);
  262|  11.8k|    }
  263|  1.16M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   799k|      : corner_table_(table),
  236|   799k|        start_corner_(corner_id),
  237|   799k|        corner_(start_corner_),
  238|   799k|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   474k|      : corner_table_(table),
  236|   474k|        start_corner_(corner_id),
  237|   474k|        corner_(start_corner_),
  238|   474k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  28.9M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  28.9M|    return is_edge_on_seam_[corner.value()];
   47|  28.9M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  12.4M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  12.4M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 12.4M]
  |  Branch (50:42): [True: 9.99M, False: 2.48M]
  ------------------
   51|  9.99M|      return kInvalidCornerIndex;
   52|  9.99M|    }
   53|  2.48M|    return corner_table_->Opposite(corner);
   54|  12.4M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  20.1M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  20.1M|    return corner_table_->Next(corner);
   58|  20.1M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  9.17M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  9.17M|    return corner_table_->Previous(corner);
   62|  9.17M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  2.40M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  2.40M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  2.40M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.71M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  1.71M|    return Opposite(Previous(corner));
   73|  1.71M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  2.04M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  2.04M|    return Opposite(Next(corner));
   76|  2.04M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  1.15M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  1.15M|    return Previous(Opposite(Previous(corner)));
   81|  1.15M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  6.46M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  6.46M|    return Next(Opposite(Next(corner)));
   86|  6.46M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  6.57k|  int num_vertices() const {
   89|  6.57k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  6.57k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  1.86k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|    966|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  50.3M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  50.3M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  50.3M|    return ConfidentVertex(corner);
   97|  50.3M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  50.3M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  50.3M|    return corner_to_vertex_map_[corner.value()];
  100|  50.3M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  1.69M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  1.69M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  1.69M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  1.69M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  1.69M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  1.69M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 1.69M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  1.69M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 1.36M, False: 328k]
  ------------------
  128|  1.36M|      return true;
  129|  1.36M|    }
  130|   328k|    return false;
  131|  1.69M|  }

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

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

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

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

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

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

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

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

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

